@human-synthesis/norns-ui 0.2.3 → 0.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@human-synthesis/norns-ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "UI library for the Norns ecosystem — Pug + Civet components on Tailwind v4.",
5
5
  "license": "MIT",
6
6
  "author": "Daniel Teodoroiu (https://humansynthesis.ai)",
@@ -37,7 +37,7 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "peerDependencies": {
40
- "@human-synthesis/norns": "^0.2.0",
40
+ "@human-synthesis/norns": "^0.4.0",
41
41
  "@human-synthesis/norns-core": "^0.0.10",
42
42
  "svelte": "^5.0.0",
43
43
  "tailwindcss": "^4.0.0"
@@ -14,14 +14,14 @@
14
14
  +if('!col.sortable')
15
15
  | {col.label ?? col.key}
16
16
  tbody
17
- +if('rows.length === 0')
17
+ +if('list.length === 0')
18
18
  tr.data-table-empty
19
19
  td(colspan!="{columns.length}")
20
20
  +if('empty')
21
21
  | {@render empty()}
22
22
  +if('!empty')
23
23
  | {emptyMessage}
24
- +each('rows as row, i')
24
+ +each('list as row, i')
25
25
  tr(onclick!="{onrowclick ? () => onrowclick(row, i) : undefined}" class!="{onrowclick ? 'data-table-row-clickable' : ''}")
26
26
  +each('columns as col')
27
27
  td(class!="{col.cellClass ?? ''}")
@@ -36,7 +36,8 @@
36
36
 
37
37
  {
38
38
  columns = []
39
- rows = []
39
+ rows = undefined
40
+ data = undefined
40
41
  striped = false
41
42
  dense = false
42
43
  stickyHeader = false
@@ -49,6 +50,10 @@
49
50
  class: extra = ''
50
51
  } .= $props()
51
52
 
53
+ // the spec generator binds queries to `data` (the palette-wide channel);
54
+ // hand-written callers keep `rows` — either works, `rows` wins
55
+ list := rows ?? data ?? []
56
+
52
57
  wrapClasses := cn
53
58
  'data-table-root'
54
59
  striped && 'data-table-striped'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "library": "@human-synthesis/norns-ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "counts": {
5
5
  "components": 78,
6
6
  "motion": 5,
@@ -1044,6 +1044,12 @@
1044
1044
  "type": "Record<string, unknown>[]",
1045
1045
  "required": false
1046
1046
  },
1047
+ {
1048
+ "name": "data",
1049
+ "type": "Record<string, unknown>[]",
1050
+ "required": false,
1051
+ "doc": "Alias for `rows` — the prop a generated Page binds a Query result to."
1052
+ },
1047
1053
  {
1048
1054
  "name": "striped",
1049
1055
  "type": "boolean",
@@ -12,6 +12,8 @@ export type DataTableColumn = {
12
12
  export type DataTableProps = {
13
13
  columns?: DataTableColumn[];
14
14
  rows?: Record<string, unknown>[];
15
+ /** Alias for `rows` — the prop a generated Page binds a Query result to. */
16
+ data?: Record<string, unknown>[];
15
17
  striped?: boolean;
16
18
  dense?: boolean;
17
19
  stickyHeader?: boolean;