@destyler/combobox 0.0.7-beta.5 → 0.0.7-beta.9

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/index.d.ts CHANGED
@@ -1,419 +1,428 @@
1
- import * as _zag_js_anatomy from '@zag-js/anatomy';
2
- import { CollectionItem, CollectionOptions, ListCollection } from '@zag-js/collection';
3
- export { CollectionItem, CollectionOptions } from '@zag-js/collection';
4
- import { DirectionProperty, CommonProperties, PropTypes, RequiredBy, NormalizeProps } from '@zag-js/types';
5
- import * as _zag_js_core from '@zag-js/core';
6
- import { StateMachine, Machine } from '@zag-js/core';
7
- import { InteractOutsideHandlers } from '@zag-js/dismissable';
8
- export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from '@zag-js/dismissable';
9
- import { PositioningOptions, Placement } from '@zag-js/popper';
10
- export { Placement, PositioningOptions } from '@zag-js/popper';
1
+ import * as _destyler_anatomy0 from "@destyler/anatomy";
2
+ import { CollectionItem, CollectionItem as CollectionItem$1, CollectionOptions, CollectionOptions as CollectionOptions$1, ListCollection } from "@destyler/collection";
3
+ import * as _destyler_xstate0 from "@destyler/xstate";
4
+ import { AnyEventObject, Machine, XSend, XState } from "@destyler/xstate";
5
+ import { Placement, PositioningOptions } from "@destyler/popper";
6
+ import { FocusOutsideEvent, InteractOutsideEvent, InteractOutsideHandlers, PointerDownOutsideEvent } from "@destyler/dismissable";
7
+ import { CommonProperties, DirectionProperty, NormalizeProps, PropTypes, RequiredBy } from "@destyler/types";
11
8
 
12
- declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "clearTrigger" | "content" | "control" | "input" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "label" | "list" | "positioner" | "trigger">;
13
-
14
- declare function collection<T extends CollectionItem>(options: CollectionOptions<T>): ListCollection<T>;
9
+ //#region src/anatomy.d.ts
10
+ declare const anatomy: _destyler_anatomy0.AnatomyInstance<"root" | "clearTrigger" | "content" | "control" | "input" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "label" | "list" | "positioner" | "trigger">;
11
+ //#endregion
12
+ //#region src/collection.d.ts
13
+ declare function collection<T extends CollectionItem$1>(options: CollectionOptions$1<T>): ListCollection<T>;
15
14
  declare namespace collection {
16
- var empty: () => ListCollection<CollectionItem>;
15
+ var empty: () => ListCollection<CollectionItem$1>;
17
16
  }
18
-
17
+ //#endregion
18
+ //#region src/types.d.ts
19
19
  interface ValueChangeDetails<T extends CollectionItem = CollectionItem> {
20
- value: string[];
21
- items: T[];
20
+ value: string[];
21
+ items: T[];
22
22
  }
23
23
  interface HighlightChangeDetails<T extends CollectionItem = CollectionItem> {
24
- highlightedValue: string | null;
25
- highlightedItem: T | null;
24
+ highlightedValue: string | null;
25
+ highlightedItem: T | null;
26
26
  }
27
27
  interface InputValueChangeDetails {
28
- inputValue: string;
28
+ inputValue: string;
29
29
  }
30
30
  interface OpenChangeDetails {
31
- open: boolean;
31
+ open: boolean;
32
32
  }
33
33
  interface ScrollToIndexDetails {
34
- index: number;
35
- immediate?: boolean | undefined;
34
+ index: number;
35
+ immediate?: boolean | undefined;
36
+ }
37
+ interface NavigateDetails {
38
+ value: string | null;
39
+ node: HTMLAnchorElement;
36
40
  }
37
41
  interface IntlTranslations {
38
- triggerLabel?: string | undefined;
39
- clearTriggerLabel?: string | undefined;
42
+ triggerLabel?: string | undefined;
43
+ clearTriggerLabel?: string | undefined;
40
44
  }
