@foldkit/ui 0.150.0 → 0.151.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.
Files changed (78) hide show
  1. package/dist/animation/update.d.ts +10 -9
  2. package/dist/animation/update.d.ts.map +1 -1
  3. package/dist/animation/update.js +27 -35
  4. package/dist/calendar/index.d.ts +100 -11
  5. package/dist/calendar/index.d.ts.map +1 -1
  6. package/dist/calendar/index.js +66 -80
  7. package/dist/checkbox/index.d.ts +3 -4
  8. package/dist/checkbox/index.d.ts.map +1 -1
  9. package/dist/checkbox/index.js +3 -4
  10. package/dist/combobox/multi.d.ts +40 -51
  11. package/dist/combobox/multi.d.ts.map +1 -1
  12. package/dist/combobox/multi.js +19 -16
  13. package/dist/combobox/shared.d.ts +20 -20
  14. package/dist/combobox/shared.d.ts.map +1 -1
  15. package/dist/combobox/shared.js +134 -128
  16. package/dist/combobox/single.d.ts +38 -51
  17. package/dist/combobox/single.d.ts.map +1 -1
  18. package/dist/combobox/single.js +21 -17
  19. package/dist/datePicker/index.d.ts +182 -15
  20. package/dist/datePicker/index.d.ts.map +1 -1
  21. package/dist/datePicker/index.js +37 -54
  22. package/dist/dialog/index.d.ts +45 -7
  23. package/dist/dialog/index.d.ts.map +1 -1
  24. package/dist/dialog/index.js +54 -49
  25. package/dist/disclosure/index.d.ts +3 -4
  26. package/dist/disclosure/index.d.ts.map +1 -1
  27. package/dist/disclosure/index.js +3 -4
  28. package/dist/dragAndDrop/index.d.ts +96 -7
  29. package/dist/dragAndDrop/index.d.ts.map +1 -1
  30. package/dist/dragAndDrop/index.js +49 -61
  31. package/dist/fileDrop/index.d.ts +26 -11
  32. package/dist/fileDrop/index.d.ts.map +1 -1
  33. package/dist/fileDrop/index.js +16 -23
  34. package/dist/listbox/multi.d.ts +39 -52
  35. package/dist/listbox/multi.d.ts.map +1 -1
  36. package/dist/listbox/multi.js +9 -7
  37. package/dist/listbox/shared.d.ts +14 -22
  38. package/dist/listbox/shared.d.ts.map +1 -1
  39. package/dist/listbox/shared.js +113 -114
  40. package/dist/listbox/single.d.ts +40 -55
  41. package/dist/listbox/single.d.ts.map +1 -1
  42. package/dist/listbox/single.js +8 -7
  43. package/dist/menu/index.d.ts +131 -37
  44. package/dist/menu/index.d.ts.map +1 -1
  45. package/dist/menu/index.js +111 -120
  46. package/dist/popover/index.d.ts +71 -10
  47. package/dist/popover/index.d.ts.map +1 -1
  48. package/dist/popover/index.js +80 -73
  49. package/dist/radioGroup/index.d.ts +31 -19
  50. package/dist/radioGroup/index.d.ts.map +1 -1
  51. package/dist/radioGroup/index.js +18 -18
  52. package/dist/slider/index.d.ts +44 -13
  53. package/dist/slider/index.d.ts.map +1 -1
  54. package/dist/slider/index.js +33 -38
  55. package/dist/switch/index.d.ts +3 -4
  56. package/dist/switch/index.d.ts.map +1 -1
  57. package/dist/switch/index.js +3 -4
  58. package/dist/tabs/index.d.ts +31 -17
  59. package/dist/tabs/index.d.ts.map +1 -1
  60. package/dist/tabs/index.js +17 -17
  61. package/dist/test/apps/disabledButton.d.ts +17 -17
  62. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  63. package/dist/test/apps/disabledButton.js +6 -4
  64. package/dist/toast/index.d.ts +96 -100
  65. package/dist/toast/index.d.ts.map +1 -1
  66. package/dist/toast/update.d.ts +97 -100
  67. package/dist/toast/update.d.ts.map +1 -1
  68. package/dist/toast/update.js +60 -58
  69. package/dist/tooltip/index.d.ts +2 -1
  70. package/dist/tooltip/index.d.ts.map +1 -1
  71. package/dist/tooltip/index.js +1 -1
  72. package/dist/tooltip/tooltip.d.ts +5 -10
  73. package/dist/tooltip/tooltip.d.ts.map +1 -1
  74. package/dist/tooltip/tooltip.js +45 -48
  75. package/dist/virtualList/index.d.ts +30 -29
  76. package/dist/virtualList/index.d.ts.map +1 -1
  77. package/dist/virtualList/index.js +21 -21
  78. package/package.json +3 -3
