foldkit 0.37.0 → 1.1.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/command/index.d.ts +20 -16
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +16 -4
- package/dist/command/public.d.ts +2 -2
- package/dist/command/public.d.ts.map +1 -1
- package/dist/command/public.js +1 -1
- package/dist/devtools/overlay.d.ts.map +1 -1
- package/dist/devtools/overlay.js +25 -17
- package/dist/runtime/managedResource.d.ts +1 -1
- package/dist/runtime/managedResource.js +1 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +2 -2
- package/dist/runtime/subscription.d.ts +5 -5
- package/dist/runtime/subscription.d.ts.map +1 -1
- package/dist/runtime/subscription.js +2 -2
- package/dist/task/dom.d.ts +6 -6
- package/dist/task/dom.js +6 -6
- package/dist/task/inert.d.ts +2 -2
- package/dist/task/inert.js +2 -2
- package/dist/task/scrollLock.d.ts +2 -2
- package/dist/task/scrollLock.js +2 -2
- package/dist/task/time.d.ts +1 -1
- package/dist/task/time.js +1 -1
- package/dist/ui/combobox/multi.d.ts +11 -11
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/public.d.ts +1 -1
- package/dist/ui/combobox/shared.d.ts +29 -30
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +34 -24
- package/dist/ui/combobox/single.d.ts +11 -11
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/dialog/index.d.ts +7 -7
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +15 -11
- package/dist/ui/dialog/public.d.ts +1 -1
- package/dist/ui/dialog/public.js +1 -1
- package/dist/ui/disclosure/index.d.ts +4 -4
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +6 -5
- package/dist/ui/disclosure/public.d.ts +1 -1
- package/dist/ui/listbox/multi.d.ts +11 -11
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/public.d.ts +1 -1
- package/dist/ui/listbox/shared.d.ts +25 -25
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +41 -29
- package/dist/ui/listbox/single.d.ts +11 -11
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/menu/index.d.ts +16 -16
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +46 -34
- package/dist/ui/popover/index.d.ts +12 -12
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +34 -25
- package/dist/ui/radioGroup/index.d.ts +4 -4
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +5 -4
- package/dist/ui/tabs/index.d.ts +2 -2
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +6 -5
- package/package.json +1 -1
|
@@ -72,19 +72,19 @@ export declare const RequestedItemClick: import("../../schema").CallableTaggedSt
|
|
|
72
72
|
index: typeof S.Number;
|
|
73
73
|
}>;
|
|
74
74
|
/** Sent when the scroll lock command completes. */
|
|
75
|
-
export declare const
|
|
75
|
+
export declare const CompletedLockScroll: import("../../schema").CallableTaggedStruct<"CompletedLockScroll", {}>;
|
|
76
76
|
/** Sent when the scroll unlock command completes. */
|
|
77
|
-
export declare const
|
|
77
|
+
export declare const CompletedUnlockScroll: import("../../schema").CallableTaggedStruct<"CompletedUnlockScroll", {}>;
|
|
78
78
|
/** Sent when the inert-others command completes. */
|
|
79
|
-
export declare const
|
|
79
|
+
export declare const CompletedSetupInert: import("../../schema").CallableTaggedStruct<"CompletedSetupInert", {}>;
|
|
80
80
|
/** Sent when the restore-inert command completes. */
|
|
81
|
-
export declare const
|
|
81
|
+
export declare const CompletedTeardownInert: import("../../schema").CallableTaggedStruct<"CompletedTeardownInert", {}>;
|
|
82
82
|
/** Sent when the focus-input command completes. */
|
|
83
|
-
export declare const
|
|
83
|
+
export declare const CompletedFocusInput: import("../../schema").CallableTaggedStruct<"CompletedFocusInput", {}>;
|
|
84
84
|
/** Sent when the scroll-into-view command completes after keyboard activation. */
|
|
85
85
|
export declare const CompletedScrollIntoView: import("../../schema").CallableTaggedStruct<"CompletedScrollIntoView", {}>;
|
|
86
86
|
/** Sent when the programmatic item click command completes. */
|
|
87
|
-
export declare const
|
|
87
|
+
export declare const CompletedClickItem: import("../../schema").CallableTaggedStruct<"CompletedClickItem", {}>;
|
|
88
88
|
/** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
|
|
89
89
|
export declare const AdvancedTransitionFrame: import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>;
|
|
90
90
|
/** Sent internally when all CSS transitions on the items container have completed. */
|
|
@@ -107,13 +107,13 @@ export declare const Message: S.Union<[
|
|
|
107
107
|
typeof SelectedItem,
|
|
108
108
|
typeof MovedPointerOverItem,
|
|
109
109
|
typeof RequestedItemClick,
|
|
110
|
-
typeof
|
|
111
|
-
typeof
|
|
112
|
-
typeof
|
|
113
|
-
typeof
|
|
114
|
-
typeof
|
|
110
|
+
typeof CompletedLockScroll,
|
|
111
|
+
typeof CompletedUnlockScroll,
|
|
112
|
+
typeof CompletedSetupInert,
|
|
113
|
+
typeof CompletedTeardownInert,
|
|
114
|
+
typeof CompletedFocusInput,
|
|
115
115
|
typeof CompletedScrollIntoView,
|
|
116
|
-
typeof
|
|
116
|
+
typeof CompletedClickItem,
|
|
117
117
|
typeof AdvancedTransitionFrame,
|
|
118
118
|
typeof EndedTransition,
|
|
119
119
|
typeof DetectedInputMovement,
|
|
@@ -128,13 +128,13 @@ export type DeactivatedItem = typeof DeactivatedItem.Type;
|
|
|
128
128
|
export type SelectedItem = typeof SelectedItem.Type;
|
|
129
129
|
export type MovedPointerOverItem = typeof MovedPointerOverItem.Type;
|
|
130
130
|
export type RequestedItemClick = typeof RequestedItemClick.Type;
|
|
131
|
-
export type
|
|
132
|
-
export type
|
|
133
|
-
export type
|
|
134
|
-
export type
|
|
135
|
-
export type
|
|
131
|
+
export type CompletedLockScroll = typeof CompletedLockScroll.Type;
|
|
132
|
+
export type CompletedUnlockScroll = typeof CompletedUnlockScroll.Type;
|
|
133
|
+
export type CompletedSetupInert = typeof CompletedSetupInert.Type;
|
|
134
|
+
export type CompletedTeardownInert = typeof CompletedTeardownInert.Type;
|
|
135
|
+
export type CompletedFocusInput = typeof CompletedFocusInput.Type;
|
|
136
136
|
export type CompletedScrollIntoView = typeof CompletedScrollIntoView.Type;
|
|
137
|
-
export type
|
|
137
|
+
export type CompletedClickItem = typeof CompletedClickItem.Type;
|
|
138
138
|
export type AdvancedTransitionFrame = typeof AdvancedTransitionFrame.Type;
|
|
139
139
|
export type EndedTransition = typeof EndedTransition.Type;
|
|
140
140
|
export type DetectedInputMovement = typeof DetectedInputMovement.Type;
|
|
@@ -155,14 +155,13 @@ export type SelectedItemContext = Readonly<{
|
|
|
155
155
|
maybeUnlockScroll: Option.Option<Command.Command<Message>>;
|
|
156
156
|
maybeRestoreInert: Option.Option<Command.Command<Message>>;
|
|
157
157
|
}>;
|
|
158
|
-
/** Creates a combobox update function from variant-specific handlers. Shared logic (open, close, activate, transition) is handled internally; only close, selection, and immediate-activation behavior varies by variant. */
|
|
159
158
|
export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
160
159
|
handleClose: (model: Model) => Model;
|
|
161
160
|
handleSelectedItem: (model: Model, item: string, displayText: string, context: SelectedItemContext) => [Model, ReadonlyArray<Command.Command<Message>>];
|
|
162
161
|
handleImmediateActivation: (model: Model, item: string, displayText: string) => Model;
|
|
163
|
-
}>) => (model: Model, message: Message) => [Model, readonly {
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
}>) => (model: Model, message: Message) => [Model, readonly Readonly<{
|
|
163
|
+
name: string;
|
|
164
|
+
effect: Effect.Effect<{
|
|
166
165
|
readonly _tag: "Opened";
|
|
167
166
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
168
167
|
} | {
|
|
@@ -192,19 +191,19 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
192
191
|
readonly _tag: "RequestedItemClick";
|
|
193
192
|
readonly index: number;
|
|
194
193
|
} | {
|
|
195
|
-
readonly _tag: "
|
|
194
|
+
readonly _tag: "CompletedLockScroll";
|
|
196
195
|
} | {
|
|
197
|
-
readonly _tag: "
|
|
196
|
+
readonly _tag: "CompletedUnlockScroll";
|
|
198
197
|
} | {
|
|
199
|
-
readonly _tag: "
|
|
198
|
+
readonly _tag: "CompletedSetupInert";
|
|
200
199
|
} | {
|
|
201
|
-
readonly _tag: "
|
|
200
|
+
readonly _tag: "CompletedTeardownInert";
|
|
202
201
|
} | {
|
|
203
|
-
readonly _tag: "
|
|
202
|
+
readonly _tag: "CompletedFocusInput";
|
|
204
203
|
} | {
|
|
205
204
|
readonly _tag: "CompletedScrollIntoView";
|
|
206
205
|
} | {
|
|
207
|
-
readonly _tag: "
|
|
206
|
+
readonly _tag: "CompletedClickItem";
|
|
208
207
|
} | {
|
|
209
208
|
readonly _tag: "AdvancedTransitionFrame";
|
|
210
209
|
} | {
|
|
@@ -217,7 +216,7 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
217
216
|
} | {
|
|
218
217
|
readonly _tag: "PressedToggleButton";
|
|
219
218
|
}, never, never>;
|
|
220
|
-
}[]];
|
|
219
|
+
}>[]];
|
|
221
220
|
/** Configuration for an individual combobox item's appearance. */
|
|
222
221
|
export type ItemConfig = Readonly<{
|
|
223
222
|
className?: string;
|
|
@@ -231,7 +230,7 @@ export type GroupHeading = Readonly<{
|
|
|
231
230
|
/** Configuration for rendering a combobox with `view`. */
|
|
232
231
|
export type BaseViewConfig<Message, Item extends string, Model extends BaseModel> = Readonly<{
|
|
233
232
|
model: Model;
|
|
234
|
-
toMessage: (message: Opened | Closed | ClosedByTab | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | UpdatedInputValue | PressedToggleButton |
|
|
233
|
+
toMessage: (message: Opened | Closed | ClosedByTab | ActivatedItem | DeactivatedItem | SelectedItem | MovedPointerOverItem | RequestedItemClick | UpdatedInputValue | PressedToggleButton | CompletedLockScroll | CompletedUnlockScroll | CompletedSetupInert | CompletedTeardownInert | CompletedFocusInput | CompletedScrollIntoView | CompletedClickItem) => Message;
|
|
235
234
|
items: ReadonlyArray<Item>;
|
|
236
235
|
itemToConfig: (item: Item, context: Readonly<{
|
|
237
236
|
isActive: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAQ,MAAM,YAAY,CAAA;AAK5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI1C,OAAO,EAAE,eAAe,EAAE,CAAA;AAI1B,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,oCAAmC,CAAA;AACjE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,oKAAoK;AACpK,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;EAepB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC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AAK,SAAS,SAAS,EAAE,UAAU,YAAY,CAAC,KAAK,CAAC,MACtD,OAAO,EAAE,IAAI,SAAS,MAAM,EAC3B,QAAQ,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAC3C,IAoiBF,CAAA"}
|
|
@@ -76,19 +76,19 @@ export const RequestedItemClick = m('RequestedItemClick', {
|
|
|
76
76
|
index: S.Number,
|
|
77
77
|
});
|
|
78
78
|
/** Sent when the scroll lock command completes. */
|
|
79
|
-
export const
|
|
79
|
+
export const CompletedLockScroll = m('CompletedLockScroll');
|
|
80
80
|
/** Sent when the scroll unlock command completes. */
|
|
81
|
-
export const
|
|
81
|
+
export const CompletedUnlockScroll = m('CompletedUnlockScroll');
|
|
82
82
|
/** Sent when the inert-others command completes. */
|
|
83
|
-
export const
|
|
83
|
+
export const CompletedSetupInert = m('CompletedSetupInert');
|
|
84
84
|
/** Sent when the restore-inert command completes. */
|
|
85
|
-
export const
|
|
85
|
+
export const CompletedTeardownInert = m('CompletedTeardownInert');
|
|
86
86
|
/** Sent when the focus-input command completes. */
|
|
87
|
-
export const
|
|
87
|
+
export const CompletedFocusInput = m('CompletedFocusInput');
|
|
88
88
|
/** Sent when the scroll-into-view command completes after keyboard activation. */
|
|
89
89
|
export const CompletedScrollIntoView = m('CompletedScrollIntoView');
|
|
90
90
|
/** Sent when the programmatic item click command completes. */
|
|
91
|
-
export const
|
|
91
|
+
export const CompletedClickItem = m('CompletedClickItem');
|
|
92
92
|
/** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
|
|
93
93
|
export const AdvancedTransitionFrame = m('AdvancedTransitionFrame');
|
|
94
94
|
/** Sent internally when all CSS transitions on the items container have completed. */
|
|
@@ -102,7 +102,7 @@ export const UpdatedInputValue = m('UpdatedInputValue', {
|
|
|
102
102
|
/** Sent when the optional toggle button is clicked. */
|
|
103
103
|
export const PressedToggleButton = m('PressedToggleButton');
|
|
104
104
|
/** Union of all messages the combobox component can produce. */
|
|
105
|
-
export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick,
|
|
105
|
+
export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, AdvancedTransitionFrame, EndedTransition, DetectedInputMovement, UpdatedInputValue, PressedToggleButton);
|
|
106
106
|
// SELECTORS
|
|
107
107
|
export const inputSelector = (id) => `#${id}-input`;
|
|
108
108
|
export const inputWrapperSelector = (id) => `#${id}-input-wrapper`;
|
|
@@ -120,18 +120,28 @@ export const closedBaseModel = (model) => constrainedEvo(model, {
|
|
|
120
120
|
maybeLastPointerPosition: () => Option.none(),
|
|
121
121
|
});
|
|
122
122
|
/** Creates a combobox update function from variant-specific handlers. Shared logic (open, close, activate, transition) is handled internally; only close, selection, and immediate-activation behavior varies by variant. */
|
|
123
|
+
const RequestFrame = Command.define('RequestFrame');
|
|
124
|
+
const LockScroll = Command.define('LockScroll');
|
|
125
|
+
const UnlockScroll = Command.define('UnlockScroll');
|
|
126
|
+
const InertOthers = Command.define('InertOthers');
|
|
127
|
+
const RestoreInert = Command.define('RestoreInert');
|
|
128
|
+
const FocusInput = Command.define('FocusInput');
|
|
129
|
+
const ScrollIntoView = Command.define('ScrollIntoView');
|
|
130
|
+
const ClickItem = Command.define('ClickItem');
|
|
131
|
+
const WaitForTransitions = Command.define('WaitForTransitions');
|
|
132
|
+
const DetectMovementOrTransitionEnd = Command.define('DetectMovementOrTransitionEnd');
|
|
123
133
|
export const makeUpdate = (handlers) => {
|
|
124
134
|
const withUpdateReturn = M.withReturnType();
|
|
125
135
|
return (model, message) => {
|
|
126
|
-
const maybeNextFrame = OptionExt.when(model.isAnimated, Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame())
|
|
127
|
-
const maybeLockScroll = OptionExt.when(model.isModal, Task.lockScroll.pipe(Effect.as(
|
|
128
|
-
const maybeUnlockScroll = OptionExt.when(model.isModal, Task.unlockScroll.pipe(Effect.as(
|
|
129
|
-
const maybeInertOthers = OptionExt.when(model.isModal, Task.inertOthers(model.id, [
|
|
136
|
+
const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
|
|
137
|
+
const maybeLockScroll = OptionExt.when(model.isModal, LockScroll(Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))));
|
|
138
|
+
const maybeUnlockScroll = OptionExt.when(model.isModal, UnlockScroll(Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))));
|
|
139
|
+
const maybeInertOthers = OptionExt.when(model.isModal, InertOthers(Task.inertOthers(model.id, [
|
|
130
140
|
inputWrapperSelector(model.id),
|
|
131
141
|
itemsSelector(model.id),
|
|
132
|
-
]).pipe(Effect.as(
|
|
133
|
-
const maybeRestoreInert = OptionExt.when(model.isModal, Task.restoreInert(model.id).pipe(Effect.as(
|
|
134
|
-
const focusInput = Task.focus(inputSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
142
|
+
]).pipe(Effect.as(CompletedSetupInert()))));
|
|
143
|
+
const maybeRestoreInert = OptionExt.when(model.isModal, RestoreInert(Task.restoreInert(model.id).pipe(Effect.as(CompletedTeardownInert()))));
|
|
144
|
+
const focusInput = FocusInput(Task.focus(inputSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusInput())));
|
|
135
145
|
return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
136
146
|
Opened: ({ maybeActiveItemIndex }) => {
|
|
137
147
|
const nextModel = constrainedEvo(model, {
|
|
@@ -178,7 +188,7 @@ export const makeUpdate = (handlers) => {
|
|
|
178
188
|
nextModel,
|
|
179
189
|
activationTrigger === 'Keyboard'
|
|
180
190
|
? [
|
|
181
|
-
Task.scrollIntoView(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView())
|
|
191
|
+
ScrollIntoView(Task.scrollIntoView(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView()))),
|
|
182
192
|
]
|
|
183
193
|
: [],
|
|
184
194
|
];
|
|
@@ -214,7 +224,7 @@ export const makeUpdate = (handlers) => {
|
|
|
214
224
|
RequestedItemClick: ({ index }) => [
|
|
215
225
|
model,
|
|
216
226
|
[
|
|
217
|
-
Task.clickElement(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(
|
|
227
|
+
ClickItem(Task.clickElement(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))),
|
|
218
228
|
],
|
|
219
229
|
],
|
|
220
230
|
UpdatedInputValue: ({ value }) => {
|
|
@@ -273,14 +283,14 @@ export const makeUpdate = (handlers) => {
|
|
|
273
283
|
transitionState: () => 'EnterAnimating',
|
|
274
284
|
}),
|
|
275
285
|
[
|
|
276
|
-
Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())
|
|
286
|
+
WaitForTransitions(Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition()))),
|
|
277
287
|
],
|
|
278
288
|
]), M.when('LeaveStart', () => [
|
|
279
289
|
constrainedEvo(model, {
|
|
280
290
|
transitionState: () => 'LeaveAnimating',
|
|
281
291
|
}),
|
|
282
292
|
[
|
|
283
|
-
Effect.raceFirst(Task.detectElementMovement(inputWrapperSelector(model.id)).pipe(Effect.as(DetectedInputMovement())), Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())))
|
|
293
|
+
DetectMovementOrTransitionEnd(Effect.raceFirst(Task.detectElementMovement(inputWrapperSelector(model.id)).pipe(Effect.as(DetectedInputMovement())), Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())))),
|
|
284
294
|
],
|
|
285
295
|
]), M.orElse(() => [model, []])),
|
|
286
296
|
EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.whenOr('EnterAnimating', 'LeaveAnimating', () => [
|
|
@@ -295,13 +305,13 @@ export const makeUpdate = (handlers) => {
|
|
|
295
305
|
}),
|
|
296
306
|
[],
|
|
297
307
|
]), M.orElse(() => [model, []])),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
308
|
+
CompletedLockScroll: () => [model, []],
|
|
309
|
+
CompletedUnlockScroll: () => [model, []],
|
|
310
|
+
CompletedSetupInert: () => [model, []],
|
|
311
|
+
CompletedTeardownInert: () => [model, []],
|
|
312
|
+
CompletedFocusInput: () => [model, []],
|
|
303
313
|
CompletedScrollIntoView: () => [model, []],
|
|
304
|
-
|
|
314
|
+
CompletedClickItem: () => [model, []],
|
|
305
315
|
}));
|
|
306
316
|
};
|
|
307
317
|
};
|
|
@@ -69,9 +69,9 @@ export declare const update: (model: {
|
|
|
69
69
|
} & {
|
|
70
70
|
readonly maybeSelectedItem: Option.Option<string>;
|
|
71
71
|
readonly maybeSelectedDisplayText: Option.Option<string>;
|
|
72
|
-
}, readonly {
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
}, readonly Readonly<{
|
|
73
|
+
name: string;
|
|
74
|
+
effect: import("effect/Effect").Effect<{
|
|
75
75
|
readonly _tag: "Opened";
|
|
76
76
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
77
77
|
} | {
|
|
@@ -101,19 +101,19 @@ export declare const update: (model: {
|
|
|
101
101
|
readonly _tag: "RequestedItemClick";
|
|
102
102
|
readonly index: number;
|
|
103
103
|
} | {
|
|
104
|
-
readonly _tag: "
|
|
104
|
+
readonly _tag: "CompletedLockScroll";
|
|
105
105
|
} | {
|
|
106
|
-
readonly _tag: "
|
|
106
|
+
readonly _tag: "CompletedUnlockScroll";
|
|
107
107
|
} | {
|
|
108
|
-
readonly _tag: "
|
|
108
|
+
readonly _tag: "CompletedSetupInert";
|
|
109
109
|
} | {
|
|
110
|
-
readonly _tag: "
|
|
110
|
+
readonly _tag: "CompletedTeardownInert";
|
|
111
111
|
} | {
|
|
112
|
-
readonly _tag: "
|
|
112
|
+
readonly _tag: "CompletedFocusInput";
|
|
113
113
|
} | {
|
|
114
114
|
readonly _tag: "CompletedScrollIntoView";
|
|
115
115
|
} | {
|
|
116
|
-
readonly _tag: "
|
|
116
|
+
readonly _tag: "CompletedClickItem";
|
|
117
117
|
} | {
|
|
118
118
|
readonly _tag: "AdvancedTransitionFrame";
|
|
119
119
|
} | {
|
|
@@ -126,7 +126,7 @@ export declare const update: (model: {
|
|
|
126
126
|
} | {
|
|
127
127
|
readonly _tag: "PressedToggleButton";
|
|
128
128
|
}, never, never>;
|
|
129
|
-
}[]];
|
|
129
|
+
}>[]];
|
|
130
130
|
/** Configuration for rendering a single-select combobox with `view`. */
|
|
131
131
|
export type ViewConfig<Message, Item extends string> = BaseViewConfig<Message, Item, Model>;
|
|
132
132
|
/** Renders a headless single-select combobox with keyboard navigation, selection tracking, and aria-activedescendant focus management. */
|
|
@@ -151,7 +151,7 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
151
151
|
readonly maybeSelectedItem: Option.Option<string>;
|
|
152
152
|
readonly maybeSelectedDisplayText: Option.Option<string>;
|
|
153
153
|
};
|
|
154
|
-
toMessage: (message: import("./shared").Opened | import("./shared").Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | import("./shared").SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton | import("./shared").
|
|
154
|
+
toMessage: (message: import("./shared").Opened | import("./shared").Closed | import("./shared").ClosedByTab | import("./shared").ActivatedItem | import("./shared").DeactivatedItem | import("./shared").SelectedItem | import("./shared").MovedPointerOverItem | import("./shared").RequestedItemClick | import("./shared").UpdatedInputValue | import("./shared").PressedToggleButton | import("./shared").CompletedLockScroll | import("./shared").CompletedUnlockScroll | import("./shared").CompletedSetupInert | import("./shared").CompletedTeardownInert | import("./shared").CompletedFocusInput | import("./shared").CompletedScrollIntoView | import("./shared").CompletedClickItem) => Message;
|
|
155
155
|
items: readonly Item[];
|
|
156
156
|
itemToConfig: (item: Item, context: Readonly<{
|
|
157
157
|
isActive: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAA;AAElD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAKpB,MAAM,UAAU,CAAA;AAIjB,uJAAuJ;AACvJ,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;GAOjB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,8RAA8R;AAC9R,MAAM,MAAM,UAAU,GAAG,cAAc,GACrC,QAAQ,CAAC;IACP,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAC,CAAA;AAEJ,4IAA4I;AAC5I,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAMxC,CAAA;AAIF,uIAAuI;AACvI,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAA;AAElD,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schema").CallableTaggedStruct<"Opened
|
|
|
15
15
|
/** Sent when the dialog should close (Escape key, backdrop click, or programmatic). Triggers the closeModal command. */
|
|
16
16
|
export declare const Closed: import("../../schema").CallableTaggedStruct<"Closed", {}>;
|
|
17
17
|
/** Sent when the show-dialog command completes (scroll lock + showModal). */
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const CompletedShowDialog: import("../../schema").CallableTaggedStruct<"CompletedShowDialog", {}>;
|
|
19
19
|
/** Sent when the close-dialog command completes (closeModal + scroll unlock). */
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const CompletedCloseDialog: import("../../schema").CallableTaggedStruct<"CompletedCloseDialog", {}>;
|
|
21
21
|
/** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
|
|
22
22
|
export declare const AdvancedTransitionFrame: import("../../schema").CallableTaggedStruct<"AdvancedTransitionFrame", {}>;
|
|
23
23
|
/** Sent internally when all CSS transitions on the dialog panel have completed. */
|
|
@@ -26,15 +26,15 @@ export declare const EndedTransition: import("../../schema").CallableTaggedStruc
|
|
|
26
26
|
export declare const Message: S.Union<[
|
|
27
27
|
typeof Opened,
|
|
28
28
|
typeof Closed,
|
|
29
|
-
typeof
|
|
30
|
-
typeof
|
|
29
|
+
typeof CompletedShowDialog,
|
|
30
|
+
typeof CompletedCloseDialog,
|
|
31
31
|
typeof AdvancedTransitionFrame,
|
|
32
32
|
typeof EndedTransition
|
|
33
33
|
]>;
|
|
34
34
|
export type Opened = typeof Opened.Type;
|
|
35
35
|
export type Closed = typeof Closed.Type;
|
|
36
|
-
export type
|
|
37
|
-
export type
|
|
36
|
+
export type CompletedShowDialog = typeof CompletedShowDialog.Type;
|
|
37
|
+
export type CompletedCloseDialog = typeof CompletedCloseDialog.Type;
|
|
38
38
|
export type Message = typeof Message.Type;
|
|
39
39
|
/** Configuration for creating a dialog model with `init`. `isAnimated` enables CSS transition coordination (default `false`). */
|
|
40
40
|
export type InitConfig = Readonly<{
|
|
@@ -55,7 +55,7 @@ export declare const descriptionId: (model: Model) => string;
|
|
|
55
55
|
/** Configuration for rendering a dialog with `view`. */
|
|
56
56
|
export type ViewConfig<Message> = Readonly<{
|
|
57
57
|
model: Model;
|
|
58
|
-
toMessage: (message: Closed |
|
|
58
|
+
toMessage: (message: Closed | CompletedShowDialog | CompletedCloseDialog) => Message;
|
|
59
59
|
panelContent: Html;
|
|
60
60
|
panelClassName?: string;
|
|
61
61
|
panelAttributes?: ReadonlyArray<Attribute<Message>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEvE,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAQxE,oIAAoI;AACpI,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wEAAwE;AACxE,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,wHAAwH;AACxH,eAAO,MAAM,MAAM,2DAAc,CAAA;AACjC,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,wEAA2B,CAAA;AAC3D,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,yEAA4B,CAAA;AAC7D,oGAAoG;AACpG,eAAO,MAAM,uBAAuB,4EAA+B,CAAA;AACnE,mFAAmF;AACnF,eAAO,MAAM,eAAe,oEAAuB,CAAA;AAEnD,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,mBAAmB;IAC1B,OAAO,oBAAoB;IAC3B,OAAO,uBAAuB;IAC9B,OAAO,eAAe;CACvB,CAQF,CAAA;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M,OAAO,GAAI,OAAO,KAAK,KAAG,MAA6B,CAAA;AAEpE,wGAAwG;AACxG,eAAO,MAAM,aAAa,GAAI,OAAO,KAAK,KAAG,MAAmC,CAAA;AAEhF,wDAAwD;AACxD,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,CACT,OAAO,EAAE,MAAM,GAAG,mBAAmB,GAAG,oBAAoB,KACzD,OAAO,CAAA;IACZ,YAAY,EAAE,IAAI,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC/C,CAAC,CAAA;AAEF,sGAAsG;AACtG,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,QAAQ,UAAU,CAAC,OAAO,CAAC,KAAG,IAiG3D,CAAA;AAED;6EAC6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAC7D,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,CAgBtE,CAAA"}
|
package/dist/ui/dialog/index.js
CHANGED
|
@@ -21,15 +21,15 @@ export const Opened = m('Opened');
|
|
|
21
21
|
/** Sent when the dialog should close (Escape key, backdrop click, or programmatic). Triggers the closeModal command. */
|
|
22
22
|
export const Closed = m('Closed');
|
|
23
23
|
/** Sent when the show-dialog command completes (scroll lock + showModal). */
|
|
24
|
-
export const
|
|
24
|
+
export const CompletedShowDialog = m('CompletedShowDialog');
|
|
25
25
|
/** Sent when the close-dialog command completes (closeModal + scroll unlock). */
|
|
26
|
-
export const
|
|
26
|
+
export const CompletedCloseDialog = m('CompletedCloseDialog');
|
|
27
27
|
/** Sent internally when a double-rAF completes, advancing the transition to its animating phase. */
|
|
28
28
|
export const AdvancedTransitionFrame = m('AdvancedTransitionFrame');
|
|
29
29
|
/** Sent internally when all CSS transitions on the dialog panel have completed. */
|
|
30
30
|
export const EndedTransition = m('EndedTransition');
|
|
31
31
|
/** Union of all messages the dialog component can produce. */
|
|
32
|
-
export const Message = S.Union(Opened, Closed,
|
|
32
|
+
export const Message = S.Union(Opened, Closed, CompletedShowDialog, CompletedCloseDialog, AdvancedTransitionFrame, EndedTransition);
|
|
33
33
|
/** Creates an initial dialog model from a config. Defaults to closed and non-animated. */
|
|
34
34
|
export const init = (config) => ({
|
|
35
35
|
id: config.id,
|
|
@@ -42,16 +42,20 @@ export const init = (config) => ({
|
|
|
42
42
|
const dialogSelector = (id) => `#${id}`;
|
|
43
43
|
const panelSelector = (id) => `#${id}-panel`;
|
|
44
44
|
const withUpdateReturn = M.withReturnType();
|
|
45
|
+
const RequestFrame = Command.define('RequestFrame');
|
|
46
|
+
const ShowDialog = Command.define('ShowDialog');
|
|
47
|
+
const CloseDialog = Command.define('CloseDialog');
|
|
48
|
+
const WaitForTransitions = Command.define('WaitForTransitions');
|
|
45
49
|
/** Processes a dialog message and returns the next model and commands. */
|
|
46
50
|
export const update = (model, message) => {
|
|
47
|
-
const maybeNextFrame = OptionExt.when(model.isAnimated, Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame())
|
|
51
|
+
const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
|
|
48
52
|
return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
49
53
|
Opened: () => {
|
|
50
54
|
const focusOptions = Option.match(model.maybeFocusSelector, {
|
|
51
55
|
onNone: () => undefined,
|
|
52
56
|
onSome: focusSelector => ({ focusSelector }),
|
|
53
57
|
});
|
|
54
|
-
const maybeShow = Option.liftPredicate(Task.lockScroll.pipe(Effect.andThen(() => Task.showModal(dialogSelector(model.id), focusOptions)), Effect.ignore, Effect.as(
|
|
58
|
+
const maybeShow = Option.liftPredicate(ShowDialog(Task.lockScroll.pipe(Effect.andThen(() => Task.showModal(dialogSelector(model.id), focusOptions)), Effect.ignore, Effect.as(CompletedShowDialog()))), () => !model.isOpen);
|
|
55
59
|
return [
|
|
56
60
|
evo(model, {
|
|
57
61
|
isOpen: () => true,
|
|
@@ -75,18 +79,18 @@ export const update = (model, message) => {
|
|
|
75
79
|
Option.toArray(maybeNextFrame),
|
|
76
80
|
];
|
|
77
81
|
}
|
|
78
|
-
const maybeClose = Option.liftPredicate(Task.closeModal(dialogSelector(model.id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(
|
|
82
|
+
const maybeClose = Option.liftPredicate(CloseDialog(Task.closeModal(dialogSelector(model.id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(CompletedCloseDialog()))), () => model.isOpen);
|
|
79
83
|
return [evo(model, { isOpen: () => false }), Option.toArray(maybeClose)];
|
|
80
84
|
},
|
|
81
85
|
AdvancedTransitionFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
|
|
82
86
|
evo(model, { transitionState: () => 'EnterAnimating' }),
|
|
83
87
|
[
|
|
84
|
-
Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition())
|
|
88
|
+
WaitForTransitions(Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))),
|
|
85
89
|
],
|
|
86
90
|
]), M.when('LeaveStart', () => [
|
|
87
91
|
evo(model, { transitionState: () => 'LeaveAnimating' }),
|
|
88
92
|
[
|
|
89
|
-
Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition())
|
|
93
|
+
WaitForTransitions(Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))),
|
|
90
94
|
],
|
|
91
95
|
]), M.orElse(() => [model, []])),
|
|
92
96
|
EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterAnimating', () => [
|
|
@@ -95,11 +99,11 @@ export const update = (model, message) => {
|
|
|
95
99
|
]), M.when('LeaveAnimating', () => [
|
|
96
100
|
evo(model, { transitionState: () => 'Idle' }),
|
|
97
101
|
[
|
|
98
|
-
Task.closeModal(dialogSelector(model.id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(
|
|
102
|
+
CloseDialog(Task.closeModal(dialogSelector(model.id)).pipe(Effect.andThen(() => Task.unlockScroll), Effect.ignore, Effect.as(CompletedCloseDialog()))),
|
|
99
103
|
],
|
|
100
104
|
]), M.orElse(() => [model, []])),
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
CompletedShowDialog: () => [model, []],
|
|
106
|
+
CompletedCloseDialog: () => [model, []],
|
|
103
107
|
}));
|
|
104
108
|
};
|
|
105
109
|
// VIEW
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { init, update, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed,
|
|
1
|
+
export { init, update, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, AdvancedTransitionFrame, EndedTransition, } from './index';
|
|
2
2
|
export type { InitConfig, ViewConfig } from './index';
|
|
3
3
|
//# sourceMappingURL=public.d.ts.map
|
package/dist/ui/dialog/public.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { init, update, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed,
|
|
1
|
+
export { init, update, view, lazy, titleId, descriptionId, Model, Message, Opened, Closed, CompletedShowDialog, CompletedCloseDialog, AdvancedTransitionFrame, EndedTransition, } from './index';
|
|
@@ -12,16 +12,16 @@ export declare const Toggled: import("../../schema").CallableTaggedStruct<"Toggl
|
|
|
12
12
|
/** Sent to explicitly close the disclosure, regardless of its current state. */
|
|
13
13
|
export declare const Closed: import("../../schema").CallableTaggedStruct<"Closed", {}>;
|
|
14
14
|
/** Sent when the focus-button command completes after closing. */
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const CompletedFocusButton: import("../../schema").CallableTaggedStruct<"CompletedFocusButton", {}>;
|
|
16
16
|
/** Union of all messages the disclosure component can produce. */
|
|
17
17
|
export declare const Message: S.Union<[
|
|
18
18
|
typeof Toggled,
|
|
19
19
|
typeof Closed,
|
|
20
|
-
typeof
|
|
20
|
+
typeof CompletedFocusButton
|
|
21
21
|
]>;
|
|
22
22
|
export type Toggled = typeof Toggled.Type;
|
|
23
23
|
export type Closed = typeof Closed.Type;
|
|
24
|
-
export type
|
|
24
|
+
export type CompletedFocusButton = typeof CompletedFocusButton.Type;
|
|
25
25
|
export type Message = typeof Message.Type;
|
|
26
26
|
/** Configuration for creating a disclosure model with `init`. */
|
|
27
27
|
export type InitConfig = Readonly<{
|
|
@@ -35,7 +35,7 @@ export declare const update: (model: Model, message: Message) => [Model, Readonl
|
|
|
35
35
|
/** Configuration for rendering a disclosure with `view`. */
|
|
36
36
|
export type ViewConfig<Message> = Readonly<{
|
|
37
37
|
model: Model;
|
|
38
|
-
toMessage: (message: Toggled | Closed |
|
|
38
|
+
toMessage: (message: Toggled | Closed | CompletedFocusButton) => Message;
|
|
39
39
|
buttonClassName?: string;
|
|
40
40
|
buttonAttributes?: ReadonlyArray<Attribute<Message>>;
|
|
41
41
|
buttonContent: Html;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/disclosure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,eAA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,MAAM,GAAG,oBAAoB,KAAK,OAAO,CAAA;IACxE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACpD,aAAa,EAAE,IAAI,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACnD,YAAY,EAAE,IAAI,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC/C,CAAC,CAAA;AAEF,oGAAoG;AACpG,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,QAAQ,UAAU,CAAC,OAAO,CAAC,KAAG,IAgG3D,CAAA;AAED;6EAC6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAC7D,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,CAgBtE,CAAA"}
|
|
@@ -16,9 +16,9 @@ export const Toggled = m('Toggled');
|
|
|
16
16
|
/** Sent to explicitly close the disclosure, regardless of its current state. */
|
|
17
17
|
export const Closed = m('Closed');
|
|
18
18
|
/** Sent when the focus-button command completes after closing. */
|
|
19
|
-
export const
|
|
19
|
+
export const CompletedFocusButton = m('CompletedFocusButton');
|
|
20
20
|
/** Union of all messages the disclosure component can produce. */
|
|
21
|
-
export const Message = S.Union(Toggled, Closed,
|
|
21
|
+
export const Message = S.Union(Toggled, Closed, CompletedFocusButton);
|
|
22
22
|
/** Creates an initial disclosure model from a config. Defaults to closed. */
|
|
23
23
|
export const init = (config) => ({
|
|
24
24
|
id: config.id,
|
|
@@ -28,20 +28,21 @@ export const init = (config) => ({
|
|
|
28
28
|
const buttonId = (id) => `${id}-button`;
|
|
29
29
|
const buttonSelector = (id) => `#${CSS.escape(buttonId(id))}`;
|
|
30
30
|
const panelId = (id) => `${id}-panel`;
|
|
31
|
+
const FocusButton = Command.define('FocusButton');
|
|
31
32
|
/** Processes a disclosure message and returns the next model and commands. */
|
|
32
33
|
export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
|
|
33
34
|
Toggled: () => {
|
|
34
|
-
const maybeFocus = Option.liftPredicate(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
35
|
+
const maybeFocus = Option.liftPredicate(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))), () => model.isOpen);
|
|
35
36
|
return [
|
|
36
37
|
evo(model, { isOpen: () => !model.isOpen }),
|
|
37
38
|
Option.toArray(maybeFocus),
|
|
38
39
|
];
|
|
39
40
|
},
|
|
40
41
|
Closed: () => {
|
|
41
|
-
const maybeFocus = Option.liftPredicate(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
42
|
+
const maybeFocus = Option.liftPredicate(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))), () => model.isOpen);
|
|
42
43
|
return [evo(model, { isOpen: () => false }), Option.toArray(maybeFocus)];
|
|
43
44
|
},
|
|
44
|
-
|
|
45
|
+
CompletedFocusButton: () => [model, []],
|
|
45
46
|
}));
|
|
46
47
|
/** Renders a headless disclosure component with accessible ARIA attributes and keyboard support. */
|
|
47
48
|
export const view = (config) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { init, update, view, lazy, Model, Message } from './index';
|
|
2
|
-
export type { Toggled, Closed,
|
|
2
|
+
export type { Toggled, Closed, CompletedFocusButton, InitConfig, ViewConfig, } from './index';
|
|
3
3
|
//# sourceMappingURL=public.d.ts.map
|