41
45
  type ElementIds = Partial<{
42
- root: string;
43
- label: string;
44
- control: string;
45
- input: string;
46
- content: string;
47
- trigger: string;
48
- clearTrigger: string;
49
- item: (id: string, index?: number) => string;
50
- positioner: string;
51
- itemGroup: (id: string | number) => string;
52
- itemGroupLabel: (id: string | number) => string;
46
+ root: string;
47
+ label: string;
48
+ control: string;
49
+ input: string;
50
+ content: string;
51
+ trigger: string;
52
+ clearTrigger: string;
53
+ item: (id: string, index?: number) => string;
54
+ positioner: string;
55
+ itemGroup: (id: string | number) => string;
56
+ itemGroupLabel: (id: string | number) => string;
53
57
  }>;
54
58
  interface PublicContext<T extends CollectionItem = CollectionItem> extends DirectionProperty, CommonProperties, InteractOutsideHandlers {
55
- /**
56
- * Whether the combobox is open
57
- */
58
- 'open'?: boolean | undefined;
59
- /**
60
- * Whether the combobox open state is controlled by the user
61
- */
62
- 'open.controlled'?: boolean | undefined;
63
- /**
64
- * The ids of the elements in the combobox. Useful for composition.
65
- */
66
- 'ids'?: ElementIds | undefined;
67
- /**
68
- * The current value of the combobox's input
69
- */
70
- 'inputValue': string;
71
- /**
72
- * The `name` attribute of the combobox's input. Useful for form submission
73
- */
74
- 'name'?: string | undefined;
75
- /**
76
- * The associate form of the combobox.
77
- */
78
- 'form'?: string | undefined;
79
- /**
80
- * Whether the combobox is disabled
81
- */
82
- 'disabled'?: boolean | undefined;
83
- /**
84
- * Whether the combobox is readonly. This puts the combobox in a "non-editable" mode
85
- * but the user can still interact with it
86
- */
87
- 'readOnly'?: boolean | undefined;
88
- /**
89
- * Whether the combobox is invalid
90
- */
91
- 'invalid'?: boolean | undefined;
92
- /**
93
- * Whether the combobox is required
94
- */
95
- 'required'?: boolean | undefined;
96
- /**
97
- * The placeholder text of the combobox's input
98
- */
99
- 'placeholder'?: string | undefined;
100
- /**
101
- * The active item's id. Used to set the `aria-activedescendant` attribute
102
- */
103
- 'highlightedValue': string | null;
104
- /**
105
- * The keys of the selected items
106
- */
107
- 'value': string[];
108
- /**
109
- * Defines the auto-completion behavior of the combobox.
110
- *
111
- * - `autohighlight`: The first focused item is highlighted as the user types
112
- * - `autocomplete`: Navigating the listbox with the arrow keys selects the item and the input is updated
113
- *
114
- * @default "none"
115
- */
116
- 'inputBehavior': 'autohighlight' | 'autocomplete' | 'none';
117
- /**
118
- * The behavior of the combobox input when an item is selected
119
- *
120
- * - `replace`: The selected item string is set as the input value
121
- * - `clear`: The input value is cleared
122
- * - `preserve`: The input value is preserved
123
- *
124
- * @default "replace"
125
- */
126
- 'selectionBehavior': 'clear' | 'replace' | 'preserve';
127
- /**
128
- * Whether to autofocus the input on mount
129
- */
130
- 'autoFocus'?: boolean | undefined;
131
- /**
132
- * Whether to open the combobox popup on initial click on the input
133
- * @default false
134
- */
135
- 'openOnClick'?: boolean | undefined;
136
- /**
137
- * Whether to show the combobox when the input value changes
138
- * @default true
139
- */
140
- 'openOnChange'?: boolean | ((details: InputValueChangeDetails) => boolean) | undefined;
141
- /**
142
- * Whether to allow typing custom values in the input
143
- */
144
- 'allowCustomValue'?: boolean | undefined;
145
- /**
146
- * Whether to loop the keyboard navigation through the items
147
- * @default true
148
- */
149
- 'loopFocus'?: boolean | undefined;
150
- /**
151
- * The positioning options to dynamically position the menu
152
- */
153
- 'positioning': PositioningOptions;
154
- /**
155
- * Function called when the input's value changes
156
- */
157
- 'onInputValueChange'?: ((details: InputValueChangeDetails) => void) | undefined;
158
- /**
159
- * Function called when a new item is selected
160
- */
161
- 'onValueChange'?: ((details: ValueChangeDetails<T>) => void) | undefined;
162
- /**
163
- * Function called when an item is highlighted using the pointer
164
- * or keyboard navigation.
165
- */
166
- 'onHighlightChange'?: ((details: HighlightChangeDetails<T>) => void) | undefined;
167
- /**
168
- * Function called when the popup is opened
169
- */
170
- 'onOpenChange'?: ((details: OpenChangeDetails) => void) | undefined;
171
- /**
172
- * Specifies the localized strings that identifies the accessibility elements and their states
173
- */
174
- 'translations': IntlTranslations;
175
- /**
176
- * The collection of items
177
- */
178
- 'collection': ListCollection<any>;
179
- /**
180
- * Whether to allow multiple selection.
181
- *
182
- * **Good to know:** When `multiple` is `true`, the `selectionBehavior` is automatically set to `clear`.
183
- * It is recommended to render the selected items in a separate container.
184
- */
185
- 'multiple'?: boolean | undefined;
186
- /**
187
- * Whether to close the combobox when an item is selected.
188
- */
189
- 'closeOnSelect'?: boolean | undefined;
190
- /**
191
- * Whether to open the combobox on arrow key press
192
- * @default true
193
- */
194
- 'openOnKeyPress': boolean;
195
- /**
196
- * Function to scroll to a specific index
197
- */
198
- 'scrollToIndexFn'?: ((details: ScrollToIndexDetails) => void) | undefined;
199
- /**
200
- * Whether the combobox is a composed with other composite widgets like tabs
201
- * @default true
202
- */
203
- 'composite': boolean;
204
- /**
205
- * Whether to disable registering this a dismissable layer
206
- */
207
- 'disableLayer'?: boolean | undefined;
59
+ /**
60
+ * Whether the combobox is open
61
+ */
62
+ 'open'?: boolean | undefined;
63
+ /**
64
+ * Whether the combobox open state is controlled by the user
65
+ */
66
+ 'open.controlled'?: boolean | undefined;
67
+ /**
68
+ * The ids of the elements in the combobox. Useful for composition.
69
+ */
70
+ 'ids'?: ElementIds | undefined;
71
+ /**
72
+ * The current value of the combobox's input
73
+ */
74
+ 'inputValue': string;
75
+ /**
76
+ * The `name` attribute of the combobox's input. Useful for form submission
77
+ */
78
+ 'name'?: string | undefined;
79
+ /**
80
+ * The associate form of the combobox.
81
+ */
82
+ 'form'?: string | undefined;
83
+ /**
84
+ * Whether the combobox is disabled
85
+ */
86
+ 'disabled'?: boolean | undefined;
87
+ /**
88
+ * Whether the combobox is readonly. This puts the combobox in a "non-editable" mode
89
+ * but the user can still interact with it
90
+ */
91
+ 'readOnly'?: boolean | undefined;
92
+ /**
93
+ * Whether the combobox is invalid
94
+ */
95
+ 'invalid'?: boolean | undefined;
96
+ /**
97
+ * Whether the combobox is required
98
+ */
99
+ 'required'?: boolean | undefined;
100
+ /**
101
+ * The placeholder text of the combobox's input
102
+ */
103
+ 'placeholder'?: string | undefined;
104
+ /**
105
+ * The active item's id. Used to set the `aria-activedescendant` attribute
106
+ */
107
+ 'highlightedValue': string | null;
108
+ /**
109
+ * The keys of the selected items
110
+ */
111
+ 'value': string[];
112
+ /**
113
+ * Defines the auto-completion behavior of the combobox.
114
+ *
115
+ * - `autohighlight`: The first focused item is highlighted as the user types
116
+ * - `autocomplete`: Navigating the listbox with the arrow keys selects the item and the input is updated
117
+ *
118
+ * @default "none"
119
+ */
120
+ 'inputBehavior': 'autohighlight' | 'autocomplete' | 'none';
121
+ /**
122
+ * The behavior of the combobox input when an item is selected
123
+ *
124
+ * - `replace`: The selected item string is set as the input value
125
+ * - `clear`: The input value is cleared
126
+ * - `preserve`: The input value is preserved
127
+ *
128
+ * @default "replace"
129
+ */
130
+ 'selectionBehavior': 'clear' | 'replace' | 'preserve';
131
+ /**
132
+ * Whether to autofocus the input on mount
133
+ */
134
+ 'autoFocus'?: boolean | undefined;
135
+ /**
136
+ * Whether to open the combobox popup on initial click on the input
137
+ * @default false
138
+ */
139
+ 'openOnClick'?: boolean | undefined;
140
+ /**
141
+ * Whether to show the combobox when the input value changes
142
+ * @default true
143
+ */
144
+ 'openOnChange'?: boolean | ((details: InputValueChangeDetails) => boolean) | undefined;
145
+ /**
146
+ * Whether to allow typing custom values in the input
147
+ */
148
+ 'allowCustomValue'?: boolean | undefined;
149
+ /**
150
+ * Whether to loop the keyboard navigation through the items
151
+ * @default true
152
+ */
153
+ 'loopFocus'?: boolean | undefined;
154
+ /**
155
+ * The positioning options to dynamically position the menu
156
+ */
157
+ 'positioning': PositioningOptions;
158
+ /**
159
+ * Function called when the input's value changes
160
+ */
161
+ 'onInputValueChange'?: ((details: InputValueChangeDetails) => void) | undefined;
162
+ /**
163
+ * Function called when a new item is selected
164
+ */
165
+ 'onValueChange'?: ((details: ValueChangeDetails<T>) => void) | undefined;
166
+ /**
167
+ * Function called when an item is highlighted using the pointer
168
+ * or keyboard navigation.
169
+ */
170
+ 'onHighlightChange'?: ((details: HighlightChangeDetails<T>) => void) | undefined;
171
+ /**
172
+ * Function called when the popup is opened
173
+ */
174
+ 'onOpenChange'?: ((details: OpenChangeDetails) => void) | undefined;
175
+ /**
176
+ * Specifies the localized strings that identifies the accessibility elements and their states
177
+ */
178
+ 'translations': IntlTranslations;
179
+ /**
180
+ * The collection of items
181
+ */
182
+ 'collection': ListCollection<any>;
183
+ /**
184
+ * Whether to allow multiple selection.
185
+ *
186
+ * **Good to know:** When `multiple` is `true`, the `selectionBehavior` is automatically set to `clear`.
187
+ * It is recommended to render the selected items in a separate container.
188
+ */
189
+ 'multiple'?: boolean | undefined;
190
+ /**
191
+ * Whether to close the combobox when an item is selected.
192
+ */
193
+ 'closeOnSelect'?: boolean | undefined;
194
+ /**
195
+ * Whether to open the combobox on arrow key press
196
+ * @default true
197
+ */
198
+ 'openOnKeyPress': boolean;
199
+ /**
200
+ * Function to scroll to a specific index
201
+ */
202
+ 'scrollToIndexFn'?: ((details: ScrollToIndexDetails) => void) | undefined;
203
+ /**
204
+ * Whether the combobox is a composed with other composite widgets like tabs
205
+ * @default true
206
+ */
207
+ 'composite': boolean;
208
+ /**
209
+ * Whether to disable registering this a dismissable layer
210
+ */
211
+ 'disableLayer'?: boolean | undefined;
212
+ /**
213
+ * Function to navigate to the selected item
214
+ */
215
+ 'navigate': (details: NavigateDetails) => void;
208
216
  }
