@lincyaw/aegis-ui 0.5.0 → 0.6.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/README.md +3 -2
- package/dist/components/ui/Alert.d.ts +14 -0
- package/dist/components/ui/AmbientBackground.d.ts +23 -0
- package/dist/components/ui/Avatar.d.ts +8 -1
- package/dist/components/ui/Breadcrumb.d.ts +3 -13
- package/dist/components/ui/Button.d.ts +26 -4
- package/dist/components/ui/Carousel.d.ts +28 -0
- package/dist/components/ui/CheckGrid.d.ts +47 -0
- package/dist/components/ui/Checkbox.d.ts +14 -0
- package/dist/components/ui/Chip.d.ts +14 -4
- package/dist/components/ui/CodeBlock.d.ts +3 -1
- package/dist/components/ui/Collapse.d.ts +16 -0
- package/dist/components/ui/ColumnLayout.d.ts +16 -0
- package/dist/components/ui/ControlListItem.d.ts +3 -1
- package/dist/components/ui/DataTable.d.ts +61 -1
- package/dist/components/ui/Dialog.d.ts +21 -0
- package/dist/components/ui/FileTree.d.ts +27 -0
- package/dist/components/ui/IdentityCell.d.ts +25 -0
- package/dist/components/ui/MdxDocument.d.ts +17 -0
- package/dist/components/ui/MetricLabel.d.ts +1 -0
- package/dist/components/ui/MonoValue.d.ts +3 -1
- package/dist/components/ui/PageHeader.d.ts +7 -2
- package/dist/components/ui/PageSizeSelect.d.ts +2 -1
- package/dist/components/ui/Pagination.d.ts +13 -0
- package/dist/components/ui/Panel.d.ts +32 -4
- package/dist/components/ui/PanelTitle.d.ts +2 -2
- package/dist/components/ui/ParetoChart.d.ts +41 -0
- package/dist/components/ui/PickerField.d.ts +17 -0
- package/dist/components/ui/RankBar.d.ts +25 -0
- package/dist/components/ui/Reveal.d.ts +17 -0
- package/dist/components/ui/RunPips.d.ts +25 -0
- package/dist/components/ui/ScoreBar.d.ts +21 -0
- package/dist/components/ui/SearchInput.d.ts +6 -1
- package/dist/components/ui/Select.d.ts +25 -0
- package/dist/components/ui/ShareLinkDialog.d.ts +21 -5
- package/dist/components/ui/StackedBar.d.ts +47 -0
- package/dist/components/ui/StatBlock.d.ts +8 -2
- package/dist/components/ui/StatusDot.d.ts +1 -1
- package/dist/components/ui/TableOfContents.d.ts +20 -0
- package/dist/components/ui/Tabs.d.ts +11 -1
- package/dist/components/ui/Timeline.d.ts +20 -5
- package/dist/components/ui/TraceSpanInspector.d.ts +4 -1
- package/dist/components/ui/TraceTree.d.ts +7 -3
- package/dist/components/ui/TrajectoryStep.d.ts +13 -0
- package/dist/components/ui/TrajectoryTimeline.d.ts +3 -1
- package/dist/components/ui/codeFence.d.ts +5 -0
- package/dist/components/ui/index.d.ts +42 -5
- package/dist/components/ui/linkComponent.d.ts +12 -0
- package/dist/components/ui/mdxTableOfContents.d.ts +13 -0
- package/dist/components/ui/tablistKeyboard.d.ts +6 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useCopyToClipboard.d.ts +1 -1
- package/dist/hooks/useElementWidth.d.ts +3 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/usePageHidden.d.ts +2 -0
- package/dist/index.cjs +9 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6439 -4163
- package/dist/index.js.map +1 -1
- package/dist/layouts/shell/AegisShell.d.ts +1 -1
- package/dist/layouts/shell/TopHeader.d.ts +5 -1
- package/dist/layouts/shell/paths.d.ts +4 -1
- package/dist/layouts/shell/types.d.ts +19 -0
- package/dist/lib/luceneQuery/lucene.d.ts +63 -0
- package/dist/locale/LocaleProvider.d.ts +9 -0
- package/dist/locale/index.d.ts +4 -0
- package/dist/locale/localeContext.d.ts +2 -0
- package/dist/locale/strings.d.ts +110 -0
- package/dist/locale/useStrings.d.ts +2 -0
- package/dist/mdx-modules.d.ts +22 -0
- package/dist/style.css +1 -1
- package/dist/vite.cjs +2 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.ts +7 -0
- package/dist/vite.js +18 -0
- package/dist/vite.js.map +1 -0
- package/package.json +20 -2
package/README.md
CHANGED
|
@@ -18,8 +18,9 @@ Peer dependencies: `react` 18, `react-dom` 18, `react-router-dom` 6,
|
|
|
18
18
|
`antd` 5.25 or later, `@ant-design/icons` 5.
|
|
19
19
|
|
|
20
20
|
Fonts are not bundled. Install `@fontsource-variable/geist`,
|
|
21
|
-
`@fontsource-variable/
|
|
22
|
-
import
|
|
21
|
+
`@fontsource-variable/hanken-grotesk`, `@fontsource-variable/noto-sans-sc`
|
|
22
|
+
and `@fontsource/google-sans-code`, and import them once in the app entry
|
|
23
|
+
(Google Sans Code as its `400.css` and `500.css` weights).
|
|
23
24
|
|
|
24
25
|
## Usage
|
|
25
26
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type AlertTone = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
interface AlertProps {
|
|
4
|
+
/** `error` is the anomaly tone — only for failures, never for emphasis. */
|
|
5
|
+
tone?: AlertTone;
|
|
6
|
+
/** Strong heading over a muted body, e.g. a verdict and its summary. */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/** Leading icon in place of the tone dot, e.g. a verdict glyph. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Alert({ tone, title, icon, children, className, }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type AmbientBackgroundVariant = 'page' | 'hero';
|
|
2
|
+
export interface AmbientBackgroundProps {
|
|
3
|
+
/**
|
|
4
|
+
* `page` for app pages; `hero` for overview and article heroes, with
|
|
5
|
+
* stronger glows that drift 1.6 times as far.
|
|
6
|
+
*/
|
|
7
|
+
variant?: AmbientBackgroundVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Layer height. Defaults to `--ambient-page-height` or
|
|
10
|
+
* `--ambient-hero-height`; the glows scale with the width, not the height.
|
|
11
|
+
*/
|
|
12
|
+
height?: number | string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Blue, teal and violet glows drifting across the top of a surface.
|
|
17
|
+
* Render it as the first child of a `position: relative; isolation:
|
|
18
|
+
* isolate` container: the layer spans that container's top edge and
|
|
19
|
+
* paints above its background and beneath its content. The drift pauses
|
|
20
|
+
* while the document is hidden and stays still under
|
|
21
|
+
* prefers-reduced-motion.
|
|
22
|
+
*/
|
|
23
|
+
export declare function AmbientBackground({ variant, height, className, }: AmbientBackgroundProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,8 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
|
|
3
3
|
type AvatarSize = 'sm' | 'md' | 'lg';
|
|
4
4
|
type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
|
|
5
|
+
/** Index into `--data-cat-1` … `--data-cat-6`, the chart series colours. */
|
|
6
|
+
export type AvatarColorSlot = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
7
|
export type AvatarSurface = PrimitiveSurface<{
|
|
6
8
|
name: string;
|
|
7
9
|
status?: AvatarStatus;
|
|
@@ -12,8 +14,13 @@ interface AvatarProps {
|
|
|
12
14
|
size?: AvatarSize;
|
|
13
15
|
status?: AvatarStatus;
|
|
14
16
|
icon?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Colours the initials fallback with `--data-cat-<n>` instead of the
|
|
19
|
+
* name-hashed hue, so it matches that series in charts.
|
|
20
|
+
*/
|
|
21
|
+
colorSlot?: AvatarColorSlot;
|
|
15
22
|
className?: string;
|
|
16
23
|
surface?: AvatarSurface;
|
|
17
24
|
}
|
|
18
|
-
export declare function Avatar({ name, src, size, status, icon, className, surface, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function Avatar({ name, src, size, status, icon, colorSlot, className, surface, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
26
|
export {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { LinkComponent } from './linkComponent';
|
|
2
3
|
export interface BreadcrumbItem {
|
|
3
4
|
label: ReactNode;
|
|
4
5
|
/** Optional destination. If omitted, the item renders as plain text. */
|
|
5
6
|
to?: string;
|
|
6
7
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Render-prop signature for routed links. Sub-apps that use a router
|
|
9
|
-
* (`react-router-dom`, `@tanstack/router`, Next.js) pass a wrapper that
|
|
10
|
-
* forwards to their `<Link>`. Keeping this contract minimal so the primitive
|
|
11
|
-
* has zero router dependency.
|
|
12
|
-
*/
|
|
13
|
-
export type BreadcrumbLinkComponent = ComponentType<{
|
|
14
|
-
to: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
}>;
|
|
18
8
|
interface BreadcrumbProps {
|
|
19
9
|
items: BreadcrumbItem[];
|
|
20
10
|
className?: string;
|
|
@@ -23,7 +13,7 @@ interface BreadcrumbProps {
|
|
|
23
13
|
* unstyled `<a href>`. Sub-apps using a router should pass their
|
|
24
14
|
* Link adapter here.
|
|
25
15
|
*/
|
|
26
|
-
linkComponent?:
|
|
16
|
+
linkComponent?: LinkComponent;
|
|
27
17
|
}
|
|
28
18
|
export declare function Breadcrumb({ items, className, linkComponent, }: BreadcrumbProps): ReactElement;
|
|
29
19
|
export {};
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { AegisAction } from '../../agent/types';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { LinkComponent } from './linkComponent';
|
|
4
|
+
type ButtonTone = 'primary' | 'secondary' | 'ghost' | 'glass';
|
|
5
|
+
type ButtonIconPosition = 'start' | 'end';
|
|
6
|
+
interface ButtonLookProps {
|
|
5
7
|
children: ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Visual treatment. `glass` is the secondary button frosted for a tinted,
|
|
10
|
+
* gradient or image background.
|
|
11
|
+
*/
|
|
12
|
+
tone?: ButtonTone;
|
|
13
|
+
/** Icon beside the label, sized to the button's icon slot. */
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
/** Side of the label the icon sits on. */
|
|
16
|
+
iconPosition?: ButtonIconPosition;
|
|
17
|
+
}
|
|
18
|
+
type NativeButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'children'>;
|
|
19
|
+
interface ButtonProps extends NativeButtonProps, ButtonLookProps {
|
|
8
20
|
/** Optional aegis-ui agent action — also wires the agent runtime. */
|
|
9
21
|
action?: AegisAction<void, unknown>;
|
|
10
22
|
/** Native HTML button type. */
|
|
11
23
|
type?: 'button' | 'submit' | 'reset';
|
|
12
24
|
}
|
|
25
|
+
/** A toggle button passes `aria-pressed`; the pressed state is the inverted fill. */
|
|
13
26
|
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
interface ButtonLinkProps extends ButtonLookProps {
|
|
28
|
+
/** Destination; the control navigates instead of firing a handler. */
|
|
29
|
+
to: string;
|
|
30
|
+
/** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */
|
|
31
|
+
linkComponent?: LinkComponent;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/** A link that looks like a Button, for actions that open another page. */
|
|
35
|
+
export declare function ButtonLink({ to, children, tone, icon, iconPosition, linkComponent, className, }: ButtonLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
14
36
|
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CarouselSlide {
|
|
3
|
+
key: string;
|
|
4
|
+
/** Name shown in the tab row under the slides. */
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface CarouselProps {
|
|
9
|
+
slides: CarouselSlide[];
|
|
10
|
+
/** Accessible name of the carousel region. */
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
/** Key of the slide shown; omit it to let the carousel track the slide. */
|
|
13
|
+
activeKey?: string;
|
|
14
|
+
/** Key of the slide shown first when `activeKey` is omitted; defaults to the first slide. */
|
|
15
|
+
defaultActiveKey?: string;
|
|
16
|
+
/** Fires with a slide's key when a tab is chosen and when autoplay moves to the next slide. */
|
|
17
|
+
onChange?: (key: string) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Slides with a named tab row under them. The current tab's progress bar
|
|
22
|
+
* fills over `--carousel-dwell`, then the next slide shows. Autoplay pauses
|
|
23
|
+
* on hover, on focus within and while the page is hidden, stops at the
|
|
24
|
+
* pause button until it is pressed again, and is off under
|
|
25
|
+
* prefers-reduced-motion, where neither the progress bars nor the button
|
|
26
|
+
* are drawn.
|
|
27
|
+
*/
|
|
28
|
+
export declare function Carousel({ slides, ariaLabel, activeKey: controlledKey, defaultActiveKey, onChange, className, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* One check in one run. `missed` carries how far the run fell short, e.g.
|
|
4
|
+
* "−0.80" or "replica"; `unchecked` (the check never ran, e.g. after a
|
|
5
|
+
* failed gate) shows an em dash.
|
|
6
|
+
*/
|
|
7
|
+
export type CheckGridCell = {
|
|
8
|
+
state: 'passed';
|
|
9
|
+
} | {
|
|
10
|
+
state: 'missed';
|
|
11
|
+
value: string;
|
|
12
|
+
} | {
|
|
13
|
+
state: 'unchecked';
|
|
14
|
+
};
|
|
15
|
+
export interface CheckGridColumn<C extends string> {
|
|
16
|
+
key: C;
|
|
17
|
+
/** Column header, e.g. "运行 1". */
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export interface CheckGridRow<C extends string> {
|
|
21
|
+
key: string;
|
|
22
|
+
/** Row header, e.g. the check's id. */
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
/** The check's outcome in every column, keyed by column key. */
|
|
25
|
+
cells: Readonly<Record<C, CheckGridCell>>;
|
|
26
|
+
}
|
|
27
|
+
export interface CheckGridProps<C extends string> {
|
|
28
|
+
/** Runs, left to right. */
|
|
29
|
+
columns: Array<CheckGridColumn<C>>;
|
|
30
|
+
/** Checks, top to bottom. */
|
|
31
|
+
rows: Array<CheckGridRow<C>>;
|
|
32
|
+
/** Header over the row labels, e.g. "检查". */
|
|
33
|
+
rowHeader: ReactNode;
|
|
34
|
+
/** Text of every passed cell, e.g. "通过". */
|
|
35
|
+
passedLabel: string;
|
|
36
|
+
/** Read out in place of an unchecked cell's em dash, e.g. "未检查". */
|
|
37
|
+
uncheckedLabel: string;
|
|
38
|
+
/** Note under the grid, e.g. "图 1 · …". */
|
|
39
|
+
caption?: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Checks against runs: one row per check, one column per run. Every cell
|
|
44
|
+
* writes its outcome — the passed label, the miss, or an em dash — so the
|
|
45
|
+
* colour is never the only signal.
|
|
46
|
+
*/
|
|
47
|
+
export declare function CheckGrid<C extends string>({ columns, rows, rowHeader, passedLabel, uncheckedLabel, caption, className, }: CheckGridProps<C>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface CheckboxProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange: (checked: boolean) => void;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
/** Mixed state for a parent checkbox whose children are partially selected. */
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Accessible name for checkboxes whose label is not visible, e.g. row selectors. */
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Checkbox({ checked, onChange, label, indeterminate, disabled, ariaLabel, className, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -3,13 +3,23 @@ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
|
|
|
3
3
|
export type ChipSurface = PrimitiveSurface<ReactNode>;
|
|
4
4
|
interface ChipProps {
|
|
5
5
|
children: ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Visual treatment. `warning` is the anomaly tone — a failed check or a
|
|
8
|
+
* rejected run belongs there, not on decorative labels.
|
|
9
|
+
*/
|
|
10
|
+
tone?: 'default' | 'ink' | 'warning' | 'success' | 'info' | 'caution' | 'ghost';
|
|
11
|
+
/**
|
|
12
|
+
* `sm` is 20 high with the micro type role; `md` and `lg` are 28 high
|
|
13
|
+
* with the label role, `lg` without vertical padding.
|
|
14
|
+
*/
|
|
15
|
+
size?: 'sm' | 'md' | 'lg';
|
|
16
|
+
/** Optional leading dot or icon; icons render at `--size-icon-sm`. */
|
|
9
17
|
leading?: ReactNode;
|
|
10
18
|
className?: string;
|
|
11
19
|
onClick?: () => void;
|
|
20
|
+
/** Renders a trailing dismiss control, e.g. for removable filter chips. */
|
|
21
|
+
onClose?: () => void;
|
|
12
22
|
surface?: ChipSurface;
|
|
13
23
|
}
|
|
14
|
-
export declare function Chip({ children, tone, leading, className, onClick, surface, }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function Chip({ children, tone, size, leading, className, onClick, onClose, surface, }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
15
25
|
export {};
|
|
@@ -8,8 +8,10 @@ interface CodeBlockProps {
|
|
|
8
8
|
/** Shown as the header label, e.g. `json`, `typescript`, `python`. */
|
|
9
9
|
language?: string;
|
|
10
10
|
showLineNumbers?: boolean;
|
|
11
|
+
/** Caps the code area's height (number → px); longer code scrolls inside. */
|
|
12
|
+
maxHeight?: number | string;
|
|
11
13
|
className?: string;
|
|
12
14
|
surface?: CodeBlockSurface;
|
|
13
15
|
}
|
|
14
|
-
export declare function CodeBlock({ code, language, showLineNumbers, className, surface, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function CodeBlock({ code, language, showLineNumbers, maxHeight, className, surface, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CollapseItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface CollapseProps {
|
|
8
|
+
items: CollapseItem[];
|
|
9
|
+
/** Controlled open keys. Omit for uncontrolled behaviour. */
|
|
10
|
+
activeKeys?: string[];
|
|
11
|
+
defaultActiveKeys?: string[];
|
|
12
|
+
onChange?: (keys: string[]) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Collapse({ items, activeKeys, defaultActiveKeys, onChange, className, }: CollapseProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ColumnLayoutProps {
|
|
3
|
+
/**
|
|
4
|
+
* `grid-template-columns` above 768 px, e.g. `'872fr 304fr'` or
|
|
5
|
+
* `'240fr 552fr 360fr'`. Each child is one column; below 768 px they
|
|
6
|
+
* stack. Nest a `columns="1fr"` layout to stack cards inside a column
|
|
7
|
+
* with the same gap.
|
|
8
|
+
*/
|
|
9
|
+
columns: string;
|
|
10
|
+
/** `md` = `--space-4`, `lg` = `--space-6`. */
|
|
11
|
+
gap?: 'md' | 'lg';
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function ColumnLayout({ columns, gap, children, className, }: ColumnLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -3,6 +3,8 @@ import { AegisAction } from '../../agent/types';
|
|
|
3
3
|
interface ControlListItemProps {
|
|
4
4
|
/** Left-side content (e.g. dot + label). */
|
|
5
5
|
left: ReactNode;
|
|
6
|
+
/** Muted line under `left`, e.g. what the option does; inverts with `active`. */
|
|
7
|
+
description?: ReactNode;
|
|
6
8
|
/** Right-side content (e.g. status text or action button). */
|
|
7
9
|
right?: ReactNode;
|
|
8
10
|
/** Inverts the row to ink — used for the currently-active item. */
|
|
@@ -14,5 +16,5 @@ interface ControlListItemProps {
|
|
|
14
16
|
className?: string;
|
|
15
17
|
style?: CSSProperties;
|
|
16
18
|
}
|
|
17
|
-
export declare function ControlListItem({ left, right, active, onClick, action, className, style, }: ControlListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function ControlListItem({ left, description, right, active, onClick, action, className, style, }: ControlListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export {};
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
|
|
3
3
|
export type DataTableSurface<T> = PrimitiveSurface<T[]>;
|
|
4
|
+
/** Background wash of one cell, e.g. a step on a pass-rate scale. */
|
|
5
|
+
export interface DataTableCellTone {
|
|
6
|
+
tone: 'success' | 'info' | 'caution' | 'warning';
|
|
7
|
+
/**
|
|
8
|
+
* 1 (default) is the tone's soft background; each step up mixes in more
|
|
9
|
+
* of the tone's accent, to 5.
|
|
10
|
+
*/
|
|
11
|
+
step?: 1 | 2 | 3 | 4 | 5;
|
|
12
|
+
}
|
|
4
13
|
export interface DataTableColumn<T> {
|
|
5
14
|
key: string;
|
|
6
15
|
header: ReactNode;
|
|
@@ -25,6 +34,14 @@ export interface DataTableColumn<T> {
|
|
|
25
34
|
* `truncate`.
|
|
26
35
|
*/
|
|
27
36
|
kind?: 'actions';
|
|
37
|
+
/**
|
|
38
|
+
* Number column: header and cells right-aligned, figures in
|
|
39
|
+
* `--font-numeric` with tabular widths so digits and decimal points line
|
|
40
|
+
* up. Overrides `align`.
|
|
41
|
+
*/
|
|
42
|
+
numeric?: boolean;
|
|
43
|
+
/** Washes a cell's background in a tone. Table rows only, not mobile cards. */
|
|
44
|
+
cellTone?: (row: T, index: number) => DataTableCellTone | undefined;
|
|
28
45
|
render: (row: T, index: number) => ReactNode;
|
|
29
46
|
}
|
|
30
47
|
/** Server-side pagination: `data` is the current page, never sliced here. */
|
|
@@ -51,6 +68,13 @@ interface DataTableProps<T> {
|
|
|
51
68
|
emptyDescription?: string;
|
|
52
69
|
emptyAction?: ReactNode;
|
|
53
70
|
className?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Draws the table as its own card: `--radius-lg`, hairline border and
|
|
73
|
+
* resting shadow, with the header flush with the top and clipped by the
|
|
74
|
+
* radius. Default true. Pass false where a container already frames the
|
|
75
|
+
* table, e.g. a titled `Panel padded={false}`, a dialog or an expanded row.
|
|
76
|
+
*/
|
|
77
|
+
framed?: boolean;
|
|
54
78
|
/**
|
|
55
79
|
* When set, resized column widths are persisted to localStorage under
|
|
56
80
|
* `aegis-data-table:<persistKey>`. Use a stable key per table.
|
|
@@ -58,7 +82,43 @@ interface DataTableProps<T> {
|
|
|
58
82
|
persistKey?: string;
|
|
59
83
|
/** Renders a footer with page navigation under the table. */
|
|
60
84
|
pagination?: DataTablePagination;
|
|
85
|
+
/** Adds a leading checkbox column and drives `selectedKeys`. */
|
|
86
|
+
selectable?: boolean;
|
|
87
|
+
selectedKeys?: Array<string | number>;
|
|
88
|
+
onSelectedKeysChange?: (keys: Array<string | number>) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Makes rows expandable: a leading column of chevron toggles, and this
|
|
91
|
+
* content full-width under each expanded row.
|
|
92
|
+
*/
|
|
93
|
+
renderExpanded?: (row: T, index: number) => ReactNode;
|
|
94
|
+
/** Controlled expanded row keys. Omit to let the table track them. */
|
|
95
|
+
expandedKeys?: Array<string | number>;
|
|
96
|
+
/** Rows expanded on mount when `expandedKeys` is omitted. */
|
|
97
|
+
defaultExpandedKeys?: Array<string | number>;
|
|
98
|
+
onExpandedKeysChange?: (keys: Array<string | number>) => void;
|
|
99
|
+
/**
|
|
100
|
+
* At ≤768 px, renders each row through this instead of the columns, as a
|
|
101
|
+
* stacked list with no sideways scroll. Selection, expansion, row clicks,
|
|
102
|
+
* loading, empty state and pagination keep working.
|
|
103
|
+
*/
|
|
104
|
+
renderMobileCard?: (row: T, index: number) => ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* Makes rows clickable: pointer cursor, a muted hover background, a
|
|
107
|
+
* trailing chevron, and Enter on a focused row. Links, buttons and form
|
|
108
|
+
* controls inside a cell keep their own behaviour.
|
|
109
|
+
*/
|
|
110
|
+
onRowClick?: (row: T, index: number) => void;
|
|
111
|
+
/**
|
|
112
|
+
* Keeps the first column (with the selection and expansion columns) in
|
|
113
|
+
* view while the other columns scroll sideways.
|
|
114
|
+
*/
|
|
115
|
+
stickyFirstColumn?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* The rows are out of date, e.g. the previous page while the next one
|
|
118
|
+
* loads: they stay in place, dimmed, and the table is marked busy.
|
|
119
|
+
*/
|
|
120
|
+
stale?: boolean;
|
|
61
121
|
surface?: DataTableSurface<T>;
|
|
62
122
|
}
|
|
63
|
-
export declare function DataTable<T>({ columns, data, rowKey, loading, emptyTitle, emptyDescription, emptyAction, className, persistKey, pagination, surface, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
123
|
+
export declare function DataTable<T>({ columns, data, rowKey, loading, emptyTitle, emptyDescription, emptyAction, className, framed, persistKey, pagination, selectable, selectedKeys, onSelectedKeysChange, renderExpanded, expandedKeys, defaultExpandedKeys, onExpandedKeysChange, renderMobileCard, onRowClick, stickyFirstColumn, stale, surface, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
64
124
|
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface DialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/** Action row rendered at the bottom of the panel, right-aligned. */
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
width?: 'sm' | 'md' | 'lg';
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Portalled to `document.body` so a transformed or glass (backdrop-filter)
|
|
15
|
+
* ancestor cannot become the containing block of the fixed backdrop. Not a
|
|
16
|
+
* native `<dialog>`: its top layer would sit above antd's body-level
|
|
17
|
+
* popups and toasts. While open, focus stays inside the panel and the page
|
|
18
|
+
* behind it does not scroll.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Dialog({ open, title, description, onClose, footer, width, children, className, }: DialogProps): import('react').ReactPortal | null;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FileTreeFile {
|
|
3
|
+
/** Path from the tree root with `/` between segments, e.g. `tests/grading.toml`. */
|
|
4
|
+
path: string;
|
|
5
|
+
/** Trailing note, typically the file size. */
|
|
6
|
+
note?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface FileTreeProps {
|
|
9
|
+
files: FileTreeFile[];
|
|
10
|
+
/** Accessible name of the tree. */
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
/**
|
|
13
|
+
* Path of the selected file. Whenever it changes, the directories above
|
|
14
|
+
* it open, unless `expandedPaths` controls them.
|
|
15
|
+
*/
|
|
16
|
+
selectedPath?: string;
|
|
17
|
+
/** Called with a file's path when it is clicked or activated with Enter or Space. */
|
|
18
|
+
onSelect?: (path: string) => void;
|
|
19
|
+
/** Open directories, each written with a trailing `/`, e.g. `tests/`. Omit it to let the tree track them. */
|
|
20
|
+
expandedPaths?: string[];
|
|
21
|
+
/** Directories open on first render when `expandedPaths` is omitted. */
|
|
22
|
+
defaultExpandedPaths?: string[];
|
|
23
|
+
/** Called with the open directories whenever one opens or closes. */
|
|
24
|
+
onExpandedPathsChange?: (paths: string[]) => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function FileTree({ files, ariaLabel, selectedPath, onSelect, expandedPaths, defaultExpandedPaths, onExpandedPathsChange, className, }: FileTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AvatarColorSlot } from './Avatar';
|
|
3
|
+
import { LinkComponent } from './linkComponent';
|
|
4
|
+
interface IdentityCellProps {
|
|
5
|
+
/** Primary line, e.g. a model or task name. Truncates; the full name shows on hover. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Muted `--font-mono` line under the name for an id or path, e.g. `source / task`; a string shows in full on hover. */
|
|
8
|
+
secondary?: ReactNode;
|
|
9
|
+
/** Leads with an Avatar of the name's initials. */
|
|
10
|
+
avatar?: boolean;
|
|
11
|
+
/** Avatar colour from the chart series colours, so it matches that series. */
|
|
12
|
+
colorSlot?: AvatarColorSlot;
|
|
13
|
+
/** Makes the name a link to this destination. */
|
|
14
|
+
to?: string;
|
|
15
|
+
/** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */
|
|
16
|
+
linkComponent?: LinkComponent;
|
|
17
|
+
/** Puts the secondary text beside the name on one line. */
|
|
18
|
+
inline?: boolean;
|
|
19
|
+
/** Wraps the name and the secondary text, breaking anywhere, instead of truncating, so a long
|
|
20
|
+
* name never widens the card or list it sits in. */
|
|
21
|
+
wrap?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function IdentityCell({ name, secondary, avatar, colorSlot, to, linkComponent, inline, wrap, className, }: IdentityCellProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MDXComponents, MDXContent } from 'mdx/types';
|
|
2
|
+
import { LinkComponent } from './linkComponent';
|
|
3
|
+
export interface MdxDocumentProps {
|
|
4
|
+
/** The default export of an `.mdx` module compiled by `aegisMdx()` from `@lincyaw/aegis-ui/vite`. */
|
|
5
|
+
content: MDXContent;
|
|
6
|
+
/** Components the document's JSX names, and overrides of its Markdown elements. */
|
|
7
|
+
components?: MDXComponents;
|
|
8
|
+
/** Renders links within the site (`/…`) through the host router; other links are plain anchors. */
|
|
9
|
+
linkComponent?: LinkComponent;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A long-form document written in MDX, such as an article or a report, in the
|
|
14
|
+
* article type roles: Markdown headings, prose, lists, tables, quotes and code,
|
|
15
|
+
* with the document's own components in between.
|
|
16
|
+
*/
|
|
17
|
+
export declare function MdxDocument({ content: Content, components, linkComponent, className, }: MdxDocumentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,11 +5,13 @@ interface MonoValueProps {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
size?: 'sm' | 'base' | 'lg';
|
|
7
7
|
weight?: 'regular' | 'medium';
|
|
8
|
+
/** Ink colour. `danger` is the anomaly red — failures only. */
|
|
9
|
+
tone?: 'default' | 'success' | 'danger' | 'muted';
|
|
8
10
|
inverted?: boolean;
|
|
9
11
|
as?: 'span' | 'div';
|
|
10
12
|
className?: string;
|
|
11
13
|
style?: CSSProperties;
|
|
12
14
|
surface?: MonoValueSurface;
|
|
13
15
|
}
|
|
14
|
-
export declare function MonoValue({ children, size, weight, inverted, as: Tag, className, style, surface, }: MonoValueProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function MonoValue({ children, size, weight, tone, inverted, as: Tag, className, style, surface, }: MonoValueProps): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
interface PageHeaderProps {
|
|
3
3
|
title: string;
|
|
4
|
-
|
|
4
|
+
/** Inline content beside the title, e.g. a verdict badge and scores. */
|
|
5
|
+
titleExtra?: ReactNode;
|
|
6
|
+
/** One line under the title; may carry inline content such as an avatar. */
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** Label row under the description, e.g. a type badge and a version. */
|
|
9
|
+
meta?: ReactNode;
|
|
5
10
|
action?: ReactNode;
|
|
6
11
|
className?: string;
|
|
7
12
|
}
|
|
8
|
-
export declare function PageHeader({ title, description, action, className, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function PageHeader({ title, titleExtra, description, meta, action, className, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
14
|
export {};
|
|
@@ -4,6 +4,7 @@ export interface PageSizeSelectProps {
|
|
|
4
4
|
onChange: (next: number) => void;
|
|
5
5
|
options?: number[];
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
/** Defaults to the locale's "rows per page"; pass '' to hide the caption. */
|
|
7
8
|
label?: string;
|
|
8
9
|
className?: string;
|
|
9
10
|
/**
|
|
@@ -14,4 +15,4 @@ export interface PageSizeSelectProps {
|
|
|
14
15
|
*/
|
|
15
16
|
placement?: 'top' | 'bottom';
|
|
16
17
|
}
|
|
17
|
-
export declare function PageSizeSelect({ value, onChange, options, disabled, label, className, placement, }: PageSizeSelectProps): ReactElement;
|
|
18
|
+
export declare function PageSizeSelect({ value, onChange, options, disabled, label: labelProp, className, placement, }: PageSizeSelectProps): ReactElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface PaginationProps {
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
/** Optional so a `DataTablePagination` can be spread straight in. */
|
|
5
|
+
total?: number;
|
|
6
|
+
onChange: (page: number, pageSize: number) => void;
|
|
7
|
+
pageSizeOptions?: number[];
|
|
8
|
+
/** Noun used in the total count, e.g. "steps"; defaults to the locale's records unit. */
|
|
9
|
+
unit?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Pagination({ page, pageSize, total, onChange, pageSizeOptions, unit, className, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,15 +1,43 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ContainerSurface } from '../../agent/usePrimitiveSurface';
|
|
3
|
+
import { LinkComponent } from './linkComponent';
|
|
3
4
|
export type PanelSurface = ContainerSurface;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* `tint` for showcase blocks on overview and article pages, `brand` for
|
|
7
|
+
* featured content, `glass` for a panel laid over a gradient or image.
|
|
8
|
+
*/
|
|
9
|
+
export type PanelVariant = 'solid' | 'tint' | 'brand' | 'glass';
|
|
10
|
+
/** `raised` lifts featured and hero cards above the resting cards. */
|
|
11
|
+
export type PanelElevation = 'rest' | 'raised';
|
|
12
|
+
interface PanelBaseProps {
|
|
13
|
+
/** Muted line under the title, e.g. a chart's metric and direction. */
|
|
14
|
+
description?: ReactNode;
|
|
6
15
|
extra?: ReactNode;
|
|
7
|
-
|
|
16
|
+
variant?: PanelVariant;
|
|
17
|
+
elevation?: PanelElevation;
|
|
18
|
+
/** False drops the body padding, e.g. for a table that fills the panel. */
|
|
8
19
|
padded?: boolean;
|
|
9
20
|
className?: string;
|
|
10
21
|
style?: CSSProperties;
|
|
11
22
|
children?: ReactNode;
|
|
12
23
|
surface?: PanelSurface;
|
|
13
24
|
}
|
|
14
|
-
|
|
25
|
+
interface PanelStaticProps extends PanelBaseProps {
|
|
26
|
+
title?: ReactNode;
|
|
27
|
+
to?: undefined;
|
|
28
|
+
linkComponent?: undefined;
|
|
29
|
+
}
|
|
30
|
+
interface PanelLinkProps extends PanelBaseProps {
|
|
31
|
+
/** The link's text; the link covers the whole panel. */
|
|
32
|
+
title: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Destination; the panel lifts on hover. Controls belong in `extra`,
|
|
35
|
+
* which stays clickable above the link; the body is part of the link.
|
|
36
|
+
*/
|
|
37
|
+
to: string;
|
|
38
|
+
/** Renders the link. Defaults to an `<a href>`; routed apps pass their Link adapter. */
|
|
39
|
+
linkComponent?: LinkComponent;
|
|
40
|
+
}
|
|
41
|
+
type PanelProps = PanelStaticProps | PanelLinkProps;
|
|
42
|
+
export declare function Panel({ title, description, extra, variant, elevation, padded, to, linkComponent, className, style, children, surface, }: PanelProps): import("react/jsx-runtime").JSX.Element;
|
|
15
43
|
export {};
|