@mechane-ai/elements 0.41.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -41
- package/bin/catalog.d.mts +17 -0
- package/bin/mechane-elements-catalog.mjs +60 -0
- package/dist/agent.js +1 -1
- package/dist/ai.js +23 -23
- package/dist/catalog.json +1984 -0
- package/dist/{categorical-values-DnGR_pQx.js → categorical-values-DzhbfZ5w.js} +3 -3
- package/dist/{chart-frame-BsyI1Zc8.js → chart-frame-9dQQNF3F.js} +74 -22
- package/dist/{chart-input-r4S3-QCT.js → chart-input-DT0STflx.js} +2 -2
- package/dist/{chart-navigation-D7OkLdSx.js → chart-navigation-BAbb5PV9.js} +67 -32
- package/dist/charts/cartesian.js +1728 -559
- package/dist/charts/distribution.js +5 -5
- package/dist/charts/graph.js +443 -76
- package/dist/charts/hierarchy.js +5 -5
- package/dist/charts/matrix.js +232 -63
- package/dist/charts/timeline.js +3 -3
- package/dist/charts.js +2 -2
- package/dist/{code-block-C4K1sM9O.js → code-block-Cpfr7B6a.js} +1 -1
- package/dist/collections.js +475 -354
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CBDqSvgP.js → content-link-CGeFFb9F.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +11 -11
- package/dist/{forms-I-WMHTkr.js → forms-DeU0Tiv3.js} +6 -2
- package/dist/forms.js +3 -3
- package/dist/index.js +1 -1
- package/dist/label-spacing-BncjePGb.js +6 -0
- package/dist/layout.js +275 -249
- package/dist/mechane-elements-catalog.mjs +4 -0
- package/dist/navigation.js +2 -2
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +15 -3
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +43 -0
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +32 -0
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +29 -0
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +40 -0
- package/dist/packages/charts/src/cartesian/index.d.ts +7 -2
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +34 -0
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +10 -1
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +66 -0
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +11 -1
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +35 -0
- package/dist/packages/charts/src/cartesian/time-series.d.ts +6 -1
- package/dist/packages/charts/src/chart-inspection.d.ts +4 -1
- package/dist/packages/charts/src/chart-navigation.d.ts +5 -1
- package/dist/packages/charts/src/chart-series-marker.d.ts +8 -1
- package/dist/packages/charts/src/chart-surface.d.ts +4 -0
- package/dist/packages/charts/src/chart-theme.d.ts +26 -0
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +26 -0
- package/dist/packages/charts/src/graph/flow-layout.d.ts +70 -0
- package/dist/packages/charts/src/graph/index.d.ts +2 -0
- package/dist/packages/charts/src/index.d.ts +1 -1
- package/dist/packages/charts/src/label-spacing.d.ts +15 -0
- package/dist/packages/charts/src/matrix/matrix-cells.d.ts +4 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +20 -0
- package/dist/packages/charts/src/matrix/matrix-types.d.ts +21 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +8 -19
- package/dist/packages/collections/src/collection-controls.d.ts +2 -1
- package/dist/packages/collections/src/data-table.d.ts +12 -8
- package/dist/packages/collections/src/index.d.ts +1 -0
- package/dist/packages/collections/src/table-results.d.ts +26 -0
- package/dist/packages/core/src/actions.d.ts +6 -0
- package/dist/packages/core/src/index.d.ts +1 -1
- package/dist/packages/forms/src/form-status.d.ts +7 -0
- package/dist/packages/forms/src/forms.d.ts +3 -1
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/foundations/src/agent/index.d.ts +2 -2
- package/dist/packages/layout/src/page-context.d.ts +4 -0
- package/dist/packages/navigation/src/index.d.ts +1 -0
- package/dist/packages/navigation/src/route-link.d.ts +2 -0
- package/dist/{pierre-diff-DJ3oOfPX.js → pierre-diff-B3tD3-6z.js} +1 -1
- package/dist/{plot-width-BQQS-mw9.js → plot-width-DzCmthQW.js} +28 -0
- package/dist/{src-D2OHco8V.js → src-Bk7M67zy.js} +3 -3
- package/dist/{src-DfOAlAd2.js → src-BpvnBWrF.js} +1 -1
- package/dist/{src-CQQvXi7a.js → src-DBNncL7_.js} +70 -50
- package/dist/{src-s3tWwnN4.js → src-DcW_gMX8.js} +178 -168
- package/dist/{src-CNV1ewzb.js → src-gqEebHEa.js} +319 -285
- package/dist/styles2.css +115 -0
- package/package.json +9 -2
- package/recipes/allocation-report.tsx +115 -0
- package/recipes/consequential-form.tsx +132 -0
- package/recipes/searchable-collection.tsx +106 -0
- package/recipes/sectioned-report.tsx +58 -0
- package/recipes/tabbed-workspace.tsx +84 -0
- package/skills/extend-elements/SKILL.md +28 -0
- package/skills/use-elements/SKILL.md +36 -0
- package/skills/{elements-presentation/SKILL.md → use-elements/references/reports.md} +0 -6
- package/skills/{elements-workspace/SKILL.md → use-elements/references/workspace.md} +0 -6
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
2
|
+
/** A stage that amounts flow into or out of. The column follows from the links: sources first, then each next step. */
|
|
3
|
+
export type FlowNode = {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
/** Absent takes the next automatic series tone in node order. */
|
|
7
|
+
readonly tone?: ChartTone | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A supplied amount moving from one node to another. A null value records a known relationship whose amount is
|
|
11
|
+
* unavailable; it draws a dashed thread and adds nothing to either node.
|
|
12
|
+
*/
|
|
13
|
+
export type FlowLink = {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly sourceId: string;
|
|
16
|
+
readonly targetId: string;
|
|
17
|
+
readonly value: number | null;
|
|
18
|
+
/** Absent uses the target node's tone, so each ribbon reads as part of where it arrives. */
|
|
19
|
+
readonly tone?: ChartTone | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type PlacedFlowNode = {
|
|
22
|
+
readonly node: FlowNode;
|
|
23
|
+
readonly tone: ChartTone;
|
|
24
|
+
readonly column: number;
|
|
25
|
+
readonly x: number;
|
|
26
|
+
readonly y: number;
|
|
27
|
+
readonly height: number;
|
|
28
|
+
readonly inflow: number;
|
|
29
|
+
readonly outflow: number;
|
|
30
|
+
readonly hasUnavailable: boolean;
|
|
31
|
+
};
|
|
32
|
+
export type PlacedFlowLink = {
|
|
33
|
+
readonly link: FlowLink;
|
|
34
|
+
readonly tone: ChartTone;
|
|
35
|
+
readonly source: PlacedFlowNode;
|
|
36
|
+
readonly target: PlacedFlowNode;
|
|
37
|
+
readonly sourceY: number;
|
|
38
|
+
readonly targetY: number;
|
|
39
|
+
readonly width: number;
|
|
40
|
+
};
|
|
41
|
+
export type FlowLayout = {
|
|
42
|
+
readonly nodes: ReadonlyArray<PlacedFlowNode>;
|
|
43
|
+
readonly links: ReadonlyArray<PlacedFlowLink>;
|
|
44
|
+
readonly columnCount: number;
|
|
45
|
+
};
|
|
46
|
+
type LayoutInput = {
|
|
47
|
+
readonly nodes: ReadonlyArray<FlowNode>;
|
|
48
|
+
readonly links: ReadonlyArray<FlowLink>;
|
|
49
|
+
readonly left: number;
|
|
50
|
+
readonly right: number;
|
|
51
|
+
readonly top: number;
|
|
52
|
+
readonly bottom: number;
|
|
53
|
+
};
|
|
54
|
+
export declare const FLOW_NODE_WIDTH_PX = 12;
|
|
55
|
+
type ColumnInput = Pick<LayoutInput, 'nodes' | 'links'>;
|
|
56
|
+
/**
|
|
57
|
+
* Each node's column: zero for sources, then the length of the longest path that reaches it. Undefined when the links
|
|
58
|
+
* form a cycle, because a path through a cycle never stops growing.
|
|
59
|
+
*/
|
|
60
|
+
export declare function flowColumns({ nodes, links }: ColumnInput): ReadonlyMap<string, number> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Lays nodes out in columns by longest path and keeps their supplied order within each column. Nodes and ribbons share
|
|
63
|
+
* one scale, so every amount keeps the same length per unit.
|
|
64
|
+
*/
|
|
65
|
+
export declare function layoutFlow({ nodes, links, left, right, top, bottom }: LayoutInput): FlowLayout;
|
|
66
|
+
/** A ribbon from the source's right edge to the target's left edge, with horizontal tangents at both ends. */
|
|
67
|
+
export declare function ribbonPath(placed: PlacedFlowLink): string;
|
|
68
|
+
/** The center line of a ribbon, used for unavailable and zero amounts that have no width. */
|
|
69
|
+
export declare function threadPath(placed: PlacedFlowLink): string;
|
|
70
|
+
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export type { FlowDiagramProps, FlowLink, FlowNode } from './flow-diagram.tsx';
|
|
2
|
+
export { FlowDiagram, MAX_FLOW_LINKS, MAX_FLOW_NODES } from './flow-diagram.tsx';
|
|
1
3
|
export type { RelationNode, RelationEdge, RelationGroup, RelationGraphProps } from './relation-graph.tsx';
|
|
2
4
|
export { MAX_RELATION_NODES, MAX_RELATION_EDGES, MAX_RELATION_GROUPS, MAX_RELATION_DIMENSION, RelationGraph, } from './relation-graph.tsx';
|
|
@@ -3,5 +3,5 @@ export type { ChartReport, ChartSeriesReport, ChartSelection, ChartFrameProps, C
|
|
|
3
3
|
export { ChartFrame, ChartLegend } from './chart-frame.tsx';
|
|
4
4
|
export type { ChartTone } from '../../foundations/src/chart-tones.ts';
|
|
5
5
|
export { chartToneColors } from '../../foundations/src/chart-tones.ts';
|
|
6
|
-
export type { ChartSeriesMarkerProps } from './chart-series-marker.tsx';
|
|
6
|
+
export type { ChartMarkShape, ChartSeriesMarkerProps } from './chart-series-marker.tsx';
|
|
7
7
|
export { ChartSeriesMarker } from './chart-series-marker.tsx';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type SpreadInput = {
|
|
2
|
+
/** Preferred centers in ascending order. */
|
|
3
|
+
readonly positions: ReadonlyArray<number>;
|
|
4
|
+
/** The least distance between neighboring centers. */
|
|
5
|
+
readonly gap: number;
|
|
6
|
+
readonly start: number;
|
|
7
|
+
readonly end: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Moves label centers apart by at least `gap`, as near their preferred positions as the bounds allow, keeping their
|
|
11
|
+
* order. When the labels cannot all fit, the first ones keep the start bound. Each center is the closed form of three
|
|
12
|
+
* passes: push labels down, pull them back above the end, then push once more.
|
|
13
|
+
*/
|
|
14
|
+
export declare function spreadPositions({ positions, gap, start, end }: SpreadInput): ReadonlyArray<number>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MatrixCell } from './matrix-types.ts';
|
|
2
|
+
export declare const CELL_TEXT_MAX_CHARACTERS = 6;
|
|
3
|
+
export declare function matrixCellGlyph(cell: MatrixCell, text: string, isOutsideDomain: boolean): string;
|
|
4
|
+
export declare function matrixValueText(cell: MatrixCell | undefined, domain: readonly [number, number], formatValue: (value: number) => string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartSelection } from '../chart-frame.tsx';
|
|
3
|
+
import type { HeatmapScale } from './heatmap-scale.ts';
|
|
4
|
+
import type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
5
|
+
type StripProps = HeatmapScale & {
|
|
6
|
+
readonly rows: ReadonlyArray<MatrixAxisItem>;
|
|
7
|
+
readonly columns: ReadonlyArray<MatrixAxisItem>;
|
|
8
|
+
readonly cellAt: (rowId: string, columnId: string) => MatrixCell | undefined;
|
|
9
|
+
readonly coordinateId: (rowId: string, columnId: string) => string;
|
|
10
|
+
readonly inspectedId: string | undefined;
|
|
11
|
+
readonly onInspect: (id: string) => void;
|
|
12
|
+
readonly formatValue: (value: number) => string;
|
|
13
|
+
readonly selection: ChartSelection | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Draws a matrix as compact intensity rows that fill the available width, such as months across categories. Cells carry
|
|
17
|
+
* color and state glyphs only; inspection and the exact-value table hold the numbers.
|
|
18
|
+
*/
|
|
19
|
+
export declare function MatrixStrip({ rows, columns, cellAt, coordinateId, inspectedId, onInspect, domain, palette, formatValue, selection, }: StripProps): ReactNode;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type MatrixAxisItem = {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
/** The full name used in headers, inspection and exact values. */
|
|
4
|
+
readonly label: string;
|
|
5
|
+
/** A concise header, such as "J" for January, that a compact strip shows. Absent uses the label. */
|
|
6
|
+
readonly axisLabel?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type MatrixCell = {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly rowId: string;
|
|
11
|
+
readonly columnId: string;
|
|
12
|
+
} & ({
|
|
13
|
+
readonly kind: 'value';
|
|
14
|
+
readonly value: number;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'masked';
|
|
17
|
+
readonly reason: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'missing';
|
|
20
|
+
readonly reason: string;
|
|
21
|
+
});
|
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ChartReport, ChartSelection } from '../chart-frame.tsx';
|
|
3
3
|
import type { HeatmapScale } from './heatmap-scale.ts';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly label: string;
|
|
7
|
-
};
|
|
8
|
-
export type MatrixCell = {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly rowId: string;
|
|
11
|
-
readonly columnId: string;
|
|
12
|
-
} & ({
|
|
13
|
-
readonly kind: 'value';
|
|
14
|
-
readonly value: number;
|
|
15
|
-
} | {
|
|
16
|
-
readonly kind: 'masked';
|
|
17
|
-
readonly reason: string;
|
|
18
|
-
} | {
|
|
19
|
-
readonly kind: 'missing';
|
|
20
|
-
readonly reason: string;
|
|
21
|
-
});
|
|
4
|
+
import type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
5
|
+
export type { MatrixAxisItem, MatrixCell } from './matrix-types.ts';
|
|
22
6
|
export type MatrixProps = HeatmapScale & {
|
|
23
7
|
readonly title: string;
|
|
24
8
|
readonly report?: ChartReport | undefined;
|
|
@@ -30,6 +14,11 @@ export type MatrixProps = HeatmapScale & {
|
|
|
30
14
|
readonly formatValue: (value: number) => string;
|
|
31
15
|
readonly selection?: ChartSelection;
|
|
32
16
|
readonly emptyLabel: string;
|
|
17
|
+
/**
|
|
18
|
+
* The values variant draws square cells with short values for exact comparison. The strip variant draws compact
|
|
19
|
+
* intensity rows that fill the width, such as months across categories. Absent means values.
|
|
20
|
+
*/
|
|
21
|
+
readonly variant?: 'values' | 'strip' | undefined;
|
|
33
22
|
};
|
|
34
23
|
export declare const MAX_MATRIX_CELLS = 4096;
|
|
35
|
-
export declare function Matrix({ title, report, description, rows, columns, cells, domain, palette, valueLabel, formatValue, selection, emptyLabel, }: MatrixProps): ReactNode;
|
|
24
|
+
export declare function Matrix({ title, report, description, rows, columns, cells, domain, palette, valueLabel, formatValue, selection, emptyLabel, variant, }: MatrixProps): ReactNode;
|
|
@@ -29,6 +29,7 @@ export type DisplayOptionsProps = {
|
|
|
29
29
|
};
|
|
30
30
|
export declare function DisplayOptions({ options, onChange, onReset, label, }: DisplayOptionsProps): ReactNode;
|
|
31
31
|
export type CollectionPaginationProps = {
|
|
32
|
+
readonly label?: string;
|
|
32
33
|
readonly description: string;
|
|
33
34
|
readonly previous: {
|
|
34
35
|
readonly disabled: boolean;
|
|
@@ -39,4 +40,4 @@ export type CollectionPaginationProps = {
|
|
|
39
40
|
readonly onClick: () => void;
|
|
40
41
|
};
|
|
41
42
|
};
|
|
42
|
-
export declare function CollectionPagination({ description, previous, next }: CollectionPaginationProps): ReactNode;
|
|
43
|
+
export declare function CollectionPagination({ label, description, previous, next }: CollectionPaginationProps): ReactNode;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CollectionPaginationProps } from './collection-controls.tsx';
|
|
3
|
+
import type { LocalTableQuery, TableQuery } from './table-query.tsx';
|
|
4
|
+
import type { DataTableSort, TableResultStatus } from './table-results.tsx';
|
|
3
5
|
type RowSizing = 'fixed' | 'content';
|
|
4
6
|
export type DataTableColumnRole = 'primary' | 'text' | 'status' | 'number' | 'timestamp' | 'actions';
|
|
5
7
|
export type DataTableColumnLayout = {
|
|
@@ -34,10 +36,7 @@ export type DataTableTextPlaceholderProps = {
|
|
|
34
36
|
};
|
|
35
37
|
export declare function DataTableText({ children, secondary, leading, trailing }: DataTableTextProps): ReactNode;
|
|
36
38
|
export declare function DataTableTextPlaceholder({ leading, isSecondary }: DataTableTextPlaceholderProps): ReactNode;
|
|
37
|
-
export type DataTableSort
|
|
38
|
-
readonly columnId: string;
|
|
39
|
-
readonly direction: 'ascending' | 'descending';
|
|
40
|
-
};
|
|
39
|
+
export type { DataTableSort } from './table-results.tsx';
|
|
41
40
|
export type DataTableWindow = {
|
|
42
41
|
readonly height: number | 'fill';
|
|
43
42
|
readonly estimatedRowHeight?: number;
|
|
@@ -90,9 +89,14 @@ type TableRowsProps<Row> = SortProperties<Row> & OptionalSelection<Row> & {
|
|
|
90
89
|
readonly endContent?: ReactNode;
|
|
91
90
|
readonly onEndReached?: () => void;
|
|
92
91
|
readonly footer?: ReactNode;
|
|
92
|
+
readonly pagination?: CollectionPaginationProps;
|
|
93
|
+
readonly resultStatus?: TableResultStatus;
|
|
93
94
|
};
|
|
94
|
-
export type DataTableProps<Row> = TableRowsProps<Row> & {
|
|
95
|
+
export type DataTableProps<Row> = TableRowsProps<Row> & ({
|
|
95
96
|
readonly query: TableQuery<Row>;
|
|
96
|
-
|
|
97
|
+
readonly onEndReached?: never;
|
|
98
|
+
readonly pagination?: never;
|
|
99
|
+
} | {
|
|
100
|
+
readonly query: Exclude<TableQuery<Row>, LocalTableQuery<Row>>;
|
|
101
|
+
});
|
|
97
102
|
export declare function DataTable<Row extends object>({ query, ...table }: DataTableProps<Row>): ReactNode;
|
|
98
|
-
export {};
|
|
@@ -15,6 +15,7 @@ export { Timeline } from './timeline.tsx';
|
|
|
15
15
|
export type { TimelineProps, TimelineItemProps } from './timeline.tsx';
|
|
16
16
|
export { useCollectionControls } from './use-collection-controls.tsx';
|
|
17
17
|
export type { CollectionSearch } from './query-controls.tsx';
|
|
18
|
+
export type { TableResultStatus } from './table-results.tsx';
|
|
18
19
|
export type { CollectionControlsProps } from './use-collection-controls.tsx';
|
|
19
20
|
export { CollectionFilters } from './collection-filters.tsx';
|
|
20
21
|
export type { CollectionFilter, FilterOption } from './collection-filters.tsx';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PartProps } from '@ui-sdk/react/primitive';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import type { CollectionPaginationProps } from './collection-controls.tsx';
|
|
4
|
+
export type DataTableSort = {
|
|
5
|
+
readonly columnId: string;
|
|
6
|
+
readonly direction: 'ascending' | 'descending';
|
|
7
|
+
};
|
|
8
|
+
export type TableResultStatus = 'ready' | 'pending' | 'failed';
|
|
9
|
+
type ResultOptions = {
|
|
10
|
+
readonly status: TableResultStatus;
|
|
11
|
+
readonly sort: DataTableSort | undefined;
|
|
12
|
+
readonly pagination: CollectionPaginationProps | undefined;
|
|
13
|
+
readonly captionElement: {
|
|
14
|
+
readonly current: HTMLTableCaptionElement | null;
|
|
15
|
+
};
|
|
16
|
+
readonly isPlaceholder: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const TableResultCaption: ComponentType<Omit<PartProps<'caption'>, 'id'> & ResultOptions>;
|
|
19
|
+
type RecordOptions = {
|
|
20
|
+
readonly recordId: string;
|
|
21
|
+
readonly collection: string;
|
|
22
|
+
};
|
|
23
|
+
type RecordTrigger<Tag extends 'a' | 'button'> = ComponentType<Omit<PartProps<Tag>, 'id'> & RecordOptions>;
|
|
24
|
+
export declare const RecordLink: RecordTrigger<'a'>;
|
|
25
|
+
export declare const RecordButton: RecordTrigger<'button'>;
|
|
26
|
+
export {};
|
|
@@ -38,4 +38,10 @@ export declare function IconButton({ children, ...props }: IconButtonProps): Rea
|
|
|
38
38
|
export declare function TextButton({ tone, density, isPending, pendingLabel, children, className, style, xstyle, onClick, disabled, ...props }: SharedButtonProps): ReactNode;
|
|
39
39
|
export declare function TextLink({ xstyle, ...props }: TextLinkProps): ReactNode;
|
|
40
40
|
export declare function IconLink({ children, density, xstyle, render, ref, ...props }: IconLinkProps): ReactNode;
|
|
41
|
+
type ConfirmProps = Pick<ButtonProps, 'disabled' | 'isPending' | 'pendingLabel' | 'tone'> & {
|
|
42
|
+
readonly children: string;
|
|
43
|
+
readonly confirmation: string;
|
|
44
|
+
readonly onClick: NonNullable<ButtonProps['onClick']>;
|
|
45
|
+
};
|
|
46
|
+
export declare function ConfirmButton({ confirmation, onClick, tone, ...props }: ConfirmProps): ReactNode;
|
|
41
47
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ControlDensity } from '../../foundations/src/control-density.ts';
|
|
2
|
-
export { Button, IconButton, IconLink, TextButton, TextLink } from './actions.tsx';
|
|
2
|
+
export { Button, ConfirmButton, IconButton, IconLink, TextButton, TextLink } from './actions.tsx';
|
|
3
3
|
export type { AvatarProps } from './avatar.tsx';
|
|
4
4
|
export { Avatar } from './avatar.tsx';
|
|
5
5
|
export type { AgentAvatarShape } from './agent-avatar-glyphs.tsx';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type FormStatusProps = {
|
|
3
|
+
readonly status: 'pending' | 'error' | 'success';
|
|
4
|
+
/** The public result shown to the user. */
|
|
5
|
+
readonly message: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function FormStatus({ status, message }: FormStatusProps): ReactNode;
|
|
@@ -5,6 +5,8 @@ import type { TextValueProperties } from '../../foundations/src/control-state.ts
|
|
|
5
5
|
import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
|
|
6
6
|
import type { TextareaAppearance } from './field-styles.ts';
|
|
7
7
|
type FieldRootProps = ComponentProps<typeof SdkField> & {
|
|
8
|
+
/** Hide this whole field, including its label, description and validation messages, from the agent. */
|
|
9
|
+
readonly isSensitive?: boolean;
|
|
8
10
|
readonly xstyle?: PlacementStyle;
|
|
9
11
|
};
|
|
10
12
|
type FieldLabelProps = ComponentProps<typeof SdkFieldLabel>;
|
|
@@ -23,7 +25,7 @@ type TextareaProps = TextControlProps<'textarea'> & {
|
|
|
23
25
|
readonly shouldGrow?: boolean;
|
|
24
26
|
readonly appearance?: TextareaAppearance;
|
|
25
27
|
};
|
|
26
|
-
declare function FieldRoot({ className, style, xstyle, ...props }: FieldRootProps): ReactNode;
|
|
28
|
+
declare function FieldRoot({ className, style, xstyle, isSensitive, ...props }: FieldRootProps): ReactNode;
|
|
27
29
|
declare function FieldLabel({ className, style, ...props }: FieldLabelProps): ReactNode;
|
|
28
30
|
declare function FieldDescription({ className, style, ...props }: FieldDescriptionProps): ReactNode;
|
|
29
31
|
declare function FieldError({ className, style, ...props }: FieldErrorProps): ReactNode;
|
|
@@ -4,6 +4,8 @@ export { AgentAvatarPicker } from './agent-avatar-picker.tsx';
|
|
|
4
4
|
export { FilePicker, Fieldset, InputGroup, NumberField, Slider } from './form-controls.tsx';
|
|
5
5
|
export type { FormActionsProps } from './form-actions.tsx';
|
|
6
6
|
export { FormActions } from './form-actions.tsx';
|
|
7
|
+
export { FormStatus } from './form-status.tsx';
|
|
8
|
+
export type { FormStatusProps } from './form-status.tsx';
|
|
7
9
|
export { Field, Input, Textarea } from './forms.tsx';
|
|
8
10
|
export { Select } from './select.tsx';
|
|
9
11
|
export type { SelectControlProps, SelectOption } from './select-control.tsx';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createAgent } from '@ui-sdk/react/agent';
|
|
2
|
-
export type { AgentAction, AgentComponent, AgentStep } from '@ui-sdk/react/agent';
|
|
1
|
+
export { agentTools, createAgent, registerTools } from '@ui-sdk/react/agent';
|
|
2
|
+
export type { AgentAction, AgentChange, AgentComponent, AgentStep, ObservedChange } from '@ui-sdk/react/agent';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Kbd, Breadcrumb } from './navigation.tsx';
|
|
2
2
|
export type { PageNavigationItem, PageNavigationProps, PageNavigationPlaceholderProps } from './page-navigation.tsx';
|
|
3
3
|
export { PageNavigation, PageNavigationPlaceholder } from './page-navigation.tsx';
|
|
4
|
+
export { RouteLink } from './route-link.tsx';
|
|
4
5
|
export { SkipLink } from './skip-link.tsx';
|
|
5
6
|
export { Tabs } from './tabs.tsx';
|
|
6
7
|
export { ContentTabs } from './content-tabs.tsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
2
|
-
import { n as t, r as n } from "./code-block-
|
|
2
|
+
import { n as t, r as n } from "./code-block-Cpfr7B6a.js";
|
|
3
3
|
import { t as r } from "./viewer-styles-DsFYri4K.js";
|
|
4
4
|
import * as i from "@stylexjs/stylex";
|
|
5
5
|
import { useCallback as a, useState as o } from "react";
|
|
@@ -26,6 +26,12 @@ var n = {
|
|
|
26
26
|
kREpy8: "x13efnbd",
|
|
27
27
|
$$css: !0
|
|
28
28
|
},
|
|
29
|
+
baseline: {
|
|
30
|
+
kjVXCG: "x1crw9hw",
|
|
31
|
+
kfJifR: "xnpr05h",
|
|
32
|
+
kREpy8: "x13efnbd",
|
|
33
|
+
$$css: !0
|
|
34
|
+
},
|
|
29
35
|
label: {
|
|
30
36
|
kDwRjp: "x1q7gtio",
|
|
31
37
|
kMv6JI: "x1hz01jw",
|
|
@@ -34,6 +40,18 @@ var n = {
|
|
|
34
40
|
kcqcaj: "xss6m8b",
|
|
35
41
|
$$css: !0
|
|
36
42
|
},
|
|
43
|
+
strongLabel: {
|
|
44
|
+
kDwRjp: "xlrhuyr",
|
|
45
|
+
k63SB2: "xk4h15q",
|
|
46
|
+
$$css: !0
|
|
47
|
+
},
|
|
48
|
+
haloLabel: {
|
|
49
|
+
kCrYw0: "x1x0jnz8",
|
|
50
|
+
kjVXCG: "xaep1og",
|
|
51
|
+
kfJifR: "xqjr0vm",
|
|
52
|
+
kJdQPc: "x1f6yumg",
|
|
53
|
+
$$css: !0
|
|
54
|
+
},
|
|
37
55
|
mark: {
|
|
38
56
|
kfJifR: "xhr4kjn",
|
|
39
57
|
kREpy8: "x13efnbd",
|
|
@@ -48,6 +66,16 @@ var n = {
|
|
|
48
66
|
inspectable: {
|
|
49
67
|
k3XXqK: "x1t137rt",
|
|
50
68
|
$$css: !0
|
|
69
|
+
},
|
|
70
|
+
emphasis: {
|
|
71
|
+
k1ekBW: "x19991ni",
|
|
72
|
+
kIyJzY: "xtitasy x12w9bfk",
|
|
73
|
+
kAMwcw: "x1faw7qm",
|
|
74
|
+
$$css: !0
|
|
75
|
+
},
|
|
76
|
+
receded: {
|
|
77
|
+
kSiTet: "xk8c4ds",
|
|
78
|
+
$$css: !0
|
|
51
79
|
}
|
|
52
80
|
}, r = 640;
|
|
53
81
|
function i() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as e, _ as t, v as n, w as r } from "./src-DcW_gMX8.js";
|
|
2
2
|
import { t as i } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
3
3
|
import { t as a } from "./viewer-styles-DsFYri4K.js";
|
|
4
|
-
import { t as o } from "./code-block-
|
|
5
|
-
import { t as s } from "./content-link-
|
|
4
|
+
import { t as o } from "./code-block-Cpfr7B6a.js";
|
|
5
|
+
import { t as s } from "./content-link-CGeFFb9F.js";
|
|
6
6
|
import * as c from "@stylexjs/stylex";
|
|
7
7
|
import { useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
|
|
8
8
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e, s as t } from "./src-
|
|
1
|
+
import { i as e, s as t } from "./src-DcW_gMX8.js";
|
|
2
2
|
import { a as n, n as r, r as i, t as a } from "./control-styles-D3q_Qyxi.js";
|
|
3
3
|
import { i as o, n as s, r as c } from "./tokens.stylex-dF5CACEJ.js";
|
|
4
4
|
import { t as l } from "./accessibility-P89UG9-r.js";
|
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { t as e } from "./header-styles-COxCYFZx.js";
|
|
2
2
|
import * as t from "@stylexjs/stylex";
|
|
3
|
-
import {
|
|
4
|
-
import { Children as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import {
|
|
3
|
+
import { createParts as n, mergeProps as r } from "@ui-sdk/react/primitive";
|
|
4
|
+
import { Children as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { definePrimitive as c } from "@ui-sdk/core";
|
|
7
|
+
import { Tabs as l, TabsList as u, TabsPanel as d, TabsTab as f } from "@ui-sdk/react/tabs";
|
|
8
|
+
// packages/navigation/src/route-link.tsx
|
|
9
|
+
function p({ current: e }) {
|
|
10
|
+
return { current: e ?? null };
|
|
11
|
+
}
|
|
12
|
+
var m = c({
|
|
13
|
+
name: "navigation-link",
|
|
14
|
+
options: { current: "value" },
|
|
15
|
+
state: p,
|
|
16
|
+
sync: p,
|
|
17
|
+
controlled: ["current"],
|
|
18
|
+
api: () => ({}),
|
|
19
|
+
slots: (e) => ({ root: e({}) })
|
|
20
|
+
}), h = n(m, { root: "a" });
|
|
21
|
+
function g(e) {
|
|
22
|
+
return e.href === void 0 ? /* @__PURE__ */ o("a", { ...e }) : /* @__PURE__ */ o(h.Root, {
|
|
23
|
+
current: e["aria-current"],
|
|
24
|
+
render: /* @__PURE__ */ o("a", { ...e })
|
|
25
|
+
});
|
|
26
|
+
}
|
|
7
27
|
// packages/navigation/src/tab-styles.ts
|
|
8
|
-
var
|
|
28
|
+
var _ = {
|
|
9
29
|
list: {
|
|
10
30
|
k1xSpc: "x78zum5",
|
|
11
31
|
kOIVth: "xxhr3t",
|
|
@@ -71,7 +91,7 @@ var d = {
|
|
|
71
91
|
kiEn40: "x1bqaal",
|
|
72
92
|
$$css: !0
|
|
73
93
|
}
|
|
74
|
-
},
|
|
94
|
+
}, v = {
|
|
75
95
|
navigation: {
|
|
76
96
|
kt9PQ7: "x1qhh985",
|
|
77
97
|
kUk6DE: "x12lumcd",
|
|
@@ -90,93 +110,93 @@ var d = {
|
|
|
90
110
|
$$css: !0
|
|
91
111
|
}
|
|
92
112
|
};
|
|
93
|
-
function
|
|
94
|
-
return /* @__PURE__ */
|
|
113
|
+
function y({ items: n, actions: r }) {
|
|
114
|
+
return /* @__PURE__ */ s("div", {
|
|
95
115
|
"aria-hidden": !0,
|
|
96
116
|
inert: !0,
|
|
97
117
|
className: "x78zum5 x1a02dak x1qjc9v5 xeuugli x2lah0s xso031l x1q0q8m5 x1qndepd",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
-
...t.props(
|
|
100
|
-
children: n.map((e) => /* @__PURE__ */
|
|
101
|
-
...t.props(
|
|
118
|
+
children: [/* @__PURE__ */ o("div", {
|
|
119
|
+
...t.props(_.list, v.navigation),
|
|
120
|
+
children: n.map((e) => /* @__PURE__ */ o("span", {
|
|
121
|
+
...t.props(_.item),
|
|
102
122
|
children: e.label
|
|
103
123
|
}, e.id))
|
|
104
|
-
}),
|
|
105
|
-
...t.props(e.row,
|
|
106
|
-
children:
|
|
124
|
+
}), i.toArray(r).length > 0 && /* @__PURE__ */ o("div", {
|
|
125
|
+
...t.props(e.row, v.actions),
|
|
126
|
+
children: r
|
|
107
127
|
})]
|
|
108
128
|
});
|
|
109
129
|
}
|
|
110
|
-
function
|
|
111
|
-
return /* @__PURE__ */
|
|
130
|
+
function b({ items: n, selectedId: r, onNavigate: a, label: c = "Page sections", actions: l }) {
|
|
131
|
+
return /* @__PURE__ */ s("div", {
|
|
112
132
|
className: "x78zum5 x1a02dak x1qjc9v5 xeuugli x2lah0s xso031l x1q0q8m5 x1qndepd",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ o("nav", {
|
|
114
134
|
"aria-label": c,
|
|
115
|
-
...t.props(
|
|
116
|
-
children: n.map((e) => /* @__PURE__ */
|
|
135
|
+
...t.props(_.list, v.navigation),
|
|
136
|
+
children: n.map((e) => /* @__PURE__ */ o(g, {
|
|
117
137
|
href: e.href,
|
|
118
|
-
"aria-current": e.id ===
|
|
119
|
-
...t.props(
|
|
138
|
+
"aria-current": e.id === r ? "page" : void 0,
|
|
139
|
+
...t.props(_.item),
|
|
120
140
|
onClick: (t) => {
|
|
121
|
-
if (
|
|
141
|
+
if (a === void 0 || t.defaultPrevented || t.button !== 0) return;
|
|
122
142
|
let n = t.metaKey || t.ctrlKey, r = t.shiftKey || t.altKey;
|
|
123
|
-
n || r || (t.preventDefault(),
|
|
143
|
+
n || r || (t.preventDefault(), a(e));
|
|
124
144
|
},
|
|
125
145
|
children: e.label
|
|
126
146
|
}, e.id))
|
|
127
|
-
}),
|
|
128
|
-
...t.props(e.row,
|
|
147
|
+
}), i.toArray(l).length > 0 && /* @__PURE__ */ o("div", {
|
|
148
|
+
...t.props(e.row, v.actions),
|
|
129
149
|
children: l
|
|
130
150
|
})]
|
|
131
151
|
});
|
|
132
152
|
}
|
|
133
153
|
// packages/navigation/src/skip-link.tsx
|
|
134
|
-
function
|
|
135
|
-
return /* @__PURE__ */
|
|
154
|
+
function x(e) {
|
|
155
|
+
return /* @__PURE__ */ o("a", { ...r({ className: "xixxii4 x1ridm32 x12hha37 x1b4oyad x174j0rr x1mvvolr x9f619 xvv7f4i xj0a0fe x1ok0vyi xpvm0e4 xbixft x1hz01jw xk4h15q xtqrqnz x1778rvt xvmahel xujl8zx x1wfrlr2 x1tkds87 x1de710j x1gnsi0 x1cm8ssg" }, e) });
|
|
136
156
|
}
|
|
137
157
|
// packages/navigation/src/tabs.tsx
|
|
138
|
-
function
|
|
139
|
-
return /* @__PURE__ */
|
|
158
|
+
function S(e) {
|
|
159
|
+
return /* @__PURE__ */ o(l, { ...r({ className: "x1hz01jw xj57cvi xtqrqnz x1778rvt xbixft xvmahel xeuugli xsg5m96 x7bu0ch x18eqmq0" }, e) });
|
|
140
160
|
}
|
|
141
|
-
function
|
|
142
|
-
return /* @__PURE__ */
|
|
161
|
+
function C(e) {
|
|
162
|
+
return /* @__PURE__ */ o(u, { ...r(t.props(_.list), e) });
|
|
143
163
|
}
|
|
144
|
-
function
|
|
145
|
-
return /* @__PURE__ */
|
|
164
|
+
function w({ value: e, ...n }) {
|
|
165
|
+
return /* @__PURE__ */ o(f, {
|
|
146
166
|
value: e,
|
|
147
|
-
...
|
|
167
|
+
...r(t.props(_.item), n)
|
|
148
168
|
});
|
|
149
169
|
}
|
|
150
|
-
function
|
|
151
|
-
return /* @__PURE__ */
|
|
170
|
+
function T({ value: e, ...t }) {
|
|
171
|
+
return /* @__PURE__ */ o(d, {
|
|
152
172
|
value: e,
|
|
153
|
-
...
|
|
173
|
+
...r({ className: "x1o3kwql xeuugli x1k57tk5 xcqfl4l xwqq6z6 x13qnu6 x9v5kkp x19rmrnh x7s97pk" }, t)
|
|
154
174
|
});
|
|
155
175
|
}
|
|
156
|
-
var
|
|
157
|
-
Root:
|
|
158
|
-
List:
|
|
159
|
-
Tab:
|
|
160
|
-
Panel:
|
|
176
|
+
var E = {
|
|
177
|
+
Root: S,
|
|
178
|
+
List: C,
|
|
179
|
+
Tab: w,
|
|
180
|
+
Panel: T
|
|
161
181
|
};
|
|
162
182
|
// packages/navigation/src/content-tabs.tsx
|
|
163
|
-
function
|
|
164
|
-
let [t, n] =
|
|
165
|
-
return /* @__PURE__ */
|
|
183
|
+
function D(e) {
|
|
184
|
+
let [t, n] = a(e.defaultSelectedId ?? e.items[0]?.id), r = e.items.find((e) => e.id === t) ?? e.items[0];
|
|
185
|
+
return /* @__PURE__ */ s(E.Root, {
|
|
166
186
|
value: r?.id ?? null,
|
|
167
187
|
onValueChange: (e) => n(e ?? void 0),
|
|
168
188
|
className: "x78zum5 xdt5ytf x98rzlu xeuugli x2lwn1j",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ o(E.List, {
|
|
170
190
|
"aria-label": e.label,
|
|
171
|
-
children: e.items.map((e) => /* @__PURE__ */
|
|
191
|
+
children: e.items.map((e) => /* @__PURE__ */ o(E.Tab, {
|
|
172
192
|
value: e.id,
|
|
173
193
|
children: e.label
|
|
174
194
|
}, e.id))
|
|
175
|
-
}), r !== void 0 && /* @__PURE__ */
|
|
195
|
+
}), r !== void 0 && /* @__PURE__ */ o(E.Panel, {
|
|
176
196
|
value: r.id,
|
|
177
197
|
className: "x78zum5 xdt5ytf x98rzlu xeuugli x2lwn1j x1odjw0f xexx8yu",
|
|
178
198
|
children: r.content
|
|
179
199
|
}, r.id)]
|
|
180
200
|
});
|
|
181
201
|
}
|
|
182
|
-
export {
|
|
202
|
+
export { y as a, b as i, E as n, g as o, x as r, D as t };
|