209
217
  type UserDefinedContext<T extends CollectionItem = CollectionItem> = RequiredBy<PublicContext<T>, 'id' | 'collection'>;
210
218
  type ComputedContext = Readonly<{
211
- /**
212
- * @computed
213
- * Whether the input's value is empty
214
- */
215
- isInputValueEmpty: boolean;
216
- /**
217
- * @computed
218
- * Whether the combobox is interactive
219
- */
220
- isInteractive: boolean;
221
- /**
222
- * @computed
223
- */
224
- autoComplete: boolean;
225
- /**
226
- * @computed
227
- */
228
- autoHighlight: boolean;
229
- /**
230
- * @computed
231
- * Whether there's a selected option
232
- */
233
- hasSelectedItems: boolean;
219
+ /**
220
+ * @computed
221
+ * Whether the input's value is empty
222
+ */
223
+ isInputValueEmpty: boolean;
224
+ /**
225
+ * @computed
226
+ * Whether the combobox is interactive
227
+ */
228
+ isInteractive: boolean;
229
+ /**
230
+ * @computed
231
+ */
232
+ autoComplete: boolean;
233
+ /**
234
+ * @computed
235
+ */
236
+ autoHighlight: boolean;
237
+ /**
238
+ * @computed
239
+ * Whether there's a selected option
240
+ */
241
+ hasSelectedItems: boolean;
234
242
  }>;
