@mithrl/design-system 0.2.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.
- package/dist/components/approval-card/ApprovalCard.d.ts +70 -0
- package/dist/components/button/Button.d.ts +4 -0
- package/dist/components/code-block/CodeBlock.d.ts +64 -0
- package/dist/components/command-search/CommandSearch.d.ts +57 -0
- package/dist/components/composer/ComposerAttachmentView.d.ts +48 -0
- package/dist/components/context-cards/ContextCards.d.ts +53 -0
- package/dist/components/disclosure/Disclosure.d.ts +38 -0
- package/dist/components/explorer/Explorer.d.ts +99 -0
- package/dist/components/field-message/FieldMessage.d.ts +12 -0
- package/dist/components/filter-table/FilterTable.d.ts +61 -0
- package/dist/components/flap-text/FlapText.d.ts +68 -0
- package/dist/components/flowchart/Flowchart.d.ts +140 -0
- package/dist/components/global-app-bar/GlobalAppBar.d.ts +14 -4
- package/dist/components/icon-swap/IconSwap.d.ts +30 -0
- package/dist/components/insight-cards/InsightCards.d.ts +97 -0
- package/dist/components/navigation-item/NavigationItem.d.ts +2 -0
- package/dist/components/number-flow/NumberFlow.d.ts +93 -0
- package/dist/components/panel-tabs/PanelTabs.d.ts +2 -0
- package/dist/components/progress-indicator/ProgressIndicator.d.ts +9 -1
- package/dist/components/prompt-bar/PromptBar.d.ts +103 -0
- package/dist/components/recommendation-card/RecommendationCard.d.ts +77 -0
- package/dist/components/records-table/RecordsTable.d.ts +87 -0
- package/dist/components/resizable-panels/ResizablePanels.d.ts +38 -0
- package/dist/components/secondary-panel/SecondaryPanel.d.ts +69 -0
- package/dist/components/selection-actions/SelectionActions.d.ts +72 -0
- package/dist/components/skeleton-reveal/SkeletonReveal.d.ts +33 -0
- package/dist/components/status-orb/StatusOrb.d.ts +51 -0
- package/dist/components/streaming-text/StreamingText.d.ts +85 -0
- package/dist/components/task-rows/TaskRows.d.ts +77 -0
- package/dist/components/upload-queue/UploadQueue.d.ts +10 -0
- package/dist/components/workspace-navigation/WorkspaceNavigation.d.ts +22 -1
- package/dist/index.d.ts +52 -2
- package/dist/index.js +5693 -1787
- package/dist/internal/useStaggerBatch.d.ts +22 -0
- package/dist/patterns/notifications/Notifications.d.ts +159 -0
- package/dist/patterns/workspace-app-shell/WorkspaceAppShell.d.ts +93 -4
- package/dist/patterns/workspace-app-shell/WorkspaceNewQuestionDialog.d.ts +24 -0
- package/dist/patterns/workspace-app-shell/WorkspaceQuestionSurface.d.ts +49 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type ForwardedRef, type HTMLAttributes, type ReactNode, type TableHTMLAttributes } from "react";
|
|
2
|
+
import type { MetadataTone } from "../badge/Badge";
|
|
3
|
+
|
|
4
|
+
export type RecordsTableAlign = "start" | "end";
|
|
5
|
+
export type RecordsTableSortDirection = "ascending" | "descending";
|
|
6
|
+
export type RecordsTableSort = {
|
|
7
|
+
/** Column currently driving row order. */
|
|
8
|
+
columnId: string;
|
|
9
|
+
direction: RecordsTableSortDirection;
|
|
10
|
+
};
|
|
11
|
+
export type RecordsTableColumn<Row> = {
|
|
12
|
+
/** Stable identifier used for sorting and cell keys. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Visible column header text. */
|
|
15
|
+
header: string;
|
|
16
|
+
/** Enables the header sort control and aria-sort reporting. */
|
|
17
|
+
sortable?: boolean;
|
|
18
|
+
/** Horizontal alignment of the header and its cells. */
|
|
19
|
+
align?: RecordsTableAlign;
|
|
20
|
+
/** Cell renderer. Defaults to the raw `sortValue` string. */
|
|
21
|
+
render?: (row: Row, index: number) => ReactNode;
|
|
22
|
+
/** Comparable primitive used when this column is sorted. */
|
|
23
|
+
sortValue?: (row: Row) => string | number;
|
|
24
|
+
/** Optional fixed column width, e.g. `var(--space-64)`. */
|
|
25
|
+
width?: string;
|
|
26
|
+
};
|
|
27
|
+
export type RecordsTableProps<Row> = Omit<TableHTMLAttributes<HTMLTableElement>, "children"> & {
|
|
28
|
+
columns: readonly RecordsTableColumn<Row>[];
|
|
29
|
+
rows: readonly Row[];
|
|
30
|
+
/** Stable row identity used for React keys. */
|
|
31
|
+
getRowId: (row: Row, index: number) => string;
|
|
32
|
+
/** Required accessible name for the grid. */
|
|
33
|
+
caption: string;
|
|
34
|
+
/** Renders the caption above the table instead of only for assistive tech. */
|
|
35
|
+
captionVisible?: boolean;
|
|
36
|
+
/** Renders the leading ordinal / group-letter cell. */
|
|
37
|
+
showIndex?: boolean;
|
|
38
|
+
/** When provided, alphabetical separator rows are inserted on letter change. */
|
|
39
|
+
groupLetter?: (row: Row) => string;
|
|
40
|
+
/** Controlled sort state. */
|
|
41
|
+
sort?: RecordsTableSort | null;
|
|
42
|
+
/** Initial sort for uncontrolled use. */
|
|
43
|
+
defaultSort?: RecordsTableSort | null;
|
|
44
|
+
onSortChange?: (sort: RecordsTableSort) => void;
|
|
45
|
+
/** Summary cells rendered in a sticky-free footer row, keyed by column id. */
|
|
46
|
+
footer?: Partial<Record<string, ReactNode>>;
|
|
47
|
+
/** Optional label rendered in the footer's leading cell. */
|
|
48
|
+
footerLabel?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A column-configuration driven record grid. RecordsTable owns row order,
|
|
52
|
+
* sticky header semantics, and optional alphabetical grouping. Cell content
|
|
53
|
+
* is supplied by the caller, usually through the exported cell primitives.
|
|
54
|
+
*/
|
|
55
|
+
declare function RecordsTableInner<Row>({ columns, rows, getRowId, caption, captionVisible, showIndex, groupLetter, sort, defaultSort, onSortChange, footer, footerLabel, className, ...props }: RecordsTableProps<Row>, ref: ForwardedRef<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare const RecordsTable: <Row>(props: RecordsTableProps<Row> & {
|
|
57
|
+
ref?: ForwardedRef<HTMLTableElement>;
|
|
58
|
+
}) => ReturnType<typeof RecordsTableInner>;
|
|
59
|
+
export type RecordsTableTagsProps = HTMLAttributes<HTMLDivElement> & {
|
|
60
|
+
/** Category labels rendered as Tag metadata. */
|
|
61
|
+
tags: readonly string[];
|
|
62
|
+
/** Number of tags shown before collapsing into a "+N" indicator. */
|
|
63
|
+
max?: number;
|
|
64
|
+
tone?: MetadataTone;
|
|
65
|
+
};
|
|
66
|
+
/** Tag cluster cell with a deterministic "+N" overflow indicator. */
|
|
67
|
+
export declare function RecordsTableTags({ tags, max, tone, className, ...props }: RecordsTableTagsProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare const recordsTableStrengthLevels: readonly ["No communication", "Very weak", "Weak", "Strong", "Very strong"];
|
|
69
|
+
export type RecordsTableStrengthLevel = 0 | 1 | 2 | 3 | 4;
|
|
70
|
+
export type RecordsTableStrengthProps = HTMLAttributes<HTMLSpanElement> & {
|
|
71
|
+
/** Ordinal level from 0 (no communication) through 4 (very strong). */
|
|
72
|
+
level: RecordsTableStrengthLevel;
|
|
73
|
+
/** Hides the text label while keeping the accessible name. */
|
|
74
|
+
hideLabel?: boolean;
|
|
75
|
+
};
|
|
76
|
+
/** Five-step ordinal meter for relationship or signal strength. */
|
|
77
|
+
export declare function RecordsTableStrength({ level, hideLabel, className, ...props }: RecordsTableStrengthProps): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export type RecordsTableLinkProps = {
|
|
79
|
+
href: string;
|
|
80
|
+
children: ReactNode;
|
|
81
|
+
/** Marks the destination as external and adds safe rel attributes. */
|
|
82
|
+
external?: boolean;
|
|
83
|
+
className?: string;
|
|
84
|
+
};
|
|
85
|
+
/** Destination cell that keeps the external affordance inside the grid. */
|
|
86
|
+
export declare function RecordsTableLink({ href, children, external, className, }: RecordsTableLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export {};
|
|
@@ -22,6 +22,25 @@ export type ResizablePanelGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "chi
|
|
|
22
22
|
onValueChange?: (value: number) => void;
|
|
23
23
|
/** Reports the final pointer value or each committed keyboard step. */
|
|
24
24
|
onValueCommit?: (value: number) => void;
|
|
25
|
+
/** Controlled Secondary width in pixels. Use instead of `value`. */
|
|
26
|
+
secondarySize?: number;
|
|
27
|
+
/** Initial Secondary width in pixels for uncontrolled pixel persistence. */
|
|
28
|
+
defaultSecondarySize?: number;
|
|
29
|
+
/** Reports every pointer or keyboard resize in Secondary pixels. */
|
|
30
|
+
onSecondarySizeChange?: (size: number) => void;
|
|
31
|
+
/** Reports the final pointer value or each keyboard step in pixels. */
|
|
32
|
+
onSecondarySizeCommit?: (size: number) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Reports one drag-to-dismiss intent per pointer drag when the pointer
|
|
35
|
+
* travels past a panel minimum by more than `dismissThreshold`. Visibility
|
|
36
|
+
* stays with the consumer; the group never hides a panel on its own.
|
|
37
|
+
*/
|
|
38
|
+
onCollapseIntent?: (region: "primary" | "secondary") => void;
|
|
39
|
+
/**
|
|
40
|
+
* Share of a panel minimum the pointer must cross before a drag counts as a
|
|
41
|
+
* dismissal request. Defaults to 0.5, i.e. half the minimum width.
|
|
42
|
+
*/
|
|
43
|
+
dismissThreshold?: number;
|
|
25
44
|
/** Exactly Primary Panel, Handle, and Secondary Panel in that order. */
|
|
26
45
|
children: ReactNode;
|
|
27
46
|
};
|
|
@@ -58,6 +77,25 @@ export declare const ResizablePanelGroup: import("react").ForwardRefExoticCompon
|
|
|
58
77
|
onValueChange?: (value: number) => void;
|
|
59
78
|
/** Reports the final pointer value or each committed keyboard step. */
|
|
60
79
|
onValueCommit?: (value: number) => void;
|
|
80
|
+
/** Controlled Secondary width in pixels. Use instead of `value`. */
|
|
81
|
+
secondarySize?: number;
|
|
82
|
+
/** Initial Secondary width in pixels for uncontrolled pixel persistence. */
|
|
83
|
+
defaultSecondarySize?: number;
|
|
84
|
+
/** Reports every pointer or keyboard resize in Secondary pixels. */
|
|
85
|
+
onSecondarySizeChange?: (size: number) => void;
|
|
86
|
+
/** Reports the final pointer value or each keyboard step in pixels. */
|
|
87
|
+
onSecondarySizeCommit?: (size: number) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Reports one drag-to-dismiss intent per pointer drag when the pointer
|
|
90
|
+
* travels past a panel minimum by more than `dismissThreshold`. Visibility
|
|
91
|
+
* stays with the consumer; the group never hides a panel on its own.
|
|
92
|
+
*/
|
|
93
|
+
onCollapseIntent?: (region: "primary" | "secondary") => void;
|
|
94
|
+
/**
|
|
95
|
+
* Share of a panel minimum the pointer must cross before a drag counts as a
|
|
96
|
+
* dismissal request. Defaults to 0.5, i.e. half the minimum width.
|
|
97
|
+
*/
|
|
98
|
+
dismissThreshold?: number;
|
|
61
99
|
/** Exactly Primary Panel, Handle, and Secondary Panel in that order. */
|
|
62
100
|
children: ReactNode;
|
|
63
101
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type PanelTabItem } from "../panel-tabs/PanelTabs";
|
|
3
|
+
|
|
4
|
+
export declare const MITHRL_QUESTION_DRAG_TYPE = "application/x-mithrl-question-id";
|
|
5
|
+
export type SecondaryPanelTabKind = "explorer" | "question" | "resource" | "tool";
|
|
6
|
+
export type SecondaryPanelTab = Omit<PanelTabItem, "closable" | "tooltip"> & {
|
|
7
|
+
/** Controls the approved icon-led or text-only tab identity. */
|
|
8
|
+
kind: SecondaryPanelTabKind;
|
|
9
|
+
/** Explorer is persistent; all other destinations may be owner-closeable. */
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type SecondaryPanelDropTarget = "secondary";
|
|
13
|
+
export type SecondaryPanelProps = Omit<HTMLAttributes<HTMLElement>, "children" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & {
|
|
14
|
+
/** Ordered, controlled panel destinations. Explorer must remain first. */
|
|
15
|
+
tabs: readonly SecondaryPanelTab[];
|
|
16
|
+
/** Controlled active destination identity. */
|
|
17
|
+
activeTabId: string;
|
|
18
|
+
/** Product-owned content for the active destination. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Optional product-owned panel actions rendered after the tab viewport. */
|
|
21
|
+
headerActions?: ReactNode;
|
|
22
|
+
/** Shows the approved trailing-edge overflow cue over the tab viewport. */
|
|
23
|
+
overflowFeedback?: boolean;
|
|
24
|
+
/** Uses the temporary compact full-screen header presentation. */
|
|
25
|
+
compactMode?: boolean;
|
|
26
|
+
/** Visible and accessible label for the compact dismissal action. */
|
|
27
|
+
compactCloseLabel?: string;
|
|
28
|
+
/** Reports controlled tab selection. */
|
|
29
|
+
onTabSelect: (tabId: string) => void;
|
|
30
|
+
/** Reports a close request and the fallback that keeps selection aligned with focus. */
|
|
31
|
+
onTabClose?: (tabId: string, fallbackTabId: string) => void;
|
|
32
|
+
/** Enables native Question drops from Workspace Navigation. */
|
|
33
|
+
onQuestionDrop?: (questionId: string, target: SecondaryPanelDropTarget) => void;
|
|
34
|
+
/** Reports compact Secondary dismissal without unmounting owner state. */
|
|
35
|
+
onSecondaryOpenChange: (open: boolean) => void;
|
|
36
|
+
/** Visible drop feedback. Defaults to the approved action copy. */
|
|
37
|
+
dropFeedbackLabel?: ReactNode;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Controlled Secondary Workspace surface. It composes Panel Tabs, compact
|
|
41
|
+
* presentation, and Question drop feedback while product code retains tab,
|
|
42
|
+
* placement, visibility, width, content, and persistence ownership.
|
|
43
|
+
*/
|
|
44
|
+
export declare const SecondaryPanel: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop"> & {
|
|
45
|
+
/** Ordered, controlled panel destinations. Explorer must remain first. */
|
|
46
|
+
tabs: readonly SecondaryPanelTab[];
|
|
47
|
+
/** Controlled active destination identity. */
|
|
48
|
+
activeTabId: string;
|
|
49
|
+
/** Product-owned content for the active destination. */
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
/** Optional product-owned panel actions rendered after the tab viewport. */
|
|
52
|
+
headerActions?: ReactNode;
|
|
53
|
+
/** Shows the approved trailing-edge overflow cue over the tab viewport. */
|
|
54
|
+
overflowFeedback?: boolean;
|
|
55
|
+
/** Uses the temporary compact full-screen header presentation. */
|
|
56
|
+
compactMode?: boolean;
|
|
57
|
+
/** Visible and accessible label for the compact dismissal action. */
|
|
58
|
+
compactCloseLabel?: string;
|
|
59
|
+
/** Reports controlled tab selection. */
|
|
60
|
+
onTabSelect: (tabId: string) => void;
|
|
61
|
+
/** Reports a close request and the fallback that keeps selection aligned with focus. */
|
|
62
|
+
onTabClose?: (tabId: string, fallbackTabId: string) => void;
|
|
63
|
+
/** Enables native Question drops from Workspace Navigation. */
|
|
64
|
+
onQuestionDrop?: (questionId: string, target: SecondaryPanelDropTarget) => void;
|
|
65
|
+
/** Reports compact Secondary dismissal without unmounting owner state. */
|
|
66
|
+
onSecondaryOpenChange: (open: boolean) => void;
|
|
67
|
+
/** Visible drop feedback. Defaults to the approved action copy. */
|
|
68
|
+
dropFeedbackLabel?: ReactNode;
|
|
69
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type HTMLAttributes, type RefObject } from "react";
|
|
2
|
+
import { type IconGlyphComponent } from "../icon/Icon";
|
|
3
|
+
|
|
4
|
+
/** A viewport-relative rectangle, matching the shape of `DOMRect`. */
|
|
5
|
+
export interface SelectionRect {
|
|
6
|
+
top: number;
|
|
7
|
+
left: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UseSelectionRectOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Restrict tracking to selections that start and end inside this element.
|
|
14
|
+
* Omit to track the whole document.
|
|
15
|
+
*/
|
|
16
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
17
|
+
/** Stop tracking without unmounting the caller. @default false */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Tracks the current document selection and returns its viewport-relative
|
|
22
|
+
* rectangle, or `null` when nothing is selected.
|
|
23
|
+
*
|
|
24
|
+
* Recomputes on `selectionchange` and on scroll/resize so the toolbar stays
|
|
25
|
+
* pinned to the passage while the page moves under it. Safe during SSR: the
|
|
26
|
+
* first render returns `null` and tracking starts after mount.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useSelectionRect({ containerRef, disabled, }?: UseSelectionRectOptions): SelectionRect | null;
|
|
29
|
+
export interface SelectionAction {
|
|
30
|
+
/** Stable identity, passed to `onSelect` and used as the React key. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Visible label. Keep it a single verb where possible. */
|
|
33
|
+
label: string;
|
|
34
|
+
/** Optional approved Lucide glyph shown before the label. */
|
|
35
|
+
icon?: IconGlyphComponent;
|
|
36
|
+
/**
|
|
37
|
+
* Emphasis. `primary` actions read as full labelled buttons; `secondary`
|
|
38
|
+
* actions are compact and sit after a divider.
|
|
39
|
+
* @default "primary"
|
|
40
|
+
*/
|
|
41
|
+
emphasis?: "primary" | "secondary";
|
|
42
|
+
/** Invoked when the action is chosen. */
|
|
43
|
+
onSelect: () => void;
|
|
44
|
+
/** Renders the action non-interactive. */
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface SelectionActionsProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
48
|
+
/** Actions offered for the highlighted passage. */
|
|
49
|
+
actions: SelectionAction[];
|
|
50
|
+
/**
|
|
51
|
+
* Viewport-relative rectangle of the passage. Pass the value from
|
|
52
|
+
* `useSelectionRect()`, or your own rect for a controlled placement. When
|
|
53
|
+
* `null` the toolbar renders nothing.
|
|
54
|
+
*/
|
|
55
|
+
anchorRect: SelectionRect | null;
|
|
56
|
+
/** Called on Escape, on a click outside, or after an action is chosen. */
|
|
57
|
+
onDismiss?: () => void;
|
|
58
|
+
/** Accessible name for the toolbar. @default "Actions for the selected text" */
|
|
59
|
+
label?: string;
|
|
60
|
+
/** Gap between the passage and the toolbar, in pixels. @default 8 */
|
|
61
|
+
offset?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A floating toolbar anchored above a highlighted passage.
|
|
65
|
+
*
|
|
66
|
+
* Keyboard contract: the bar is a `role="toolbar"` with roving tabindex — one
|
|
67
|
+
* tab stop for the whole bar, then Arrow Left/Right to move between actions,
|
|
68
|
+
* with Home and End jumping to the ends. Escape dismisses without acting, as
|
|
69
|
+
* does a click outside the bar. Focus is never stolen from the document
|
|
70
|
+
* selection; the bar becomes reachable by Tab and only takes focus once entered.
|
|
71
|
+
*/
|
|
72
|
+
export declare const SelectionActions: import("react").ForwardRefExoticComponent<SelectionActionsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export interface SkeletonRevealProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> {
|
|
4
|
+
/** Whether the real content has arrived. Flipping this plays the hand-off. */
|
|
5
|
+
loaded: boolean;
|
|
6
|
+
/** The loading surface — normally one or more `Skeleton` elements. */
|
|
7
|
+
placeholder: ReactNode;
|
|
8
|
+
/** The real content. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Cross-fades a loading placeholder into the content that replaces it, so
|
|
13
|
+
* arriving data resolves instead of snapping.
|
|
14
|
+
*
|
|
15
|
+
* Both layers occupy the same grid cell, so they stack without either one
|
|
16
|
+
* leaving the flow: the box is as tall as whichever layer is taller and the
|
|
17
|
+
* swap costs no layout. The outgoing placeholder fades away through
|
|
18
|
+
* `--motion-blur-soft` while the content fades in from the same blur, the two
|
|
19
|
+
* crossing through each other over one shared duration.
|
|
20
|
+
*
|
|
21
|
+
* The hidden layer is `visibility: hidden`, so it is out of the tab order and
|
|
22
|
+
* out of the accessibility tree until it is the live one — the visibility
|
|
23
|
+
* switch is delayed to the end of the fade on the way out and immediate on the
|
|
24
|
+
* way in.
|
|
25
|
+
*
|
|
26
|
+
* `Skeleton` itself is untouched by this: it stays a decorative surface that
|
|
27
|
+
* rejects children and semantics. The hand-off needs both layers mounted at
|
|
28
|
+
* once, which a prop on a childless primitive cannot express.
|
|
29
|
+
*
|
|
30
|
+
* Reduced motion: no blur and no cross-fade timing — the layers swap behind a
|
|
31
|
+
* `--motion-duration-fast` opacity change.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SkeletonReveal: import("react").ForwardRefExoticComponent<SkeletonRevealProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
|
-
import { type HTMLAttributes, type MouseEvent, type MouseEventHandler } from "react";
|
|
2
|
+
import { type DragEvent, type HTMLAttributes, type MouseEvent, type MouseEventHandler } from "react";
|
|
3
3
|
import { type IconButtonProps } from "../icon-button/IconButton";
|
|
4
4
|
|
|
5
5
|
export declare const workspaceNavigationVariants: (props?: ({
|
|
@@ -15,9 +15,14 @@ export type WorkspaceNavigationQuestion = {
|
|
|
15
15
|
href?: string;
|
|
16
16
|
/** Uses the approved text shimmer and Progress Indicator. */
|
|
17
17
|
loading?: boolean;
|
|
18
|
+
/** Enables opening this unopened Question through native drag. */
|
|
19
|
+
draggable?: boolean;
|
|
20
|
+
/** Optional explicit name for the product-owned overflow action. */
|
|
21
|
+
menuActionLabel?: string;
|
|
18
22
|
};
|
|
19
23
|
type NavigationClick = MouseEvent<HTMLAnchorElement | HTMLButtonElement>;
|
|
20
24
|
type MenuClick = MouseEvent<HTMLButtonElement>;
|
|
25
|
+
type QuestionDrag = DragEvent<HTMLAnchorElement | HTMLButtonElement>;
|
|
21
26
|
export type WorkspaceNavigationProps = Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & VariantProps<typeof workspaceNavigationVariants> & {
|
|
22
27
|
/** Accessible name for the navigation landmark. */
|
|
23
28
|
"aria-label"?: string;
|
|
@@ -27,16 +32,24 @@ export type WorkspaceNavigationProps = Omit<HTMLAttributes<HTMLElement>, "childr
|
|
|
27
32
|
allProjectsLabel?: string;
|
|
28
33
|
/** Visible label for the creation action. */
|
|
29
34
|
newQuestionLabel?: string;
|
|
35
|
+
/** Stable identity for a controlled New Question dialog trigger. */
|
|
36
|
+
newQuestionTriggerId?: string;
|
|
30
37
|
/** Visible heading for the question destination region. */
|
|
31
38
|
questionsLabel?: string;
|
|
32
39
|
/** Controlled question destinations in display order. */
|
|
33
40
|
questions: readonly WorkspaceNavigationQuestion[];
|
|
34
41
|
/** Controlled current question identity. */
|
|
35
42
|
selectedQuestionId?: string;
|
|
43
|
+
/** Controlled Questions currently active in Primary or Secondary panels. */
|
|
44
|
+
activeQuestionIds?: readonly string[];
|
|
36
45
|
/** Selects a question without prescribing router ownership. */
|
|
37
46
|
onQuestionSelect?: (question: WorkspaceNavigationQuestion, event: NavigationClick) => void;
|
|
38
47
|
/** Opens the product-owned menu for one question. */
|
|
39
48
|
onQuestionMenuAction?: (question: WorkspaceNavigationQuestion, event: MenuClick) => void;
|
|
49
|
+
/** Reports the beginning of an enabled Question drag. */
|
|
50
|
+
onQuestionDragStart?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
|
|
51
|
+
/** Reports the end of an enabled Question drag. */
|
|
52
|
+
onQuestionDragEnd?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
|
|
40
53
|
/** Starts a new question. */
|
|
41
54
|
onNewQuestion: MouseEventHandler<HTMLButtonElement>;
|
|
42
55
|
/** Reports activation of the All Projects destination. */
|
|
@@ -60,16 +73,24 @@ export declare const WorkspaceNavigation: import("react").ForwardRefExoticCompon
|
|
|
60
73
|
allProjectsLabel?: string;
|
|
61
74
|
/** Visible label for the creation action. */
|
|
62
75
|
newQuestionLabel?: string;
|
|
76
|
+
/** Stable identity for a controlled New Question dialog trigger. */
|
|
77
|
+
newQuestionTriggerId?: string;
|
|
63
78
|
/** Visible heading for the question destination region. */
|
|
64
79
|
questionsLabel?: string;
|
|
65
80
|
/** Controlled question destinations in display order. */
|
|
66
81
|
questions: readonly WorkspaceNavigationQuestion[];
|
|
67
82
|
/** Controlled current question identity. */
|
|
68
83
|
selectedQuestionId?: string;
|
|
84
|
+
/** Controlled Questions currently active in Primary or Secondary panels. */
|
|
85
|
+
activeQuestionIds?: readonly string[];
|
|
69
86
|
/** Selects a question without prescribing router ownership. */
|
|
70
87
|
onQuestionSelect?: (question: WorkspaceNavigationQuestion, event: NavigationClick) => void;
|
|
71
88
|
/** Opens the product-owned menu for one question. */
|
|
72
89
|
onQuestionMenuAction?: (question: WorkspaceNavigationQuestion, event: MenuClick) => void;
|
|
90
|
+
/** Reports the beginning of an enabled Question drag. */
|
|
91
|
+
onQuestionDragStart?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
|
|
92
|
+
/** Reports the end of an enabled Question drag. */
|
|
93
|
+
onQuestionDragEnd?: (question: WorkspaceNavigationQuestion, event: QuestionDrag) => void;
|
|
73
94
|
/** Starts a new question. */
|
|
74
95
|
onNewQuestion: MouseEventHandler<HTMLButtonElement>;
|
|
75
96
|
/** Reports activation of the All Projects destination. */
|