@magicx-eng/ai-autocomplete-react 0.17.1 → 0.17.3
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.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -623,15 +623,17 @@ import{buildSubmitResult as Li,cellDay as Oi,cellIso as Mi,DATE_RANGE_META_END a
|
|
|
623
623
|
it tracks the grid's bottom edge in every layout). It never moves: the
|
|
624
624
|
controller toggles data-aia-visible and the only thing that transitions is
|
|
625
625
|
opacity \u2014 a slow, even second in and the same second out. Any travel read as
|
|
626
|
-
the disc sliding with the scroll (2026-09-04). z-index
|
|
627
|
-
option rows and
|
|
628
|
-
.magicx-aia-scroll-arrow
|
|
629
|
-
commit. */
|
|
626
|
+
the disc sliding with the scroll (2026-09-04). z-index 4 puts it over the
|
|
627
|
+
option rows and the footer (z-index 3), whose opaque fade plate would
|
|
628
|
+
otherwise bury it. Declarations mirror vanilla's .magicx-aia-scroll-arrow
|
|
629
|
+
and Angular's copy \u2014 change all three in the same commit. */
|
|
630
630
|
.AIAutocompleteDropdown-module_scrollArrow_uUzV0 {
|
|
631
631
|
position: absolute;
|
|
632
632
|
left: 50%;
|
|
633
633
|
bottom: var(--aia-scroll-arrow-bottom, 8px);
|
|
634
|
-
z-index:
|
|
634
|
+
/* Above the footer (z-index 3): its fade plate is opaque on desktop and
|
|
635
|
+
would otherwise bury the disc, which sits half over it by design. */
|
|
636
|
+
z-index: 4;
|
|
635
637
|
display: inline-flex;
|
|
636
638
|
align-items: center;
|
|
637
639
|
justify-content: center;
|
|
@@ -1556,7 +1558,7 @@ import{buildSubmitResult as Li,cellDay as Oi,cellIso as Mi,DATE_RANGE_META_END a
|
|
|
1556
1558
|
}
|
|
1557
1559
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
1558
1560
|
}
|
|
1559
|
-
`,document.head.appendChild(e)}import{jsx as xa}from"react/jsx-runtime";function vt({space:e,align:r="stretch",className:a,children:i,...s}){let o=e?{"--aia-stack-space":e}:void 0;return xa("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":r,style:o,...s,children:i})}import{jsx as B,jsxs as qe}from"react/jsx-runtime";var Ia=[159,119,164],Aa=()=>{},wt=()=>{};function Sa(e){let r=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,i]=Pa(r);if(Ue(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let s=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>i(s.matches);return s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function Da(e,r){let a=Le(null);Ue(()=>{let i=e.current,s=r.current;if(!i||!s)return;let o=i.querySelector(".aia-grid[data-scroll]");if(a.current&&a.current.grid!==o&&(a.current.controller.destroy(),a.current=null),o&&!a.current){a.current={grid:o,controller:ya({dropdown:i,grid:o,button:s})};return}a.current?.controller.update()}),Ue(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function je({suggestions:e,activeIndex:r,onSelect:a,onHighlight:i,isOpen:s,id:o,className:n,pills:f,onPillClick:g,showPills:v=!0,onSkip:_,showSkipButton:p=!0,skipDisabled:w=!1,activeSelected:y=!1,isLoading:b=!1,isInputEmpty:D=!1,products:C,onProductSelect:Q,onProductFocusChange:Y,formatType:L="options",dateView:k=null,selectedDateIso:X=null,selectedDateRange:Z=null,dateRangeStart:u=null,onPreviousMonth:se,onNextMonth:J,optionsPosition:E="below",mode:W}){let ee=Sa(W),te=ee!==void 0,q=Le(null),U=Le(null);Da(q,U);let R=e[0]?.options??[],ae=!!(f&&f.length>0&&g),le=!!(C&&C.length>0),T=s&&(R.length>0||v&&ae||b||le),O={suggestions:e,activeIndex:r,pills:f,showPills:v,showSkipButton:p,skipDisabled:w,activeSelected:y,isLoading:b,isInputEmpty:D,products:C,formatType:L,dateView:k,selectedDateIso:X,selectedDateRange:Z,dateRangeStart:u},oe=Le(O);T&&(oe.current=O);let t=T?O:oe.current,c=t.suggestions[0],h=c?.options??[],l=t.activeIndex>=0&&!!h[t.activeIndex]?.is_tappable,x=!!(t.pills&&t.pills.length>0&&g),A=t.showPills&&x,M=t.showPills&&!x&&t.isLoading,d=A||M,ie=x&&t.showSkipButton&&!t.isInputEmpty&&!!_,fe=t.pills?.[0]?.text,de=_a(t.formatType)&&t.dateView!=null,ce=h.length>0&&!de,j=h.length>0&&de,ge=t.isLoading&&!ce&&!j,F=t.products??[];return qe("div",{ref:q,id:o,role:"listbox","data-aia-dropdown":"","data-options-position":E,"data-mode":ee,"data-aia-loading":t.isLoading?"":void 0,"data-aia-has-products":F.length>0?"":void 0,className:`${te?"magicx-aia ":""}${ne.dropdown} ${T?ne.visible:""} ${n??""}`,onMouseDown:N=>N.preventDefault(),children:[qe(vt,{space:"8px",children:[(d||ie)&&qe(_e,{noWrap:!0,className:ne.pillBar,"data-aia-pillbar":"",children:[d&&B("span",{className:ne.pillScroll,"data-aia-pill-scroll":"",children:B(Re,{pills:t.pills??[],activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:g??(()=>{}),rounded:!0,loading:t.isLoading})}),ie&&B("button",{type:"button",tabIndex:-1,className:ne.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":fe?`Skip ${fe}`:"Skip",onClick:_,children:"skip"})]}),ce&&B(bt,{options:h,activeIndex:t.activeIndex,onSelect:a,onHighlight:i,listboxId:o,loading:t.isLoading,groupKey:c?`${c.type} ${c.text}`:"",optionsPosition:E}),j&&t.dateView&&B(nt,{options:h,activeIndex:t.activeIndex,listboxId:o,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null},onSelect:a,onHighlight:i,onPreviousMonth:se??wt,onNextMonth:J??wt}),ge&&B("div",{className:ne.skeletonBars,"data-aia-skeleton-bars":"",children:Ia.map(N=>B("span",{className:ne.skeletonBar,style:{width:N}},`bar-${N}`))}),B(ct,{products:F,listboxId:o,onSelect:Q??Aa,onFocusChange:Y,focusable:T}),B(st,{isOptionHighlighted:l,isInputEmpty:t.isInputEmpty})]}),B("button",{ref:U,type:"button",tabIndex:-1,className:ne.scrollArrow,"data-aia-scroll-arrow":"","aria-label":ka,"aria-hidden":"true",children:B("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:B("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Fa,ModeController as Ha,setCursorOffset as Ka}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.SubmitButton-module_submitButton_otz7H {
|
|
1561
|
+
`,document.head.appendChild(e)}import{jsx as xa}from"react/jsx-runtime";function vt({space:e,align:r="stretch",className:a,children:i,...s}){let o=e?{"--aia-stack-space":e}:void 0;return xa("div",{className:a?`aia-stack ${a}`:"aia-stack","data-align":r,style:o,...s,children:i})}import{jsx as B,jsxs as qe}from"react/jsx-runtime";var Ia=[159,119,164],Aa=()=>{},wt=()=>{};function Sa(e){let r=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches,[a,i]=Pa(r);if(Ue(()=>{if(e!=="auto"||typeof window>"u"||typeof window.matchMedia!="function")return;let s=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>i(s.matches);return s.addEventListener("change",o),()=>s.removeEventListener("change",o)},[e]),e!==void 0)return e==="auto"?a?"dark":"light":e}function Da(e,r){let a=Le(null);Ue(()=>{let i=e.current,s=r.current;if(!i||!s)return;let o=i.querySelector(".aia-grid[data-scroll]");if(a.current&&a.current.grid!==o&&(a.current.controller.destroy(),a.current=null),o&&!a.current){a.current={grid:o,controller:ya({dropdown:i,grid:o,button:s})};return}a.current?.controller.update()}),Ue(()=>()=>{a.current?.controller.destroy(),a.current=null},[])}function je({suggestions:e,activeIndex:r,onSelect:a,onHighlight:i,isOpen:s,id:o,className:n,pills:f,onPillClick:g,showPills:v=!0,onSkip:_,showSkipButton:p=!0,skipDisabled:w=!1,activeSelected:y=!1,isLoading:b=!1,isInputEmpty:D=!1,products:C,onProductSelect:Q,onProductFocusChange:Y,formatType:L="options",dateView:k=null,selectedDateIso:X=null,selectedDateRange:Z=null,dateRangeStart:u=null,onPreviousMonth:se,onNextMonth:J,optionsPosition:E="below",mode:W}){let ee=Sa(W),te=ee!==void 0,q=Le(null),U=Le(null);Da(q,U);let R=e[0]?.options??[],ae=!!(f&&f.length>0&&g),le=!!(C&&C.length>0),T=s&&(R.length>0||v&&ae||b||le),O={suggestions:e,activeIndex:r,pills:f,showPills:v,showSkipButton:p,skipDisabled:w,activeSelected:y,isLoading:b,isInputEmpty:D,products:C,formatType:L,dateView:k,selectedDateIso:X,selectedDateRange:Z,dateRangeStart:u},oe=Le(O);T&&(oe.current=O);let t=T?O:oe.current,c=t.suggestions[0],h=c?.options??[],l=t.activeIndex>=0&&!!h[t.activeIndex]?.is_tappable,x=!!(t.pills&&t.pills.length>0&&g),A=t.showPills&&x,M=t.showPills&&!x&&t.isLoading,d=A||M,ie=x&&t.showSkipButton&&!t.isInputEmpty&&!!_,fe=t.pills?.[0]?.text,de=_a(t.formatType)&&t.dateView!=null,ce=h.length>0&&!de,j=h.length>0&&de&&!t.isLoading,ge=t.isLoading&&!ce&&!j,F=t.products??[];return qe("div",{ref:q,id:o,role:"listbox","data-aia-dropdown":"","data-options-position":E,"data-mode":ee,"data-aia-loading":t.isLoading?"":void 0,"data-aia-has-products":F.length>0?"":void 0,className:`${te?"magicx-aia ":""}${ne.dropdown} ${T?ne.visible:""} ${n??""}`,onMouseDown:N=>N.preventDefault(),children:[qe(vt,{space:"8px",children:[(d||ie)&&qe(_e,{noWrap:!0,className:ne.pillBar,"data-aia-pillbar":"",children:[d&&B("span",{className:ne.pillScroll,"data-aia-pill-scroll":"",children:B(Re,{pills:t.pills??[],activePillIndex:0,activeSelected:t.activeSelected,onSelectPill:g??(()=>{}),rounded:!0,loading:t.isLoading})}),ie&&B("button",{type:"button",tabIndex:-1,className:ne.skip,"data-aia-skip":"",disabled:t.isLoading||t.skipDisabled,"aria-label":fe?`Skip ${fe}`:"Skip",onClick:_,children:"skip"})]}),ce&&B(bt,{options:h,activeIndex:t.activeIndex,onSelect:a,onHighlight:i,listboxId:o,loading:t.isLoading,groupKey:c?`${c.type} ${c.text}`:"",optionsPosition:E}),j&&t.dateView&&B(nt,{options:h,activeIndex:t.activeIndex,listboxId:o,view:t.dateView,selection:{selectedIso:t.selectedDateIso??null,selectedRange:t.selectedDateRange??null,rangeStart:t.dateRangeStart??null},onSelect:a,onHighlight:i,onPreviousMonth:se??wt,onNextMonth:J??wt}),ge&&B("div",{className:ne.skeletonBars,"data-aia-skeleton-bars":"",children:Ia.map(N=>B("span",{className:ne.skeletonBar,style:{width:N}},`bar-${N}`))}),B(ct,{products:F,listboxId:o,onSelect:Q??Aa,onFocusChange:Y,focusable:T}),B(st,{isOptionHighlighted:l,isInputEmpty:t.isInputEmpty})]}),B("button",{ref:U,type:"button",tabIndex:-1,className:ne.scrollArrow,"data-aia-scroll-arrow":"","aria-label":ka,"aria-hidden":"true",children:B("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:B("path",{d:"M4 6.5 8 10.5l4-4"})})})]})}import{buildSubmitResult as Fa,ModeController as Ha,setCursorOffset as Ka}from"@magicx-eng/ai-autocomplete-vanilla";if(typeof document<"u"&&!document.getElementById("ac-style-fdee06e6")){let e=document.createElement("style");e.id="ac-style-fdee06e6",e.textContent=`.SubmitButton-module_submitButton_otz7H {
|
|
1560
1562
|
flex-shrink: 0;
|
|
1561
1563
|
width: 32px;
|
|
1562
1564
|
height: 32px;
|