235
243
  interface PrivateContext<T extends CollectionItem = CollectionItem> {
236
- /**
237
- * @internal
238
- * The placement of the combobox popover.
239
- */
240
- currentPlacement?: Placement | undefined;
241
- /**
242
- * The highlighted item
243
- */
244
- highlightedItem: T | null;
245
- /**
246
- * @internal
247
- * The selected items
248
- */
249
- selectedItems: T[];
250
- /**
251
- * @internal
252
- * The display value of the combobox (based on the selected items)
253
- */
254
- valueAsString: string;
255
- }
256
- interface MachineContext extends PublicContext, PrivateContext, ComputedContext {
244
+ /**
245
+ * @internal
246
+ * The placement of the combobox popover.
247
+ */
248
+ currentPlacement?: Placement | undefined;
249
+ /**
250
+ * The highlighted item
251
+ */
252
+ highlightedItem: T | null;
253
+ /**
254
+ * @internal
255
+ * The selected items
256
+ */
257
+ selectedItems: T[];
258
+ /**
259
+ * @internal
260
+ * The display value of the combobox (based on the selected items)
261
+ */
262
+ valueAsString: string;
257
263
  }
264
+ interface MachineContext extends PublicContext, PrivateContext, ComputedContext {}
258
265
  interface MachineState {
259
- value: 'idle' | 'focused' | 'suggesting' | 'interacting';
260
- tags: 'open' | 'focused' | 'idle' | 'closed';
266
+ value: 'idle' | 'focused' | 'suggesting' | 'interacting';
267
+ tags: 'open' | 'focused' | 'idle' | 'closed';
261
268
  }
