@peasant-labs/fairtrade 0.0.28 → 0.0.30
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 +30 -0
- package/dist/lib/{GraphLegend-kO2WP4yM.js → GraphLegend-CxEDHRXa.js} +1215 -835
- package/dist/lib/commons.js +270 -261
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.js +442 -442
- package/dist/lib/types/DataTable.d.ts +19 -12
- package/dist/lib/types/DataTableControls.d.ts +44 -0
- package/dist/lib/types/VillageObservations.d.ts +87 -0
- package/dist/lib/types/graph/index.d.ts +6 -0
- package/dist/lib/types/index.d.ts +7 -0
- package/dist/lib/{ui-Cb4c1qQR.js → ui-BaKO2zmG.js} +3912 -4088
- package/dist/lib/ui.js +4 -4
- package/package.json +3 -3
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* a sortable + selectable data table. square, hairline, mono headers; both themes
|
|
3
3
|
* via tokens. sort + selection state/logic are powered by TanStack Table
|
|
4
4
|
* (@tanstack/react-table, headless) while this component still renders its own markup
|
|
5
|
-
* + token classes. Search
|
|
6
|
-
*
|
|
5
|
+
* + token classes. Search and filter controls are opt-in toolbar content. Pagination
|
|
6
|
+
* is enabled only by explicit pagination/defaultPagination props. Sorting cycles none -> asc -> desc -> none on a
|
|
7
7
|
* sortable header (a real <button>, so it is keyboard-operable), exposes aria-sort on the
|
|
8
8
|
* <th>, and shows a lucide chevron indicator. selection reuses the existing .check-box control:
|
|
9
9
|
* a header checkbox selects/clears all (with an indeterminate middle state) and
|
|
@@ -47,11 +47,14 @@
|
|
|
47
47
|
* @param {DataTableColumnFilters} [props.defaultColumnFilters=[]] initial column filters.
|
|
48
48
|
* @param {(next: DataTableColumnFilters) => void} [props.onColumnFiltersChange] next filters.
|
|
49
49
|
* @param {DataTablePagination} [props.pagination] controlled pagination (zero-based pageIndex).
|
|
50
|
-
* @param {DataTablePagination} [props.defaultPagination]
|
|
50
|
+
* @param {DataTablePagination} [props.defaultPagination] enables local pagination with this initial state.
|
|
51
51
|
* @param {(next: DataTablePagination) => void} [props.onPaginationChange] next pagination.
|
|
52
52
|
* @param {number} [props.rowCount] host total for host-sliced data: pagination stays manual (the page count comes from rowCount) and sorting stays local, while search and column filters still apply to the rows given; with a partial window and an active filter the footer reports the loaded rows, never the host total.
|
|
53
|
+
* @param {(controls: Parameters<typeof import('./DataTableControls.jsx').DataTableToolbar>[0]) => React.ReactNode} [props.toolbar] optional controls; render DataTableToolbar or importer-owned content.
|
|
54
|
+
* @param {(controls: Parameters<typeof DataTablePaginationControls>[0]) => React.ReactNode} [props.footer] optional footer; replaces the default pager when pagination is enabled.
|
|
55
|
+
* @param {React.CSSProperties['maxHeight']} [props.maxHeight] explicit inner scroll bound; natural height when omitted.
|
|
53
56
|
*/
|
|
54
|
-
export default function DataTable({ columns, rows, selectable, disabled, rowKey, defaultSort, sort: sortProp, onSortChange, defaultSelectedKeys, selectedKeys: selectedProp, onSelectionChange, caption, className, search: searchProp, defaultSearch, onSearchChange, columnFilters: filtersProp, defaultColumnFilters, onColumnFiltersChange, pagination: paginationProp, defaultPagination, onPaginationChange, rowCount, }: {
|
|
57
|
+
export default function DataTable({ columns, rows, selectable, disabled, rowKey, defaultSort, sort: sortProp, onSortChange, defaultSelectedKeys, selectedKeys: selectedProp, onSelectionChange, caption, className, search: searchProp, defaultSearch, onSearchChange, columnFilters: filtersProp, defaultColumnFilters, onColumnFiltersChange, pagination: paginationProp, defaultPagination, onPaginationChange, rowCount, toolbar, footer, maxHeight, }: {
|
|
55
58
|
columns: DataTableColumn[];
|
|
56
59
|
rows: any[];
|
|
57
60
|
selectable?: boolean;
|
|
@@ -75,13 +78,16 @@ export default function DataTable({ columns, rows, selectable, disabled, rowKey,
|
|
|
75
78
|
defaultPagination?: DataTablePagination;
|
|
76
79
|
onPaginationChange?: (next: DataTablePagination) => void;
|
|
77
80
|
rowCount?: number;
|
|
81
|
+
toolbar?: (controls: Parameters<typeof import("./DataTableControls.jsx").DataTableToolbar>[0]) => React.ReactNode;
|
|
82
|
+
footer?: (controls: Parameters<typeof DataTablePaginationControls>[0]) => React.ReactNode;
|
|
83
|
+
maxHeight?: React.CSSProperties["maxHeight"];
|
|
78
84
|
}): import("react").JSX.Element;
|
|
79
85
|
/**
|
|
80
86
|
* a sortable + selectable data table. square, hairline, mono headers; both themes
|
|
81
87
|
* via tokens. sort + selection state/logic are powered by TanStack Table
|
|
82
88
|
* (@tanstack/react-table, headless) while this component still renders its own markup
|
|
83
|
-
* + token classes. Search
|
|
84
|
-
*
|
|
89
|
+
* + token classes. Search and filter controls are opt-in toolbar content. Pagination
|
|
90
|
+
* is enabled only by explicit pagination/defaultPagination props. Sorting cycles none -> asc -> desc -> none on a
|
|
85
91
|
* sortable header (a real <button>, so it is keyboard-operable), exposes aria-sort on the
|
|
86
92
|
* <th>, and shows a lucide chevron indicator. selection reuses the existing .check-box control:
|
|
87
93
|
* a header checkbox selects/clears all (with an indeterminate middle state) and
|
|
@@ -122,8 +128,8 @@ export type DataTableColumn = {
|
|
|
122
128
|
* a sortable + selectable data table. square, hairline, mono headers; both themes
|
|
123
129
|
* via tokens. sort + selection state/logic are powered by TanStack Table
|
|
124
130
|
* (@tanstack/react-table, headless) while this component still renders its own markup
|
|
125
|
-
* + token classes. Search
|
|
126
|
-
*
|
|
131
|
+
* + token classes. Search and filter controls are opt-in toolbar content. Pagination
|
|
132
|
+
* is enabled only by explicit pagination/defaultPagination props. Sorting cycles none -> asc -> desc -> none on a
|
|
127
133
|
* sortable header (a real <button>, so it is keyboard-operable), exposes aria-sort on the
|
|
128
134
|
* <th>, and shows a lucide chevron indicator. selection reuses the existing .check-box control:
|
|
129
135
|
* a header checkbox selects/clears all (with an indeterminate middle state) and
|
|
@@ -142,8 +148,8 @@ export type DataTableSort = {
|
|
|
142
148
|
* a sortable + selectable data table. square, hairline, mono headers; both themes
|
|
143
149
|
* via tokens. sort + selection state/logic are powered by TanStack Table
|
|
144
150
|
* (@tanstack/react-table, headless) while this component still renders its own markup
|
|
145
|
-
* + token classes. Search
|
|
146
|
-
*
|
|
151
|
+
* + token classes. Search and filter controls are opt-in toolbar content. Pagination
|
|
152
|
+
* is enabled only by explicit pagination/defaultPagination props. Sorting cycles none -> asc -> desc -> none on a
|
|
147
153
|
* sortable header (a real <button>, so it is keyboard-operable), exposes aria-sort on the
|
|
148
154
|
* <th>, and shows a lucide chevron indicator. selection reuses the existing .check-box control:
|
|
149
155
|
* a header checkbox selects/clears all (with an indeterminate middle state) and
|
|
@@ -162,8 +168,8 @@ export type DataTableColumnFilters = {
|
|
|
162
168
|
* a sortable + selectable data table. square, hairline, mono headers; both themes
|
|
163
169
|
* via tokens. sort + selection state/logic are powered by TanStack Table
|
|
164
170
|
* (@tanstack/react-table, headless) while this component still renders its own markup
|
|
165
|
-
* + token classes. Search
|
|
166
|
-
*
|
|
171
|
+
* + token classes. Search and filter controls are opt-in toolbar content. Pagination
|
|
172
|
+
* is enabled only by explicit pagination/defaultPagination props. Sorting cycles none -> asc -> desc -> none on a
|
|
167
173
|
* sortable header (a real <button>, so it is keyboard-operable), exposes aria-sort on the
|
|
168
174
|
* <th>, and shows a lucide chevron indicator. selection reuses the existing .check-box control:
|
|
169
175
|
* a header checkbox selects/clears all (with an indeterminate middle state) and
|
|
@@ -178,3 +184,4 @@ export type DataTablePagination = {
|
|
|
178
184
|
pageIndex: number;
|
|
179
185
|
pageSize: number;
|
|
180
186
|
};
|
|
187
|
+
import { DataTablePaginationControls } from './DataTableControls.jsx';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional table controls. Omit search or columnFilters to leave that control out;
|
|
3
|
+
* children extend the toolbar with importer-owned actions.
|
|
4
|
+
* @param {Object} props
|
|
5
|
+
* @param {{ value: string, onChange: (value: string) => void }} [props.search]
|
|
6
|
+
* @param {{ columns: import('./DataTable.jsx').DataTableColumn[], value: import('./DataTable.jsx').DataTableColumnFilters, onChange: (value: import('./DataTable.jsx').DataTableColumnFilters) => void }} [props.columnFilters]
|
|
7
|
+
* @param {boolean} [props.disabled=false]
|
|
8
|
+
* @param {React.ReactNode} [props.children]
|
|
9
|
+
*/
|
|
10
|
+
export function DataTableToolbar({ search, columnFilters, disabled, children }: {
|
|
11
|
+
search?: {
|
|
12
|
+
value: string;
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
};
|
|
15
|
+
columnFilters?: {
|
|
16
|
+
columns: import("./DataTable.jsx").DataTableColumn[];
|
|
17
|
+
value: import("./DataTable.jsx").DataTableColumnFilters;
|
|
18
|
+
onChange: (value: import("./DataTable.jsx").DataTableColumnFilters) => void;
|
|
19
|
+
};
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Optional pagination/footer presentation, independent of the table's row markup.
|
|
25
|
+
* @param {Object} props
|
|
26
|
+
* @param {string} props.countLabel
|
|
27
|
+
* @param {number} props.pageIndex
|
|
28
|
+
* @param {number} props.pageCount
|
|
29
|
+
* @param {boolean} props.canPreviousPage
|
|
30
|
+
* @param {boolean} props.canNextPage
|
|
31
|
+
* @param {() => void} props.onPreviousPage
|
|
32
|
+
* @param {() => void} props.onNextPage
|
|
33
|
+
* @param {boolean} [props.disabled=false]
|
|
34
|
+
*/
|
|
35
|
+
export function DataTablePaginationControls({ countLabel, pageIndex, pageCount, canPreviousPage, canNextPage, onPreviousPage, onNextPage, disabled }: {
|
|
36
|
+
countLabel: string;
|
|
37
|
+
pageIndex: number;
|
|
38
|
+
pageCount: number;
|
|
39
|
+
canPreviousPage: boolean;
|
|
40
|
+
canNextPage: boolean;
|
|
41
|
+
onPreviousPage: () => void;
|
|
42
|
+
onNextPage: () => void;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Metadata-only observation browsing. No effects, storage, routing or network requests.
|
|
2
|
+
* @param {VillageObservationsProps} props
|
|
3
|
+
*/
|
|
4
|
+
export default function VillageObservations({ accountLabel, villageLabel, domains, collectives, categories, view, categoryId, fetching, fetchDisabled, status, issue, onFetch, onTrack, onViewChange, onCategoryChange, onPageChange, onRestart, }: VillageObservationsProps): import("react").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* Cooked presentation models. Hosts own wire validation, scope, tokens and policy.
|
|
7
|
+
*/
|
|
8
|
+
export type ObservationIssue = {
|
|
9
|
+
message: string;
|
|
10
|
+
retry: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Cooked presentation models. Hosts own wire validation, scope, tokens and policy.
|
|
14
|
+
*/
|
|
15
|
+
export type ObservationDomain = {
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
result: string;
|
|
19
|
+
commit?: string;
|
|
20
|
+
lastCompletedAt?: string;
|
|
21
|
+
lastAttemptAt?: string;
|
|
22
|
+
issue?: ObservationIssue;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Cooked presentation models. Hosts own wire validation, scope, tokens and policy.
|
|
26
|
+
*/
|
|
27
|
+
export type ObservedCollective = {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
reasons: string[];
|
|
32
|
+
observedAt?: string;
|
|
33
|
+
state: string;
|
|
34
|
+
policy?: string;
|
|
35
|
+
tracking?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Cooked presentation models. Hosts own wire validation, scope, tokens and policy.
|
|
39
|
+
*/
|
|
40
|
+
export type ContributionEvidenceRow = {
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
outcome: string;
|
|
45
|
+
occurredAt?: string;
|
|
46
|
+
details?: Array<{
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Cooked presentation models. Hosts own wire validation, scope, tokens and policy.
|
|
53
|
+
*/
|
|
54
|
+
export type ContributionEvidenceCategory = {
|
|
55
|
+
id: string;
|
|
56
|
+
label: string;
|
|
57
|
+
rows: ContributionEvidenceRow[];
|
|
58
|
+
page: number;
|
|
59
|
+
pageCount: number;
|
|
60
|
+
total: number;
|
|
61
|
+
coverage: string;
|
|
62
|
+
issue?: ObservationIssue;
|
|
63
|
+
conflict?: boolean;
|
|
64
|
+
loading?: boolean;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Cooked presentation models. Hosts own wire validation, scope, tokens and policy.
|
|
68
|
+
*/
|
|
69
|
+
export type VillageObservationsProps = {
|
|
70
|
+
accountLabel: string;
|
|
71
|
+
villageLabel: string;
|
|
72
|
+
domains: ObservationDomain[];
|
|
73
|
+
collectives: ObservedCollective[];
|
|
74
|
+
categories: ContributionEvidenceCategory[];
|
|
75
|
+
view?: "catalog" | "history";
|
|
76
|
+
categoryId?: string;
|
|
77
|
+
fetching?: boolean;
|
|
78
|
+
fetchDisabled?: boolean;
|
|
79
|
+
status?: string;
|
|
80
|
+
issue?: ObservationIssue;
|
|
81
|
+
onFetch?: () => void;
|
|
82
|
+
onTrack?: (id: string, tracking: boolean) => void;
|
|
83
|
+
onViewChange?: (view: "catalog" | "history") => void;
|
|
84
|
+
onCategoryChange?: (id: string) => void;
|
|
85
|
+
onPageChange?: (id: string, page: number) => void;
|
|
86
|
+
onRestart?: (id: string) => void;
|
|
87
|
+
};
|
|
@@ -2,6 +2,7 @@ export { default as Changes } from "./Changes.jsx";
|
|
|
2
2
|
export { default as ChangeDetail } from "./ChangeDetail.jsx";
|
|
3
3
|
export { default as CodeMapNavigator } from "./CodeMapNavigator.jsx";
|
|
4
4
|
export { assertTimelineNavigationAction } from "./timelineNavigation.js";
|
|
5
|
+
export { default as VillageObservations } from "../VillageObservations.jsx";
|
|
5
6
|
export { default as SessionLane } from "./SessionLane.jsx";
|
|
6
7
|
export { default as GhostCommitNode } from "./GhostCommitNode.jsx";
|
|
7
8
|
export { default as GhostGroup } from "./GhostGroup.jsx";
|
|
@@ -21,6 +22,11 @@ export type InsightKind = import("@peasant-labs/schema").InsightKind;
|
|
|
21
22
|
export type InsightProvenance = import("@peasant-labs/schema").InsightProvenance;
|
|
22
23
|
export type ReadAttributionState = import("@peasant-labs/schema").ReadAttributionState;
|
|
23
24
|
export type ReadStateGrade = import("@peasant-labs/schema").ReadStateGrade;
|
|
25
|
+
export type VillageObservationsProps = import("../VillageObservations.jsx").VillageObservationsProps;
|
|
26
|
+
export type ObservationDomain = import("../VillageObservations.jsx").ObservationDomain;
|
|
27
|
+
export type ObservedCollective = import("../VillageObservations.jsx").ObservedCollective;
|
|
28
|
+
export type ContributionEvidenceCategory = import("../VillageObservations.jsx").ContributionEvidenceCategory;
|
|
29
|
+
export type ContributionEvidenceRow = import("../VillageObservations.jsx").ContributionEvidenceRow;
|
|
24
30
|
export type CommitRefPayload = import("./types.js").CommitRefPayload;
|
|
25
31
|
export type TimelineSessionPayload = import("./types.js").TimelineSessionPayload;
|
|
26
32
|
export type MapEdgePayload = import("./types.js").MapEdgePayload;
|
|
@@ -27,9 +27,15 @@ export { default as StatsStrip } from "./StatsStrip.jsx";
|
|
|
27
27
|
export { default as CopyIconButton } from "./CopyIconButton.jsx";
|
|
28
28
|
export { default as OverflowList } from "./OverflowList.jsx";
|
|
29
29
|
export { default as RepoPicker } from "./RepoPicker.jsx";
|
|
30
|
+
export { default as VillageObservations } from "./VillageObservations.jsx";
|
|
30
31
|
export * from "./transcript/index.js";
|
|
31
32
|
export * from "./transcript/graph/index.js";
|
|
32
33
|
export type TimelineNavigationAction = import("./graph/timelineNavigation.js").TimelineNavigationAction;
|
|
34
|
+
export type VillageObservationsProps = import("./VillageObservations.jsx").VillageObservationsProps;
|
|
35
|
+
export type ObservationDomain = import("./VillageObservations.jsx").ObservationDomain;
|
|
36
|
+
export type ObservedCollective = import("./VillageObservations.jsx").ObservedCollective;
|
|
37
|
+
export type ContributionEvidenceCategory = import("./VillageObservations.jsx").ContributionEvidenceCategory;
|
|
38
|
+
export type ContributionEvidenceRow = import("./VillageObservations.jsx").ContributionEvidenceRow;
|
|
33
39
|
export { default as Button, ButtonGroup, Segmented } from "./Button.jsx";
|
|
34
40
|
export { default as Input, Textarea, Select, Field } from "./Input.jsx";
|
|
35
41
|
export { default as Checkbox, Radio, RadioGroup } from "./Checkbox.jsx";
|
|
@@ -41,6 +47,7 @@ export { Avatar, AvatarGroup, Kbd, KbdChord, Tag } from "./Avatar.jsx";
|
|
|
41
47
|
export { default as BrandMark, resolveBrand } from "./BrandMark.jsx";
|
|
42
48
|
export { providerAccent, providerDisplayName } from "./provider-policy.js";
|
|
43
49
|
export { Skeleton, Progress, Spinner, Toast, FeedbackPanel } from "./Feedback.jsx";
|
|
50
|
+
export { DataTableToolbar, DataTablePaginationControls } from "./DataTableControls.jsx";
|
|
44
51
|
export { default as HelperGroup, HelperGroupListItem, HelperThreadRow, useHelperSelection, helperOwnerState, helperSelectionIds, helperOwnerToggle, helperMemberToggle, HELPER_OWNER_STATE } from "./HelperGroup.jsx";
|
|
45
52
|
export { default as Timeline, TimelineItem, ToolCall, ThinkingBlock } from "./Timeline.jsx";
|
|
46
53
|
export { default as ToastProvider, useToast } from "./ToastHost.jsx";
|