lucent-ui 0.5.0 → 0.6.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.
@@ -4,19 +4,23 @@ export const COMPONENT_MANIFEST = {
4
4
  tier: 'molecule',
5
5
  domain: 'neutral',
6
6
  specVersion: '1.0',
7
- description: 'A sortable, paginated data table with configurable columns, custom cell renderers, and keyboard-accessible pagination controls.',
7
+ description: 'A sortable, filterable, paginated data table with configurable columns, custom cell renderers, and keyboard-accessible pagination controls.',
8
8
  designIntent: 'DataTable is generic over row type T so TypeScript consumers get full type safety on column keys and renderers. ' +
9
9
  'Sorting is client-side and composable — each column opts in via sortable:true; clicking a sorted column cycles asc → desc → unsorted. ' +
10
+ 'Filtering is per-column — each column opts in via filterable:true, which adds a dropdown button above the table. ' +
11
+ 'Each dropdown is searchable and multi-select: a search input filters the option list, and each option is a checkbox that toggles membership in the active set. ' +
12
+ 'Filtering uses set-membership: a row passes if its column value is included in the selected values array. ' +
13
+ 'A "Clear selection" link inside each dropdown clears that column; a "Clear all" button in the bar appears when any filter is active. ' +
14
+ 'Filter → sort → paginate is the fixed pipeline order; any filter change resets the page to 0. ' +
10
15
  'Pagination is either controlled (page prop + onPageChange) or uncontrolled (internal state). ' +
11
16
  'A pageSize of 0 disables pagination entirely, useful when the parent manages windowing. ' +
12
- 'Column filtering is intentionally excluded here (see DataTable Filter issue #52) to keep the API focused. ' +
13
17
  'Row hover uses bg-subtle, not a border change, so the visual weight stays low for dense data views.',
14
18
  props: [
15
19
  {
16
20
  name: 'columns',
17
21
  type: 'array',
18
22
  required: true,
19
- description: 'Column definitions. Each column has a key, header, optional render function, optional sortable flag, optional width, and optional text align.',
23
+ description: 'Column definitions. Each column has a key, header, optional render function, optional sortable flag, optional filterable flag (renders a text filter input below the header), optional width, and optional text align.',
20
24
  },
21
25
  {
22
26
  name: 'rows',
@@ -41,7 +45,13 @@ export const COMPONENT_MANIFEST = {
41
45
  name: 'onPageChange',
42
46
  type: 'function',
43
47
  required: false,
44
- description: 'Called with the new page index whenever the page changes (from pagination controls or after a sort reset).',
48
+ description: 'Called with the new page index whenever the page changes (from pagination controls or after a sort/filter reset).',
49
+ },
50
+ {
51
+ name: 'onFilterChange',
52
+ type: 'function',
53
+ required: false,
54
+ description: 'Called with the current filter map (Record<string, string[]>) whenever any column filter changes. Keys are column keys; columns with no selection are omitted from the map.',
45
55
  },
46
56
  {
47
57
  name: 'emptyState',
@@ -66,6 +76,18 @@ export const COMPONENT_MANIFEST = {
66
76
  { key: 'status', header: 'Status', render: (row) => <Badge>{row.status}</Badge> },
67
77
  ]}
68
78
  rows={users}
79
+ />`,
80
+ },
81
+ {
82
+ title: 'Sortable + filterable table',
83
+ code: `<DataTable
84
+ columns={[
85
+ { key: 'name', header: 'Name', sortable: true, filterable: true },
86
+ { key: 'role', header: 'Role', filterable: true },
87
+ { key: 'status', header: 'Status', render: (row) => <Badge>{row.status}</Badge> },
88
+ ]}
89
+ rows={users}
90
+ onFilterChange={(filters) => console.log(filters)}
69
91
  />`,
70
92
  },
71
93
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucent-ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "An AI-first React component library with machine-readable manifests.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",