@magicx-eng/ai-autocomplete-react 0.52.1 → 0.53.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
@@ -284,6 +284,7 @@ function App() {
284
284
  | `mode?` | `"light" \| "dark" \| "auto"` | `"auto"` | Color mode. `"auto"` follows `prefers-color-scheme`. |
285
285
  | `optionsPosition?` | `"above" \| "below"` | `"below"` | Where the dropdown opens relative to the input. |
286
286
  | `animations?` | `boolean` | `true` | Enable/disable all SDK animations (press + shimmer, the typed-in starting-state placeholder, the option rows' staggered entrance, and the "more below" arrow's slide). `prefers-reduced-motion` also switches the last three off. |
287
+ | `optionsStyle?` | `"floating" \| "classic"` | `"floating"` | The options box's look and motion. `"floating"`: no stroke, sized to the text, and it dissolves in where it sits and glides between questions. `"classic"` brings back the earlier stroke, size and motion: it unfolds out of the input with a stroke, at full size. A standalone `AIAutocompleteDropdown` opts in with `data-aia-options-style="classic"` on its `.magicx-aia` element or an ancestor of that element: any ancestor when `mode` is set, otherwise your `.magicx-aia` wrapper or above. |
287
288
  | `dropdownTrigger?` | `"auto" \| "manual" \| "hidden"` | `"auto"` | When the dropdown appears. `"auto"` = when options available. `"manual"` = only on pill tap, closes after selection. `"hidden"` = never shows. |
288
289
  | `closeDropdownOnBlur?` | `boolean` | `true` | When `true`, the dropdown closes if the input loses focus. Set to `false` to keep it open whenever options are available, regardless of focus. |
289
290
  | `prependPlaceholder?` | `boolean` | `true` | Set to `false` to show the starting state's lead-in text as a hint only: a picked option is not written after it. |
@@ -389,7 +390,7 @@ The SDK handles token refresh transparently: 401 → `getAccessToken` → retry
389
390
 
390
391
  ### `useAIAutocomplete(options)`
391
392
 
392
- 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). `productImageFallback` is also accepted and forwarded through `dropdownProps`. `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).
393
+ 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`, `optionsStyle`, and `autoFocus` (those belong to the wrapping component — the hook doesn't own the input element). `productImageFallback` is also accepted and forwarded through `dropdownProps`. `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).
393
394
 
394
395
  #### Return Value
395
396
 
package/dist/index.d.mts CHANGED
@@ -81,6 +81,14 @@ interface AIAutocompleteProps {
81
81
  optionsPosition?: "above" | "below";
82
82
  /** Enable all SDK animations (press + shimmer). Default: true */
83
83
  animations?: boolean;
84
+ /**
85
+ * The options box's look and motion. Default `"floating"`: no stroke, sized
86
+ * to the text, and it dissolves in where it sits and glides between
87
+ * questions. `"classic"` brings back the earlier stroke, size and motion:
88
+ * it unfolds out of the input with a stroke, at full size. The new header
89
+ * layout stays.
90
+ */
91
+ optionsStyle?: "floating" | "classic";
84
92
  /** When the dropdown appears. "auto" (default) = shows when options available. "manual" = only on pill tap, closes after selection. "hidden" = never shows. */
85
93
  dropdownTrigger?: "auto" | "manual" | "hidden";
86
94
  /** When true (default), the dropdown closes when the input loses focus. Set to false to keep it open whenever options are available, regardless of focus. */
package/dist/index.d.ts CHANGED
@@ -81,6 +81,14 @@ interface AIAutocompleteProps {
81
81
  optionsPosition?: "above" | "below";
82
82
  /** Enable all SDK animations (press + shimmer). Default: true */
83
83
  animations?: boolean;
84
+ /**
85
+ * The options box's look and motion. Default `"floating"`: no stroke, sized
86
+ * to the text, and it dissolves in where it sits and glides between
87
+ * questions. `"classic"` brings back the earlier stroke, size and motion:
88
+ * it unfolds out of the input with a stroke, at full size. The new header
89
+ * layout stays.
90
+ */
91
+ optionsStyle?: "floating" | "classic";
84
92
  /** When the dropdown appears. "auto" (default) = shows when options available. "manual" = only on pill tap, closes after selection. "hidden" = never shows. */
85
93
  dropdownTrigger?: "auto" | "manual" | "hidden";
86
94
  /** When true (default), the dropdown closes when the input loses focus. Set to false to keep it open whenever options are available, regardless of focus. */