262
- type State = StateMachine.State<MachineContext, MachineState>;
263
- type Send = StateMachine.Send<StateMachine.AnyEventObject>;
264
- type Service = Machine<MachineContext, MachineState, StateMachine.AnyEventObject>;
269
+ type State = XState<MachineContext, MachineState>;
270
+ type Send = XSend<AnyEventObject>;
271
+ type Service = Machine<MachineContext, MachineState, AnyEventObject>;
265
272
  interface TriggerProps {
266
- /**
267
- * Whether the trigger is focusable
268
- */
269
- focusable?: boolean | undefined;
273
+ /**
274
+ * Whether the trigger is focusable
275
+ */
276
+ focusable?: boolean | undefined;
270
277
  }
271
278
  interface ItemProps {
272
- /**
273
- * Whether hovering outside should clear the highlighted state
274
- */
275
- persistFocus?: boolean | undefined;
276
- /**
277
- * The item to render
278
- */
279
- item: CollectionItem;
279
+ /**
280
+ * Whether hovering outside should clear the highlighted state
281
+ */
282
+ persistFocus?: boolean | undefined;
283
+ /**
284
+ * The item to render
285
+ */
286
+ item: CollectionItem;
280
287
  }
281
288
  interface ItemState {
282
- /**
283
- * The value of the item
284
- */
285
- value: string;
286
- /**
287
- * Whether the item is disabled
288
- */
289
- disabled: boolean;
290
- /**
291
- * Whether the item is selected
292
- */
293
- selected: boolean;
294
- /**
295
- * Whether the item is highlighted via pointer or keyboard navigation
296
- */
297
- highlighted: boolean;
289
+ /**
290
+ * The value of the item
291
+ */
292
+ value: string;
293
+ /**
294
+ * Whether the item is disabled
295
+ */
296
+ disabled: boolean;
297
+ /**
298
+ * Whether the item is selected
299
+ */
300
+ selected: boolean;
301
+ /**
302
+ * Whether the item is highlighted via pointer or keyboard navigation
303
+ */
304
+ highlighted: boolean;
298
305
  }
