@contentful/f36-autocomplete
Advanced tools
Comparing version 4.0.1-next-v4-9155.2412 to 4.0.1-next-v4-9168.2413
@@ -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:M="No Matches",placeholder:N="Search",inputRef:P,toggleRef:R,listRef:T,listWidth:O="auto",listMaxHeight:B=180,isLoading:D=!1,testId:j="cf-autocomplete"}=a,z=(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),[$,_]=l(y),{getComboboxProps:A,getInputProps:F,getItemProps:H,getMenuProps:V,getToggleButtonProps:L,highlightedIndex:W,isOpen:X,setInputValue:K,inputValue:Y,toggleMenu:G}=r({items:$,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":j,className:t(z.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:z.combobox}),o.createElement(c,e({},U,{id:p,isInvalid:C,isDisabled:q,isRequired:S,isReadOnly:w,ref:i(U.ref,P),testId:"cf-autocomplete-input",placeholder:N})),o.createElement(s,e({},ee,{ref:i(ee.ref,R),"aria-label":"toggle menu",className:z.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,T),className:z.list,"data-test-id":"cf-autocomplete-list"}),D&&[...Array(3)].map(((e,n)=>o.createElement("li",{key:n,className:t(z.item,z.disabled)},o.createElement(x,null)))),!D&&0===$.length&&o.createElement("li",{className:t(z.item,z.disabled)},M),!D&&$.map(((n,a)=>{const l=H({item:n,index:a});return o.createElement("li",e({},l,{key:a,className:t([z.item,W===a&&z.highlighted]),"data-test-id":"cf-autocomplete-list-item"}),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{ChevronDownIcon as c,CloseIcon 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:M,listRef:B,listWidth:O="auto",listMaxHeight:D=180,isLoading:z=!1,testId:A="cf-autocomplete"}=p,$=(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":A,className:t($.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:$.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,M),"aria-label":"toggle menu",className:$.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,B),className:$.list,"data-test-id":"cf-autocomplete-list"}),z&&[...Array(3)].map(((e,o)=>a.createElement("li",{key:o,className:t($.item,$.disabled)},a.createElement(I,null)))),!z&&0===F.length&&a.createElement("li",{className:t($.item,$.disabled)},R),!z&&F.map(((o,n)=>{const s=q({item:o,index:n});return a.createElement("li",e({},s,{key:n,className:t([$.item,X===n&&$.highlighted]),"data-test-id":"cf-autocomplete-list-item"}),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-9155.2412+a8fb03d4", | ||
"version": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"description": "Forma 36: Autocomplete component", | ||
@@ -10,9 +10,9 @@ "scripts": { | ||
"@babel/runtime": "^7.6.2", | ||
"@contentful/f36-button": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-core": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-forms": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-icons": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-popover": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-skeleton": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-tokens": "4.0.1-next-v4-9155.2412+a8fb03d4", | ||
"@contentful/f36-button": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"@contentful/f36-core": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"@contentful/f36-forms": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"@contentful/f36-icons": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"@contentful/f36-popover": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"@contentful/f36-skeleton": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"@contentful/f36-tokens": "4.0.1-next-v4-9168.2413+4186f37c", | ||
"downshift": "^6.1.7", | ||
@@ -42,3 +42,3 @@ "emotion": "^10.0.17" | ||
}, | ||
"gitHead": "a8fb03d4471a672485729d9e9b3a664dbdc53df1" | ||
"gitHead": "4186f37c3eff41d00bb53df50952e8a8b93763b3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
83278
Updated@contentful/f36-button@4.0.1-next-v4-9168.2413+4186f37c
Updated@contentful/f36-core@4.0.1-next-v4-9168.2413+4186f37c
Updated@contentful/f36-forms@4.0.1-next-v4-9168.2413+4186f37c
Updated@contentful/f36-icons@4.0.1-next-v4-9168.2413+4186f37c
Updated@contentful/f36-popover@4.0.1-next-v4-9168.2413+4186f37c
Updated@contentful/f36-skeleton@4.0.1-next-v4-9168.2413+4186f37c
Updated@contentful/f36-tokens@4.0.1-next-v4-9168.2413+4186f37c