@magicx-eng/ai-autocomplete-react 0.4.0 → 0.4.2
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -170,7 +170,7 @@ interface AIAutocompleteDropdownProps {
|
|
|
170
170
|
isLoading?: boolean;
|
|
171
171
|
/** Once the user has tabbed to highlight an option, the footer hint switches from "tab to select" to "→ to skip". Provided by `dropdownProps` from the hook. */
|
|
172
172
|
hasTabbedToHighlight?: boolean;
|
|
173
|
-
/** When the input has no typed text, the footer hint reads "tab to
|
|
173
|
+
/** When the input has no typed text, the footer hint reads "tab to select". Provided by `dropdownProps` from the hook. */
|
|
174
174
|
isInputEmpty?: boolean;
|
|
175
175
|
/**
|
|
176
176
|
* Where the dropdown opens relative to the input. When `"above"`, the dropdown
|
package/dist/index.d.ts
CHANGED
|
@@ -170,7 +170,7 @@ interface AIAutocompleteDropdownProps {
|
|
|
170
170
|
isLoading?: boolean;
|
|
171
171
|
/** Once the user has tabbed to highlight an option, the footer hint switches from "tab to select" to "→ to skip". Provided by `dropdownProps` from the hook. */
|
|
172
172
|
hasTabbedToHighlight?: boolean;
|
|
173
|
-
/** When the input has no typed text, the footer hint reads "tab to
|
|
173
|
+
/** When the input has no typed text, the footer hint reads "tab to select". Provided by `dropdownProps` from the hook. */
|
|
174
174
|
isInputEmpty?: boolean;
|
|
175
175
|
/**
|
|
176
176
|
* Where the dropdown opens relative to the input. When `"above"`, the dropdown
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
.AIAutocomplete-module_inputWrapper_FLq1b {
|
|
11
11
|
padding: 12px 10px;
|
|
12
12
|
border: 1px solid var(--aia-border, #b0b0b0);
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: 20px;
|
|
14
14
|
background: var(--aia-surface, #ffffff);
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
display: flex;
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
--aia-surface: #ffffff;
|
|
174
174
|
--aia-border: #b0b0b0;
|
|
175
175
|
--aia-dropdown-border: #e5e7eb;
|
|
176
|
-
--aia-dropdown-shadow: 0 8px 12px rgba(0, 0, 0, 0.
|
|
176
|
+
--aia-dropdown-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
|
|
177
177
|
--aia-pill-bg: #bdbdbd;
|
|
178
178
|
--aia-pill-color: #333539;
|
|
179
179
|
--aia-pill-font-size: 14px;
|
|
@@ -208,12 +208,12 @@
|
|
|
208
208
|
--aia-surface: #000000;
|
|
209
209
|
--aia-border: #505050;
|
|
210
210
|
--aia-dropdown-border: #484848;
|
|
211
|
-
--aia-dropdown-shadow: 0 8px 12px rgba(0, 0, 0, 0.
|
|
211
|
+
--aia-dropdown-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
|
|
212
212
|
--aia-pill-bg: #bdbdbd;
|
|
213
213
|
--aia-pill-color: #b0b0b0;
|
|
214
214
|
--aia-pill-font-size: 14px;
|
|
215
215
|
|
|
216
|
-
--aia-option-bg:
|
|
216
|
+
--aia-option-bg: #323232;
|
|
217
217
|
--aia-option-color: #b0b0b0;
|
|
218
218
|
--aia-option-color-selected: #ffffff;
|
|
219
219
|
--aia-option-font-size: 14px;
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
display: flex;
|
|
288
288
|
flex-direction: column;
|
|
289
289
|
box-sizing: border-box;
|
|
290
|
-
padding:
|
|
290
|
+
padding: 10px 8px;
|
|
291
291
|
overflow: hidden;
|
|
292
292
|
container-type: inline-size;
|
|
293
293
|
z-index: 10;
|
|
@@ -298,8 +298,8 @@
|
|
|
298
298
|
frosted-glass look with data-aia-surface="glass". */
|
|
299
299
|
background: var(--aia-surface, #ffffff);
|
|
300
300
|
border: 1px solid var(--aia-dropdown-border, #e5e7eb);
|
|
301
|
-
border-radius:
|
|
302
|
-
box-shadow: var(--aia-dropdown-shadow, 0 8px 12px rgba(0, 0, 0, 0.
|
|
301
|
+
border-radius: 18px;
|
|
302
|
+
box-shadow: var(--aia-dropdown-shadow, 0 8px 12px rgba(0, 0, 0, 0.1));
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
.AIAutocompleteDropdown-module_dropdown_yz2KC[data-aia-surface="glass"] {
|
|
@@ -324,10 +324,9 @@
|
|
|
324
324
|
pointer-events: auto;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
/* The dropdown owns
|
|
328
|
-
(
|
|
327
|
+
/* The dropdown container owns the 10px/8px edge padding and the 8px section
|
|
328
|
+
gaps (matching Figma); the pill row adds none \u2014 just horizontal scroll + fade. */
|
|
329
329
|
.AIAutocompleteDropdown-module_pillBar_pwTXe {
|
|
330
|
-
padding: 7px 8px;
|
|
331
330
|
overflow-x: auto;
|
|
332
331
|
overflow-y: hidden;
|
|
333
332
|
scrollbar-width: none;
|
|
@@ -415,18 +414,19 @@
|
|
|
415
414
|
justify-content: space-around;
|
|
416
415
|
}
|
|
417
416
|
}
|
|
418
|
-
`,document.head.appendChild(e)}var Re=require("react/jsx-runtime");function ge({gap:e,align:t="center",justify:o="start",noWrap:p=!1,inline:a=!1,className:s,children:l,...d}){let f=e?{"--aia-cluster-gap":e}:void 0,x={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":t,"data-justify":o,"data-nowrap":p||void 0,"data-inline":a||void 0,style:f,...d};return a?(0,Re.jsx)("span",{...x,children:l}):(0,Re.jsx)("div",{...x,children:l})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own
|
|
419
|
-
|
|
420
|
-
dropdown's
|
|
417
|
+
`,document.head.appendChild(e)}var Re=require("react/jsx-runtime");function ge({gap:e,align:t="center",justify:o="start",noWrap:p=!1,inline:a=!1,className:s,children:l,...d}){let f=e?{"--aia-cluster-gap":e}:void 0,x={className:s?`aia-cluster ${s}`:"aia-cluster","data-align":t,"data-justify":o,"data-nowrap":p||void 0,"data-inline":a||void 0,style:f,...d};return a?(0,Re.jsx)("span",{...x,children:l}):(0,Re.jsx)("div",{...x,children:l})}if(typeof document<"u"&&!document.getElementById("ac-style-56b0c577")){let e=document.createElement("style");e.id="ac-style-56b0c577",e.textContent=`/* The footer adds its own 8px horizontal inset (no vertical padding \u2014 the 8px
|
|
418
|
+
section gap above and its own 8px gap provide the vertical rhythm), so the
|
|
419
|
+
divider spans the full footer width yet still stays clear of the dropdown's
|
|
420
|
+
rounded edges. */
|
|
421
421
|
.DropdownFooter-module_footer_qQQ7x {
|
|
422
422
|
display: flex;
|
|
423
423
|
flex-direction: column;
|
|
424
424
|
gap: 8px;
|
|
425
|
-
padding:
|
|
425
|
+
padding: 0 8px;
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
.DropdownFooter-module_divider_FlX4C {
|
|
429
|
-
border-top:
|
|
429
|
+
border-top: 1px solid var(--aia-footer-divider, rgba(176, 176, 176, 0.4));
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
.DropdownFooter-module_hintGroup_ZzbPf {
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
}
|
|
970
970
|
/* data-align="stretch" is the flex default \u2014 no rule needed. */
|
|
971
971
|
}
|
|
972
|
-
`,document.head.appendChild(e)}var Qe=require("react/jsx-runtime");function Ue({space:e,align:t="stretch",className:o,children:p,...a}){let s=e?{"--aia-stack-space":e}:void 0;return(0,Qe.jsx)("div",{className:o?`aia-stack ${o}`:"aia-stack","data-align":t,style:s,...a,children:p})}var $=require("react/jsx-runtime"),bt=[159,119,164];function Ie({suggestions:e,activeIndex:t,onSelect:o,onHighlight:p,isOpen:a,id:s,className:l,pills:d,onPillClick:f,showPills:x=!0,activeSelected:L=!1,isLoading:P=!1,hasTabbedToHighlight:A=!1,isInputEmpty:C=!1,optionsPosition:v="below"}){let B=e[0]?.options??[],M=!!(d&&d.length>0&&f),N=a&&(B.length>0||x&&M||P),n={suggestions:e,activeIndex:t,pills:d,showPills:x,activeSelected:L,isLoading:P,hasTabbedToHighlight:A,isInputEmpty:C},_=(0,Xe.useRef)(n);N&&(_.current=n);let g=N?n:_.current,z=g.suggestions[0]?.options??[],U=g.activeIndex>=0&&!!z[g.activeIndex]?.is_tappable,K=!!(g.pills&&g.pills.length>0&&f),R=g.showPills&&K,Q=g.showPills&&!K&&g.isLoading,F=R||Q,X=z.length>0,J=g.isLoading&&!X;return(0,$.jsx)("div",{id:s,role:"listbox","data-aia-dropdown":"","data-options-position":v,"data-aia-loading":g.isLoading?"":void 0,className:`${ce.dropdown} ${N?ce.visible:""} ${l??""}`,onMouseDown:H=>H.preventDefault(),children:(0,$.jsxs)(Ue,{space:"
|
|
972
|
+
`,document.head.appendChild(e)}var Qe=require("react/jsx-runtime");function Ue({space:e,align:t="stretch",className:o,children:p,...a}){let s=e?{"--aia-stack-space":e}:void 0;return(0,Qe.jsx)("div",{className:o?`aia-stack ${o}`:"aia-stack","data-align":t,style:s,...a,children:p})}var $=require("react/jsx-runtime"),bt=[159,119,164];function Ie({suggestions:e,activeIndex:t,onSelect:o,onHighlight:p,isOpen:a,id:s,className:l,pills:d,onPillClick:f,showPills:x=!0,activeSelected:L=!1,isLoading:P=!1,hasTabbedToHighlight:A=!1,isInputEmpty:C=!1,optionsPosition:v="below"}){let B=e[0]?.options??[],M=!!(d&&d.length>0&&f),N=a&&(B.length>0||x&&M||P),n={suggestions:e,activeIndex:t,pills:d,showPills:x,activeSelected:L,isLoading:P,hasTabbedToHighlight:A,isInputEmpty:C},_=(0,Xe.useRef)(n);N&&(_.current=n);let g=N?n:_.current,z=g.suggestions[0]?.options??[],U=g.activeIndex>=0&&!!z[g.activeIndex]?.is_tappable,K=!!(g.pills&&g.pills.length>0&&f),R=g.showPills&&K,Q=g.showPills&&!K&&g.isLoading,F=R||Q,X=z.length>0,J=g.isLoading&&!X;return(0,$.jsx)("div",{id:s,role:"listbox","data-aia-dropdown":"","data-options-position":v,"data-aia-loading":g.isLoading?"":void 0,className:`${ce.dropdown} ${N?ce.visible:""} ${l??""}`,onMouseDown:H=>H.preventDefault(),children:(0,$.jsxs)(Ue,{space:"8px",children:[F&&(0,$.jsx)(ge,{noWrap:!0,className:ce.pillBar,"data-aia-pillbar":"",children:(0,$.jsx)(_e,{pills:g.pills??[],activePillIndex:0,activeSelected:g.activeSelected,onSelectPill:f??(()=>{}),rounded:!0,loading:g.isLoading})}),X&&(0,$.jsx)($e,{options:z,activeIndex:g.activeIndex,onSelect:o,onHighlight:p,listboxId:s,loading:g.isLoading}),J&&(0,$.jsx)("div",{className:ce.skeletonBars,"data-aia-skeleton-bars":"",children:bt.map(H=>(0,$.jsx)("span",{className:ce.skeletonBar,style:{width:H}},`bar-${H}`))}),(0,$.jsx)(Ke,{hasTabbedToHighlight:g.hasTabbedToHighlight,isOptionHighlighted:U,isInputEmpty:g.isInputEmpty})]})})}var ue=require("@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 {
|
|
973
973
|
flex-shrink: 0;
|
|
974
974
|
width: 32px;
|
|
975
975
|
height: 32px;
|