@magicx-eng/ai-autocomplete-react 0.29.0 → 0.29.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.mjs CHANGED
@@ -1710,8 +1710,18 @@ import{buildSubmitResult as on,cellDay as nn,cellIso as rn,DATE_RANGE_META_END a
1710
1710
  gap: var(--aia-grid-gap, 0);
1711
1711
  }
1712
1712
 
1713
- /* Scrollable variant \u2014 capped height with a styled thin scrollbar. Rows pack
1714
- from the top instead of stretching to fill the container. */
1713
+ /* Scrollable variant \u2014 capped height, rows packed from the top instead of
1714
+ stretching to fill the container.
1715
+
1716
+ The scrollbar is hidden in every engine, as the product strip's and the
1717
+ input's already are: the list stays scrollable by wheel, trackpad, touch
1718
+ and keyboard, and the dropdown's "more below" arrow says there is more.
1719
+ Styling it instead (a thin, tinted bar) looked right only in Chrome, whose
1720
+ macOS overlay scrollbar ignores the ::-webkit-scrollbar rules \u2014 Safari drew
1721
+ a permanent bar over the list.
1722
+
1723
+ overscroll-behavior: contain keeps a wheel or trackpad fling that runs past
1724
+ either end of the list from scrolling the page behind the dropdown. */
1715
1725
  .aia-grid[data-scroll] {
1716
1726
  grid-auto-rows: min-content;
1717
1727
  align-content: start;
@@ -1721,18 +1731,11 @@ import{buildSubmitResult as on,cellDay as nn,cellIso as rn,DATE_RANGE_META_END a
1721
1731
  appearance.css for why. */
1722
1732
  max-height: var(--aia-grid-max-height, 120px);
1723
1733
  overflow-y: auto;
1724
- scrollbar-width: thin;
1725
- scrollbar-color: var(--aia-scrollbar-thumb, rgba(0, 0, 0, 0.3)) transparent;
1734
+ overscroll-behavior: contain;
1735
+ scrollbar-width: none;
1726
1736
  }
1727
1737
  .aia-grid[data-scroll]::-webkit-scrollbar {
1728
- width: 6px;
1729
- }
1730
- .aia-grid[data-scroll]::-webkit-scrollbar-track {
1731
- background: transparent;
1732
- }
1733
- .aia-grid[data-scroll]::-webkit-scrollbar-thumb {
1734
- background: var(--aia-scrollbar-thumb, rgba(0, 0, 0, 0.3));
1735
- border-radius: 3px;
1738
+ display: none;
1736
1739
  }
1737
1740
  `,document.head.appendChild(e)}import{jsx as Ca}from"react/jsx-runtime";function bt({min:e="16rem",max:o,gap:t,scroll:n=!1,maxHeight:r,scrollResetKey:i,cols:a,template:l,innerRef:w,className:b,children:v,...C}){let g=ka(null);ya(()=>{if(i===void 0)return;let T=g.current;T&&(T.scrollTop=0)},[i]);let x={"--aia-grid-min":e};return o&&(x["--aia-grid-max"]=o),t&&(x["--aia-grid-gap"]=t),r&&(x["--aia-grid-max-height"]=r),a&&(x.gridTemplateColumns=xa(a)),l&&(x.gridTemplateColumns=l),Ca("div",{ref:T=>{g.current=T,w?.(T)},className:b?`aia-grid ${b}`:"aia-grid","data-scroll":n||void 0,style:x,...C,children:v})}import{formatOptionCount as Pa,OPTION_ENTER_DELAY_VAR as Sa,optionImageSrc as Ia,optionLabel as Ea,sanitizeOptionIconSvg as Ta}from"@magicx-eng/ai-autocomplete-vanilla";import{useEffect as Aa,useMemo as Ra,useRef as Da,useState as Ze}from"react";if(typeof document<"u"&&!document.getElementById("ac-style-82820da7")){let e=document.createElement("style");e.id="ac-style-82820da7",e.textContent=`.aia-item-d4vpD {
1738
1741
  position: relative;