@zag-js/combobox 0.74.1 → 0.75.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/index.d.mts CHANGED
@@ -37,11 +37,11 @@ interface SelectionValueDetails<T extends CollectionItem = CollectionItem> {
37
37
  }
38
38
  interface ScrollToIndexDetails {
39
39
  index: number;
40
- immediate?: boolean;
40
+ immediate?: boolean | undefined;
41
41
  }
42
42
  interface IntlTranslations {
43
- triggerLabel?: string;
44
- clearTriggerLabel?: string;
43
+ triggerLabel?: string | undefined;
44
+ clearTriggerLabel?: string | undefined;
45
45
  }
46
46
  type ElementIds = Partial<{
47
47
  root: string;
@@ -60,15 +60,15 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
60
60
  /**
61
61
  * Whether the combobox is open
62
62
  */
63
- open?: boolean;
63
+ open?: boolean | undefined;
64
64
  /**
65
65
  * Whether the combobox open state is controlled by the user
66
66
  */
67
- "open.controlled"?: boolean;
67
+ "open.controlled"?: boolean | undefined;
68
68
  /**
69
69
  * The ids of the elements in the combobox. Useful for composition.
70
70
  */
71
- ids?: ElementIds;
71
+ ids?: ElementIds | undefined;
72
72
  /**
73
73
  * The current value of the combobox's input
74
74
  */
@@ -76,32 +76,32 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
76
76
  /**
77
77
  * The `name` attribute of the combobox's input. Useful for form submission
78
78
  */
79
- name?: string;
79
+ name?: string | undefined;
80
80
  /**
81
81
  * The associate form of the combobox.
82
82
  */
83
- form?: string;
83
+ form?: string | undefined;
84
84
  /**
85
85
  * Whether the combobox is disabled
86
86
  */
87
- disabled?: boolean;
87
+ disabled?: boolean | undefined;
88
88
  /**
89
89
  * Whether the combobox is readonly. This puts the combobox in a "non-editable" mode
90
90
  * but the user can still interact with it
91
91
  */
92
- readOnly?: boolean;
92
+ readOnly?: boolean | undefined;
93
93
  /**
94
94
  * Whether the combobox is invalid
95
95
  */
96
- invalid?: boolean;
96
+ invalid?: boolean | undefined;
97
97
  /**
98
98
  * Whether the combobox is required
99
99
  */
100
- required?: boolean;
100
+ required?: boolean | undefined;
101
101
  /**
102
102
  * The placeholder text of the combobox's input
103
103
  */
104
- placeholder?: string;
104
+ placeholder?: string | undefined;
105
105
  /**
106
106
  * The active item's id. Used to set the `aria-activedescendant` attribute
107
107
  */
@@ -132,26 +132,26 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
132
132
  /**
133
133
  * Whether to autofocus the input on mount
134
134
  */
135
- autoFocus?: boolean;
135
+ autoFocus?: boolean | undefined;
136
136
  /**
137
137
  * Whether to open the combobox popup on initial click on the input
138
138
  * @default false
139
139
  */
140
- openOnClick?: boolean;
140
+ openOnClick?: boolean | undefined;
141
141
  /**
142
142
  * Whether to show the combobox when the input value changes
143
143
  * @default true
144
144
  */
145
- openOnChange?: boolean | ((details: InputValueChangeDetails) => boolean);
145
+ openOnChange?: boolean | ((details: InputValueChangeDetails) => boolean) | undefined;
146
146
  /**
147
147
  * Whether to allow typing custom values in the input
148
148
  */
149
- allowCustomValue?: boolean;
149
+ allowCustomValue?: boolean | undefined;
150
150
  /**
151
151
  * Whether to loop the keyboard navigation through the items
152
152
  * @default true
153
153
  */
154
- loopFocus?: boolean;
154
+ loopFocus?: boolean | undefined;
155
155
  /**
156
156
  * The positioning options to dynamically position the menu
157
157
  */
@@ -159,20 +159,20 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
159
159
  /**
160
160
  * Function called when the input's value changes
161
161
  */
162
- onInputValueChange?: (details: InputValueChangeDetails) => void;
162
+ onInputValueChange?: ((details: InputValueChangeDetails) => void) | undefined;
163
163
  /**
164
164
  * Function called when a new item is selected
165
165
  */
166
- onValueChange?: (details: ValueChangeDetails<T>) => void;
166
+ onValueChange?: ((details: ValueChangeDetails<T>) => void) | undefined;
167
167
  /**
168
168
  * Function called when an item is highlighted using the pointer
169
169
  * or keyboard navigation.
170
170
  */
171
- onHighlightChange?: (details: HighlightChangeDetails<T>) => void;
171
+ onHighlightChange?: ((details: HighlightChangeDetails<T>) => void) | undefined;
172
172
  /**
173
173
  * Function called when the popup is opened
174
174
  */
175
- onOpenChange?: (details: OpenChangeDetails) => void;
175
+ onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
176
176
  /**
177
177
  * Specifies the localized strings that identifies the accessibility elements and their states
178
178
  */
@@ -187,15 +187,15 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
187
187
  * **Good to know:** When `multiple` is `true`, the `selectionBehavior` is automatically set to `clear`.
188
188
  * It is recommended to render the selected items in a separate container.
189
189
  */
190
- multiple?: boolean;
190
+ multiple?: boolean | undefined;
191
191
  /**
192
192
  * Whether to close the combobox when an item is selected.
193
193
  */
194
- closeOnSelect?: boolean;
194
+ closeOnSelect?: boolean | undefined;
195
195
  /**
196
196
  * Function to get the display value of the selected item
197
197
  */
198
- getSelectionValue?: (details: SelectionValueDetails<T>) => string;
198
+ getSelectionValue?: ((details: SelectionValueDetails<T>) => string) | undefined;
199
199
  /**
200
200
  * Whether to open the combobox on arrow key press
201
201
  * @default true
@@ -204,7 +204,7 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
204
204
  /**
205
205
  * Function to scroll to a specific index
206
206
  */
207
- scrollToIndexFn?: (details: ScrollToIndexDetails) => void;
207
+ scrollToIndexFn?: ((details: ScrollToIndexDetails) => void) | undefined;
208
208
  /**
209
209
  * Whether the combobox is a composed with other composite widgets like tabs
210
210
  * @default true
@@ -213,7 +213,7 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
213
213
  /**
214
214
  * Whether to disable registering this a dismissable layer
215
215
  */
216
- disableLayer?: boolean;
216
+ disableLayer?: boolean | undefined;
217
217
  }
