@mechane-ai/ui 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +34 -13
  2. package/dist/ai.js +315 -0
  3. package/dist/assets/stylex.css +1533 -360
  4. package/dist/cartesian-Bwt6ZnF5.js +847 -0
  5. package/dist/chart-input-Bti0gyzz.js +173 -0
  6. package/dist/charts/cartesian.js +1 -0
  7. package/dist/charts/distribution.js +1 -0
  8. package/dist/charts/graph.js +1 -0
  9. package/dist/charts/matrix.js +1 -0
  10. package/dist/charts.js +98 -93
  11. package/dist/code-BJp-g4Fw.js +172 -0
  12. package/dist/collections.js +666 -0
  13. package/dist/content/code.js +1 -0
  14. package/dist/content/diff.js +101 -0
  15. package/dist/content/link.js +1 -0
  16. package/dist/content/tree.js +77 -0
  17. package/dist/content-link-52aZVX3X.js +26 -0
  18. package/dist/content.js +367 -0
  19. package/dist/distribution-CViLvcPP.js +609 -0
  20. package/dist/graph-DAfo72ZD.js +230 -0
  21. package/dist/index.js +1 -1
  22. package/dist/layout.js +201 -160
  23. package/dist/matrix-B9dybkce.js +785 -0
  24. package/dist/packages/ai/src/approval.d.ts +29 -0
  25. package/dist/packages/ai/src/conversation.d.ts +34 -0
  26. package/dist/packages/ai/src/index.d.ts +10 -0
  27. package/dist/packages/ai/src/message.d.ts +19 -0
  28. package/dist/packages/ai/src/prompt-input.d.ts +25 -0
  29. package/dist/packages/ai/src/sources.d.ts +17 -0
  30. package/dist/packages/charts/src/cartesian/categorical.d.ts +43 -0
  31. package/dist/packages/charts/src/cartesian/index.d.ts +8 -0
  32. package/dist/packages/charts/src/cartesian/sparkline.d.ts +11 -0
  33. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +54 -0
  34. package/dist/packages/charts/src/cartesian/time-series-line.d.ts +9 -0
  35. package/dist/packages/charts/src/cartesian/time-series.d.ts +29 -0
  36. package/dist/packages/charts/src/chart-frame.d.ts +34 -0
  37. package/dist/packages/charts/src/chart-input.d.ts +10 -0
  38. package/dist/packages/charts/src/chart-theme.d.ts +48 -0
  39. package/dist/packages/charts/src/distribution/distribution-input.d.ts +14 -0
  40. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +135 -0
  41. package/dist/packages/charts/src/distribution/ecdf.d.ts +23 -0
  42. package/dist/packages/charts/src/distribution/histogram.d.ts +26 -0
  43. package/dist/packages/charts/src/distribution/index.d.ts +8 -0
  44. package/dist/packages/charts/src/distribution/interval-plot.d.ts +24 -0
  45. package/dist/packages/charts/src/distribution/ranked-bars.d.ts +22 -0
  46. package/dist/packages/charts/src/graph/index.d.ts +2 -0
  47. package/dist/packages/charts/src/graph/relation-graph.d.ts +45 -0
  48. package/dist/packages/charts/src/index.d.ts +13 -0
  49. package/dist/packages/charts/src/matrix/color-legend.d.ts +7 -0
  50. package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -0
  51. package/dist/packages/charts/src/matrix/index.d.ts +9 -0
  52. package/dist/packages/charts/src/matrix/matrix.d.ts +34 -0
  53. package/dist/packages/charts/src/matrix/scatter-plot.d.ts +37 -0
  54. package/dist/packages/charts/src/matrix/token-heatmap.d.ts +20 -0
  55. package/dist/packages/charts/src/plot-width.d.ts +5 -0
  56. package/dist/packages/collections/src/calendar.d.ts +32 -0
  57. package/dist/packages/collections/src/collection-controls.d.ts +41 -0
  58. package/dist/packages/collections/src/command.d.ts +37 -0
  59. package/dist/packages/collections/src/data-table.d.ts +49 -0
  60. package/dist/packages/collections/src/date-range-picker.d.ts +16 -0
  61. package/dist/packages/collections/src/index.d.ts +13 -0
  62. package/dist/packages/content/src/code/code-block.d.ts +22 -0
  63. package/dist/packages/content/src/code/index.d.ts +2 -0
  64. package/dist/packages/content/src/code/use-highlighted-code.d.ts +9 -0
  65. package/dist/packages/content/src/content-link.d.ts +8 -0
  66. package/dist/packages/content/src/diff/diff-source.d.ts +32 -0
  67. package/dist/packages/content/src/diff/diff-viewer.d.ts +3 -0
  68. package/dist/packages/content/src/diff/index.d.ts +2 -0
  69. package/dist/packages/content/src/diff/pierre-diff.d.ts +14 -0
  70. package/dist/packages/content/src/index.d.ts +10 -0
  71. package/dist/packages/content/src/json-viewer.d.ts +11 -0
  72. package/dist/packages/content/src/link.d.ts +2 -0
  73. package/dist/packages/content/src/log-viewer.d.ts +9 -0
  74. package/dist/packages/content/src/markdown.d.ts +7 -0
  75. package/dist/packages/content/src/pierre-theme.d.ts +36 -0
  76. package/dist/packages/content/src/stack-trace.d.ts +16 -0
  77. package/dist/packages/content/src/tree/file-tree-types.d.ts +12 -0
  78. package/dist/packages/content/src/tree/file-tree.d.ts +3 -0
  79. package/dist/packages/content/src/tree/index.d.ts +2 -0
  80. package/dist/packages/content/src/tree/pierre-tree.d.ts +3 -0
  81. package/dist/packages/core/src/alert-dialog.d.ts +18 -0
  82. package/dist/packages/core/src/combobox.d.ts +81 -0
  83. package/dist/{control-state.d.ts → packages/core/src/control-state.d.ts} +18 -2
  84. package/dist/{copy-value.d.ts → packages/core/src/copy-value.d.ts} +2 -1
  85. package/dist/packages/core/src/details-controls.d.ts +23 -0
  86. package/dist/packages/core/src/disclosure.d.ts +33 -0
  87. package/dist/packages/core/src/field-styles.d.ts +66 -0
  88. package/dist/packages/core/src/form-controls.d.ts +81 -0
  89. package/dist/{forms.d.ts → packages/core/src/forms.d.ts} +1 -1
  90. package/dist/packages/core/src/index.d.ts +32 -0
  91. package/dist/packages/core/src/menu.d.ts +51 -0
  92. package/dist/packages/core/src/navigation.d.ts +24 -0
  93. package/dist/packages/core/src/popover.d.ts +24 -0
  94. package/dist/packages/core/src/popup-styles.d.ts +84 -0
  95. package/dist/packages/core/src/preview.d.ts +17 -0
  96. package/dist/packages/core/src/progress.d.ts +10 -0
  97. package/dist/packages/core/src/selection-styles.d.ts +110 -0
  98. package/dist/packages/core/src/selection.d.ts +57 -0
  99. package/dist/packages/core/src/skeleton.d.ts +18 -0
  100. package/dist/packages/core/src/theme.d.ts +16 -0
  101. package/dist/packages/core/src/toast.d.ts +28 -0
  102. package/dist/{tokens.stylex.d.ts → packages/core/src/tokens.stylex.d.ts} +60 -0
  103. package/dist/packages/core/src/trace.d.ts +35 -0
  104. package/dist/{layout → packages/layout/src}/index.d.ts +2 -0
  105. package/dist/{layout → packages/layout/src}/page-toolbar.d.ts +1 -1
  106. package/dist/packages/layout/src/resizable.d.ts +27 -0
  107. package/dist/{layout → packages/layout/src}/sidebar.d.ts +1 -1
  108. package/dist/pierre-diff-D3m4JCu0.js +66 -0
  109. package/dist/pierre-theme-CPlfl-AA.js +96 -0
  110. package/dist/pierre-tree-BaEkz16y.js +105 -0
  111. package/dist/plot-width--OgdohB5.js +18 -0
  112. package/dist/src-E7YRJBMO.js +2821 -0
  113. package/dist/tokens.js +118 -64
  114. package/package.json +67 -10
  115. package/{src → packages/core/src}/tokens.stylex.ts +64 -0
  116. package/dist/charts/index.d.ts +0 -2
  117. package/dist/index.d.ts +0 -16
  118. package/dist/src-Czfi0YQa.js +0 -1319
  119. /package/dist/{charts → packages/charts/src}/waterfall.d.ts +0 -0
  120. /package/dist/{inspector.d.ts → packages/collections/src/inspector.d.ts} +0 -0
  121. /package/dist/{list-footer.d.ts → packages/collections/src/list-footer.d.ts} +0 -0
  122. /package/dist/{table.d.ts → packages/collections/src/table.d.ts} +0 -0
  123. /package/dist/{accessibility.d.ts → packages/core/src/accessibility.d.ts} +0 -0
  124. /package/dist/{actions.d.ts → packages/core/src/actions.d.ts} +0 -0
  125. /package/dist/{dialog.d.ts → packages/core/src/dialog.d.ts} +0 -0
  126. /package/dist/{drawer.d.ts → packages/core/src/drawer.d.ts} +0 -0
  127. /package/dist/{loading.d.ts → packages/core/src/loading.d.ts} +0 -0
  128. /package/dist/{metrics.d.ts → packages/core/src/metrics.d.ts} +0 -0
  129. /package/dist/{overlay-styles.d.ts → packages/core/src/overlay-styles.d.ts} +0 -0
  130. /package/dist/{select.d.ts → packages/core/src/select.d.ts} +0 -0
  131. /package/dist/{skip-link.d.ts → packages/core/src/skip-link.d.ts} +0 -0
  132. /package/dist/{style-composition.d.ts → packages/core/src/style-composition.d.ts} +0 -0
  133. /package/dist/{surfaces.d.ts → packages/core/src/surfaces.d.ts} +0 -0
  134. /package/dist/{tabs.d.ts → packages/core/src/tabs.d.ts} +0 -0
  135. /package/dist/{text.d.ts → packages/core/src/text.d.ts} +0 -0
  136. /package/dist/{tooltip.d.ts → packages/core/src/tooltip.d.ts} +0 -0
  137. /package/dist/{layout → packages/layout/src}/app-shell.d.ts +0 -0
  138. /package/dist/{layout → packages/layout/src}/detail-page.d.ts +0 -0
  139. /package/dist/{layout → packages/layout/src}/frame.stylex.d.ts +0 -0
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartSelection } from '../chart-frame.tsx';
3
+ import type { ChartTone } from '../chart-theme.ts';
4
+ import type { NumericDomain } from './distribution-input.ts';
5
+ export type RankedBarDatum = {
6
+ readonly id: string;
7
+ readonly label: string;
8
+ readonly rank?: string;
9
+ readonly value: number | null;
10
+ readonly tone?: ChartTone;
11
+ };
12
+ export type RankedBarsProps = {
13
+ readonly title: string;
14
+ readonly description?: string;
15
+ readonly items: ReadonlyArray<RankedBarDatum>;
16
+ readonly domain: NumericDomain;
17
+ readonly valueLabel: string;
18
+ readonly formatValue: (value: number) => string;
19
+ readonly selection?: ChartSelection;
20
+ readonly emptyLabel?: string;
21
+ };
22
+ export declare function RankedBars({ title, description, items, domain, valueLabel, formatValue, selection, emptyLabel, }: RankedBarsProps): ReactNode;
@@ -0,0 +1,2 @@
1
+ export { RelationGraph, MAX_RELATION_NODES, MAX_RELATION_EDGES, MAX_RELATION_GROUPS, MAX_RELATION_DIMENSION, } from './relation-graph.tsx';
2
+ export type { RelationGraphProps, RelationNode, RelationEdge, RelationGroup } from './relation-graph.tsx';
@@ -0,0 +1,45 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartSelection } from '../chart-frame.tsx';
3
+ import type { ChartTone } from '../chart-theme.ts';
4
+ export type RelationNode = {
5
+ readonly id: string;
6
+ readonly label: string;
7
+ readonly description?: string | undefined;
8
+ readonly x: number;
9
+ readonly y: number;
10
+ readonly width: number;
11
+ readonly height: number;
12
+ readonly tone: ChartTone;
13
+ };
14
+ export type RelationEdge = {
15
+ readonly id: string;
16
+ readonly sourceId: string;
17
+ readonly targetId: string;
18
+ readonly label: string;
19
+ readonly direction: 'directed' | 'undirected';
20
+ };
21
+ export type RelationGroup = {
22
+ readonly id: string;
23
+ readonly label: string;
24
+ readonly x: number;
25
+ readonly y: number;
26
+ readonly width: number;
27
+ readonly height: number;
28
+ readonly nodeIds: ReadonlyArray<string>;
29
+ };
30
+ export type RelationGraphProps = {
31
+ readonly title: string;
32
+ readonly description: string;
33
+ readonly nodes: ReadonlyArray<RelationNode>;
34
+ readonly edges: ReadonlyArray<RelationEdge>;
35
+ readonly groups?: ReadonlyArray<RelationGroup> | undefined;
36
+ readonly width: number;
37
+ readonly height: number;
38
+ readonly selection?: ChartSelection | undefined;
39
+ readonly emptyLabel: string;
40
+ };
41
+ export declare const MAX_RELATION_NODES = 256;
42
+ export declare const MAX_RELATION_EDGES = 1024;
43
+ export declare const MAX_RELATION_GROUPS = 256;
44
+ export declare const MAX_RELATION_DIMENSION = 8192;
45
+ export declare function RelationGraph({ title, description, nodes, edges, groups, width, height, selection, emptyLabel, }: RelationGraphProps): ReactNode;
@@ -0,0 +1,13 @@
1
+ export { Waterfall } from './waterfall.tsx';
2
+ export type { WaterfallItem } from './waterfall.tsx';
3
+ export { ChartFrame, ChartLegend } from './chart-frame.tsx';
4
+ export type { ChartFrameProps, ChartLegendProps, ChartLegendItem, ChartSelection } from './chart-frame.tsx';
5
+ export type { ChartTone } from './chart-theme.ts';
6
+ export { LineChart, AreaChart, Sparkline, SmallMultiples, BreakdownBar, BarChart, Treemap } from './cartesian/index.ts';
7
+ export type { TimeSeriesPoint, TimeSeries, TimeSeriesMarker, TimeSeriesChartProps, AreaChartProps, SmallMultiplesProps, SparklineProps, BreakdownItem, BreakdownBarProps, BarSeries, BarChartProps, TreemapProps, } from './cartesian/index.ts';
8
+ export { Histogram, ECDF, IntervalPlot, RankedBars } from './distribution/index.ts';
9
+ export type { HistogramBin, HistogramProps, ECDFPoint, ECDFProps, IntervalDatum, IntervalPlotProps, RankedBarDatum, RankedBarsProps, } from './distribution/index.ts';
10
+ export { ColorLegend, Matrix, TokenHeatmap, ScatterPlot } from './matrix/index.ts';
11
+ export type { ColorLegendProps, HeatmapPalette, HeatmapScale, MatrixProps, MatrixAxisItem, MatrixCell, TokenHeatmapProps, HeatmapToken, ScatterPlotProps, ScatterPoint, ScatterRange, ScatterRangeSelection, } from './matrix/index.ts';
12
+ export { RelationGraph } from './graph/index.ts';
13
+ export type { RelationGraphProps, RelationNode, RelationEdge, RelationGroup } from './graph/index.ts';
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { HeatmapScale } from './heatmap-scale.ts';
3
+ export type ColorLegendProps = HeatmapScale & {
4
+ readonly label: string;
5
+ readonly formatValue: (value: number) => string;
6
+ };
7
+ export declare function ColorLegend({ label, domain, palette, formatValue }: ColorLegendProps): ReactNode;
@@ -0,0 +1,8 @@
1
+ export type HeatmapPalette = 'sequential' | 'diverging';
2
+ export type HeatmapScale = {
3
+ readonly domain: readonly [number, number];
4
+ readonly palette: HeatmapPalette;
5
+ };
6
+ export declare function heatmapScaleProblem({ domain, palette }: HeatmapScale): string | null;
7
+ export declare function isHeatmapValueInDomain(value: number, domain: readonly [number, number]): boolean;
8
+ export declare function heatmapColor(value: number, { domain, palette }: HeatmapScale): string;
@@ -0,0 +1,9 @@
1
+ export { ColorLegend } from './color-legend.tsx';
2
+ export type { ColorLegendProps } from './color-legend.tsx';
3
+ export type { HeatmapPalette, HeatmapScale } from './heatmap-scale.ts';
4
+ export { Matrix, MAX_MATRIX_CELLS } from './matrix.tsx';
5
+ export type { MatrixProps, MatrixAxisItem, MatrixCell } from './matrix.tsx';
6
+ export { TokenHeatmap, MAX_HEATMAP_TOKENS } from './token-heatmap.tsx';
7
+ export type { TokenHeatmapProps, HeatmapToken } from './token-heatmap.tsx';
8
+ export { ScatterPlot, MAX_SCATTER_POINTS } from './scatter-plot.tsx';
9
+ export type { ScatterPlotProps, ScatterPoint, ScatterRange, ScatterRangeSelection } from './scatter-plot.tsx';
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartSelection } from '../chart-frame.tsx';
3
+ import type { HeatmapScale } from './heatmap-scale.ts';
4
+ export type MatrixAxisItem = {
5
+ readonly id: string;
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
+ });
22
+ export type MatrixProps = HeatmapScale & {
23
+ readonly title: string;
24
+ readonly description: string;
25
+ readonly rows: ReadonlyArray<MatrixAxisItem>;
26
+ readonly columns: ReadonlyArray<MatrixAxisItem>;
27
+ readonly cells: ReadonlyArray<MatrixCell>;
28
+ readonly valueLabel: string;
29
+ readonly formatValue: (value: number) => string;
30
+ readonly selection?: ChartSelection;
31
+ readonly emptyLabel: string;
32
+ };
33
+ export declare const MAX_MATRIX_CELLS = 4096;
34
+ export declare function Matrix({ title, description, rows, columns, cells, domain, palette, valueLabel, formatValue, selection, emptyLabel, }: MatrixProps): ReactNode;
@@ -0,0 +1,37 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartSelection } from '../chart-frame.tsx';
3
+ import type { ChartTone } from '../chart-theme.ts';
4
+ export type ScatterPoint = {
5
+ readonly id: string;
6
+ readonly label: string;
7
+ readonly x: number;
8
+ readonly y: number;
9
+ readonly tone: ChartTone;
10
+ };
11
+ export type ScatterRange = {
12
+ readonly x: readonly [number, number];
13
+ readonly y: readonly [number, number];
14
+ };
15
+ export type ScatterRangeSelection = {
16
+ readonly value: ScatterRange | null;
17
+ readonly onChange: (range: ScatterRange | null) => void;
18
+ readonly xStep: number;
19
+ readonly yStep: number;
20
+ readonly locale: string;
21
+ };
22
+ export type ScatterPlotProps = {
23
+ readonly title: string;
24
+ readonly description: string;
25
+ readonly points: ReadonlyArray<ScatterPoint>;
26
+ readonly xDomain: readonly [number, number];
27
+ readonly yDomain: readonly [number, number];
28
+ readonly xLabel: string;
29
+ readonly yLabel: string;
30
+ readonly formatX: (value: number) => string;
31
+ readonly formatY: (value: number) => string;
32
+ readonly selection?: ChartSelection | undefined;
33
+ readonly rangeSelection?: ScatterRangeSelection | undefined;
34
+ readonly emptyLabel: string;
35
+ };
36
+ export declare const MAX_SCATTER_POINTS = 1000;
37
+ export declare function ScatterPlot(props: ScatterPlotProps): ReactNode;
@@ -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
+ export type HeatmapToken = {
5
+ readonly id: string;
6
+ readonly index: number;
7
+ readonly text: string;
8
+ readonly score: number | null;
9
+ };
10
+ export type TokenHeatmapProps = HeatmapScale & {
11
+ readonly title: string;
12
+ readonly description: string;
13
+ readonly tokens: ReadonlyArray<HeatmapToken>;
14
+ readonly valueLabel: string;
15
+ readonly formatValue: (value: number) => string;
16
+ readonly selection?: ChartSelection;
17
+ readonly emptyLabel: string;
18
+ };
19
+ export declare const MAX_HEATMAP_TOKENS = 2048;
20
+ export declare function TokenHeatmap({ title, description, tokens, domain, palette, valueLabel, formatValue, selection, emptyLabel, }: TokenHeatmapProps): ReactNode;
@@ -0,0 +1,5 @@
1
+ export declare function usePlotWidth(): {
2
+ ref: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null>>;
3
+ width: number;
4
+ element: HTMLDivElement | null;
5
+ };
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ export type CalendarDate = {
3
+ readonly year: number;
4
+ readonly month: number;
5
+ readonly day: number;
6
+ };
7
+ export type CalendarRange = {
8
+ readonly from: CalendarDate;
9
+ readonly to?: CalendarDate | undefined;
10
+ };
11
+ export type CalendarEnvironment = {
12
+ readonly locale: string;
13
+ readonly timeZone: string;
14
+ readonly today: CalendarDate;
15
+ readonly initialMonth: CalendarDate;
16
+ readonly minimum?: CalendarDate;
17
+ readonly maximum?: CalendarDate;
18
+ readonly weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
19
+ };
20
+ export type CalendarProps = CalendarEnvironment & {
21
+ readonly label: string;
22
+ readonly autoFocus?: boolean;
23
+ } & ({
24
+ readonly mode: 'single';
25
+ readonly value: CalendarDate | undefined;
26
+ readonly onValueChange: (value: CalendarDate | undefined) => void;
27
+ } | {
28
+ readonly mode: 'range';
29
+ readonly value: CalendarRange | undefined;
30
+ readonly onValueChange: (value: CalendarRange | undefined) => void;
31
+ });
32
+ export declare function Calendar(props: CalendarProps): ReactNode;
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ export type CollectionToolbarProps = {
3
+ readonly label: string;
4
+ readonly children: ReactNode;
5
+ readonly actions?: ReactNode;
6
+ };
7
+ export declare function CollectionToolbar({ label, children, actions }: CollectionToolbarProps): ReactNode;
8
+ export type FilterChip = {
9
+ readonly id: string;
10
+ readonly label: string;
11
+ };
12
+ export type FilterChipsProps = {
13
+ readonly filters: ReadonlyArray<FilterChip>;
14
+ readonly onRemove: (id: string) => void;
15
+ readonly label?: string;
16
+ };
17
+ export declare function FilterChips({ filters, onRemove, label }: FilterChipsProps): ReactNode;
18
+ export type ColumnChoice = {
19
+ readonly id: string;
20
+ readonly label: string;
21
+ readonly visible: boolean;
22
+ readonly required?: boolean;
23
+ };
24
+ export type ColumnControlsProps = {
25
+ readonly columns: ReadonlyArray<ColumnChoice>;
26
+ readonly onVisibilityChange: (columnId: string, visible: boolean) => void;
27
+ readonly label?: string;
28
+ };
29
+ export declare function ColumnControls({ columns, onVisibilityChange, label }: ColumnControlsProps): ReactNode;
30
+ export type CollectionPaginationProps = {
31
+ readonly description: string;
32
+ readonly previous: {
33
+ readonly disabled: boolean;
34
+ readonly onClick: () => void;
35
+ };
36
+ readonly next: {
37
+ readonly disabled: boolean;
38
+ readonly onClick: () => void;
39
+ };
40
+ };
41
+ export declare function CollectionPagination({ description, previous, next }: CollectionPaginationProps): ReactNode;
@@ -0,0 +1,37 @@
1
+ import type { ReactElement, ReactNode, RefObject } from 'react';
2
+ export type CommandShortcut = {
3
+ readonly key: string;
4
+ readonly mod?: boolean;
5
+ readonly ctrl?: boolean;
6
+ readonly alt?: boolean;
7
+ readonly shift?: boolean;
8
+ readonly meta?: boolean;
9
+ };
10
+ export type CommandAction = {
11
+ readonly id: string;
12
+ readonly label: string;
13
+ readonly description?: string;
14
+ readonly shortcut?: CommandShortcut;
15
+ readonly disabled?: boolean;
16
+ readonly onSelect: () => void;
17
+ };
18
+ export type CommandShortcutsOptions = {
19
+ readonly commands: ReadonlyArray<CommandAction>;
20
+ readonly target: RefObject<HTMLElement | null> | HTMLElement | null;
21
+ readonly enabled: boolean;
22
+ };
23
+ export declare function useCommandShortcuts({ commands, target, enabled }: CommandShortcutsOptions): void;
24
+ export type ShortcutHintProps = {
25
+ readonly shortcut: CommandShortcut;
26
+ };
27
+ export declare function ShortcutHint({ shortcut }: ShortcutHintProps): ReactNode;
28
+ export type CommandPaletteProps = {
29
+ readonly open: boolean;
30
+ readonly onOpenChange: (open: boolean) => void;
31
+ readonly title: string;
32
+ readonly commands: ReadonlyArray<CommandAction>;
33
+ readonly trigger?: ReactElement;
34
+ readonly placeholder?: string;
35
+ readonly empty?: string;
36
+ };
37
+ export declare function CommandPalette({ open, onOpenChange, title, commands, trigger, placeholder, empty, }: CommandPaletteProps): ReactNode;
@@ -0,0 +1,49 @@
1
+ import type { ReactNode } from 'react';
2
+ type ColumnAlignment = 'start' | 'end';
3
+ export type DataTableColumn<Row> = {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ readonly cell: (row: Row) => ReactNode;
7
+ readonly align?: ColumnAlignment;
8
+ readonly width?: number;
9
+ readonly sortable?: boolean;
10
+ };
11
+ export type DataTableSort = {
12
+ readonly columnId: string;
13
+ readonly direction: 'ascending' | 'descending';
14
+ };
15
+ export type DataTableWindow = {
16
+ readonly height: number;
17
+ readonly estimatedRowHeight?: number;
18
+ };
19
+ type SortProperties<Row> = {
20
+ readonly columns: ReadonlyArray<DataTableColumn<Row>>;
21
+ readonly sort: DataTableSort | undefined;
22
+ readonly onSortChange: (sort: DataTableSort | undefined) => void;
23
+ } | {
24
+ readonly columns: ReadonlyArray<DataTableColumn<Row> & {
25
+ readonly sortable?: false;
26
+ }>;
27
+ readonly sort?: never;
28
+ readonly onSortChange?: never;
29
+ };
30
+ type SelectionProperties<Row> = {
31
+ readonly selectedIds: ReadonlySet<string>;
32
+ readonly onSelectionChange: (selectedIds: ReadonlySet<string>) => void;
33
+ readonly selectionLabel: (row: Row) => string;
34
+ };
35
+ type OptionalSelection<Row> = SelectionProperties<Row> | {
36
+ readonly selectedIds?: never;
37
+ readonly onSelectionChange?: never;
38
+ readonly selectionLabel?: never;
39
+ };
40
+ export type DataTableProps<Row> = SortProperties<Row> & OptionalSelection<Row> & {
41
+ readonly rows: ReadonlyArray<Row>;
42
+ readonly getRowId: (row: Row) => string;
43
+ readonly caption: string;
44
+ readonly empty: string;
45
+ readonly window?: DataTableWindow;
46
+ readonly footer?: ReactNode;
47
+ };
48
+ export declare function DataTable<Row extends object>({ rows, columns, getRowId, caption, empty, sort, onSortChange, selectedIds, onSelectionChange, selectionLabel, window, footer, }: DataTableProps<Row>): ReactNode;
49
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CalendarEnvironment, CalendarRange } from './calendar.tsx';
3
+ export type DateRangePreset = {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ readonly value: CalendarRange;
7
+ };
8
+ export type DateRangePickerProps = {
9
+ readonly label: string;
10
+ readonly value: CalendarRange | undefined;
11
+ readonly onValueChange: (value: CalendarRange | undefined) => void;
12
+ readonly formatValue: (value: CalendarRange) => string;
13
+ readonly presets?: ReadonlyArray<DateRangePreset>;
14
+ readonly disabled?: boolean;
15
+ } & CalendarEnvironment;
16
+ export declare function DateRangePicker({ label, value, onValueChange, formatValue, presets, disabled, ...environment }: DateRangePickerProps): ReactNode;
@@ -0,0 +1,13 @@
1
+ export { ListFooter } from './list-footer.tsx';
2
+ export { Cell, Table } from './table.tsx';
3
+ export { Inspector, Details } from './inspector.tsx';
4
+ export { DataTable } from './data-table.tsx';
5
+ export type { DataTableColumn, DataTableProps, DataTableSort, DataTableWindow } from './data-table.tsx';
6
+ export { CollectionToolbar, FilterChips, ColumnControls, CollectionPagination } from './collection-controls.tsx';
7
+ export type { CollectionToolbarProps, FilterChip, FilterChipsProps, ColumnChoice, ColumnControlsProps, CollectionPaginationProps, } from './collection-controls.tsx';
8
+ export { Calendar } from './calendar.tsx';
9
+ export type { CalendarDate, CalendarRange, CalendarEnvironment, CalendarProps } from './calendar.tsx';
10
+ export { DateRangePicker } from './date-range-picker.tsx';
11
+ export type { DateRangePreset, DateRangePickerProps } from './date-range-picker.tsx';
12
+ export { CommandPalette, ShortcutHint, useCommandShortcuts } from './command.tsx';
13
+ export type { CommandAction, CommandPaletteProps, CommandShortcut, CommandShortcutsOptions, ShortcutHintProps, } from './command.tsx';
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from 'react';
2
+ export type CodeAnnotation = {
3
+ readonly line: number;
4
+ readonly content: ReactNode;
5
+ };
6
+ export type CodeSelection = {
7
+ readonly start: number;
8
+ readonly end?: number;
9
+ };
10
+ export type CodeBlockProps = {
11
+ readonly code: string;
12
+ readonly language?: string | undefined;
13
+ readonly filename?: string | undefined;
14
+ readonly streaming?: boolean;
15
+ readonly wrap?: boolean;
16
+ readonly lineNumbers?: boolean;
17
+ readonly selectedLines?: CodeSelection;
18
+ readonly annotations?: ReadonlyArray<CodeAnnotation>;
19
+ readonly maxHeight?: number;
20
+ readonly maxLines?: number;
21
+ };
22
+ export declare function CodeBlock({ code, language, filename, streaming, wrap, lineNumbers, selectedLines, annotations, maxHeight, maxLines, }: CodeBlockProps): ReactNode;
@@ -0,0 +1,2 @@
1
+ export { CodeBlock } from './code-block.tsx';
2
+ export type { CodeAnnotation, CodeBlockProps, CodeSelection } from './code-block.tsx';
@@ -0,0 +1,9 @@
1
+ import type { ThemedToken } from '@pierre/highlights';
2
+ type HighlightResult = {
3
+ readonly code: string;
4
+ readonly language: string;
5
+ readonly lines: ReadonlyArray<ReadonlyArray<ThemedToken>>;
6
+ readonly hasFailed: boolean;
7
+ };
8
+ export declare function useHighlightedCode(code: string, language: string): HighlightResult | undefined;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ContentLinkProps = {
3
+ readonly href?: string | undefined;
4
+ readonly children: ReactNode;
5
+ readonly title?: string | undefined;
6
+ };
7
+ export declare function contentHref(value: string | undefined): string | undefined;
8
+ export declare function ContentLink({ href, children, title }: ContentLinkProps): ReactNode;
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ export type DiffFile = {
3
+ readonly name: string;
4
+ readonly code: string;
5
+ readonly language?: string | undefined;
6
+ };
7
+ export type DiffAnnotation = {
8
+ readonly file: string;
9
+ readonly side: 'old' | 'new';
10
+ readonly line: number;
11
+ readonly content: ReactNode;
12
+ };
13
+ export type DiffSource = {
14
+ readonly patch: string;
15
+ readonly before?: never;
16
+ readonly after?: never;
17
+ } | {
18
+ readonly patch?: never;
19
+ readonly before: DiffFile;
20
+ readonly after: DiffFile | null;
21
+ } | {
22
+ readonly patch?: never;
23
+ readonly before: null;
24
+ readonly after: DiffFile;
25
+ };
26
+ export type DiffViewerProps = DiffSource & {
27
+ readonly label: string;
28
+ readonly layout?: 'unified' | 'split';
29
+ readonly wrap?: boolean;
30
+ readonly annotations?: ReadonlyArray<DiffAnnotation>;
31
+ readonly maxHeight?: number;
32
+ };
@@ -0,0 +1,3 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DiffViewerProps } from './diff-source.ts';
3
+ export declare function DiffViewer(props: DiffViewerProps): ReactNode;
@@ -0,0 +1,2 @@
1
+ export { DiffViewer } from './diff-viewer.tsx';
2
+ export type { DiffAnnotation, DiffFile, DiffSource, DiffViewerProps } from './diff-source.ts';
@@ -0,0 +1,14 @@
1
+ import type { FileDiffMetadata } from '@pierre/diffs';
2
+ import type { ReactNode } from 'react';
3
+ import type { DiffAnnotation, DiffSource } from './diff-source.ts';
4
+ type PierreDiffProps = {
5
+ readonly files: ReadonlyArray<FileDiffMetadata>;
6
+ readonly layout: 'unified' | 'split';
7
+ readonly wrap: boolean;
8
+ readonly annotations: ReadonlyArray<DiffAnnotation>;
9
+ readonly maxHeight: number;
10
+ readonly label: string;
11
+ };
12
+ export declare function prepareDiff(source: DiffSource): ReadonlyArray<FileDiffMetadata>;
13
+ export declare function PierreDiff({ files, layout, wrap, annotations, maxHeight, label }: PierreDiffProps): ReactNode;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ export { Markdown } from './markdown.tsx';
2
+ export type { MarkdownProps } from './markdown.tsx';
3
+ export { JsonViewer } from './json-viewer.tsx';
4
+ export type { JsonValue, JsonViewerProps } from './json-viewer.tsx';
5
+ export { LogViewer } from './log-viewer.tsx';
6
+ export type { LogViewerProps } from './log-viewer.tsx';
7
+ export { StackTrace } from './stack-trace.tsx';
8
+ export type { StackFrame, StackTraceProps } from './stack-trace.tsx';
9
+ export { ContentLink } from './content-link.tsx';
10
+ export type { ContentLinkProps } from './content-link.tsx';
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ export type JsonValue = null | boolean | number | string | ReadonlyArray<JsonValue> | {
3
+ readonly [key: string]: JsonValue;
4
+ };
5
+ export type JsonViewerProps = {
6
+ readonly value: JsonValue;
7
+ readonly label: string;
8
+ readonly maxDepth?: number;
9
+ readonly maxEntries?: number;
10
+ };
11
+ export declare function JsonViewer({ value, label, maxDepth, maxEntries }: JsonViewerProps): ReactNode;
@@ -0,0 +1,2 @@
1
+ export { ContentLink } from './content-link.tsx';
2
+ export type { ContentLinkProps } from './content-link.tsx';
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export type LogViewerProps = {
3
+ readonly output: string;
4
+ readonly label: string;
5
+ readonly maxLines?: number;
6
+ readonly maxHeight?: number;
7
+ readonly isRunning?: boolean;
8
+ };
9
+ export declare function LogViewer({ output, label, maxLines, maxHeight, isRunning, }: LogViewerProps): ReactNode;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export type MarkdownProps = {
3
+ readonly children: string;
4
+ readonly streaming?: boolean;
5
+ readonly label?: string;
6
+ };
7
+ export declare function Markdown({ children, streaming, label }: MarkdownProps): ReactNode;
@@ -0,0 +1,36 @@
1
+ export declare const highlightTheme: {
2
+ readonly name: 'Mechane';
3
+ readonly appearance: 'light';
4
+ readonly cssVariables: {
5
+ readonly prefix: '--mechane-syntax-';
6
+ readonly defaults: {
7
+ readonly foreground: import("@stylexjs/stylex").StyleXVar<string>;
8
+ readonly background: import("@stylexjs/stylex").StyleXVar<string>;
9
+ readonly keyword: import("@stylexjs/stylex").StyleXVar<string>;
10
+ readonly string: import("@stylexjs/stylex").StyleXVar<string>;
11
+ readonly comment: import("@stylexjs/stylex").StyleXVar<string>;
12
+ readonly number: import("@stylexjs/stylex").StyleXVar<string>;
13
+ readonly type: import("@stylexjs/stylex").StyleXVar<string>;
14
+ readonly punctuation: import("@stylexjs/stylex").StyleXVar<string>;
15
+ };
16
+ };
17
+ readonly style: {
18
+ readonly 'editor.background': 'background';
19
+ readonly 'editor.foreground': 'foreground';
20
+ readonly syntax: {
21
+ readonly keyword: {
22
+ readonly color: 'keyword';
23
+ readonly font_weight: 600;
24
+ };
25
+ readonly string: 'string';
26
+ readonly comment: 'comment';
27
+ readonly number: 'number';
28
+ readonly type: 'type';
29
+ readonly function: 'foreground';
30
+ readonly operator: 'punctuation';
31
+ readonly punctuation: 'punctuation';
32
+ };
33
+ };
34
+ };
35
+ export declare const pierreCSS: string;
36
+ export declare const treeCSS: string;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ export type StackFrame = {
3
+ readonly id: string;
4
+ readonly name: string;
5
+ readonly file?: string;
6
+ readonly line?: number;
7
+ readonly column?: number;
8
+ readonly href?: string;
9
+ readonly code?: string;
10
+ readonly language?: string;
11
+ };
12
+ export type StackTraceProps = {
13
+ readonly message: string;
14
+ readonly frames: ReadonlyArray<StackFrame>;
15
+ };
16
+ export declare function StackTrace({ message, frames }: StackTraceProps): ReactNode;
@@ -0,0 +1,12 @@
1
+ export type FileStatus = {
2
+ readonly path: string;
3
+ readonly status: 'added' | 'deleted' | 'ignored' | 'modified' | 'renamed' | 'untracked';
4
+ };
5
+ export type FileTreeProps = {
6
+ readonly paths: ReadonlyArray<string>;
7
+ readonly label: string;
8
+ readonly selectedPaths: ReadonlyArray<string>;
9
+ readonly onSelectedPathsChange: (paths: ReadonlyArray<string>) => void;
10
+ readonly statuses?: ReadonlyArray<FileStatus>;
11
+ readonly height?: number;
12
+ };
@@ -0,0 +1,3 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FileTreeProps } from './file-tree-types.ts';
3
+ export declare function FileTree(props: FileTreeProps): ReactNode;
@@ -0,0 +1,2 @@
1
+ export { FileTree } from './file-tree.tsx';
2
+ export type { FileStatus, FileTreeProps } from './file-tree-types.ts';