@magicx-eng/ai-autocomplete-react 0.14.2 → 0.16.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/README.md CHANGED
@@ -17,7 +17,7 @@ A React/TypeScript SDK that provides a guided AI-powered autocomplete experience
17
17
  - **IME-safe** — composition events are buffered so input text is committed once, after composition ends
18
18
  - **Client-side filtering** — instant substring filtering on every keystroke
19
19
  - **Datepicker** — date parameters are answered with a calendar instead of an option list. Click a day or navigate with the arrow keys; the date is committed the way it would be written — `Tuesday` for a date inside the next week, `March 23` for one later this year, `March 23 2027` for another year. Tapping a committed date re-opens the calendar on the month that text names now — for a weekday name, that is the next such day, not the one originally picked.
20
- - **Option overrides** — inject or dynamically generate client-side options per suggestion type
20
+ - **Option overrides** — supply the options for a parameter yourself: a fixed list, a computed one, or one fetched from your own search endpoint as the user types
21
21
  - **Product strip (opt-in)** — plug in any platform's product search and the dropdown renders a horizontal row of product cards below the options; the SDK owns the UI, your integration owns only `fetch` and `transform`
22
22
  - **Controlled & uncontrolled** — works out of the box or integrates with external state
23
23
  - **Ref forwarding** — imperative `focus()`, `blur()`, `reset()`, and `setMode()` via ref
