@zag-js/combobox 1.0.0 → 1.0.1

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
@@ -3,9 +3,9 @@ export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from
3
3
  import * as _zag_js_anatomy from '@zag-js/anatomy';
4
4
  import { CollectionOptions, ListCollection, CollectionItem } from '@zag-js/collection';
5
5
  export { CollectionItem, CollectionOptions } from '@zag-js/collection';
6
- import { DirectionProperty, CommonProperties, RequiredBy, PropTypes, NormalizeProps } from '@zag-js/types';
6
+ import { DirectionProperty, CommonProperties, PropTypes, RequiredBy, NormalizeProps } from '@zag-js/types';
7
7
  import * as _zag_js_core from '@zag-js/core';
8
- import { Service, EventObject } from '@zag-js/core';
8
+ import { Service, Machine, EventObject } from '@zag-js/core';
9
9
  import { PositioningOptions, Placement } from '@zag-js/popper';
10
10
  export { Placement, PositioningOptions } from '@zag-js/popper';
11
11
 
@@ -198,7 +198,7 @@ interface ComboboxProps<T extends CollectionItem = CollectionItem> extends Direc
198
198
  /**
199
199
  * The collection of items
200
200
  */
201
- collection?: ListCollection<any> | undefined;
201
+ collection?: ListCollection<T> | undefined;
202
202
  /**
203
203
  * Whether to allow multiple selection.
204
204
  *
@@ -234,7 +234,6 @@ interface ComboboxProps<T extends CollectionItem = CollectionItem> extends Direc
234
234
  navigate?: ((details: NavigateDetails) => void) | undefined;
235
235
  }
236
236
  type PropsWithDefault = "openOnChange" | "openOnKeyPress" | "composite" | "navigate" | "loopFocus" | "positioning" | "openOnClick" | "openOnChange" | "inputBehavior" | "collection" | "selectionBehavior" | "closeOnSelect" | "translations" | "positioning";
237
- type ComboboxService<T extends CollectionItem = CollectionItem> = Service<ComboboxSchema<T>>;
238
237
  interface ComboboxSchema<T extends CollectionItem = CollectionItem> {
239
238
  props: RequiredBy<ComboboxProps<T>, PropsWithDefault>;
240
239
  state: "idle" | "focused" | "suggesting" | "interacting";
@@ -260,6 +259,8 @@ interface ComboboxSchema<T extends CollectionItem = CollectionItem> {
260
259
  effect: string;
261
260
  guard: string;
262
261
  }
262
+ type ComboboxService<T extends CollectionItem = CollectionItem> = Service<ComboboxSchema<T>>;
263
+ type ComboboxMachine<T extends CollectionItem = CollectionItem> = Machine<ComboboxSchema<T>>;
263
264
  interface TriggerProps {
264
265
  /**
265
266
  * Whether the trigger is focusable
@@ -408,7 +409,7 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
408
409
 
409
410
  declare function connect<T extends PropTypes, V extends CollectionItem>(service: ComboboxService<V>, normalize: NormalizeProps<T>): ComboboxApi<T, V>;
410
411
 
411
- declare const machine: _zag_js_core.MachineConfig<ComboboxSchema<any>>;
412
+ declare const machine: _zag_js_core.Machine<ComboboxSchema<any>>;
412
413
 
413
414
  declare const props: (keyof ComboboxProps<any>)[];
414
415
  declare const splitProps: <Props extends Partial<ComboboxProps<any>>>(props: Props) => [Partial<ComboboxProps<any>>, Omit<Props, keyof ComboboxProps<any>>];
@@ -419,4 +420,4 @@ declare const splitItemGroupProps: <Props extends ItemGroupProps>(props: Props)
419
420
  declare const itemProps: (keyof ItemProps)[];
420
421
  declare const splitItemProps: <Props extends ItemProps>(props: Props) => [ItemProps, Omit<Props, keyof ItemProps>];
421
422
 
422
- export { type ComboboxApi as Api, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type NavigateDetails, type OpenChangeDetails, type ComboboxProps as Props, type ScrollToIndexDetails, type ComboboxService as Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, itemGroupLabelProps, itemGroupProps, itemProps, machine, props, splitItemGroupLabelProps, splitItemGroupProps, splitItemProps, splitProps };
423
+ export { type ComboboxApi as Api, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type ComboboxMachine as Machine, type NavigateDetails, type OpenChangeDetails, type ComboboxProps as Props, type ScrollToIndexDetails, type ComboboxService as Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, itemGroupLabelProps, itemGroupProps, itemProps, machine, props, splitItemGroupLabelProps, splitItemGroupProps, splitItemProps, splitProps };
package/dist/index.d.ts CHANGED
@@ -3,9 +3,9 @@ export { FocusOutsideEvent, InteractOutsideEvent, PointerDownOutsideEvent } from
3
3
  import * as _zag_js_anatomy from '@zag-js/anatomy';
4
4
  import { CollectionOptions, ListCollection, CollectionItem } from '@zag-js/collection';
5
5
  export { CollectionItem, CollectionOptions } from '@zag-js/collection';
6
- import { DirectionProperty, CommonProperties, RequiredBy, PropTypes, NormalizeProps } from '@zag-js/types';
6
+ import { DirectionProperty, CommonProperties, PropTypes, RequiredBy, NormalizeProps } from '@zag-js/types';
7
7
  import * as _zag_js_core from '@zag-js/core';
8
- import { Service, EventObject } from '@zag-js/core';
8
+ import { Service, Machine, EventObject } from '@zag-js/core';
9
9
  import { PositioningOptions, Placement } from '@zag-js/popper';
10
10
  export { Placement, PositioningOptions } from '@zag-js/popper';
11
11
 
@@ -198,7 +198,7 @@ interface ComboboxProps<T extends CollectionItem = CollectionItem> extends Direc
198
198
  /**
199
199
  * The collection of items
200
200
  */