299
306
  interface ItemGroupProps {
300
- id: string;
307
+ id: string;
301
308
  }
302
309
  interface ItemGroupLabelProps {
303
- htmlFor: string;
310
+ htmlFor: string;
304
311
  }
305
312
  interface MachineApi<T extends PropTypes = PropTypes, V extends CollectionItem = CollectionItem> {
306
- /**
307
- * Whether the combobox is focused
308
- */
309
- focused: boolean;
310
- /**
311
- * Whether the combobox is open
312
- */
313
- open: boolean;
314
- /**
315
- * The value of the combobox input
316
- */
317
- inputValue: string;
318
- /**
319
- * The value of the highlighted item
320
- */
321
- highlightedValue: string | null;
322
- /**
323
- * The highlighted item
324
- */
325
- highlightedItem: V | null;
326
- /**
327
- * The value of the combobox input
328
- */
329
- setHighlightValue: (value: string) => void;
330
- /**
331
- * Function to sync the selected items with the value.
332
- * Useful when `value` is updated from async sources.
333
- */
334
- syncSelectedItems: () => void;
335
- /**
336
- * The selected items
337
- */
338
- selectedItems: V[];
339
- /**
340
- * Whether there's a selected item
341
- */
342
- hasSelectedItems: boolean;
343
- /**
344
- * The selected item keys
345
- */
346
- value: string[];
347
- /**
348
- * The string representation of the selected items
349
- */
350
- valueAsString: string;
351
- /**
352
- * Function to select a value
353
- */
354
- selectValue: (value: string) => void;
355
- /**
356
- * Function to set the value of the combobox
357
- */
358
- setValue: (value: string[]) => void;
359
- /**
360
- * Function to clear the value of the combobox
361
- */
362
- clearValue: (value?: string) => void;
363
- /**
364
- * Function to focus on the combobox input
365
- */
366
- focus: () => void;
367
- /**
368
- * Function to set the input value of the combobox
369
- */
370
- setInputValue: (value: string) => void;
371
- /**
372
- * Returns the state of a combobox item
373
- */
374
- getItemState: (props: ItemProps) => ItemState;
375
- /**
376
- * Function to open or close the combobox
377
- */
378
- setOpen: (open: boolean) => void;
379
- /**
380
- * Function to toggle the combobox
381
- */
382
- collection: ListCollection<V>;
383
- /**
384
- * Function to set the collection of items
385
- */
386
- setCollection: (collection: ListCollection<V>) => void;
387
- /**
388
- * Function to set the positioning options
389
- */
390
- reposition: (options?: Partial<PositioningOptions>) => void;
391
- /**
392
- * Whether the combobox allows multiple selections
393
- */
394
- multiple: boolean;
395
- /**
396
- * Whether the combobox is disabled
397
- */
398
- disabled: boolean;
399
- getRootProps: () => T['element'];
400
- getLabelProps: () => T['label'];
401
- getControlProps: () => T['element'];
402
- getPositionerProps: () => T['element'];
403
- getInputProps: () => T['input'];
404
- getContentProps: () => T['element'];
405
- getTriggerProps: (props?: TriggerProps) => T['button'];
406
- getClearTriggerProps: () => T['button'];
407
- getListProps: () => T['element'];
408
- getItemProps: (props: ItemProps) => T['element'];
409
- getItemTextProps: (props: ItemProps) => T['element'];
410
- getItemIndicatorProps: (props: ItemProps) => T['element'];
411
- getItemGroupProps: (props: ItemGroupProps) => T['element'];
412
- getItemGroupLabelProps: (props: ItemGroupLabelProps) => T['element'];
313
+ /**
314
+ * Whether the combobox is focused
315
+ */
316
+ focused: boolean;
317
+ /**
318
+ * Whether the combobox is open
319
+ */
320
+ open: boolean;
321
+ /**
322
+ * The value of the combobox input
323
+ */
324
+ inputValue: string;
325
+ /**
326
+ * The value of the highlighted item
327
+ */
328
+ highlightedValue: string | null;
329
+ /**
330
+ * The highlighted item
331
+ */
332
+ highlightedItem: V | null;
333
+ /**
334
+ * The value of the combobox input
335
+ */
336
+ setHighlightValue: (value: string) => void;
337
+ /**
338
+ * Function to sync the selected items with the value.
339
+ * Useful when `value` is updated from async sources.
340
+ */
341
+ syncSelectedItems: () => void;
342
+ /**
343
+ * The selected items
344
+ */
345
+ selectedItems: V[];
346
+ /**
347
+ * Whether there's a selected item
348
+ */
349
+ hasSelectedItems: boolean;
350
+ /**
351
+ * The selected item keys
352
+ */
353
+ value: string[];
354
+ /**
355
+ * The string representation of the selected items
356
+ */
357
+ valueAsString: string;
358
+ /**
359
+ * Function to select a value
360
+ */
361
+ selectValue: (value: string) => void;
362
+ /**
363
+ * Function to set the value of the combobox
364
+ */
365
+ setValue: (value: string[]) => void;
366
+ /**
367
+ * Function to clear the value of the combobox
368
+ */
369
+ clearValue: (value?: string) => void;
370
+ /**
371
+ * Function to focus on the combobox input
372
+ */
373
+ focus: () => void;
374
+ /**
375
+ * Function to set the input value of the combobox
376
+ */
377
+ setInputValue: (value: string) => void;
378
+ /**
379
+ * Returns the state of a combobox item
380
+ */
381
+ getItemState: (props: ItemProps) => ItemState;
382
+ /**
383
+ * Function to open or close the combobox
384
+ */
385
+ setOpen: (open: boolean) => void;
386
+ /**
387
+ * Function to toggle the combobox
388
+ */
389
+ collection: ListCollection<V>;
390
+ /**
391
+ * Function to set the collection of items
392
+ */
393
+ setCollection: (collection: ListCollection<V>) => void;
394
+ /**
395
+ * Function to set the positioning options
396
+ */
397
+ reposition: (options?: Partial<PositioningOptions>) => void;
398
+ /**
399
+ * Whether the combobox allows multiple selections
400
+ */
401
+ multiple: boolean;
402
+ /**
403
+ * Whether the combobox is disabled
404
+ */
405
+ disabled: boolean;
406
+ getRootProps: () => T['element'];
407
+ getLabelProps: () => T['label'];
408
+ getControlProps: () => T['element'];
409
+ getPositionerProps: () => T['element'];
410
+ getInputProps: () => T['input'];
411
+ getContentProps: () => T['element'];
412
+ getTriggerProps: (props?: TriggerProps) => T['button'];
413
+ getClearTriggerProps: () => T['button'];
414
+ getListProps: () => T['element'];
415
+ getItemProps: (props: ItemProps) => T['element'];
416
+ getItemTextProps: (props: ItemProps) => T['element'];
417
+ getItemIndicatorProps: (props: ItemProps) => T['element'];
418
+ getItemGroupProps: (props: ItemGroupProps) => T['element'];
419
+ getItemGroupLabelProps: (props: ItemGroupLabelProps) => T['element'];
413
420
  }
