@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.
- package/dist/components/approval-card/ApprovalCard.d.ts +70 -0
- package/dist/components/code-block/CodeBlock.d.ts +64 -0
- package/dist/components/command-search/CommandSearch.d.ts +57 -0
- package/dist/components/context-cards/ContextCards.d.ts +53 -0
- package/dist/components/disclosure/Disclosure.d.ts +38 -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/number-flow/NumberFlow.d.ts +93 -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 +22 -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/index.d.ts +41 -1
- package/dist/index.js +5041 -1845
- 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 +50 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/** One selectable answer on an approval question. */
|
|
4
|
+
export interface ApprovalOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** Short clarifier shown under the label. Keep it to one plain sentence. */
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
/** A single question the agent asks before it acts. */
|
|
11
|
+
export interface ApprovalQuestion {
|
|
12
|
+
id: string;
|
|
13
|
+
/** The question itself, phrased the way a colleague would ask it. */
|
|
14
|
+
prompt: string;
|
|
15
|
+
/** Optional context sentence shown under the prompt. */
|
|
16
|
+
helpText?: ReactNode;
|
|
17
|
+
options: ApprovalOption[];
|
|
18
|
+
/** Allow more than one option. Defaults to single choice. */
|
|
19
|
+
multiSelect?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Selected option ids keyed by question id. */
|
|
22
|
+
export type ApprovalAnswers = Record<string, string[]>;
|
|
23
|
+
type RestrictedApprovalCardAttribute = "children" | "onSubmit" | "role";
|
|
24
|
+
export type ApprovalCardProps = Omit<HTMLAttributes<HTMLElement>, RestrictedApprovalCardAttribute> & {
|
|
25
|
+
/** Ordered questions. The card pages through them one at a time. */
|
|
26
|
+
questions: ApprovalQuestion[];
|
|
27
|
+
/** Optional heading above the question, e.g. the run the agent is planning. */
|
|
28
|
+
eyebrow?: ReactNode;
|
|
29
|
+
/** Controlled answers. Pair with `onAnswersChange`. */
|
|
30
|
+
answers?: ApprovalAnswers;
|
|
31
|
+
/** Initial answers when the card owns its own state. */
|
|
32
|
+
defaultAnswers?: ApprovalAnswers;
|
|
33
|
+
onAnswersChange?: (answers: ApprovalAnswers) => void;
|
|
34
|
+
/** Fired once the last question is confirmed. */
|
|
35
|
+
onComplete?: (answers: ApprovalAnswers) => void;
|
|
36
|
+
/** Fired when the scientist declines to answer and lets the agent decide. */
|
|
37
|
+
onSkip?: (answers: ApprovalAnswers) => void;
|
|
38
|
+
skipLabel?: string;
|
|
39
|
+
continueLabel?: string;
|
|
40
|
+
/** Label for the final page's primary action. */
|
|
41
|
+
completeLabel?: string;
|
|
42
|
+
/** Require a selection before the primary action enables. @default true */
|
|
43
|
+
requireAnswer?: boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Human-in-the-loop approval. The agent pauses, asks what it should do, and
|
|
47
|
+
* waits: one question per page, a clear way out, and no hidden defaults.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ApprovalCard: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, RestrictedApprovalCardAttribute> & {
|
|
50
|
+
/** Ordered questions. The card pages through them one at a time. */
|
|
51
|
+
questions: ApprovalQuestion[];
|
|
52
|
+
/** Optional heading above the question, e.g. the run the agent is planning. */
|
|
53
|
+
eyebrow?: ReactNode;
|
|
54
|
+
/** Controlled answers. Pair with `onAnswersChange`. */
|
|
55
|
+
answers?: ApprovalAnswers;
|
|
56
|
+
/** Initial answers when the card owns its own state. */
|
|
57
|
+
defaultAnswers?: ApprovalAnswers;
|
|
58
|
+
onAnswersChange?: (answers: ApprovalAnswers) => void;
|
|
59
|
+
/** Fired once the last question is confirmed. */
|
|
60
|
+
onComplete?: (answers: ApprovalAnswers) => void;
|
|
61
|
+
/** Fired when the scientist declines to answer and lets the agent decide. */
|
|
62
|
+
onSkip?: (answers: ApprovalAnswers) => void;
|
|
63
|
+
skipLabel?: string;
|
|
64
|
+
continueLabel?: string;
|
|
65
|
+
/** Label for the final page's primary action. */
|
|
66
|
+
completeLabel?: string;
|
|
67
|
+
/** Require a selection before the primary action enables. @default true */
|
|
68
|
+
requireAnswer?: boolean;
|
|
69
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type CodeBlockVariant = "code" | "diff";
|
|
4
|
+
export type CodeLineKind = "context" | "added" | "removed";
|
|
5
|
+
export type CodeLine = {
|
|
6
|
+
/** Raw line text. Rendered verbatim in the mono column. */
|
|
7
|
+
content: string;
|
|
8
|
+
/** Diff classification. Ignored by the `code` variant. */
|
|
9
|
+
kind?: CodeLineKind;
|
|
10
|
+
};
|
|
11
|
+
export type CodeBlockRenderLineArgs = {
|
|
12
|
+
/** Raw line text. */
|
|
13
|
+
content: string;
|
|
14
|
+
/** Resolved diff classification. */
|
|
15
|
+
kind: CodeLineKind;
|
|
16
|
+
/** One-based line number as shown in the gutter. */
|
|
17
|
+
number: number;
|
|
18
|
+
/** Variant the line is being rendered for. */
|
|
19
|
+
variant: CodeBlockVariant;
|
|
20
|
+
};
|
|
21
|
+
export type CodeBlockLabels = {
|
|
22
|
+
copy: string;
|
|
23
|
+
copied: string;
|
|
24
|
+
copyFailed: string;
|
|
25
|
+
codeTab: string;
|
|
26
|
+
diffTab: string;
|
|
27
|
+
listing: string;
|
|
28
|
+
};
|
|
29
|
+
type CodeBlockOwnProps = {
|
|
30
|
+
/** Source text. Split on newlines into the listing. */
|
|
31
|
+
code?: string;
|
|
32
|
+
/** Pre-split lines, required for diff rendering. Wins over `code`. */
|
|
33
|
+
lines?: readonly CodeLine[];
|
|
34
|
+
/** Language label rendered as a Tag in the header. */
|
|
35
|
+
language?: string;
|
|
36
|
+
/** File path or name rendered as the header title. */
|
|
37
|
+
fileName?: string;
|
|
38
|
+
/** Listing mode. Ignored when `tabs` is enabled. */
|
|
39
|
+
variant?: CodeBlockVariant;
|
|
40
|
+
/** Renders a Code/Diff segmented control. Requires `code` and `lines`. */
|
|
41
|
+
tabs?: boolean;
|
|
42
|
+
/** Controlled tab value when `tabs` is enabled. */
|
|
43
|
+
activeTab?: CodeBlockVariant;
|
|
44
|
+
/** Called when the Code/Diff segmented control changes. */
|
|
45
|
+
onTabChange?: (variant: CodeBlockVariant) => void;
|
|
46
|
+
/** Hides the line-number column. */
|
|
47
|
+
hideLineNumbers?: boolean;
|
|
48
|
+
/** Called with the text placed on the clipboard. */
|
|
49
|
+
onCopy?: (text: string) => void;
|
|
50
|
+
/** Injects highlighted nodes for a line. Defaults to plain mono text. */
|
|
51
|
+
renderLine?: (line: CodeBlockRenderLineArgs) => ReactNode;
|
|
52
|
+
labels?: Partial<CodeBlockLabels>;
|
|
53
|
+
className?: string;
|
|
54
|
+
};
|
|
55
|
+
export type CodeBlockProps = Omit<HTMLAttributes<HTMLDivElement>, keyof CodeBlockOwnProps | "children"> & CodeBlockOwnProps;
|
|
56
|
+
/**
|
|
57
|
+
* A notebook-tier code surface: a titled header rail with an optional
|
|
58
|
+
* language Tag and copy action, and a line-numbered, horizontally scrolling
|
|
59
|
+
* listing. The `diff` variant renders unified diff lines with semantic
|
|
60
|
+
* tinting. CodeBlock ships no syntax highlighting engine — pass `renderLine`
|
|
61
|
+
* to inject already-highlighted nodes.
|
|
62
|
+
*/
|
|
63
|
+
export declare const CodeBlock: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | keyof CodeBlockOwnProps> & CodeBlockOwnProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type CommandSearchItem = {
|
|
4
|
+
/** Stable identity used for keys and active-descendant wiring. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Visible command label; match highlighting applies to this text. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Optional group heading the item is filed under. */
|
|
9
|
+
group?: string;
|
|
10
|
+
/** Optional trailing hint such as a shortcut or destination. */
|
|
11
|
+
hint?: string;
|
|
12
|
+
/** Invoked on Enter or click. */
|
|
13
|
+
onSelect?: (item: CommandSearchItem) => void;
|
|
14
|
+
/** Removes the item from keyboard navigation and selection. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type CommandSearchProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> & {
|
|
18
|
+
items: readonly CommandSearchItem[];
|
|
19
|
+
/** Required accessible name for the search field. */
|
|
20
|
+
label: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/** Controlled query. Omit for uncontrolled use. */
|
|
23
|
+
query?: string;
|
|
24
|
+
defaultQuery?: string;
|
|
25
|
+
onQueryChange?: (query: string) => void;
|
|
26
|
+
/** Called after any item is chosen, in addition to the item's own handler. */
|
|
27
|
+
onSelect?: (item: CommandSearchItem) => void;
|
|
28
|
+
/** Called when Escape is pressed on a field that is already empty. */
|
|
29
|
+
onEscape?: () => void;
|
|
30
|
+
/** Renders group headings when items carry a `group`. */
|
|
31
|
+
grouped?: boolean;
|
|
32
|
+
/** Secondary line shown under the empty-state title. */
|
|
33
|
+
emptyHint?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A command palette search surface. CommandSearch renders inline as an
|
|
37
|
+
* embedded panel and can be composed inside a Dialog by the consumer; it owns
|
|
38
|
+
* filtering, match highlighting, and roving keyboard selection only.
|
|
39
|
+
*/
|
|
40
|
+
export declare const CommandSearch: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> & {
|
|
41
|
+
items: readonly CommandSearchItem[];
|
|
42
|
+
/** Required accessible name for the search field. */
|
|
43
|
+
label: string;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
/** Controlled query. Omit for uncontrolled use. */
|
|
46
|
+
query?: string;
|
|
47
|
+
defaultQuery?: string;
|
|
48
|
+
onQueryChange?: (query: string) => void;
|
|
49
|
+
/** Called after any item is chosen, in addition to the item's own handler. */
|
|
50
|
+
onSelect?: (item: CommandSearchItem) => void;
|
|
51
|
+
/** Called when Escape is pressed on a field that is already empty. */
|
|
52
|
+
onEscape?: () => void;
|
|
53
|
+
/** Renders group headings when items carry a `group`. */
|
|
54
|
+
grouped?: boolean;
|
|
55
|
+
/** Secondary line shown under the empty-state title. */
|
|
56
|
+
emptyHint?: ReactNode;
|
|
57
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/** File types a retrieved chunk can come from. */
|
|
4
|
+
export type ContextFileType = "PDF" | "CSV" | "XLSX" | "TXT";
|
|
5
|
+
export interface FileTypeChipProps {
|
|
6
|
+
/** The chunk's source file type. */
|
|
7
|
+
fileType: ContextFileType;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A tinted three-or-four letter file-type marker. Each type gets a distinct
|
|
11
|
+
* semantic tint so a mixed list is scannable at a glance without reading
|
|
12
|
+
* filenames.
|
|
13
|
+
*/
|
|
14
|
+
export declare function FileTypeChip({ fileType }: FileTypeChipProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export interface ContextCardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
16
|
+
/** Chunk heading — usually the section or table it was taken from. */
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
/** Retrieved text. Clamped to three lines and faded, never truncated mid-word with an ellipsis. */
|
|
19
|
+
excerpt: ReactNode;
|
|
20
|
+
/** Character count of the full chunk, shown as retrieval metadata. */
|
|
21
|
+
characterCount?: number;
|
|
22
|
+
/** File the chunk came from. */
|
|
23
|
+
fileName: string;
|
|
24
|
+
/** File type of `fileName`. */
|
|
25
|
+
fileType: ContextFileType;
|
|
26
|
+
/**
|
|
27
|
+
* Optional page or row provenance, e.g. `"p. 4"` or `"rows 120–184"`.
|
|
28
|
+
*/
|
|
29
|
+
locator?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One retrieved knowledge chunk. Presentational: the card is not a control, so
|
|
33
|
+
* it carries no role or tab stop. Wrap it in a button or link at the call site
|
|
34
|
+
* if opening the source is supported there.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ContextCard: import("react").ForwardRefExoticComponent<ContextCardProps & import("react").RefAttributes<HTMLElement>>;
|
|
37
|
+
export interface ContextCardListProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
38
|
+
/** Group heading. @default "All chunks" */
|
|
39
|
+
title?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Number shown in the count Tag. Defaults to the number of rendered cards,
|
|
42
|
+
* so pass it explicitly only when the list is paged or virtualised.
|
|
43
|
+
*/
|
|
44
|
+
count?: number;
|
|
45
|
+
/** `ContextCard` children. */
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A labelled group of retrieved chunks. Rendered as a `<section>` with its
|
|
50
|
+
* heading wired through `aria-labelledby`, and the cards themselves in a
|
|
51
|
+
* `<ul>` so assistive technology announces the group size.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ContextCardList: import("react").ForwardRefExoticComponent<ContextCardListProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type DisclosureProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
4
|
+
/** Whether the region is expanded. Disclosure is always controlled. */
|
|
5
|
+
open: boolean;
|
|
6
|
+
/** Region content. Padding belongs on the content, never on Disclosure. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* An animated, controlled disclosure region.
|
|
11
|
+
*
|
|
12
|
+
* Disclosure animates its own height between collapsed and expanded using the
|
|
13
|
+
* `grid-template-rows: 0fr -> 1fr` technique, so content of any size animates
|
|
14
|
+
* without JavaScript measurement. Open animates over
|
|
15
|
+
* `--motion-duration-moderate` on `--motion-easing-enter`; close animates over
|
|
16
|
+
* the shorter `--motion-duration-standard` on `--motion-easing-exit`, matching
|
|
17
|
+
* the foundations asymmetry rule and the Dialog precedent.
|
|
18
|
+
*
|
|
19
|
+
* Boundary — Disclosure is presentational and owns the region only. It does
|
|
20
|
+
* **not** own the trigger, the chevron, focus management, `aria-expanded`, or
|
|
21
|
+
* `aria-controls`; the caller already owns those and keeps them on its own
|
|
22
|
+
* trigger. Pass `id` here and reference it from the trigger's `aria-controls`.
|
|
23
|
+
*
|
|
24
|
+
* While closed the content is hidden from the accessibility tree and from the
|
|
25
|
+
* tab order twice over: `visibility: hidden` is deferred behind the collapse
|
|
26
|
+
* transition (the pattern already used by `secondary-panel.css` and
|
|
27
|
+
* `workspace-app-shell.css`), and `inert` is applied immediately so nothing
|
|
28
|
+
* inside can be focused during the closing transition.
|
|
29
|
+
*
|
|
30
|
+
* Under `prefers-reduced-motion: reduce` the height animation is dropped
|
|
31
|
+
* entirely and the region crossfades at `--motion-duration-fast`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Disclosure: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
34
|
+
/** Whether the region is expanded. Disclosure is always controlled. */
|
|
35
|
+
open: boolean;
|
|
36
|
+
/** Region content. Padding belongs on the content, never on Disclosure. */
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -13,6 +13,18 @@ export type FieldMessageProps = Omit<HTMLAttributes<HTMLParagraphElement>, "chil
|
|
|
13
13
|
/**
|
|
14
14
|
* Supporting or validation text for one form control. The consumer owns the
|
|
15
15
|
* ID, ARIA relationship, live-region policy, and validation behavior.
|
|
16
|
+
*
|
|
17
|
+
* The message reveals itself on mount rather than popping in: an outer grid
|
|
18
|
+
* wrapper animates `grid-template-rows: 0fr -> 1fr` from a CSS
|
|
19
|
+
* `@starting-style` rule, so surrounding layout eases open instead of jumping.
|
|
20
|
+
* The wrapper is purely presentational — every prop, the `className`, the
|
|
21
|
+
* forwarded ref, `role="alert"`, and the ARIA relationship stay on the same
|
|
22
|
+
* `<p>` element they were on before, so nothing about the announcement is
|
|
23
|
+
* delayed, duplicated, or moved. Browsers without `@starting-style` simply
|
|
24
|
+
* show the message immediately.
|
|
25
|
+
*
|
|
26
|
+
* Exit is owned by the consumer, because the consumer owns the unmount. Wrap
|
|
27
|
+
* FieldMessage in `Disclosure` and keep it mounted to animate it away.
|
|
16
28
|
*/
|
|
17
29
|
export declare const FieldMessage: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLParagraphElement>, "children" | "className"> & VariantProps<(props?: ({
|
|
18
30
|
tone?: "error" | "helper" | "warning" | null | undefined;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
|
|
3
|
+
export declare const filterTableStatuses: readonly ["to-do", "in-progress", "completed"];
|
|
4
|
+
export type FilterTableStatus = (typeof filterTableStatuses)[number];
|
|
5
|
+
export type FilterTableRow = {
|
|
6
|
+
/** Stable row identity. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Primary task name. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Preformatted date string; rendered with tabular figures. */
|
|
11
|
+
date: string;
|
|
12
|
+
status: FilterTableStatus;
|
|
13
|
+
/** Person or team accountable for the task. */
|
|
14
|
+
owner: string;
|
|
15
|
+
/** Optional secondary line under the task name. */
|
|
16
|
+
detail?: string;
|
|
17
|
+
};
|
|
18
|
+
export type FilterTableProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> & {
|
|
19
|
+
rows: readonly FilterTableRow[];
|
|
20
|
+
/** Required accessible name for the table. */
|
|
21
|
+
caption: string;
|
|
22
|
+
/** Controlled filter. `null` shows every row. */
|
|
23
|
+
filter?: FilterTableStatus | null;
|
|
24
|
+
/** Initial filter for uncontrolled use. */
|
|
25
|
+
defaultFilter?: FilterTableStatus | null;
|
|
26
|
+
onFilterChange?: (filter: FilterTableStatus | null) => void;
|
|
27
|
+
/** Label used on the "show everything" chip. */
|
|
28
|
+
allLabel?: string;
|
|
29
|
+
/** Column headers, in render order. */
|
|
30
|
+
headers?: {
|
|
31
|
+
name: string;
|
|
32
|
+
date: string;
|
|
33
|
+
status: string;
|
|
34
|
+
owner: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A light task table whose status chips reorganize the visible rows in place.
|
|
39
|
+
* Row movement is animated with a FLIP pass that only touches `transform`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const FilterTable: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> & {
|
|
42
|
+
rows: readonly FilterTableRow[];
|
|
43
|
+
/** Required accessible name for the table. */
|
|
44
|
+
caption: string;
|
|
45
|
+
/** Controlled filter. `null` shows every row. */
|
|
46
|
+
filter?: FilterTableStatus | null;
|
|
47
|
+
/** Initial filter for uncontrolled use. */
|
|
48
|
+
defaultFilter?: FilterTableStatus | null;
|
|
49
|
+
onFilterChange?: (filter: FilterTableStatus | null) => void;
|
|
50
|
+
/** Label used on the "show everything" chip. */
|
|
51
|
+
allLabel?: string;
|
|
52
|
+
/** Column headers, in render order. */
|
|
53
|
+
headers?: {
|
|
54
|
+
name: string;
|
|
55
|
+
date: string;
|
|
56
|
+
status: string;
|
|
57
|
+
owner: string;
|
|
58
|
+
};
|
|
59
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export type FilterTableStatusLabelMap = Record<FilterTableStatus, string>;
|
|
61
|
+
export declare const filterTableStatusLabels: FilterTableStatusLabelMap;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Milliseconds one cell spends flipping. Mirrors `--motion-duration-moderate`;
|
|
5
|
+
* the CSS reads the token directly and only falls back to this number when the
|
|
6
|
+
* caller overrides `flapDuration`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FLAP_TEXT_DEFAULT_DURATION_MS = 220;
|
|
9
|
+
/** Milliseconds each successive cell waits before it starts flipping. */
|
|
10
|
+
export declare const FLAP_TEXT_DEFAULT_STAGGER_MS = 18;
|
|
11
|
+
export type FlapTextElement = "span" | "div" | "p" | "strong" | "em";
|
|
12
|
+
export type FlapTextAlign = "start" | "center" | "end";
|
|
13
|
+
export interface FlapTextProps {
|
|
14
|
+
/** The string to display. Changing it flips the characters that differ. */
|
|
15
|
+
text: string;
|
|
16
|
+
/** Host element. @default "span" */
|
|
17
|
+
as?: FlapTextElement;
|
|
18
|
+
/** Per-character delay, in milliseconds. @default 18 */
|
|
19
|
+
stagger?: number;
|
|
20
|
+
/** Flip duration, in milliseconds. @default `--motion-duration-moderate` */
|
|
21
|
+
flapDuration?: number;
|
|
22
|
+
/** Horizontal alignment of the rendered line. @default "start" */
|
|
23
|
+
align?: FlapTextAlign;
|
|
24
|
+
className?: string;
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export type FlapCell = {
|
|
28
|
+
/** Glyph shown once the cell settles. */
|
|
29
|
+
char: string;
|
|
30
|
+
/** Glyph rotating out, or `null` when the cell is new or settled. */
|
|
31
|
+
previous: string | null;
|
|
32
|
+
/** Whether this cell is mid-flip. */
|
|
33
|
+
flap: boolean;
|
|
34
|
+
/** Trailing cell that disappears when the text got shorter. */
|
|
35
|
+
exiting: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A Solari board only moves the cells whose glyph actually changed. Identical
|
|
39
|
+
* characters at the same index stay perfectly still, which is both faithful and
|
|
40
|
+
* far calmer to read.
|
|
41
|
+
*/
|
|
42
|
+
export declare function flapTextCells(previous: string, next: string): FlapCell[];
|
|
43
|
+
/**
|
|
44
|
+
* Split-flap text.
|
|
45
|
+
*
|
|
46
|
+
* Each character is its own cell. When `text` changes, only the cells whose
|
|
47
|
+
* glyph differs flip: the old glyph rotates away around the horizontal midline
|
|
48
|
+
* while the new one rotates in behind it, staggered left to right.
|
|
49
|
+
*
|
|
50
|
+
* Sharpness: cells are inline-block with `preserve-3d` and hidden backfaces,
|
|
51
|
+
* `will-change: transform` is present only while a cell is actually flipping,
|
|
52
|
+
* and settled cells carry `transform: none` exactly — never an identity matrix
|
|
53
|
+
* — so the browser re-rasterises the glyph at full fidelity. No scale is ever
|
|
54
|
+
* applied, and the component sets no font property, so text metrics are the
|
|
55
|
+
* caller's.
|
|
56
|
+
*
|
|
57
|
+
* Accessibility: cells are `aria-hidden`, the host carries `aria-label={text}`,
|
|
58
|
+
* and a visually hidden polite live region announces one clean string.
|
|
59
|
+
*
|
|
60
|
+
* Reduced motion: no 3D at all — a fast opacity crossfade swaps the glyph.
|
|
61
|
+
*/
|
|
62
|
+
export declare function FlapText({ text, as, stagger, flapDuration, align, className, style, }: FlapTextProps): import("react").DetailedReactHTMLElement<{
|
|
63
|
+
className: string;
|
|
64
|
+
style: CSSProperties | undefined;
|
|
65
|
+
"aria-label": string;
|
|
66
|
+
"data-align": FlapTextAlign;
|
|
67
|
+
"data-flapping": string;
|
|
68
|
+
}, HTMLElement>;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type IconGlyphComponent } from "../icon/Icon";
|
|
3
|
+
|
|
4
|
+
export type FlowchartCanvasProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
/** Flow nodes and connectors, composed top to bottom. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Hides the dotted grid when the flow sits inside an already-textured surface. */
|
|
8
|
+
grid?: boolean;
|
|
9
|
+
/** Horizontal alignment of the node column. @default "center" */
|
|
10
|
+
align?: "center" | "start";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A static presentation surface for a vertically-connected workflow.
|
|
14
|
+
* Flowchart never owns drag, drop, or node editing: it renders an already
|
|
15
|
+
* decided pipeline so a reader can follow it top to bottom.
|
|
16
|
+
*/
|
|
17
|
+
export declare const FlowchartCanvas: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
/** Flow nodes and connectors, composed top to bottom. */
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** Hides the dotted grid when the flow sits inside an already-textured surface. */
|
|
21
|
+
grid?: boolean;
|
|
22
|
+
/** Horizontal alignment of the node column. @default "center" */
|
|
23
|
+
align?: "center" | "start";
|
|
24
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export type FlowchartConnectorVariant = "line" | "elbow-left" | "elbow-right";
|
|
26
|
+
export type FlowchartConnectorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
27
|
+
/** Straight run, or an elbow that steps the flow into a branch column. */
|
|
28
|
+
variant?: FlowchartConnectorVariant;
|
|
29
|
+
/** Short branch caption such as `Yes`, `No`, or `On failure`. */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Draws the run dashed to signal a conditional or deferred path. */
|
|
32
|
+
dashed?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The visual run between two flow nodes. Decorative by default; the label,
|
|
36
|
+
* when present, is the only readable content and is exposed to assistive tech.
|
|
37
|
+
*/
|
|
38
|
+
export declare const FlowchartConnector: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
39
|
+
/** Straight run, or an elbow that steps the flow into a branch column. */
|
|
40
|
+
variant?: FlowchartConnectorVariant;
|
|
41
|
+
/** Short branch caption such as `Yes`, `No`, or `On failure`. */
|
|
42
|
+
label?: string;
|
|
43
|
+
/** Draws the run dashed to signal a conditional or deferred path. */
|
|
44
|
+
dashed?: boolean;
|
|
45
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
+
export type FlowchartTriggerProps = Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> & {
|
|
47
|
+
/** Approved Lucide glyph naming the event source. */
|
|
48
|
+
icon?: IconGlyphComponent;
|
|
49
|
+
/** What starts the flow, phrased as an event. */
|
|
50
|
+
title: ReactNode;
|
|
51
|
+
/** One sentence of supporting detail about the event. */
|
|
52
|
+
description?: ReactNode;
|
|
53
|
+
/** Overrides the default `Trigger` eyebrow. */
|
|
54
|
+
eyebrow?: string;
|
|
55
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
56
|
+
trailing?: ReactNode;
|
|
57
|
+
};
|
|
58
|
+
/** The entry node of a flow. Carries an accent left treatment. */
|
|
59
|
+
export declare const FlowchartTrigger: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "title"> & {
|
|
60
|
+
/** Approved Lucide glyph naming the event source. */
|
|
61
|
+
icon?: IconGlyphComponent;
|
|
62
|
+
/** What starts the flow, phrased as an event. */
|
|
63
|
+
title: ReactNode;
|
|
64
|
+
/** One sentence of supporting detail about the event. */
|
|
65
|
+
description?: ReactNode;
|
|
66
|
+
/** Overrides the default `Trigger` eyebrow. */
|
|
67
|
+
eyebrow?: string;
|
|
68
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
69
|
+
trailing?: ReactNode;
|
|
70
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
71
|
+
export type FlowchartActionProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
72
|
+
icon?: IconGlyphComponent;
|
|
73
|
+
/** What the step does. */
|
|
74
|
+
title: ReactNode;
|
|
75
|
+
description?: ReactNode;
|
|
76
|
+
/** Overrides the default `Action` eyebrow, e.g. `Step 2`. */
|
|
77
|
+
eyebrow?: string;
|
|
78
|
+
/** Optional metadata slot, typically a `Tag` or a duration. */
|
|
79
|
+
trailing?: ReactNode;
|
|
80
|
+
/** Extra detail rendered beneath the header. */
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
};
|
|
83
|
+
/** A generic executed step in the flow. */
|
|
84
|
+
export declare const FlowchartAction: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
85
|
+
icon?: IconGlyphComponent;
|
|
86
|
+
/** What the step does. */
|
|
87
|
+
title: ReactNode;
|
|
88
|
+
description?: ReactNode;
|
|
89
|
+
/** Overrides the default `Action` eyebrow, e.g. `Step 2`. */
|
|
90
|
+
eyebrow?: string;
|
|
91
|
+
/** Optional metadata slot, typically a `Tag` or a duration. */
|
|
92
|
+
trailing?: ReactNode;
|
|
93
|
+
/** Extra detail rendered beneath the header. */
|
|
94
|
+
children?: ReactNode;
|
|
95
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
96
|
+
export type FlowchartClauseJoin = "and" | "or";
|
|
97
|
+
export type FlowchartConditionClause = {
|
|
98
|
+
/** The measured entity, e.g. `run QC score`. */
|
|
99
|
+
entity: string;
|
|
100
|
+
/** The comparison, e.g. `is below`. */
|
|
101
|
+
operator: string;
|
|
102
|
+
/** The compared value, e.g. `0.8`. */
|
|
103
|
+
value: string;
|
|
104
|
+
/**
|
|
105
|
+
* How this clause joins the previous one. Ignored on the first clause.
|
|
106
|
+
* @default "and"
|
|
107
|
+
*/
|
|
108
|
+
join?: FlowchartClauseJoin;
|
|
109
|
+
};
|
|
110
|
+
export type FlowchartConditionProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
111
|
+
icon?: IconGlyphComponent;
|
|
112
|
+
/** Short name for the decision, e.g. `Route low-quality runs`. */
|
|
113
|
+
title: ReactNode;
|
|
114
|
+
/** The clauses evaluated together, rendered as entity / operator / value chips. */
|
|
115
|
+
clauses: readonly FlowchartConditionClause[];
|
|
116
|
+
/** Overrides the default `If / Else` eyebrow. */
|
|
117
|
+
eyebrow?: string;
|
|
118
|
+
/** Caption for the true outcome. */
|
|
119
|
+
thenLabel?: string;
|
|
120
|
+
/** Caption for the false outcome. Omit for an if-only condition. */
|
|
121
|
+
elseLabel?: string;
|
|
122
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
123
|
+
trailing?: ReactNode;
|
|
124
|
+
};
|
|
125
|
+
/** A branching If/Else node whose clauses read as inline chips. */
|
|
126
|
+
export declare const FlowchartCondition: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
127
|
+
icon?: IconGlyphComponent;
|
|
128
|
+
/** Short name for the decision, e.g. `Route low-quality runs`. */
|
|
129
|
+
title: ReactNode;
|
|
130
|
+
/** The clauses evaluated together, rendered as entity / operator / value chips. */
|
|
131
|
+
clauses: readonly FlowchartConditionClause[];
|
|
132
|
+
/** Overrides the default `If / Else` eyebrow. */
|
|
133
|
+
eyebrow?: string;
|
|
134
|
+
/** Caption for the true outcome. */
|
|
135
|
+
thenLabel?: string;
|
|
136
|
+
/** Caption for the false outcome. Omit for an if-only condition. */
|
|
137
|
+
elseLabel?: string;
|
|
138
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
139
|
+
trailing?: ReactNode;
|
|
140
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type MouseEventHandler, type ReactElement } from "react";
|
|
1
|
+
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type MouseEventHandler, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type AccountMenuProps } from "../account-menu/AccountMenu";
|
|
3
3
|
import { type DropdownMenuProps } from "../dropdown-menu/DropdownMenu";
|
|
4
4
|
import { type ThemeMode } from "../switch/Switch";
|
|
@@ -59,6 +59,11 @@ export type GlobalAppBarProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
59
59
|
onAccountMenuOpenChange?: DropdownMenuProps["onOpenChange"];
|
|
60
60
|
/** Additional native attributes for the account-menu button. */
|
|
61
61
|
accountButtonProps?: AccountButtonProps;
|
|
62
|
+
/**
|
|
63
|
+
* Product-wide utility controls rendered before Theme Switch. Use for
|
|
64
|
+
* persistent utilities such as Notifications, never page-specific actions.
|
|
65
|
+
*/
|
|
66
|
+
utilityActions?: ReactNode;
|
|
62
67
|
/**
|
|
63
68
|
* Workspace-only App Shell controls. Each control keeps its own semantics;
|
|
64
69
|
* Global App Bar owns only their approved order and alignment.
|
|
@@ -70,9 +75,9 @@ export type GlobalAppBarProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
70
75
|
};
|
|
71
76
|
};
|
|
72
77
|
/**
|
|
73
|
-
* Persistent application anchor. Home keeps
|
|
74
|
-
* account
|
|
75
|
-
* context without introducing a second App Bar component.
|
|
78
|
+
* Persistent application anchor. Home keeps brand, optional product-wide
|
|
79
|
+
* utilities, theme, and account; Workspace adds structural panel controls and
|
|
80
|
+
* project context without introducing a second App Bar component.
|
|
76
81
|
*/
|
|
77
82
|
export declare const GlobalAppBar: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
78
83
|
/** Home destination used by the official Mithrl brand action. */
|
|
@@ -105,6 +110,11 @@ export declare const GlobalAppBar: import("react").ForwardRefExoticComponent<Omi
|
|
|
105
110
|
onAccountMenuOpenChange?: DropdownMenuProps["onOpenChange"];
|
|
106
111
|
/** Additional native attributes for the account-menu button. */
|
|
107
112
|
accountButtonProps?: AccountButtonProps;
|
|
113
|
+
/**
|
|
114
|
+
* Product-wide utility controls rendered before Theme Switch. Use for
|
|
115
|
+
* persistent utilities such as Notifications, never page-specific actions.
|
|
116
|
+
*/
|
|
117
|
+
utilityActions?: ReactNode;
|
|
108
118
|
/**
|
|
109
119
|
* Workspace-only App Shell controls. Each control keeps its own semantics;
|
|
110
120
|
* Global App Bar owns only their approved order and alignment.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { type IconGlyphComponent, type IconSize } from "../icon/Icon";
|
|
3
|
+
|
|
4
|
+
export type IconSwapProps = Omit<HTMLAttributes<HTMLSpanElement>, "aria-label" | "aria-hidden" | "children" | "role"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Approved glyph to display. Changing the component identity swaps the
|
|
7
|
+
* glyph in place; the caller never manages two children.
|
|
8
|
+
*/
|
|
9
|
+
icon: IconGlyphComponent;
|
|
10
|
+
/** Icon Foundation size token. Matches the `Icon` contract exactly. */
|
|
11
|
+
size?: IconSize;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Cross-fades two glyphs through one slot.
|
|
15
|
+
*
|
|
16
|
+
* IconSwap is a single-slot component: pass one `icon`, and whenever that
|
|
17
|
+
* component identity changes the outgoing glyph fades out while the incoming
|
|
18
|
+
* glyph fades in over it. Both share one grid cell so the slot never reflows.
|
|
19
|
+
*
|
|
20
|
+
* Motion — `--motion-duration-standard` on `--motion-easing-standard`, with
|
|
21
|
+
* the incoming glyph rising from `--motion-scale-enter` and
|
|
22
|
+
* `--motion-blur-soft` to rest. Under `prefers-reduced-motion: reduce` the
|
|
23
|
+
* scale and blur are dropped and the two glyphs cross-fade on opacity alone at
|
|
24
|
+
* `--motion-duration-fast`.
|
|
25
|
+
*
|
|
26
|
+
* Boundary — the swap is decorative. IconSwap announces nothing: the root and
|
|
27
|
+
* every glyph are hidden from assistive technology, exactly as a bare `Icon`
|
|
28
|
+
* without a `label` is. The accessible name belongs to the owning control.
|
|
29
|
+
*/
|
|
30
|
+
export declare function IconSwap({ icon, size, className, ...props }: IconSwapProps): import("react/jsx-runtime").JSX.Element;
|