Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/f36-autocomplete

Package Overview
Dependencies
Maintainers
104
Versions
305
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-autocomplete - npm Package Compare versions

Comparing version 4.0.1-next-v4-9287.2420 to 4.0.1-next-v4-9320.2421

2

dist/main.js

@@ -1,2 +0,2 @@

var e=b(require("@babel/runtime/helpers/extends")),{cx:t,css:n}=require("emotion"),a=require("react"),o=b(a),{useState:l}=a,{useCombobox:r}=require("downshift"),{mergeRefs:i}=require("@contentful/f36-core"),{IconButton:s}=require("@contentful/f36-button"),{TextInput:c}=require("@contentful/f36-forms"),{ChevronDownIcon:u,CloseIcon:m}=require("@contentful/f36-icons"),{SkeletonContainer:d,SkeletonBodyText:p}=require("@contentful/f36-skeleton"),{Popover:g}=require("@contentful/f36-popover"),f=b(require("@contentful/f36-tokens"));function b(e){return e&&e.__esModule?e.default:e}var h,y,k,v,E={};h=E,y="Autocomplete",k=()=>C,Object.defineProperty(h,y,{get:k,set:v,enumerable:!0,configurable:!0});function I(a,d){const{id:p,className:b,clearAfterSelect:h=!1,items:y,onFilter:k,onSelectItem:v,renderItem:E,itemToString:I=(e=>e),isInvalid:C,isDisabled:q,isRequired:S,isReadOnly:w,noMatchesMessage:N="No matches",placeholder:P="Search",inputRef:R,toggleRef:T,listRef:M,listWidth:O="auto",listMaxHeight:B=180,isLoading:D=!1,testId:$="cf-autocomplete"}=a,j=(e=>({autocomplete:n({name:"1jke4yk",styles:"position:relative;width:100%;"}),combobox:n({name:"79elbk",styles:"position:relative;"}),toggleButton:n({name:"1nbt92p",styles:"position:absolute;top:4px;right:4px;z-index:1;"}),list:n({overflowY:"auto",listStyle:"none",padding:`${f.spacingXs} 0`,margin:0,maxHeight:`${e}px`},""),item:n({display:"block",padding:`${f.spacingXs} ${f.spacingM}`,wordBreak:"break-word",whiteSpace:"break-spaces",cursor:"pointer",hyphens:"auto","&:focus, &:hover":{backgroundColor:f.gray100},"&:active":{backgroundColor:f.gray200}},""),disabled:n({name:"1e07izz",styles:"opacity:0.5;pointer-events:none;"}),highlighted:n({backgroundColor:f.gray100},"")}))(B),[z,_]=l(y),{getComboboxProps:A,getInputProps:F,getItemProps:H,getMenuProps:V,getToggleButtonProps:L,highlightedIndex:W,isOpen:X,setInputValue:K,inputValue:Y,toggleMenu:G}=r({items:z,itemToString:I,onStateChange:({inputValue:e,type:t,selectedItem:n})=>{switch(t){case r.stateChangeTypes.InputChange:{const t=y.filter((t=>k(t,e)));_(t);break}case r.stateChangeTypes.InputKeyDownEnter:case r.stateChangeTypes.ItemClick:n&&v(n),h&&K("")}}}),{"aria-labelledby":J,id:Q,...U}=F(),Z=A(),ee=L(),te=V();return o.createElement("div",{"data-test-id":$,className:t(j.autocomplete,b),ref:d},o.createElement(g,{autoFocus:!1,usePortal:!1,isOpen:X,isFullWidth:"full"===O},o.createElement(g.Trigger,null,o.createElement("div",e({},Z,{className:j.combobox}),o.createElement(c,e({},U,{id:p,isInvalid:C,isDisabled:q,isRequired:S,isReadOnly:w,ref:i(U.ref,R),testId:"cf-autocomplete-input",placeholder:P})),o.createElement(s,e({},ee,{ref:i(ee.ref,T),"aria-label":"toggle menu",className:j.toggleButton,variant:"transparent",icon:Y?o.createElement(m,{"aria-label":"Clear"}):o.createElement(u,{"aria-label":"Show list"}),onClick:()=>{Y?(K(""),_(y)):G()},isDisabled:q,size:"small"})))),o.createElement(g.Content,null,o.createElement("ul",e({},te,{ref:i(te.ref,M),className:j.list,"data-test-id":"cf-autocomplete-list"}),D&&[...Array(3)].map(((e,n)=>o.createElement("li",{key:n,className:t(j.item,j.disabled)},o.createElement(x,null)))),!D&&0===z.length&&o.createElement("li",{className:t(j.item,j.disabled)},N),!D&&z.map(((n,a)=>{const l=H({item:n,index:a});return o.createElement("li",e({},l,{key:a,className:t([j.item,W===a&&j.highlighted]),"data-test-id":`cf-autocomplete-list-item-${a}`}),E?E(n):n)}))))))}function x(){return o.createElement(d,{svgHeight:16},o.createElement(p,{numberOfLines:1}))}const C=o.forwardRef(I);var q,S;q=module.exports,S=E,Object.keys(S).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(q,e,{enumerable:!0,get:function(){return S[e]}})}));
var e=b(require("@babel/runtime/helpers/extends")),{cx:t,css:n}=require("emotion"),a=require("react"),o=b(a),{useState:l}=a,{useCombobox:r}=require("downshift"),{mergeRefs:i}=require("@contentful/f36-core"),{IconButton:s}=require("@contentful/f36-button"),{TextInput:c}=require("@contentful/f36-forms"),{CloseIcon:u,ChevronDownIcon:m}=require("@contentful/f36-icons"),{SkeletonBodyText:d,SkeletonContainer:p}=require("@contentful/f36-skeleton"),{Popover:g}=require("@contentful/f36-popover"),f=b(require("@contentful/f36-tokens"));function b(e){return e&&e.__esModule?e.default:e}var h,y,k,v,E={};h=E,y="Autocomplete",k=()=>C,Object.defineProperty(h,y,{get:k,set:v,enumerable:!0,configurable:!0});function I(a,d){const{id:p,className:b,clearAfterSelect:h=!1,items:y,onFilter:k,onSelectItem:v,renderItem:E,itemToString:I=(e=>e),isInvalid:C,isDisabled:q,isRequired:S,isReadOnly:w,noMatchesMessage:N="No matches",placeholder:P="Search",inputRef:R,toggleRef:T,listRef:M,listWidth:O="auto",listMaxHeight:B=180,isLoading:D=!1,testId:$="cf-autocomplete"}=a,j=(e=>({autocomplete:n({name:"1jke4yk",styles:"position:relative;width:100%;"}),combobox:n({name:"79elbk",styles:"position:relative;"}),toggleButton:n({name:"1nbt92p",styles:"position:absolute;top:4px;right:4px;z-index:1;"}),list:n({overflowY:"auto",listStyle:"none",padding:`${f.spacingXs} 0`,margin:0,maxHeight:`${e}px`},""),item:n({display:"block",padding:`${f.spacingXs} ${f.spacingM}`,wordBreak:"break-word",whiteSpace:"break-spaces",cursor:"pointer",hyphens:"auto","&:focus, &:hover":{backgroundColor:f.gray100},"&:active":{backgroundColor:f.gray200}},""),disabled:n({name:"1e07izz",styles:"opacity:0.5;pointer-events:none;"}),highlighted:n({backgroundColor:f.gray100},"")}))(B),[z,_]=l(y),{getComboboxProps:A,getInputProps:F,getItemProps:H,getMenuProps:V,getToggleButtonProps:L,highlightedIndex:W,isOpen:X,setInputValue:K,inputValue:Y,toggleMenu:G}=r({items:z,itemToString:I,onStateChange:({inputValue:e,type:t,selectedItem:n})=>{switch(t){case r.stateChangeTypes.InputChange:{const t=y.filter((t=>k(t,e)));_(t);break}case r.stateChangeTypes.InputKeyDownEnter:case r.stateChangeTypes.ItemClick:n&&v(n),h&&K("")}}}),{"aria-labelledby":J,id:Q,...U}=F(),Z=A(),ee=L(),te=V();return o.createElement("div",{"data-test-id":$,className:t(j.autocomplete,b),ref:d},o.createElement(g,{autoFocus:!1,usePortal:!1,isOpen:X,isFullWidth:"full"===O},o.createElement(g.Trigger,null,o.createElement("div",e({},Z,{className:j.combobox}),o.createElement(c,e({},U,{id:p,isInvalid:C,isDisabled:q,isRequired:S,isReadOnly:w,ref:i(U.ref,R),testId:"cf-autocomplete-input",placeholder:P})),o.createElement(s,e({},ee,{ref:i(ee.ref,T),"aria-label":"toggle menu",className:j.toggleButton,variant:"transparent",icon:Y?o.createElement(u,{"aria-label":"Clear"}):o.createElement(m,{"aria-label":"Show list"}),onClick:()=>{Y?(K(""),_(y)):G()},isDisabled:q,size:"small"})))),o.createElement(g.Content,null,o.createElement("ul",e({},te,{ref:i(te.ref,M),className:j.list,"data-test-id":"cf-autocomplete-list"}),D&&[...Array(3)].map(((e,n)=>o.createElement("li",{key:n,className:t(j.item,j.disabled)},o.createElement(x,null)))),!D&&0===z.length&&o.createElement("li",{className:t(j.item,j.disabled)},N),!D&&z.map(((n,a)=>{const l=H({item:n,index:a});return o.createElement("li",e({},l,{key:a,className:t([j.item,W===a&&j.highlighted]),"data-test-id":`cf-autocomplete-list-item-${a}`}),E?E(n):n)}))))))}function x(){return o.createElement(p,{svgHeight:16},o.createElement(d,{numberOfLines:1}))}const C=o.forwardRef(I);var q,S;q=module.exports,S=E,Object.keys(S).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(q,e,{enumerable:!0,get:function(){return S[e]}})}));
//# sourceMappingURL=main.js.map