201
- collection?: ListCollection<any> | undefined;
201
+ collection?: ListCollection<T> | undefined;
202
202
  /**
203
203
  * Whether to allow multiple selection.
204
204
  *
@@ -234,7 +234,6 @@ interface ComboboxProps<T extends CollectionItem = CollectionItem> extends Direc
234
234
  navigate?: ((details: NavigateDetails) => void) | undefined;
235
235
  }
236
236
  type PropsWithDefault = "openOnChange" | "openOnKeyPress" | "composite" | "navigate" | "loopFocus" | "positioning" | "openOnClick" | "openOnChange" | "inputBehavior" | "collection" | "selectionBehavior" | "closeOnSelect" | "translations" | "positioning";
237
- type ComboboxService<T extends CollectionItem = CollectionItem> = Service<ComboboxSchema<T>>;
238
237
  interface ComboboxSchema<T extends CollectionItem = CollectionItem> {
239
238
  props: RequiredBy<ComboboxProps<T>, PropsWithDefault>;
240
239
  state: "idle" | "focused" | "suggesting" | "interacting";
@@ -260,6 +259,8 @@ interface ComboboxSchema<T extends CollectionItem = CollectionItem> {
260
259
  effect: string;
261
260
  guard: string;
262
261
  }
262
+ type ComboboxService<T extends CollectionItem = CollectionItem> = Service<ComboboxSchema<T>>;
263
+ type ComboboxMachine<T extends CollectionItem = CollectionItem> = Machine<ComboboxSchema<T>>;
263
264
  interface TriggerProps {
264
265
  /**
265
266
  * Whether the trigger is focusable
@@ -408,7 +409,7 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
408
409
 
409
410
  declare function connect<T extends PropTypes, V extends CollectionItem>(service: ComboboxService<V>, normalize: NormalizeProps<T>): ComboboxApi<T, V>;
410
411
 
411
- declare const machine: _zag_js_core.MachineConfig<ComboboxSchema<any>>;
412
+ declare const machine: _zag_js_core.Machine<ComboboxSchema<any>>;
412
413
 
413
414
  declare const props: (keyof ComboboxProps<any>)[];
414
415
  declare const splitProps: <Props extends Partial<ComboboxProps<any>>>(props: Props) => [Partial<ComboboxProps<any>>, Omit<Props, keyof ComboboxProps<any>>];
@@ -419,4 +420,4 @@ declare const splitItemGroupProps: <Props extends ItemGroupProps>(props: Props)
419
420
  declare const itemProps: (keyof ItemProps)[];
420
421
  declare const splitItemProps: <Props extends ItemProps>(props: Props) => [ItemProps, Omit<Props, keyof ItemProps>];
421
422
 
422
- export { type ComboboxApi as Api, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type NavigateDetails, type OpenChangeDetails, type ComboboxProps as Props, type ScrollToIndexDetails, type ComboboxService as Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, itemGroupLabelProps, itemGroupProps, itemProps, machine, props, splitItemGroupLabelProps, splitItemGroupProps, splitItemProps, splitProps };
423
+ export { type ComboboxApi as Api, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type ComboboxMachine as Machine, type NavigateDetails, type OpenChangeDetails, type ComboboxProps as Props, type ScrollToIndexDetails, type ComboboxService as Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, itemGroupLabelProps, itemGroupProps, itemProps, machine, props, splitItemGroupLabelProps, splitItemGroupProps, splitItemProps, splitProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/combobox",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Core logic for the combobox widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -26,15 +26,15 @@
26
26
  "url": "https://github.com/chakra-ui/zag/issues"
27
27
  },
28
28
  "dependencies": {
29
- "@zag-js/anatomy": "1.0.0",
30
- "@zag-js/aria-hidden": "1.0.0",
31
- "@zag-js/collection": "1.0.0",
32
- "@zag-js/core": "1.0.0",
33
- "@zag-js/dismissable": "1.0.0",
34
- "@zag-js/dom-query": "1.0.0",
35
- "@zag-js/utils": "1.0.0",
36
- "@zag-js/popper": "1.0.0",
37
- "@zag-js/types": "1.0.0"
29
+ "@zag-js/anatomy": "1.0.1",
30
+ "@zag-js/aria-hidden": "1.0.1",
31
+ "@zag-js/collection": "1.0.1",
32
+ "@zag-js/core": "1.0.1",
33
+ "@zag-js/dismissable": "1.0.1",
34
+ "@zag-js/dom-query": "1.0.1",
35
+ "@zag-js/utils": "1.0.1",
36
+ "@zag-js/popper": "1.0.1",
37
+ "@zag-js/types": "1.0.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "clean-package": "2.2.0"