@foldkit/ui 0.156.0 → 0.157.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.
- package/dist/anchor/anchor.d.ts +18 -18
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +16 -16
- package/dist/animation/index.d.ts +4 -4
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +8 -8
- package/dist/animation/public.d.ts +1 -1
- package/dist/animation/public.d.ts.map +1 -1
- package/dist/animation/public.js +1 -1
- package/dist/animation/schema.d.ts +6 -6
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +5 -5
- package/dist/animation/update.d.ts +8 -2
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +22 -9
- package/dist/calendar/index.d.ts +56 -56
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +49 -37
- package/dist/checkbox/index.js +2 -2
- package/dist/combobox/multi.d.ts +19 -19
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.d.ts +61 -61
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +74 -62
- package/dist/combobox/single.d.ts +19 -19
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +2 -2
- package/dist/datePicker/index.d.ts +72 -72
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +12 -12
- package/dist/dialog/index.d.ts +14 -14
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +35 -23
- package/dist/disclosure/index.js +2 -2
- package/dist/dragAndDrop/index.d.ts +61 -61
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +85 -85
- package/dist/fileDrop/index.d.ts +6 -6
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +6 -6
- package/dist/hoverIntent/hoverIntent.d.ts +15 -15
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +17 -17
- package/dist/hoverIntent/message.d.ts +4 -4
- package/dist/hoverIntent/message.d.ts.map +1 -1
- package/dist/hoverIntent/message.js +4 -4
- package/dist/keyboard.js +2 -2
- package/dist/listbox/multi.d.ts +19 -19
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multi.js +2 -2
- package/dist/listbox/shared.d.ts +58 -58
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +74 -62
- package/dist/listbox/single.d.ts +19 -19
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/listbox/single.js +2 -2
- package/dist/menu/index.d.ts +67 -67
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +82 -67
- package/dist/popover/index.d.ts +34 -34
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +49 -37
- package/dist/radioGroup/index.d.ts +12 -12
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +16 -16
- package/dist/slider/index.d.ts +14 -14
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +31 -31
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +18 -18
- package/dist/test/apps/disabledButton.d.ts +12 -12
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +5 -5
- package/dist/textarea/index.d.ts +2 -2
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +63 -63
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +19 -19
- package/dist/toast/schema.d.ts +55 -55
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +29 -29
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +3 -3
- package/dist/toast/update.d.ts +61 -61
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +13 -13
- package/dist/tooltip/message.d.ts +3 -3
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/message.js +3 -3
- package/dist/tooltip/tooltip.d.ts +24 -24
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +13 -13
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/typeahead.js +3 -3
- package/dist/virtualList/index.d.ts +16 -16
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +13 -13
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Array, Effect, Number, Option, Queue, Schema
|
|
2
|
+
import { Array, Effect, Number, Option, Queue, Schema, Stream, pipe, } from 'effect';
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import { childAttributes, } from 'foldkit/html';
|
|
5
5
|
import { defineMessageUnion } from 'foldkit/message';
|
|
@@ -17,29 +17,29 @@ import * as Subscription from 'foldkit/subscription';
|
|
|
17
17
|
*/
|
|
18
18
|
const Measurement = defineTaggedUnion({
|
|
19
19
|
Unmeasured: {},
|
|
20
|
-
Measured: { containerHeight:
|
|
20
|
+
Measured: { containerHeight: Schema.Number },
|
|
21
21
|
});
|
|
22
22
|
/** State of a programmatic scroll initiated by `scrollToIndex`. */
|
|
23
23
|
const PendingScroll = defineTaggedUnion({
|
|
24
24
|
Idle: {},
|
|
25
|
-
ScrollingToIndex: { index:
|
|
25
|
+
ScrollingToIndex: { index: Schema.Number, version: Schema.Number },
|
|
26
26
|
});
|
|
27
27
|
/** Schema for the virtual list's state. Tracks scroll position, container
|
|
28
28
|
* measurement, and any in-flight programmatic scroll. */
|
|
29
|
-
export const Model =
|
|
30
|
-
id:
|
|
31
|
-
rowHeightPx:
|
|
32
|
-
scrollTop:
|
|
29
|
+
export const Model = Schema.Struct({
|
|
30
|
+
id: Schema.String,
|
|
31
|
+
rowHeightPx: Schema.Number,
|
|
32
|
+
scrollTop: Schema.Number,
|
|
33
33
|
measurement: Measurement,
|
|
34
34
|
pendingScroll: PendingScroll,
|
|
35
|
-
pendingScrollVersion:
|
|
35
|
+
pendingScrollVersion: Schema.Number,
|
|
36
36
|
});
|
|
37
37
|
// MESSAGE
|
|
38
38
|
/** Union of all messages the virtual list component can produce. */
|
|
39
39
|
export const Message = defineMessageUnion({
|
|
40
|
-
ScrolledContainer: { scrollTop:
|
|
41
|
-
MeasuredContainer: { containerHeight:
|
|
42
|
-
CompletedApplyScroll: { version:
|
|
40
|
+
ScrolledContainer: { scrollTop: Schema.Number },
|
|
41
|
+
MeasuredContainer: { containerHeight: Schema.Number },
|
|
42
|
+
CompletedApplyScroll: { version: Schema.Number },
|
|
43
43
|
});
|
|
44
44
|
/** Creates an initial virtual list model from a config. The container starts
|
|
45
45
|
* in `Unmeasured` state. The first `ResizeObserver` entry transitions it to
|
|
@@ -54,7 +54,7 @@ export const init = (config) => (__foldkitBrandViewResult(({
|
|
|
54
54
|
}), "@foldkit/ui/virtualList/index.js#init"));
|
|
55
55
|
// UPDATE
|
|
56
56
|
export const ApplyScroll = Command.define('ApplyScroll', {
|
|
57
|
-
args: { id:
|
|
57
|
+
args: { id: Schema.String, scrollTop: Schema.Number, version: Schema.Number },
|
|
58
58
|
messages: [Message.CompletedApplyScroll],
|
|
59
59
|
execute: ({ id, scrollTop, version }) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
60
60
|
const element = document.getElementById(id);
|
|
@@ -245,7 +245,7 @@ const containerElement = (id) => __foldkitBrandViewResult((Option.fromNullishOr(
|
|
|
245
245
|
* page that mounts the list, away, and back all reattach correctly without
|
|
246
246
|
* the consumer having to teach the framework about navigation. */
|
|
247
247
|
export const subscriptions = Subscription.make()(entry => (__foldkitBrandViewResult(({
|
|
248
|
-
containerEvents: entry({ id:
|
|
248
|
+
containerEvents: entry({ id: Schema.String }, {
|
|
249
249
|
modelToDependencies: model => (__foldkitBrandViewResult(({ id: model.id }), "@foldkit/ui/virtualList/index.js#modelToDependencies")),
|
|
250
250
|
dependenciesToStream: ({ id }) => __foldkitBrandViewResult((Stream.callback(queue => __foldkitBrandViewResult((Effect.acquireRelease(Effect.sync(() => {
|
|
251
251
|
const state = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foldkit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.157.0",
|
|
4
4
|
"description": "Headless, accessible UI components for Foldkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
"rimraf": "^6.1.3",
|
|
135
135
|
"typescript": "^7.0.2",
|
|
136
136
|
"vitest": "^4.1.11",
|
|
137
|
-
"
|
|
138
|
-
"foldkit": "0.
|
|
137
|
+
"foldkit": "0.157.0",
|
|
138
|
+
"@foldkit/vite-plugin": "0.20.1"
|
|
139
139
|
},
|
|
140
140
|
"keywords": [
|
|
141
141
|
"foldkit",
|