@@ -311,10 +311,11 @@ function App() {
311
311
  | Prop | Type | Default | Description |
312
312
  |---|---|---|---|
313
313
  | `onSubmit` | `(result: AutocompleteResult) => void` | **required** | Called on Enter or submit button. |
314
+ | `onResult?` | `(result: AutocompleteResult) => void` | — | Called after every successful round-trip with the structured query as it now stands — see [Reading the query as it's built](#reading-the-query-as-its-built). |
314
315
  | `onError?` | `(error: Error) => void` | — | Called when a fetch fails. |
315
316
  | `apiConfig?` | `APIConfig` | — | Runtime API configuration (see below). |
316
317
  | `additionalContext?` | `Record<string, unknown>` | — | Optional user context. Include whatever you know about the user (a profile, preferences, workspace, anything) to personalize suggested parameters and options to them. |
317
- | `optionOverrides?` | `Record<string, (query: string) => SuggestionOption[]>` | — | Override options per suggestion type. |
318
+ | `optionOverrides?` | `OptionOverrides` | — | Supply the options for a parameter yourself, per suggestion type — fixed, computed, or fetched as the user types. See [Option Overrides](#option-overrides). |
318
319
  | `maskCompletedText?` | `boolean` | `false` | When `true`, omits completed params' literal text from API requests (for masking PII/sensitive values from the server). |
319
320
  | `className?` | `string` | — | CSS class applied to the container. |
320
321
  | `columns?` | `number` | `2` | Number of columns in the dropdown grid. |
@@ -497,7 +498,7 @@ The SDK handles token refresh transparently: 401 → `getAccessToken` → retry
497
498
 
498
499
  ### `useAIAutocomplete(options)`
499
500
 
500
- The headless hook for Tier 2 and Tier 3. Accepts the same options as `<AIAutocomplete />` except for the component-only rendering props: `className`, `ref`, `pillPlacement`, `mode`, `animations`, and `autoFocus` (those belong to the wrapping component — the hook doesn't own the input element). `optionsPosition` **is** accepted: it sets the arrow-key direction and flows through `dropdownProps` to the dropdown. `onFocus` and `onBlur` are forwarded and fire whenever the consumer-owned textarea's focus changes (they're driven by `inputProps.onFocus` / `inputProps.onBlur`).
501
+ The headless hook for Tier 2 and Tier 3. Accepts the same options as `<AIAutocomplete />` except for the component-only rendering props: `className`, `ref`, `pillPlacement`, `mode`, `animations`, and `autoFocus` (those belong to the wrapping component — the hook doesn't own the input element). `optionsPosition` **is** accepted: it sets the arrow-key direction and flows through `dropdownProps` to the dropdown. `onFocus` and `onBlur` are forwarded and fire whenever the consumer-owned textarea's focus changes (they're driven by `inputProps.onFocus` / `inputProps.onBlur`). `onResult` is accepted too and fires after every successful round-trip — see [Reading the query as it's built](#reading-the-query-as-its-built).
501
502
 
502
503
  #### Return Value
503
504
 
@@ -507,6 +508,7 @@ The headless hook for Tier 2 and Tier 3. Accepts the same options as `<AIAutocom
507
508
  |---|---|---|
508
509
  | `completedParams` | `CompletedParamState[]` | Filled parameters. |
509
510
  | `skippedParams` | `SkippedParamState[]` | Suggestions the user dismissed with <kbd>→</kbd>. Nothing renders them — pass them to `buildSubmitResult` for a hand-rolled submit. |
511
+ | `identifiedParams` | `IdentifiedParamState[]` | Parameters the server recognised in the user's own words. Already rendered through `segments`; pass them to `buildSubmitResult` for a hand-rolled submit so it reports the same `identified_params` the SDK's own results do. |
510
512
  | `suggestionPills` | `Suggestion[]` | Unfilled suggestions (pills). First item is the active pill. |
511
513
  | `segments` | `Segment[]` | Input text split into typed text vs completed params — completed segments render as bold `<strong>` runs inside the editor. |
512
514
  | `newParamId` | `string \| null` | ID of the most recently added param (for shimmer animation). |
@@ -571,11 +573,40 @@ The dropdown component for Tier 2. Spread `dropdownProps` from the hook (and add
571
573
 
572
574
  ### `AutocompleteResult`
573
575
 
576
+ The structured query as the SDK currently understands it. The same object is passed to `onSubmit` when the user submits and to `onResult` after every successful round-trip:
577
+
574
578
  | Field | Type | Description |
575
579
  |---|---|---|
576
- | `query` | `string` | Plain text as the user sees it. |
577
- | `raw_query` | `string` | Text with placeholder tokens (e.g. `"Create a {{TASK_1}}"`). |
578
- | `completed_params` | `CompletedParam[]` | Filled parameter values, followed by any the user skipped (see below). |
580
+ | `query` | `string` | Plain text as the user sees it, trimmed. |
581
+ | `raw_query` | `string` | `query` with each completed param replaced by its placeholder token (e.g. `"Create a {{TASK_1}}"`). |
582
+ | `completed_params` | `CompletedParam[]` | Filled parameter values in query order, followed by any the user skipped (see below). |
583
+ | `identified_params` | `IdentifiedParam[]` | Parameters the server recognised in the user's own words, as `{ type, value }` — e.g. `{ type: "due_date", value: "Friday" }` when the user typed "by Friday" instead of picking a date. They are not tokenized in `raw_query`, and they are tentative: each response replaces the set, and an entry drops out as soon as its text is edited away. |
584
+ | `is_ready` | `boolean` | Whether the server considers the query complete enough to act on. |
585
+
586
+ #### Reading the query as it's built
587
+
588
+ You don't have to wait for submit. `onResult` fires after **every** successful round-trip with the result as it now stands, so you can mirror the structured query live — a preview panel, a draft saved as the user goes, analytics on how far they got. It works on both tiers:
589
+
590
+ ```tsx
591
+ <AIAutocomplete
592
+ onResult={(result) => setPreview(result)}
593
+ onSubmit={(result) => run(result)}
594
+ />
595
+
596
+ // Tier 2 / 3
597
+ const ac = useAIAutocomplete({
598
+ onResult: (result) => saveDraft(result),
599
+ onSubmit: (result) => run(result),
600
+ });
601
+ ```
602
+
603
+ What "every successful round-trip" means in practice:
604
+
605
+ - It fires once per response the SDK applied — including the very first request on mount (an empty result) and after a response that promoted text the user had already typed into a completed param.
606
+ - It does **not** fire for a request that failed (`onError` does), was cancelled, or was superseded by a newer one before it returned.
607
+ - Keystrokes that haven't been sent yet don't fire it. Typing is debounced and only reaches the server once at least two new characters have been added, so `onResult` lags the input by a beat.
608
+ - An inline arrow function is fine — the latest one you passed is always the one called.
609
+ - A submit is the last result you saw plus whatever the user typed since. Both are built by the same exported `buildSubmitResult`, so the shapes never drift.
579
610
 
580
611
  #### Skipped parameters
581
612
 
@@ -585,7 +616,7 @@ Pressing <kbd>→</kbd> at the end of the input dismisses the active pill. The d
585
616
  { placeholder: "", type: "goal", text: "skipped", kind: null }
586
617
  ```
587
618
 
588
- Tier 2 consumers who build their own submit payload get the raw skips from the hook as `skippedParams`, and can fold them in the same way with the exported `buildSubmitResult(text, completedParams, skippedParams)`.
619
+ Tier 2 consumers who build their own submit payload get the raw skips from the hook as `skippedParams`, and can fold them in the same way with the exported `buildSubmitResult(text, completedParams, skippedParams, { identifiedParams, isReady })` — the last argument carries the hook's `identifiedParams` and `isReady` so a hand-rolled submit reports the same `identified_params` and `is_ready` the SDK's own results do.
589
620
 
590
621
  > **Reading `skippedParams` directly:** the array is append-only until `reset()`. The "drop a skip whose type got filled" rule is applied when the payload is built, not by pruning the array — so if the user skips `goal` and later fills one, the raw array still holds the `goal` entry. That's deliberate: the filter self-heals if they then delete that param's text, where pruning would discard the signal for good. `buildSubmitResult` applies the rule for you; to apply it elsewhere (say, a "you skipped X" badge), use the exported `withSkippedParams(completedParams, skippedParams)`.
591
622
 
@@ -733,23 +764,38 @@ correlate a user's report with the query that produced it.
733
764
 
734
765
  ## Option Overrides
735
766
 
767
+ Supply the options for a parameter yourself instead of taking the server's. Each entry is keyed by the suggestion `type` and is a function of the phrase the user has typed for that parameter — return an array for a fixed or computed list, or a promise for one that lives behind a request (the dropdown shows its loading skeleton until it settles):
768
+
736
769
  ```tsx
737
- <AIAutocomplete
738
- optionOverrides={{
739
- account: () => [
740
- { text: "Savings", is_tappable: true, kind: null },
741
- { text: "Checking", is_tappable: true, kind: null },
742
- ],
743
- value: (query) => {
744
- const digits = query.replace(/\D/g, "");
745
- if (!digits) return [{ text: "$100", is_tappable: true, kind: null }];
746
- return [{ text: `$${digits}`, is_tappable: true, kind: null }];
747
- },
748
- }}
749
- onSubmit={handleSubmit}
750
- />
770
+ import type { OptionOverrides } from "@magicx-eng/ai-autocomplete-react";
771
+
772
+ // Inline is fine: the functions are read live on each call, so a fresh object
773
+ // per render is not a swap. Only the set of overridden types has to change
774
+ // for the core to be told.
775
+ const overrides: OptionOverrides = {
776
+ account: () => [
777
+ { text: "Savings", is_tappable: true, kind: null },
778
+ { text: "Checking", is_tappable: true, kind: null },
779
+ ],
780
+ location: async (query, signal) => {
781
+ const res = await fetch(`/api/locations?q=${encodeURIComponent(query)}`, { signal });
782
+ const places = await res.json();
783
+ return places.map((p) => ({ text: p.name, is_tappable: true, kind: null }));
784
+ },
785
+ };
786
+
787
+ <AIAutocomplete optionOverrides={overrides} onSubmit={handleSubmit} />;
751
788
  ```
752
789
 
790
+ How it behaves:
791
+
792
+ - **Called** once the moment the parameter becomes active, with whatever the user has already typed for it (usually `""`, the request for the default list), and again on the SDK's typing debounce with each new phrase — so you can search or page a larger list. Return the same list again if the phrase is already covered.
793
+ - **Shown as-is.** The answer is not filtered again by the phrase it was produced for, so a fuzzy match survives. Between two calls the previous answer is filtered locally by what the user types. Typing an option's full text completes the parameter, as it does for a server option.
794
+ - **The server steps back.** Its own options for an overridden type are never shown, and it is not asked for suggestions while an override owns the active parameter — it is asked again when the parameter is answered or skipped. Return an empty list for a typed phrase and the SDK falls back to the server for that phrase (once), the way it does for a parameter with no matching options. An empty list for `""` leaves the parameter on screen with no options.
795
+ - **Honour `signal`** — it is aborted when a newer phrase supersedes the call, when the parameter stops being active, and on unmount. A throw or a rejection is logged once and treated as an empty answer, never as a fetch error.
796
+
797
+ The hook's `isLoading` is true while an answer is pending, the same flag it raises for a suggest request.
798
+
753
799
  ## License
754
800
 
755
801
  Private package. All rights reserved.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { AutocompleteResult, OptionOverrides, APIConfig, AppearanceMode, CompletedParamState, ProductsConfig, Product, Suggestion, SuggestionOption, FormatType, DateMonthView, SkippedParamState, Segment } from '@magicx-eng/ai-autocomplete-vanilla';
2
- export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, DateMonthView, FormatType, OptionOverrides, Product, ProductsConfig, Segment, SkippedParamState, Suggestion, SuggestionOption, TaskKind, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, formatDate, isoDate, monthLabel, parseDate, parseLooseDate, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
1
+ import { AutocompleteResult, OptionOverrides, APIConfig, AppearanceMode, CompletedParamState, ProductsConfig, Product, Suggestion, SuggestionOption, FormatType, DateMonthView, SkippedParamState, IdentifiedParamState, Segment } from '@magicx-eng/ai-autocomplete-vanilla';
2
+ export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, DateMonthView, FormatType, IdentifiedParam, IdentifiedParamState, OptionOverrides, Product, ProductsConfig, Segment, SkippedParamState, SubmitResultExtras, Suggestion, SuggestionOption, TaskKind, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, formatDate, isoDate, monthLabel, parseDate, parseLooseDate, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, KeyboardEvent, ChangeEvent } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -17,7 +17,21 @@ interface AIAutocompleteHandle {
17
17
  skipActivePill: () => void;
18
18
  }
19
19
  interface AIAutocompleteProps {
20
+ /** Called on Enter or submit-button click with the final structured query. */
20
21
  onSubmit: (result: AutocompleteResult) => void;
22
+ /**
23
+ * Called after every successful suggestion round-trip with the structured
24
+ * query as the SDK now understands it — the same `AutocompleteResult` shape
25
+ * `onSubmit` receives, so you can mirror the query as it is built (a live
26
+ * preview, a draft, analytics) without waiting for submit.
27
+ *
28
+ * Fires once per response that was applied, including the initial request
29
+ * on mount (an empty result). Does not fire for a request that failed, was
30
+ * aborted, or was superseded before it returned, and nothing fires for a
31
+ * keystroke that hasn't been sent yet. May be an inline arrow — the latest
32
+ * function is always the one called.
33
+ */
34
+ onResult?: (result: AutocompleteResult) => void;
21
35
  onError?: (error: Error) => void;
22
36
  optionOverrides?: OptionOverrides;
23
37
  maskCompletedText?: boolean;
@@ -102,7 +116,15 @@ interface AIAutocompleteProps {
102
116
  submitButton?: ReactNode;
103
117
  }
104
118
  interface UseAIAutocompleteOptions {
119
+ /** Called on Enter with the final structured query. */
105
120
  onSubmit?: (result: AutocompleteResult) => void;
121
+ /**
122
+ * Called after every successful suggestion round-trip with the structured
123
+ * query as the SDK now understands it — see `AIAutocompleteProps.onResult`.
124
+ * A hand-rolled submit should hand the consumer the same shape; build it
125
+ * with `buildSubmitResult(text, completedParams, skippedParams, { identifiedParams, isReady })`.
126
+ */
127
+ onResult?: (result: AutocompleteResult) => void;
106
128
  onError?: (error: Error) => void;
107
129
  optionOverrides?: OptionOverrides;
108
130
  maskCompletedText?: boolean;
@@ -189,6 +211,13 @@ interface UseAIAutocompleteReturn {
189
211
  * entries the SDK's own requests do.
190
212
  */
191
213
  skippedParams: SkippedParamState[];
214
+ /**
215
+ * Params the server identified in the user's own words. Already rendered
216
+ * through `segments`; exposed so a hand-rolled submit can pass them to
217
+ * `buildSubmitResult` and report the same `identified_params` the SDK's
218
+ * own results carry.
219
+ */
220
+ identifiedParams: IdentifiedParamState[];
192
221
  suggestionPills: Suggestion[];
193
222
  setActivePill: (index: number) => void;
194
223
  /**
@@ -310,7 +339,7 @@ interface AIAutocompleteDropdownProps {
310
339
  /**
311
340
  * Extra disabled gate for the skip button beyond `isLoading`. Provided by
312
341
  * `dropdownProps` from the hook (wired to `inSelectionAnimation`): the
313
- * UI-facing loading flag is deliberately suppressed during the ~500ms
342
+ * UI-facing loading flag is deliberately suppressed during the ~170ms
314
343
  * post-selection window, but `skipActivePill` no-ops in it — the button
315
344
  * renders disabled instead of swallowing clicks silently. Default: false.
316
345
  */
@@ -373,6 +402,6 @@ declare const AIAutocomplete: react.ForwardRefExoticComponent<AIAutocompleteProp
373
402
 
374
403
  declare function AIAutocompleteDropdown({ suggestions, activeIndex, onSelect, onHighlight, isOpen, id, className, pills, onPillClick, showPills, onSkip, showSkipButton, skipDisabled, activeSelected, isLoading, isInputEmpty, products, onProductSelect, onProductFocusChange, formatType, dateView, selectedDateIso, onPreviousMonth, onNextMonth, optionsPosition, mode, }: AIAutocompleteDropdownProps): react_jsx_runtime.JSX.Element;
375
404
 
376
- declare function useAIAutocomplete({ onSubmit, onError, optionOverrides, maskCompletedText, apiConfig, additionalContext, columns, dropdownTrigger, optionsPosition, closeDropdownOnBlur, showNonTappableOptions, showSkipButton, onFocus, onBlur, value: controlledValue, completedParams: controlledParams, onChange: onChangeProp, onParamsChange, products, onProductSelect, source, setCursor, }: UseAIAutocompleteOptions): UseAIAutocompleteReturn;
405
+ declare function useAIAutocomplete({ onSubmit, onResult, onError, optionOverrides, maskCompletedText, apiConfig, additionalContext, columns, dropdownTrigger, optionsPosition, closeDropdownOnBlur, showNonTappableOptions, showSkipButton, onFocus, onBlur, value: controlledValue, completedParams: controlledParams, onChange: onChangeProp, onParamsChange, products, onProductSelect, source, setCursor, }: UseAIAutocompleteOptions): UseAIAutocompleteReturn;
377
406
 
378
407
  export { AIAutocomplete, AIAutocompleteDropdown, type AIAutocompleteDropdownProps, type AIAutocompleteHandle, type AIAutocompleteProps, type UseAIAutocompleteOptions, type UseAIAutocompleteReturn, useAIAutocomplete };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AutocompleteResult, OptionOverrides, APIConfig, AppearanceMode, CompletedParamState, ProductsConfig, Product, Suggestion, SuggestionOption, FormatType, DateMonthView, SkippedParamState, Segment } from '@magicx-eng/ai-autocomplete-vanilla';
2
- export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, DateMonthView, FormatType, OptionOverrides, Product, ProductsConfig, Segment, SkippedParamState, Suggestion, SuggestionOption, TaskKind, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, formatDate, isoDate, monthLabel, parseDate, parseLooseDate, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
1
+ import { AutocompleteResult, OptionOverrides, APIConfig, AppearanceMode, CompletedParamState, ProductsConfig, Product, Suggestion, SuggestionOption, FormatType, DateMonthView, SkippedParamState, IdentifiedParamState, Segment } from '@magicx-eng/ai-autocomplete-vanilla';
2
+ export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, DateMonthView, FormatType, IdentifiedParam, IdentifiedParamState, OptionOverrides, Product, ProductsConfig, Segment, SkippedParamState, SubmitResultExtras, Suggestion, SuggestionOption, TaskKind, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, formatDate, isoDate, monthLabel, parseDate, parseLooseDate, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, KeyboardEvent, ChangeEvent } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -17,7 +17,21 @@ interface AIAutocompleteHandle {
17
17
  skipActivePill: () => void;
18
18
  }
19
19
  interface AIAutocompleteProps {
20
+ /** Called on Enter or submit-button click with the final structured query. */
20
21
  onSubmit: (result: AutocompleteResult) => void;
22
+ /**
23
+ * Called after every successful suggestion round-trip with the structured
24
+ * query as the SDK now understands it — the same `AutocompleteResult` shape
25
+ * `onSubmit` receives, so you can mirror the query as it is built (a live
26
+ * preview, a draft, analytics) without waiting for submit.
27
+ *
28
+ * Fires once per response that was applied, including the initial request
29
+ * on mount (an empty result). Does not fire for a request that failed, was
30
+ * aborted, or was superseded before it returned, and nothing fires for a
31
+ * keystroke that hasn't been sent yet. May be an inline arrow — the latest
32
+ * function is always the one called.
33
+ */
34
+ onResult?: (result: AutocompleteResult) => void;
21
35
  onError?: (error: Error) => void;
22
36
  optionOverrides?: OptionOverrides;
23
37
  maskCompletedText?: boolean;
@@ -102,7 +116,15 @@ interface AIAutocompleteProps {
102
116
  submitButton?: ReactNode;
103
117
  }
104
118
  interface UseAIAutocompleteOptions {
119
+ /** Called on Enter with the final structured query. */
105
120
  onSubmit?: (result: AutocompleteResult) => void;
121
+ /**
122
+ * Called after every successful suggestion round-trip with the structured
123
+ * query as the SDK now understands it — see `AIAutocompleteProps.onResult`.
124
+ * A hand-rolled submit should hand the consumer the same shape; build it
125
+ * with `buildSubmitResult(text, completedParams, skippedParams, { identifiedParams, isReady })`.
126
+ */
127
+ onResult?: (result: AutocompleteResult) => void;
106
128
  onError?: (error: Error) => void;
107
129
  optionOverrides?: OptionOverrides;
108
130
  maskCompletedText?: boolean;
@@ -189,6 +211,13 @@ interface UseAIAutocompleteReturn {
189
211
  * entries the SDK's own requests do.
190
212
  */
191
213
  skippedParams: SkippedParamState[];
214
+ /**
215
+ * Params the server identified in the user's own words. Already rendered
216
+ * through `segments`; exposed so a hand-rolled submit can pass them to
217
+ * `buildSubmitResult` and report the same `identified_params` the SDK's
218
+ * own results carry.
219
+ */
220
+ identifiedParams: IdentifiedParamState[];
192
221
  suggestionPills: Suggestion[];
193
222
  setActivePill: (index: number) => void;
194
223
  /**
@@ -310,7 +339,7 @@ interface AIAutocompleteDropdownProps {
310
339
  /**
311
340
  * Extra disabled gate for the skip button beyond `isLoading`. Provided by
312
341
  * `dropdownProps` from the hook (wired to `inSelectionAnimation`): the
313
- * UI-facing loading flag is deliberately suppressed during the ~500ms
342
+ * UI-facing loading flag is deliberately suppressed during the ~170ms
314
343
  * post-selection window, but `skipActivePill` no-ops in it — the button
315
344
  * renders disabled instead of swallowing clicks silently. Default: false.
316
345
  */
@@ -373,6 +402,6 @@ declare const AIAutocomplete: react.ForwardRefExoticComponent<AIAutocompleteProp
373
402
 
374
403
  declare function AIAutocompleteDropdown({ suggestions, activeIndex, onSelect, onHighlight, isOpen, id, className, pills, onPillClick, showPills, onSkip, showSkipButton, skipDisabled, activeSelected, isLoading, isInputEmpty, products, onProductSelect, onProductFocusChange, formatType, dateView, selectedDateIso, onPreviousMonth, onNextMonth, optionsPosition, mode, }: AIAutocompleteDropdownProps): react_jsx_runtime.JSX.Element;
375
404
 
376
- declare function useAIAutocomplete({ onSubmit, onError, optionOverrides, maskCompletedText, apiConfig, additionalContext, columns, dropdownTrigger, optionsPosition, closeDropdownOnBlur, showNonTappableOptions, showSkipButton, onFocus, onBlur, value: controlledValue, completedParams: controlledParams, onChange: onChangeProp, onParamsChange, products, onProductSelect, source, setCursor, }: UseAIAutocompleteOptions): UseAIAutocompleteReturn;
405
+ declare function useAIAutocomplete({ onSubmit, onResult, onError, optionOverrides, maskCompletedText, apiConfig, additionalContext, columns, dropdownTrigger, optionsPosition, closeDropdownOnBlur, showNonTappableOptions, showSkipButton, onFocus, onBlur, value: controlledValue, completedParams: controlledParams, onChange: onChangeProp, onParamsChange, products, onProductSelect, source, setCursor, }: UseAIAutocompleteOptions): UseAIAutocompleteReturn;
377
406
 
378
407
  export { AIAutocomplete, AIAutocompleteDropdown, type AIAutocompleteDropdownProps, type AIAutocompleteHandle, type AIAutocompleteProps, type UseAIAutocompleteOptions, type UseAIAutocompleteReturn, useAIAutocomplete };