@@ -65,19 +65,18 @@ export const ApplyScroll = Command.define('ApplyScroll', {
65
65
  return __foldkitBrandViewResult((Message.CompletedApplyScroll({ version })), "@foldkit/ui/virtualList/index.js#anonymous");
66
66
  })), "@foldkit/ui/virtualList/index.js#execute"),
67
67
  });
68
- /** Processes a virtual list message and returns the next model and commands. */
68
+ /** Processes a VirtualList Message and returns the next Model and optional Commands. */
69
69
  export const update = (model, message) => __foldkitBrandViewResult((Message.match(message, {
70
- ScrolledContainer: ({ scrollTop }) => __foldkitBrandViewResult(([
71
- evo(model, { scrollTop: () => __foldkitBrandViewResult((scrollTop), "@foldkit/ui/virtualList/index.js#scrollTop") }),
72
- [],
73
- ]), "@foldkit/ui/virtualList/index.js#ScrolledContainer"),
70
+ ScrolledContainer: ({ scrollTop }) => (__foldkitBrandViewResult(({
71
+ model: evo(model, { scrollTop: () => __foldkitBrandViewResult((scrollTop), "@foldkit/ui/virtualList/index.js#scrollTop") }),
72
+ }), "@foldkit/ui/virtualList/index.js#ScrolledContainer")),
74
73
  MeasuredContainer: ({ containerHeight }) => {
75
74
  const wasUnmeasured = model.measurement._tag === 'Unmeasured';
76
75
  const needsInitialApply = wasUnmeasured && model.scrollTop !== 0;
77
76
  if (needsInitialApply) {
78
77
  const nextVersion = Number.increment(model.pendingScrollVersion);
79
- return __foldkitBrandViewResult(([
80
- evo(model, {
78
+ return __foldkitBrandViewResult(({
79
+ model: evo(model, {
81
80
  measurement: () => __foldkitBrandViewResult((Measured({ containerHeight })), "@foldkit/ui/virtualList/index.js#measurement"),
82
81
  pendingScrollVersion: () => __foldkitBrandViewResult((nextVersion), "@foldkit/ui/virtualList/index.js#pendingScrollVersion"),
83
82
  pendingScroll: () => __foldkitBrandViewResult((ScrollingToIndex({
@@ -85,49 +84,50 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
85
84
  version: nextVersion,
86
85
  })), "@foldkit/ui/virtualList/index.js#pendingScroll"),
87
86
  }),
88
- [
87
+ commands: [
89
88
  ApplyScroll({
90
89
  id: model.id,
91
90
  scrollTop: model.scrollTop,
92
91
  version: nextVersion,
93
92
  }),
94
93
  ],
95
- ]), "@foldkit/ui/virtualList/index.js#MeasuredContainer");
94
+ }), "@foldkit/ui/virtualList/index.js#MeasuredContainer");
96
95
  }
97
96
  else {
98
- return __foldkitBrandViewResult(([
99
- evo(model, { measurement: () => __foldkitBrandViewResult((Measured({ containerHeight })), "@foldkit/ui/virtualList/index.js#measurement~2") }),
100
- [],
101
- ]), "@foldkit/ui/virtualList/index.js#MeasuredContainer");
97
+ return __foldkitBrandViewResult(({
98
+ model: evo(model, {
99
+ measurement: () => __foldkitBrandViewResult((Measured({ containerHeight })), "@foldkit/ui/virtualList/index.js#measurement~2"),
100
+ }),
101
+ }), "@foldkit/ui/virtualList/index.js#MeasuredContainer");
102
102
  }
103
103
  },
104
104
  CompletedApplyScroll: ({ version }) => {
105
105
  if (version !== model.pendingScrollVersion) {
106
- return __foldkitBrandViewResult(([model, []]), "@foldkit/ui/virtualList/index.js#CompletedApplyScroll");
106
+ return __foldkitBrandViewResult(({ model }), "@foldkit/ui/virtualList/index.js#CompletedApplyScroll");
107
107
  }
108
108
  else {
109
- return __foldkitBrandViewResult(([evo(model, { pendingScroll: () => __foldkitBrandViewResult((Idle()), "@foldkit/ui/virtualList/index.js#pendingScroll~2") }), []]), "@foldkit/ui/virtualList/index.js#CompletedApplyScroll");
109
+ return __foldkitBrandViewResult(({ model: evo(model, { pendingScroll: () => __foldkitBrandViewResult((Idle()), "@foldkit/ui/virtualList/index.js#pendingScroll~2") }) }), "@foldkit/ui/virtualList/index.js#CompletedApplyScroll");
110
110
  }
111
111
  },
112
112
  })), "@foldkit/ui/virtualList/index.js#update");
113
113
  const buildScrollToIndex = (model, index, targetScrollTop) => {
114
114
  const nextVersion = Number.increment(model.pendingScrollVersion);
115
- return __foldkitBrandViewResult(([
116
- evo(model, {
115
+ return __foldkitBrandViewResult(({
116
+ model: evo(model, {
117
117
  pendingScrollVersion: () => __foldkitBrandViewResult((nextVersion), "@foldkit/ui/virtualList/index.js#pendingScrollVersion~2"),
118
118
  pendingScroll: () => __foldkitBrandViewResult((ScrollingToIndex({ index, version: nextVersion })), "@foldkit/ui/virtualList/index.js#pendingScroll~3"),
119
119
  }),
120
- [
120
+ commands: [
121
121
  ApplyScroll({
122
122
  id: model.id,
123
123
  scrollTop: targetScrollTop,
124
124
  version: nextVersion,
125
125
  }),
126
126
  ],
127
- ]), "@foldkit/ui/virtualList/index.js#buildScrollToIndex");
127
+ }), "@foldkit/ui/virtualList/index.js#buildScrollToIndex");
128
128
  };
129
129
  /** Programmatically scrolls the container so the row at `index` is visible.
130
- * Returns the next model and a Command that mutates `element.scrollTop`. The
130
+ * Returns the next Model and a Command that mutates `element.scrollTop`. The
131
131
  * natural scroll event then flows back through `ScrolledContainer` and the
132
132
  * component re-renders the new visible slice.
133
133
  *
@@ -136,7 +136,7 @@ const buildScrollToIndex = (model, index, targetScrollTop) => {
136
136
  * previous in-flight scroll) is ignored when its version no longer matches.
137
137
  *
138
138
  * Should be called after the container has rendered. If the container is not
139
- * yet in the DOM the Command silently no-ops (the model still transitions
139
+ * yet in the DOM the Command silently no-ops (the Model still transitions
140
140
  * through `ScrollingToIndex` → `Idle` via the version-matched completion).
141
141
  *
142
142
  * Assumes uniform row heights: target scroll position is computed as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/ui",
3
- "version": "0.150.0",
3
+ "version": "0.151.0",
4
4
  "description": "Headless, accessible UI components for Foldkit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -131,8 +131,8 @@
131
131
  "typedoc": "^0.28.19",
132
132
  "typescript": "^6.0.3",
133
133
  "vitest": "^4.1.9",
134
- "foldkit": "0.150.0",
135
- "@foldkit/vite-plugin": "0.17.0"
134
+ "@foldkit/vite-plugin": "0.17.0",
135
+ "foldkit": "0.151.0"
136
136
  },
137
137
  "keywords": [
138
138
  "foldkit",