218
218
  type UserDefinedContext<T extends CollectionItem = CollectionItem> = RequiredBy<PublicContext<T>, "id" | "collection">;
219
219
  type ComputedContext = Readonly<{
@@ -270,13 +270,13 @@ interface TriggerProps {
270
270
  /**
271
271
  * Whether the trigger is focusable
272
272
  */
273
- focusable?: boolean;
273
+ focusable?: boolean | undefined;
274
274
  }
275
275
  interface ItemProps {
276
276
  /**
277
277
  * Whether hovering outside should clear the highlighted state
278
278
  */
279
- persistFocus?: boolean;
279
+ persistFocus?: boolean | undefined;
280
280
  /**
281
281
  * The item to render
282
282
  */
package/dist/index.d.ts CHANGED
@@ -37,11 +37,11 @@ interface SelectionValueDetails<T extends CollectionItem = CollectionItem> {
37
37
  }
38
38
  interface ScrollToIndexDetails {
39
39
  index: number;
40
- immediate?: boolean;
40
+ immediate?: boolean | undefined;
41
41
  }
42
42
  interface IntlTranslations {
43
- triggerLabel?: string;
44
- clearTriggerLabel?: string;
43
+ triggerLabel?: string | undefined;
44
+ clearTriggerLabel?: string | undefined;
45
45
  }
46
46
  type ElementIds = Partial<{
47
47
  root: string;
@@ -60,15 +60,15 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
60
60
  /**
61
61
  * Whether the combobox is open
62
62
  */
63
- open?: boolean;
63
+ open?: boolean | undefined;
64
64
  /**
65
65
  * Whether the combobox open state is controlled by the user
66
66
  */
67
- "open.controlled"?: boolean;
67
+ "open.controlled"?: boolean | undefined;
68
68
  /**
69
69
  * The ids of the elements in the combobox. Useful for composition.
70
70
  */
71
- ids?: ElementIds;
71
+ ids?: ElementIds | undefined;
72
72
  /**
73
73
  * The current value of the combobox's input
74
74
  */
@@ -76,32 +76,32 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
76
76
  /**
77
77
  * The `name` attribute of the combobox's input. Useful for form submission
78
78
  */
79
- name?: string;
79
+ name?: string | undefined;
80
80
  /**
81
81
  * The associate form of the combobox.
82
82
  */
83
- form?: string;
83
+ form?: string | undefined;
84
84
  /**
85
85
  * Whether the combobox is disabled
86
86
  */
87
- disabled?: boolean;
87
+ disabled?: boolean | undefined;
88
88
  /**
89
89
  * Whether the combobox is readonly. This puts the combobox in a "non-editable" mode
90
90
  * but the user can still interact with it
91
91
  */
92
- readOnly?: boolean;
92
+ readOnly?: boolean | undefined;
93
93
  /**
94
94
  * Whether the combobox is invalid
95
95
  */
96
- invalid?: boolean;
96
+ invalid?: boolean | undefined;
97
97
  /**
98
98
  * Whether the combobox is required
99
99
  */
100
- required?: boolean;
100
+ required?: boolean | undefined;
101
101
  /**
102
102
  * The placeholder text of the combobox's input
103
103
  */
104
- placeholder?: string;
104
+ placeholder?: string | undefined;
105
105
  /**
106
106
  * The active item's id. Used to set the `aria-activedescendant` attribute
107
107
  */
@@ -132,26 +132,26 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
132
132
  /**
133
133
  * Whether to autofocus the input on mount
134
134
  */
135
- autoFocus?: boolean;
135
+ autoFocus?: boolean | undefined;
136
136
  /**
137
137
  * Whether to open the combobox popup on initial click on the input
138
138
  * @default false
139
139
  */
140
- openOnClick?: boolean;
140
+ openOnClick?: boolean | undefined;
141
141
  /**
142
142
  * Whether to show the combobox when the input value changes
143
143
  * @default true
144
144
  */
145
- openOnChange?: boolean | ((details: InputValueChangeDetails) => boolean);
145
+ openOnChange?: boolean | ((details: InputValueChangeDetails) => boolean) | undefined;
146
146
  /**
147
147
  * Whether to allow typing custom values in the input
148
148
  */
149
- allowCustomValue?: boolean;
149
+ allowCustomValue?: boolean | undefined;
150
150
  /**
151
151
  * Whether to loop the keyboard navigation through the items
152
152
  * @default true
153
153
  */
154
- loopFocus?: boolean;
154
+ loopFocus?: boolean | undefined;
155
155
  /**
156
156
  * The positioning options to dynamically position the menu
157
157
  */
@@ -159,20 +159,20 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
159
159
  /**
160
160
  * Function called when the input's value changes
161
161
  */
162
- onInputValueChange?: (details: InputValueChangeDetails) => void;
162
+ onInputValueChange?: ((details: InputValueChangeDetails) => void) | undefined;
163
163
  /**
164
164
  * Function called when a new item is selected
165
165
  */
166
- onValueChange?: (details: ValueChangeDetails<T>) => void;
166
+ onValueChange?: ((details: ValueChangeDetails<T>) => void) | undefined;
167
167
  /**
168
168
  * Function called when an item is highlighted using the pointer
169
169
  * or keyboard navigation.
170
170
  */
171
- onHighlightChange?: (details: HighlightChangeDetails<T>) => void;
171
+ onHighlightChange?: ((details: HighlightChangeDetails<T>) => void) | undefined;
172
172
  /**
173
173
  * Function called when the popup is opened
174
174
  */
175
- onOpenChange?: (details: OpenChangeDetails) => void;
175
+ onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
176
176
  /**
177
177
  * Specifies the localized strings that identifies the accessibility elements and their states
178
178
  */
@@ -187,15 +187,15 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
187
187
  * **Good to know:** When `multiple` is `true`, the `selectionBehavior` is automatically set to `clear`.
188
188
  * It is recommended to render the selected items in a separate container.
189
189
  */
190
- multiple?: boolean;
190
+ multiple?: boolean | undefined;
191
191
  /**
192
192
  * Whether to close the combobox when an item is selected.
193
193
  */
194
- closeOnSelect?: boolean;
194
+ closeOnSelect?: boolean | undefined;
195
195
  /**
196
196
  * Function to get the display value of the selected item
197
197
  */
198
- getSelectionValue?: (details: SelectionValueDetails<T>) => string;
198
+ getSelectionValue?: ((details: SelectionValueDetails<T>) => string) | undefined;
199
199
  /**
200
200
  * Whether to open the combobox on arrow key press
201
201
  * @default true
@@ -204,7 +204,7 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
204
204
  /**
205
205
  * Function to scroll to a specific index
206
206
  */
207
- scrollToIndexFn?: (details: ScrollToIndexDetails) => void;
207
+ scrollToIndexFn?: ((details: ScrollToIndexDetails) => void) | undefined;
208
208
  /**
209
209
  * Whether the combobox is a composed with other composite widgets like tabs
210
210
  * @default true
@@ -213,7 +213,7 @@ interface PublicContext<T extends CollectionItem = CollectionItem> extends Direc
213
213
  /**
214
214
  * Whether to disable registering this a dismissable layer
215
215
  */
216
- disableLayer?: boolean;
216
+ disableLayer?: boolean | undefined;
217
217
  }
218
218
  type UserDefinedContext<T extends CollectionItem = CollectionItem> = RequiredBy<PublicContext<T>, "id" | "collection">;
219
219
  type ComputedContext = Readonly<{
@@ -270,13 +270,13 @@ interface TriggerProps {
270
270
  /**
271
271
  * Whether the trigger is focusable
272
272
  */
273
- focusable?: boolean;
273
+ focusable?: boolean | undefined;
274
274
  }
275
275
  interface ItemProps {
276
276
  /**
277
277
  * Whether hovering outside should clear the highlighted state
278
278
  */
279
- persistFocus?: boolean;
279
+ persistFocus?: boolean | undefined;
280
280
  /**
281
281
  * The item to render
282
282
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/combobox",
3
- "version": "0.74.1",
3
+ "version": "0.75.0",
4
4
  "description": "Core logic for the combobox widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -26,16 +26,16 @@
26
26
  "url": "https://github.com/chakra-ui/zag/issues"
27
27
  },
28
28
  "dependencies": {
29
- "@zag-js/anatomy": "0.74.1",
30
- "@zag-js/aria-hidden": "0.74.1",
31
- "@zag-js/collection": "0.74.1",
32
- "@zag-js/core": "0.74.1",
33
- "@zag-js/dismissable": "0.74.1",
34
- "@zag-js/dom-query": "0.74.1",
35
- "@zag-js/dom-event": "0.74.1",
36
- "@zag-js/utils": "0.74.1",
37
- "@zag-js/popper": "0.74.1",
38
- "@zag-js/types": "0.74.1"
29
+ "@zag-js/anatomy": "0.75.0",
30
+ "@zag-js/aria-hidden": "0.75.0",
31
+ "@zag-js/collection": "0.75.0",
32
+ "@zag-js/core": "0.75.0",
33
+ "@zag-js/dismissable": "0.75.0",
34
+ "@zag-js/dom-query": "0.75.0",
35
+ "@zag-js/dom-event": "0.75.0",
36
+ "@zag-js/utils": "0.75.0",
37
+ "@zag-js/popper": "0.75.0",
38
+ "@zag-js/types": "0.75.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "clean-package": "2.2.0"