@magicx-eng/ai-autocomplete-vanilla 0.51.2 → 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 +11 -0
- package/dist/index.d.mts +19 -6
- package/dist/index.d.ts +19 -6
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +25 -4
package/README.md
CHANGED
|
@@ -877,6 +877,15 @@ This is the way to embed the widget in a page whose CSS you don't control. In th
|
|
|
877
877
|
|
|
878
878
|
Override these on the container element. The variables are declared with `:where()` (zero specificity), so a value you set on the container always wins without `!important`.
|
|
879
879
|
|
|
880
|
+
The full input also accepts `--aia-input-radius` and `--aia-written-text-font-weight` on its container or an ancestor. Omit them to retain the default `10px` radius and `300` weight; changing `mode` does not reset these overrides. In dropdown-only integrations, style your own input directly.
|
|
881
|
+
|
|
882
|
+
```css
|
|
883
|
+
.my-search {
|
|
884
|
+
--aia-input-radius: 0;
|
|
885
|
+
--aia-written-text-font-weight: 500;
|
|
886
|
+
}
|
|
887
|
+
```
|
|
888
|
+
|
|
880
889
|
| Variable | Default (light) | Default (dark) | Description |
|
|
881
890
|
|---|---|---|---|
|
|
882
891
|
| `--aia-font-family` | `inherit` | `inherit` | Font used by the library. Defaults to `inherit` so the library picks up your page's font automatically. Set this to pin a specific font on the library without changing the surrounding page. |
|
|
@@ -889,12 +898,14 @@ Override these on the container element. The variables are declared with `:where
|
|
|
889
898
|
| `--aia-option-font-size` | `19px` | `19px` | Option font size |
|
|
890
899
|
| `--aia-written-text-color` | `#000000` | `#ffffff` | Input text |
|
|
891
900
|
| `--aia-written-text-font-size` | `19px` | `19px` | Input text font size |
|
|
901
|
+
| `--aia-written-text-font-weight` | `300` | `300` | Written text weight in the full input. Completed chips keep their own typography. |
|
|
892
902
|
| `--aia-caret-color` | `--aia-written-text-color` | `--aia-written-text-color` | Editor caret color. Override independently of input text color. |
|
|
893
903
|
| `--aia-submit-bg` | `#000000` | `#ffffff` | Submit button background. Solid + full-opacity at rest, even when the input is empty/disabled. |
|
|
894
904
|
| `--aia-submit-color` | `#ffffff` | `#000000` | Submit button arrow color |
|
|
895
905
|
| `--aia-submit-bg-disabled` | `--aia-submit-bg` | `--aia-submit-bg` | Submit background when disabled (empty input). Defaults to the enabled background so themed colors aren't washed out. Set this for a faded rest state. |
|
|
896
906
|
| `--aia-submit-color-disabled` | `--aia-submit-color` | `--aia-submit-color` | Submit arrow color when disabled. Defaults to the enabled color. |
|
|
897
907
|
| `--aia-border` | `rgba(17, 24, 39, 0.14)` | `#505050` | Input container border color |
|
|
908
|
+
| `--aia-input-radius` | `10px` | `10px` | Full input corner radius. Set `0` for square corners. |
|
|
898
909
|
| `--aia-shadow` | `none` | `none` | Input container elevation (box-shadow). Flat by default; set it to add one |
|
|
899
910
|
| `--aia-dropdown-offset` | `13px` | `13px` | Gap between the input box and the dropdown (the dropdown's margin toward the input). |
|
|
900
911
|
| `--aia-content-inset-left` | `16px` | `16px` | Left inset of the SDK's content: the input wrapper's left padding, and the line the dropdown's content (parameter label, option text, product strip) starts on. Set it when you pad the field to clear a leading icon of your own, so the dropdown's content stays aligned under the typed text. Practical minimum is `10px` (the option text's own inset); both surfaces floor it there. |
|
package/dist/index.d.mts
CHANGED
|
@@ -94,6 +94,14 @@ interface Suggestion {
|
|
|
94
94
|
* nothing about how the options are answered.
|
|
95
95
|
*/
|
|
96
96
|
smart_suggestion?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The joining word or two typed before a date or date range picker's answer
|
|
99
|
+
* ("from" before "Nov 17"). Typed as plain text, so the completed param still
|
|
100
|
+
* holds only the answer. A suggestion answered from its options carries its
|
|
101
|
+
* joining words in their text instead. Absent on servers that send none,
|
|
102
|
+
* which then answer exactly as before.
|
|
103
|
+
*/
|
|
104
|
+
lead_in?: string;
|
|
97
105
|
}
|
|
98
106
|
interface InputItem {
|
|
99
107
|
parameter: string;
|
|
@@ -2392,12 +2400,17 @@ declare function productImageSrc(url: string | null | undefined): string | undef
|
|
|
2392
2400
|
* viewport by default, iOS Safari never resizes the layout one), so
|
|
2393
2401
|
* `innerHeight` alone would never see the keyboard.
|
|
2394
2402
|
*
|
|
2395
|
-
*
|
|
2396
|
-
*
|
|
2397
|
-
*
|
|
2398
|
-
*
|
|
2399
|
-
*
|
|
2400
|
-
*
|
|
2403
|
+
* A fitted panel goes back to the normal layout as soon as that layout fits
|
|
2404
|
+
* again: a window enlarged or zoomed out, the keyboard closed, the page
|
|
2405
|
+
* scrolled, a shorter question. The two layouts are not interchangeable even
|
|
2406
|
+
* when the space is there: fitting lifts the options grid's row cap, so a
|
|
2407
|
+
* long option list is drawn in full and pushes the product strip below the
|
|
2408
|
+
* fold (2026-11-04, a dashboard preview zoomed out to 50% kept its fitted
|
|
2409
|
+
* panel and the strip was out of sight). Measuring the normal layout means
|
|
2410
|
+
* dropping the attribute for one synchronous read — nothing paints in
|
|
2411
|
+
* between — and restoring the stack's scroll if the panel stays fitted. That
|
|
2412
|
+
* height depends on the content, not the space, so it is measured once per
|
|
2413
|
+
* content and only compared on the scroll and resize frames that follow.
|
|
2401
2414
|
*
|
|
2402
2415
|
* The DOM differs per package, so like the scroll arrow the behaviour lives in
|
|
2403
2416
|
* this one controller: each package hands it its dropdown element and a way
|
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,14 @@ interface Suggestion {
|
|
|
94
94
|
* nothing about how the options are answered.
|
|
95
95
|
*/
|
|
96
96
|
smart_suggestion?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The joining word or two typed before a date or date range picker's answer
|
|
99
|
+
* ("from" before "Nov 17"). Typed as plain text, so the completed param still
|
|
100
|
+
* holds only the answer. A suggestion answered from its options carries its
|
|
101
|
+
* joining words in their text instead. Absent on servers that send none,
|
|
102
|
+
* which then answer exactly as before.
|
|
103
|
+
*/
|
|
104
|
+
lead_in?: string;
|
|
97
105
|
}
|
|
98
106
|
interface InputItem {
|
|
99
107
|
parameter: string;
|
|
@@ -2392,12 +2400,17 @@ declare function productImageSrc(url: string | null | undefined): string | undef
|
|
|
2392
2400
|
* viewport by default, iOS Safari never resizes the layout one), so
|
|
2393
2401
|
* `innerHeight` alone would never see the keyboard.
|
|
2394
2402
|
*
|
|
2395
|
-
*
|
|
2396
|
-
*
|
|
2397
|
-
*
|
|
2398
|
-
*
|
|
2399
|
-
*
|
|
2400
|
-
*
|
|
2403
|
+
* A fitted panel goes back to the normal layout as soon as that layout fits
|
|
2404
|
+
* again: a window enlarged or zoomed out, the keyboard closed, the page
|
|
2405
|
+
* scrolled, a shorter question. The two layouts are not interchangeable even
|
|
2406
|
+
* when the space is there: fitting lifts the options grid's row cap, so a
|
|
2407
|
+
* long option list is drawn in full and pushes the product strip below the
|
|
2408
|
+
* fold (2026-11-04, a dashboard preview zoomed out to 50% kept its fitted
|
|
2409
|
+
* panel and the strip was out of sight). Measuring the normal layout means
|
|
2410
|
+
* dropping the attribute for one synchronous read — nothing paints in
|
|
2411
|
+
* between — and restoring the stack's scroll if the panel stays fitted. That
|
|
2412
|
+
* height depends on the content, not the space, so it is measured once per
|
|
2413
|
+
* content and only compared on the scroll and resize frames that follow.
|
|
2401
2414
|
*
|
|
2402
2415
|
* The DOM differs per package, so like the scroll arrow the behaviour lives in
|
|
2403
2416
|
* this one controller: each package hands it its dropdown element and a way
|