414
-
421
+ //#endregion
422
+ //#region src/connect.d.ts
415
423
  declare function connect<T extends PropTypes, V extends CollectionItem>(state: State, send: Send, normalize: NormalizeProps<T>): MachineApi<T, V>;
416
-
417
- declare function machine<T extends CollectionItem>(userContext: UserDefinedContext<T>): _zag_js_core.Machine<MachineContext, MachineState, _zag_js_core.StateMachine.AnyEventObject>;
418
-
419
- export { type MachineApi as Api, type UserDefinedContext as Context, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type OpenChangeDetails, type ScrollToIndexDetails, type Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, machine };
424
+ //#endregion
425
+ //#region src/machine.d.ts
426
+ declare function machine<T extends CollectionItem>(userContext: UserDefinedContext<T>): _destyler_xstate0.Machine<MachineContext, MachineState, _destyler_xstate0.AnyEventObject>;
427
+ //#endregion
428
+ export { type MachineApi as Api, type CollectionItem, type CollectionOptions, type UserDefinedContext as Context, type ElementIds, type FocusOutsideEvent, type HighlightChangeDetails, type InputValueChangeDetails, type InteractOutsideEvent, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type OpenChangeDetails, type Placement, type PointerDownOutsideEvent, type PositioningOptions, type ScrollToIndexDetails, type Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, machine };