@peasant-labs/fairtrade 0.0.27 → 0.0.29
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/commons.js +217 -208
- package/dist/lib/components.css +1 -1
- package/dist/lib/types/DataTable.d.ts +19 -12
- package/dist/lib/types/DataTableControls.d.ts +44 -0
- package/dist/lib/types/Publish.d.ts +6 -4
- package/dist/lib/types/Redaction.d.ts +12 -10
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/redaction-categories.d.ts +0 -15
- package/dist/lib/{ui-Y-iKXft1.js → ui-kyAEj4Vo.js} +1381 -1341
- package/dist/lib/ui.js +4 -4
- package/package.json +5 -5
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
|