@@ -1,2 +0,2 @@

import e from"@babel/runtime/helpers/esm/extends";import{cx as t,css as o}from"emotion";import a,{useState as n}from"react";import{useCombobox as s}from"downshift";import{mergeRefs as l}from"@contentful/f36-core";import{IconButton as i}from"@contentful/f36-button";import{TextInput as r}from"@contentful/f36-forms";import{CloseIcon as c,ChevronDownIcon as m}from"@contentful/f36-icons";import{SkeletonContainer as p,SkeletonBodyText as u}from"@contentful/f36-skeleton";import{Popover as d}from"@contentful/f36-popover";import g from"@contentful/f36-tokens";var f,b,h,y;f={},b="Autocomplete",h=()=>x,Object.defineProperty(f,b,{get:h,set:y,enumerable:!0,configurable:!0});function k(p,u){const{id:f,className:b,clearAfterSelect:h=!1,items:y,onFilter:k,onSelectItem:x,renderItem:C,itemToString:E=(e=>e),isInvalid:v,isDisabled:S,isRequired:w,isReadOnly:N,noMatchesMessage:R="No matches",placeholder:T="Search",inputRef:P,toggleRef:B,listRef:M,listWidth:O="auto",listMaxHeight:D=180,isLoading:$=!1,testId:z="cf-autocomplete"}=p,A=(e=>({autocomplete:o({name:"1jke4yk",styles:"position:relative;width:100%;"}),combobox:o({name:"79elbk",styles:"position:relative;"}),toggleButton:o({name:"1nbt92p",styles:"position:absolute;top:4px;right:4px;z-index:1;"}),list:o({overflowY:"auto",listStyle:"none",padding:`${g.spacingXs} 0`,margin:0,maxHeight:`${e}px`},""),item:o({display:"block",padding:`${g.spacingXs} ${g.spacingM}`,wordBreak:"break-word",whiteSpace:"break-spaces",cursor:"pointer",hyphens:"auto","&:focus, &:hover":{backgroundColor:g.gray100},"&:active":{backgroundColor:g.gray200}},""),disabled:o({name:"1e07izz",styles:"opacity:0.5;pointer-events:none;"}),highlighted:o({backgroundColor:g.gray100},"")}))(D),[F,H]=n(y),{getComboboxProps:V,getInputProps:j,getItemProps:q,getMenuProps:L,getToggleButtonProps:W,highlightedIndex:X,isOpen:K,setInputValue:Y,inputValue:G,toggleMenu:J}=s({items:F,itemToString:E,onStateChange:({inputValue:e,type:t,selectedItem:o})=>{switch(t){case s.stateChangeTypes.InputChange:{const t=y.filter((t=>k(t,e)));H(t);break}case s.stateChangeTypes.InputKeyDownEnter:case s.stateChangeTypes.ItemClick:o&&x(o),h&&Y("")}}}),{"aria-labelledby":Q,id:U,...Z}=j(),_=V(),ee=W(),te=L();return a.createElement("div",{"data-test-id":z,className:t(A.autocomplete,b),ref:u},a.createElement(d,{autoFocus:!1,usePortal:!1,isOpen:K,isFullWidth:"full"===O},a.createElement(d.Trigger,null,a.createElement("div",e({},_,{className:A.combobox}),a.createElement(r,e({},Z,{id:f,isInvalid:v,isDisabled:S,isRequired:w,isReadOnly:N,ref:l(Z.ref,P),testId:"cf-autocomplete-input",placeholder:T})),a.createElement(i,e({},ee,{ref:l(ee.ref,B),"aria-label":"toggle menu",className:A.toggleButton,variant:"transparent",icon:G?a.createElement(c,{"aria-label":"Clear"}):a.createElement(m,{"aria-label":"Show list"}),onClick:()=>{G?(Y(""),H(y)):J()},isDisabled:S,size:"small"})))),a.createElement(d.Content,null,a.createElement("ul",e({},te,{ref:l(te.ref,M),className:A.list,"data-test-id":"cf-autocomplete-list"}),$&&[...Array(3)].map(((e,o)=>a.createElement("li",{key:o,className:t(A.item,A.disabled)},a.createElement(I,null)))),!$&&0===F.length&&a.createElement("li",{className:t(A.item,A.disabled)},R),!$&&F.map(((o,n)=>{const s=q({item:o,index:n});return a.createElement("li",e({},s,{key:n,className:t([A.item,X===n&&A.highlighted]),"data-test-id":`cf-autocomplete-list-item-${n}`}),C?C(o):o)}))))))}function I(){return a.createElement(p,{svgHeight:16},a.createElement(u,{numberOfLines:1}))}const x=a.forwardRef(k);export{x as Autocomplete};
import e from"@babel/runtime/helpers/esm/extends";import{cx as t,css as o}from"emotion";import a,{useState as n}from"react";import{useCombobox as s}from"downshift";import{mergeRefs as l}from"@contentful/f36-core";import{IconButton as i}from"@contentful/f36-button";import{TextInput as r}from"@contentful/f36-forms";import{ChevronDownIcon as c,CloseIcon as m}from"@contentful/f36-icons";import{SkeletonBodyText as p,SkeletonContainer as u}from"@contentful/f36-skeleton";import{Popover as d}from"@contentful/f36-popover";import g from"@contentful/f36-tokens";var f,b,h,y;f={},b="Autocomplete",h=()=>x,Object.defineProperty(f,b,{get:h,set:y,enumerable:!0,configurable:!0});function k(p,u){const{id:f,className:b,clearAfterSelect:h=!1,items:y,onFilter:k,onSelectItem:x,renderItem:C,itemToString:E=(e=>e),isInvalid:v,isDisabled:S,isRequired:w,isReadOnly:N,noMatchesMessage:R="No matches",placeholder:T="Search",inputRef:P,toggleRef:B,listRef:M,listWidth:O="auto",listMaxHeight:D=180,isLoading:$=!1,testId:z="cf-autocomplete"}=p,A=(e=>({autocomplete:o({name:"1jke4yk",styles:"position:relative;width:100%;"}),combobox:o({name:"79elbk",styles:"position:relative;"}),toggleButton:o({name:"1nbt92p",styles:"position:absolute;top:4px;right:4px;z-index:1;"}),list:o({overflowY:"auto",listStyle:"none",padding:`${g.spacingXs} 0`,margin:0,maxHeight:`${e}px`},""),item:o({display:"block",padding:`${g.spacingXs} ${g.spacingM}`,wordBreak:"break-word",whiteSpace:"break-spaces",cursor:"pointer",hyphens:"auto","&:focus, &:hover":{backgroundColor:g.gray100},"&:active":{backgroundColor:g.gray200}},""),disabled:o({name:"1e07izz",styles:"opacity:0.5;pointer-events:none;"}),highlighted:o({backgroundColor:g.gray100},"")}))(D),[F,H]=n(y),{getComboboxProps:V,getInputProps:j,getItemProps:q,getMenuProps:L,getToggleButtonProps:W,highlightedIndex:X,isOpen:K,setInputValue:Y,inputValue:G,toggleMenu:J}=s({items:F,itemToString:E,onStateChange:({inputValue:e,type:t,selectedItem:o})=>{switch(t){case s.stateChangeTypes.InputChange:{const t=y.filter((t=>k(t,e)));H(t);break}case s.stateChangeTypes.InputKeyDownEnter:case s.stateChangeTypes.ItemClick:o&&x(o),h&&Y("")}}}),{"aria-labelledby":Q,id:U,...Z}=j(),_=V(),ee=W(),te=L();return a.createElement("div",{"data-test-id":z,className:t(A.autocomplete,b),ref:u},a.createElement(d,{autoFocus:!1,usePortal:!1,isOpen:K,isFullWidth:"full"===O},a.createElement(d.Trigger,null,a.createElement("div",e({},_,{className:A.combobox}),a.createElement(r,e({},Z,{id:f,isInvalid:v,isDisabled:S,isRequired:w,isReadOnly:N,ref:l(Z.ref,P),testId:"cf-autocomplete-input",placeholder:T})),a.createElement(i,e({},ee,{ref:l(ee.ref,B),"aria-label":"toggle menu",className:A.toggleButton,variant:"transparent",icon:G?a.createElement(m,{"aria-label":"Clear"}):a.createElement(c,{"aria-label":"Show list"}),onClick:()=>{G?(Y(""),H(y)):J()},isDisabled:S,size:"small"})))),a.createElement(d.Content,null,a.createElement("ul",e({},te,{ref:l(te.ref,M),className:A.list,"data-test-id":"cf-autocomplete-list"}),$&&[...Array(3)].map(((e,o)=>a.createElement("li",{key:o,className:t(A.item,A.disabled)},a.createElement(I,null)))),!$&&0===F.length&&a.createElement("li",{className:t(A.item,A.disabled)},R),!$&&F.map(((o,n)=>{const s=q({item:o,index:n});return a.createElement("li",e({},s,{key:n,className:t([A.item,X===n&&A.highlighted]),"data-test-id":`cf-autocomplete-list-item-${n}`}),C?C(o):o)}))))))}function I(){return a.createElement(u,{svgHeight:16},a.createElement(p,{numberOfLines:1}))}const x=a.forwardRef(k);export{x as Autocomplete};
//# sourceMappingURL=module.js.map
{
"name": "@contentful/f36-autocomplete",
"version": "4.0.1-next-v4-9287.2420+30ea0235",
"version": "4.0.1-next-v4-9320.2421+96dfad4f",
"description": "Forma 36: Autocomplete component",

@@ -10,9 +10,9 @@ "scripts": {

"@babel/runtime": "^7.6.2",
"@contentful/f36-button": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-core": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-forms": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-icons": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-popover": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-skeleton": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-tokens": "4.0.1-next-v4-9287.2420+30ea0235",
"@contentful/f36-button": "4.0.1-next-v4-9320.2421+96dfad4f",
"@contentful/f36-core": "4.0.1-next-v4-9320.2421+96dfad4f",
"@contentful/f36-forms": "4.0.1-next-v4-9320.2421+96dfad4f",
"@contentful/f36-icons": "4.0.1-next-v4-9320.2421+96dfad4f",
"@contentful/f36-popover": "4.0.1-next-v4-9320.2421+96dfad4f",
"@contentful/f36-skeleton": "4.0.1-next-v4-9320.2421+96dfad4f",
"@contentful/f36-tokens": "4.0.1-next-v4-9320.2421+96dfad4f",
"downshift": "^6.1.7",

@@ -42,3 +42,3 @@ "emotion": "^10.0.17"

},
"gitHead": "30ea0235e3f48cf75cf3577df0ba09e91db487a5"
"gitHead": "96dfad4f76e42d3e8711f0b706b6060996a46fa1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc