@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 CHANGED
@@ -77,6 +77,36 @@ pnpm build-storybook # compile every component + story
77
77
  `public/tokens.json` (w3c dtcg) + `public/components.json` + `packages/tokens/*` (kept fresh by
78
78
  `pnpm gen:check`).
79
79
 
80
+ ## data table compatibility
81
+
82
+ `DataTable` renders all supplied rows by default, with sorting and selection but
83
+ no injected search, filters, pager, or vertical height cap. Existing importers
84
+ keep ownership of their search and pagination.
85
+
86
+ Opt into pagination with `pagination` or `defaultPagination`; `rowCount` supports
87
+ host-sliced rows. Search and filter state can be controlled without adding UI.
88
+ Use the public toolbar to opt into either or both controls and add host actions:
89
+
90
+ ```jsx
91
+ import { DataTable, DataTableToolbar } from '@peasant-labs/fairtrade/ui'
92
+
93
+ <DataTable
94
+ columns={columns}
95
+ rows={rows}
96
+ defaultPagination={{ pageIndex: 0, pageSize: 25 }}
97
+ toolbar={({ search, disabled }) => (
98
+ <DataTableToolbar search={search} disabled={disabled}>
99
+ {extraActions}
100
+ </DataTableToolbar>
101
+ )}
102
+ />
103
+ ```
104
+
105
+ Pass the toolbar's `columnFilters` binding to add column filters. A `footer`
106
+ callback can compose `DataTablePaginationControls` or host-owned content instead
107
+ of the standard opted-in pager. `maxHeight` explicitly enables bounded inner
108
+ scrolling; omit it for naturally expanding, wrapped rows.
109
+
80
110
  ## gates / ci
81
111
 
82
112
  `pnpm build` regenerates the machine-readable artifacts then runs a pure-js wcag contrast gate (both