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

@elvia/elvis-dropdown

Package Overview
Dependencies
Maintainers
7
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elvia/elvis-dropdown - npm Package Compare versions

Comparing version 5.1.3 to 5.1.4

10

CHANGELOG.json

@@ -5,2 +5,12 @@ {

{
"date": "02.12.22",
"version": "5.1.4",
"changelog": [
{
"type": "patch",
"changes": ["Use shared backdrop component."]
}
]
},
{
"date": "29.11.22",

@@ -7,0 +17,0 @@ "version": "5.1.3",

4

dist/react/js/dropdown-overlay/dropdownOverlay.js

@@ -5,5 +5,5 @@ /*

*/
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DropdownOverlay=void 0;var _react=_interopRequireWildcard(require("react")),_reactDom=require("react-dom"),_dropdownItem=require("../dropdown-item/dropdownItem"),_dropdownListUtils=require("../dropdownListUtils"),_backButton=require("./backButton"),_dropdownOverlayStyles=require("./dropdownOverlayStyles"),_loadMoreButton=require("./loadMoreButton"),_selectAllOption=require("./selectAllOption"),_itemValue=require("../dropdown-item/itemValue"),_react2=require("@elvia/elvis-icon/react");function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d.default=a,c&&c.set(a,d),d}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f=[],g=!0,h=!1;try{for(c=c.call(a);!(g=(d=c.next()).done)&&(f.push(d.value),!(b&&f.length===b));g=!0);}catch(a){h=!0,e=a}finally{try{g||null==c["return"]||c["return"]()}finally{if(h)throw e}}return f}}function _arrayWithHoles(a){if(Array.isArray(a))return a}var uniqueId=0,DropdownOverlay=_react.default.forwardRef(function(a,b){var c=a.isRootOverlay,d=a.isGtMobile,e=a.filteredItems,f=a.allItems,g=a.inputIsKeyboard,h=a.isCompact,i=a.isMulti,j=a.onClose,k=a.noItemsText,l=a.currentVal,m=a.onItemSelect,n=a.pressedKey,o=a.selectAllOption,p=a.hasLoadMoreItemsButton,q=a.onLoadMoreItems,r=a.isLoadingMoreItems,s=a.focusedItem,t=a.setFocusedItem,u=a.setHoveredItem,v=a.parentItem,w=a.isSearchMode,x=(0,_react.useState)(d),y=_slicedToArray(x,1),z=y[0],A=(0,_react.useRef)(null),B=(0,_react.useState)(!1),C=_slicedToArray(B,2),D=C[0],E=C[1],F=(0,_react.useState)({label:null!==o&&void 0!==o?o:"",value:"selectAll-".concat(uniqueId++)}),G=_slicedToArray(F,1),H=G[0],I=(0,_react.useState)({label:"Tilbake",value:"back-".concat(uniqueId++)}),J=_slicedToArray(I,1),K=J[0],L=(0,_react.useState)({label:"Last inn flere",value:"loadMore-".concat(uniqueId++)}),M=_slicedToArray(L,1),N=M[0],O=(0,_react.useMemo)(function(){var a=e.slice();return d||c||a.unshift(K),o&&a.unshift(H),p&&a.push(N),a},[e,d,o,p]),P=(0,_react.useMemo)(function(){return e.every(function(a){return a.icon})},[e]),Q=(0,_react.useMemo)(function(){return O.some(function(a){return(null===s||void 0===s?void 0:s.value)===a.value})},[O,s]),R=function(a){var b=(0,_dropdownListUtils.getValueAsList)(l);return b.includes(a.value)},S=function(a){return(0,_dropdownListUtils.flattenTree)(null!==a&&void 0!==a?a:[]).filter(function(a){return!a.isDisabled&&!a.children})},T=function(a){if(!a.isDisabled){if(i&&a.children){var b=S(a.children);b.every(R)?m(b.map(function(a){return a.value})):m(b.filter(function(a){return!R(a)}).map(function(a){return a.value}))}else a.children||(m([a.value]),i||E(!0));// Focus on first item after selecting item in multi select while search is active
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DropdownOverlay=void 0;var _react=_interopRequireWildcard(require("react")),_reactDom=require("react-dom"),_dropdownItem=require("../dropdown-item/dropdownItem"),_dropdownListUtils=require("../dropdownListUtils"),_backButton=require("./backButton"),_dropdownOverlayStyles=require("./dropdownOverlayStyles"),_loadMoreButton=require("./loadMoreButton"),_selectAllOption=require("./selectAllOption"),_itemValue=require("../dropdown-item/itemValue"),_react2=require("@elvia/elvis-icon/react"),_elvisToolbox=require("@elvia/elvis-toolbox");function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d.default=a,c&&c.set(a,d),d}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _iterableToArrayLimit(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f=[],g=!0,h=!1;try{for(c=c.call(a);!(g=(d=c.next()).done)&&(f.push(d.value),!(b&&f.length===b));g=!0);}catch(a){h=!0,e=a}finally{try{g||null==c["return"]||c["return"]()}finally{if(h)throw e}}return f}}function _arrayWithHoles(a){if(Array.isArray(a))return a}var uniqueId=0,DropdownOverlay=_react.default.forwardRef(function(a,b){var c=a.isRootOverlay,d=a.isGtMobile,e=a.filteredItems,f=a.allItems,g=a.inputIsKeyboard,h=a.isCompact,i=a.isMulti,j=a.onClose,k=a.noItemsText,l=a.currentVal,m=a.onItemSelect,n=a.pressedKey,o=a.selectAllOption,p=a.hasLoadMoreItemsButton,q=a.onLoadMoreItems,r=a.isLoadingMoreItems,s=a.focusedItem,t=a.setFocusedItem,u=a.setHoveredItem,v=a.parentItem,w=a.isSearchMode,x=(0,_react.useState)(d),y=_slicedToArray(x,1),z=y[0],A=(0,_react.useRef)(null),B=(0,_react.useState)(!1),C=_slicedToArray(B,2),D=C[0],E=C[1],F=(0,_react.useState)({label:null!==o&&void 0!==o?o:"",value:"selectAll-".concat(uniqueId++)}),G=_slicedToArray(F,1),H=G[0],I=(0,_react.useState)({label:"Tilbake",value:"back-".concat(uniqueId++)}),J=_slicedToArray(I,1),K=J[0],L=(0,_react.useState)({label:"Last inn flere",value:"loadMore-".concat(uniqueId++)}),M=_slicedToArray(L,1),N=M[0],O=(0,_react.useMemo)(function(){var a=e.slice();return d||c||a.unshift(K),o&&a.unshift(H),p&&a.push(N),a},[e,d,o,p]),P=(0,_react.useMemo)(function(){return e.every(function(a){return a.icon})},[e]),Q=(0,_react.useMemo)(function(){return O.some(function(a){return(null===s||void 0===s?void 0:s.value)===a.value})},[O,s]),R=function(a){var b=(0,_dropdownListUtils.getValueAsList)(l);return b.includes(a.value)},S=function(a){return(0,_dropdownListUtils.flattenTree)(null!==a&&void 0!==a?a:[]).filter(function(a){return!a.isDisabled&&!a.children})},T=function(a){if(!a.isDisabled){if(i&&a.children){var b=S(a.children);b.every(R)?m(b.map(function(a){return a.value})):m(b.filter(function(a){return!R(a)}).map(function(a){return a.value}))}else a.children||(m([a.value]),i||E(!0));// Focus on first item after selecting item in multi select while search is active
// This moves keyboard focus to a focusable item.
i&&w&&c&&t(null===f||void 0===f?void 0:f[0])}},U=function(){v&&(E(!0),t(v))},V=function(a){var b=O.findIndex(function(a){return a.value===(null===s||void 0===s?void 0:s.value)});if(["Enter","Tab"].includes(a.code))a.preventDefault(),(null===s||void 0===s?void 0:s.value)===H.value?W():(null===s||void 0===s?void 0:s.value)===N.value?q&&q():(null===s||void 0===s?void 0:s.value)===K.value?U():s&&!s.children&&T(s);else if("ArrowUp"===a.code){a.preventDefault();var c=0>b-1?O.length-1:b-1;t(O[c])}else if("ArrowDown"===a.code){a.preventDefault();var d=b+1>O.length-1?0:b+1;t(O[d])}else"ArrowLeft"===a.code&&(a.preventDefault(),U())},W=function(){var a=S(e),b=(0,_dropdownListUtils.getValueAsList)(l);if(a.length===b.length)m(a.map(function(a){return a.value}));else{var c=a.filter(function(a){return!R(a)});m(c.map(function(a){return a.value}))}};return(0,_react.useEffect)(function(){n&&(Q||c&&w)&&V(n)},[n]),(0,_react.useEffect)(function(){g&&s&&function scrollItemListToFocusedItem(a){var b=h?40:48,c=O.findIndex(function(b){return b.value===a.value});if(-1!==c){var d,e;null===(d=A.current)||void 0===d?void 0:d.scrollTo({top:b*c-(null===(e=A.current)||void 0===e?void 0:e.offsetHeight)/2})}}(s)},[s]),(0,_react.useEffect)(function(){z!==d&&j()},[d]),(0,_react.useEffect)(function(){(function focusFirstItemOnInit(){(g||c&&!Q||!d)&&t(O[0])})()},[]),(0,_reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_react.default.Fragment,null,c&&/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.Backdrop,{onClick:function onClick(){return E(!0)}}),/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.DropdownPopupContainer,{ref:b,"data-testid":"popover",onMouseLeave:function onMouseLeave(){return u&&u(void 0)},isCompact:h},!c&&d&&/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.CursorCurve,null),/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.DropdownPopup,{fadeOut:D,onAnimationEnd:function onAnimationEnd(){D&&j()},isInvisible:!d&&!Q,animate:!!c||d},/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.ItemList,{ref:A},!(null!==e&&void 0!==e&&e.length)&&/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.NoItemsMessage,null,k),!d&&!c&&/*#__PURE__*/_react.default.createElement(_backButton.BackButton,{item:K,onClick:function onClick(){return U()},onHover:function onHover(a){return t(a)},focusedValue:null===s||void 0===s?void 0:s.value,isCompact:h,inputIsKeyboard:g}),o&&c&&/*#__PURE__*/_react.default.createElement(_selectAllOption.SelectAllOption,{focusedValue:null===s||void 0===s?void 0:s.value,isCompact:h,item:H,items:null!==f&&void 0!==f?f:[],selectedItems:l,onClick:W,onHover:function onHover(a){return t(a)}}),e.map(function(a){return/*#__PURE__*/_react.default.createElement(_dropdownItem.DropdownItem,{key:a.value,item:a,focusedItem:s,setFocusedItem:function setFocusedItem(a){t(a),(null===a||void 0===a?void 0:a.value)===(null===v||void 0===v?void 0:v.value)&&E(!0)},setHoveredItem:function setHoveredItem(a){u&&u(a)},isCompact:h,isMulti:i,inputIsKeyboard:g,currentVal:l,onItemSelect:function onItemSelect(a){m(a),i||E(!0)},onClick:function onClick(a){return T(a)},pressedKey:n,listRef:A,isGtMobile:d},a.icon&&!i&&P&&/*#__PURE__*/_react.default.createElement(_react2.Icon,{name:a.icon,color:a.isDisabled?"disabled":"elvia-off",size:h?"xs":"sm"}),/*#__PURE__*/_react.default.createElement(_itemValue.ItemValue,{item:a,focusedValue:s,isRootOverlay:c}))}),p&&c&&/*#__PURE__*/_react.default.createElement(_loadMoreButton.LoadMoreButton,{focusedValue:null===s||void 0===s?void 0:s.value,item:N,isLoadingMoreItems:r,onLoadMoreItems:q,isCompact:h,onHover:function onHover(a){return t(a)}}))))),document.body)});exports.DropdownOverlay=DropdownOverlay,DropdownOverlay.displayName="DropdownOverlayComponent";
i&&w&&c&&t(null===f||void 0===f?void 0:f[0])}},U=function(){v&&(E(!0),t(v))},V=function(a){var b=O.findIndex(function(a){return a.value===(null===s||void 0===s?void 0:s.value)});if(["Enter","Tab"].includes(a.code))a.preventDefault(),(null===s||void 0===s?void 0:s.value)===H.value?W():(null===s||void 0===s?void 0:s.value)===N.value?q&&q():(null===s||void 0===s?void 0:s.value)===K.value?U():s&&!s.children&&T(s);else if("ArrowUp"===a.code){a.preventDefault();var c=0>b-1?O.length-1:b-1;t(O[c])}else if("ArrowDown"===a.code){a.preventDefault();var d=b+1>O.length-1?0:b+1;t(O[d])}else"ArrowLeft"===a.code&&(a.preventDefault(),U())},W=function(){var a=S(e),b=(0,_dropdownListUtils.getValueAsList)(l);if(a.length===b.length)m(a.map(function(a){return a.value}));else{var c=a.filter(function(a){return!R(a)});m(c.map(function(a){return a.value}))}};return(0,_react.useEffect)(function(){n&&(Q||c&&w)&&V(n)},[n]),(0,_react.useEffect)(function(){g&&s&&function scrollItemListToFocusedItem(a){var b=h?40:48,c=O.findIndex(function(b){return b.value===a.value});if(-1!==c){var d,e;null===(d=A.current)||void 0===d?void 0:d.scrollTo({top:b*c-(null===(e=A.current)||void 0===e?void 0:e.offsetHeight)/2})}}(s)},[s]),(0,_react.useEffect)(function(){z!==d&&j()},[d]),(0,_react.useEffect)(function(){(function focusFirstItemOnInit(){(g||c&&!Q||!d)&&t(O[0])})()},[]),(0,_reactDom.createPortal)(/*#__PURE__*/_react.default.createElement(_react.default.Fragment,null,c&&/*#__PURE__*/_react.default.createElement(_elvisToolbox.Backdrop,{onClick:function onClick(){return E(!0)}}),/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.DropdownPopupContainer,{ref:b,"data-testid":"popover",onMouseLeave:function onMouseLeave(){return u&&u(void 0)},isCompact:h},!c&&d&&/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.CursorCurve,null),/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.DropdownPopup,{fadeOut:D,onAnimationEnd:function onAnimationEnd(){D&&j()},isInvisible:!d&&!Q,animate:!!c||d},/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.ItemList,{ref:A},!(null!==e&&void 0!==e&&e.length)&&/*#__PURE__*/_react.default.createElement(_dropdownOverlayStyles.NoItemsMessage,null,k),!d&&!c&&/*#__PURE__*/_react.default.createElement(_backButton.BackButton,{item:K,onClick:function onClick(){return U()},onHover:function onHover(a){return t(a)},focusedValue:null===s||void 0===s?void 0:s.value,isCompact:h,inputIsKeyboard:g}),o&&c&&/*#__PURE__*/_react.default.createElement(_selectAllOption.SelectAllOption,{focusedValue:null===s||void 0===s?void 0:s.value,isCompact:h,item:H,items:null!==f&&void 0!==f?f:[],selectedItems:l,onClick:W,onHover:function onHover(a){return t(a)}}),e.map(function(a){return/*#__PURE__*/_react.default.createElement(_dropdownItem.DropdownItem,{key:a.value,item:a,focusedItem:s,setFocusedItem:function setFocusedItem(a){t(a),(null===a||void 0===a?void 0:a.value)===(null===v||void 0===v?void 0:v.value)&&E(!0)},setHoveredItem:function setHoveredItem(a){u&&u(a)},isCompact:h,isMulti:i,inputIsKeyboard:g,currentVal:l,onItemSelect:function onItemSelect(a){m(a),i||E(!0)},onClick:function onClick(a){return T(a)},pressedKey:n,listRef:A,isGtMobile:d},a.icon&&!i&&P&&/*#__PURE__*/_react.default.createElement(_react2.Icon,{name:a.icon,color:a.isDisabled?"disabled":"elvia-off",size:h?"xs":"sm"}),/*#__PURE__*/_react.default.createElement(_itemValue.ItemValue,{item:a,focusedValue:s,isRootOverlay:c}))}),p&&c&&/*#__PURE__*/_react.default.createElement(_loadMoreButton.LoadMoreButton,{focusedValue:null===s||void 0===s?void 0:s.value,item:N,isLoadingMoreItems:r,onLoadMoreItems:q,isCompact:h,onHover:function onHover(a){return t(a)}}))))),document.body)});exports.DropdownOverlay=DropdownOverlay,DropdownOverlay.displayName="DropdownOverlayComponent";
//# sourceMappingURL=dropdownOverlay.js.map

@@ -14,3 +14,2 @@ export declare const CursorCurve: import("styled-components").StyledComponent<"div", any, {}, never>;

export declare const NoItemsMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
export declare const Backdrop: import("styled-components").StyledComponent<"div", any, {}, never>;
export declare const Divider: import("styled-components").StyledComponent<"hr", any, {}, never>;

@@ -17,0 +16,0 @@ export declare const RotateAnimation: import("styled-components").Keyframes;

@@ -5,3 +5,3 @@ /*

*/
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SpinContainer=exports.RotateAnimation=exports.NoItemsMessage=exports.LoadMoreButtonStyles=exports.ItemList=exports.DropdownPopupContainer=exports.DropdownPopup=exports.Divider=exports.CursorCurve=exports.Backdrop=exports.BackButtonStyles=void 0;var _elvisColors=require("@elvia/elvis-colors"),_elvisToolbox=require("@elvia/elvis-toolbox"),_elvisTypography=require("@elvia/elvis-typography"),_styledComponents=_interopRequireWildcard(require("styled-components")),_dropdownItemStyles=require("../dropdown-item/dropdownItemStyles");function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d.default=a,c&&c.set(a,d),d}var fadeIn=(0,_styledComponents.keyframes)(["0%{opacity:0.3;}100%{opacity:1;}"]),fadeOut=(0,_styledComponents.keyframes)(["0%{opacity:1;}100%{transform:scale(0.9);opacity:0;}"]),CursorCurve=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__CursorCurve",componentId:"sc-1ehdlkz-0"})(["position:absolute;top:calc(var(--item-height) - 1px);right:100%;width:30%;height:20%;min-height:var(--item-height);clip-path:polygon(0% 0%,100% 0%,100% 100%,80% 50%,50% 20%);"]);exports.CursorCurve=CursorCurve;var DropdownPopupContainer=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__DropdownPopupContainer",componentId:"sc-1ehdlkz-1"})(["position:absolute;z-index:99999;--item-height:48px;",";"],function(a){var b=a.isCompact;return b&&(0,_styledComponents.css)(["--item-height:40px;","{",";}","{","}"],NoItemsMessage,(0,_elvisTypography.getTypographyCss)("text-sm"),BackButtonStyles,(0,_elvisTypography.getTypographyCss)("text-sm-strong"))});exports.DropdownPopupContainer=DropdownPopupContainer;var DropdownPopup=_styledComponents.default.div.attrs(function(){return{role:"listbox"}}).withConfig({displayName:"dropdownOverlayStyles__DropdownPopup",componentId:"sc-1ehdlkz-2"})(["background-color:",";box-shadow:0px 0px 30px rgba(0,0,0,0.08);animation:"," 300ms ease;position:relative;border-radius:4px;overflow:hidden;width:100%;",";",";",";"],(0,_elvisColors.getColor)("elvia-on"),fadeIn,function(a){return a.fadeOut?(0,_styledComponents.css)(["animation:"," 100ms ease;"],fadeOut):""},function(a){var b=a.isInvisible;return b&&(0,_styledComponents.css)(["visibility:hidden;"])},function(a){var b=a.animate;return!b&&(0,_styledComponents.css)(["animation-duration:0ms;"])});exports.DropdownPopup=DropdownPopup;var ItemList=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__ItemList",componentId:"sc-1ehdlkz-3"})(["max-height:calc(var(--item-height) * 7.5);overflow-y:auto;"]);exports.ItemList=ItemList;var NoItemsMessage=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__NoItemsMessage",componentId:"sc-1ehdlkz-4"})([""," text-align:center;padding:40px 16px;"],(0,_elvisTypography.getTypographyCss)("text-md"));exports.NoItemsMessage=NoItemsMessage;var Backdrop=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__Backdrop",componentId:"sc-1ehdlkz-5"})(["top:0;right:0;bottom:0;left:0;position:fixed;z-index:99999;"]);exports.Backdrop=Backdrop;var Divider=_styledComponents.default.hr.withConfig({displayName:"dropdownOverlayStyles__Divider",componentId:"sc-1ehdlkz-6"})(["height:0px;border:0px solid ",";border-bottom-width:1px;margin:0;"],(0,_elvisColors.getColor)("grey-10"));exports.Divider=Divider;var RotateAnimation=(0,_styledComponents.keyframes)(["from{transform:rotate(0deg)}to{transform:rotate(-360deg)}"]);exports.RotateAnimation=RotateAnimation;var SpinContainer=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__SpinContainer",componentId:"sc-1ehdlkz-7"})([""]);exports.SpinContainer=SpinContainer;var LoadMoreButtonStyles=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__LoadMoreButtonStyles",componentId:"sc-1ehdlkz-8"})(["height:var(--item-height);width:100%;display:flex;align-items:center;justify-content:center;cursor:pointer;","{cursor:inherit;pointer-events:none;}",";"],_elvisToolbox.TertiaryButton,function(a){return a.isLoading&&(0,_styledComponents.css)(["cursor:progress;","{animation:"," 1s linear infinite;}"],SpinContainer,RotateAnimation)});exports.LoadMoreButtonStyles=LoadMoreButtonStyles;var BackButtonStyles=(0,_styledComponents.default)(_dropdownItemStyles.DropdownItemStyles).withConfig({displayName:"dropdownOverlayStyles__BackButtonStyles",componentId:"sc-1ehdlkz-9"})([""," gap:8px;","{pointer-events:none;cursor:inherit;}&:hover{","{background-color:",";}}"],(0,_elvisTypography.getTypographyCss)("text-md-strong"),_elvisToolbox.IconButton,_elvisToolbox.IconButton,(0,_elvisColors.getColor)("elvia-charge"));exports.BackButtonStyles=BackButtonStyles;
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.SpinContainer=exports.RotateAnimation=exports.NoItemsMessage=exports.LoadMoreButtonStyles=exports.ItemList=exports.DropdownPopupContainer=exports.DropdownPopup=exports.Divider=exports.CursorCurve=exports.BackButtonStyles=void 0;var _elvisColors=require("@elvia/elvis-colors"),_elvisToolbox=require("@elvia/elvis-toolbox"),_elvisTypography=require("@elvia/elvis-typography"),_styledComponents=_interopRequireWildcard(require("styled-components")),_dropdownItemStyles=require("../dropdown-item/dropdownItemStyles");function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d.default=a,c&&c.set(a,d),d}var fadeIn=(0,_styledComponents.keyframes)(["0%{opacity:0.3;}100%{opacity:1;}"]),fadeOut=(0,_styledComponents.keyframes)(["0%{opacity:1;}100%{transform:scale(0.9);opacity:0;}"]),CursorCurve=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__CursorCurve",componentId:"sc-1ehdlkz-0"})(["position:absolute;top:calc(var(--item-height) - 1px);right:100%;width:30%;height:20%;min-height:var(--item-height);clip-path:polygon(0% 0%,100% 0%,100% 100%,80% 50%,50% 20%);"]);exports.CursorCurve=CursorCurve;var DropdownPopupContainer=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__DropdownPopupContainer",componentId:"sc-1ehdlkz-1"})(["position:absolute;z-index:99999;--item-height:48px;",";"],function(a){var b=a.isCompact;return b&&(0,_styledComponents.css)(["--item-height:40px;","{",";}","{","}"],NoItemsMessage,(0,_elvisTypography.getTypographyCss)("text-sm"),BackButtonStyles,(0,_elvisTypography.getTypographyCss)("text-sm-strong"))});exports.DropdownPopupContainer=DropdownPopupContainer;var DropdownPopup=_styledComponents.default.div.attrs(function(){return{role:"listbox"}}).withConfig({displayName:"dropdownOverlayStyles__DropdownPopup",componentId:"sc-1ehdlkz-2"})(["background-color:",";box-shadow:0px 0px 30px rgba(0,0,0,0.08);animation:"," 300ms ease;position:relative;border-radius:4px;overflow:hidden;width:100%;",";",";",";"],(0,_elvisColors.getColor)("elvia-on"),fadeIn,function(a){return a.fadeOut?(0,_styledComponents.css)(["animation:"," 100ms ease;"],fadeOut):""},function(a){var b=a.isInvisible;return b&&(0,_styledComponents.css)(["visibility:hidden;"])},function(a){var b=a.animate;return!b&&(0,_styledComponents.css)(["animation-duration:0ms;"])});exports.DropdownPopup=DropdownPopup;var ItemList=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__ItemList",componentId:"sc-1ehdlkz-3"})(["max-height:calc(var(--item-height) * 7.5);overflow-y:auto;"]);exports.ItemList=ItemList;var NoItemsMessage=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__NoItemsMessage",componentId:"sc-1ehdlkz-4"})([""," text-align:center;padding:40px 16px;"],(0,_elvisTypography.getTypographyCss)("text-md"));exports.NoItemsMessage=NoItemsMessage;var Divider=_styledComponents.default.hr.withConfig({displayName:"dropdownOverlayStyles__Divider",componentId:"sc-1ehdlkz-5"})(["height:0px;border:0px solid ",";border-bottom-width:1px;margin:0;"],(0,_elvisColors.getColor)("grey-10"));exports.Divider=Divider;var RotateAnimation=(0,_styledComponents.keyframes)(["from{transform:rotate(0deg)}to{transform:rotate(-360deg)}"]);exports.RotateAnimation=RotateAnimation;var SpinContainer=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__SpinContainer",componentId:"sc-1ehdlkz-6"})([""]);exports.SpinContainer=SpinContainer;var LoadMoreButtonStyles=_styledComponents.default.div.withConfig({displayName:"dropdownOverlayStyles__LoadMoreButtonStyles",componentId:"sc-1ehdlkz-7"})(["height:var(--item-height);width:100%;display:flex;align-items:center;justify-content:center;cursor:pointer;","{cursor:inherit;pointer-events:none;}",";"],_elvisToolbox.TertiaryButton,function(a){return a.isLoading&&(0,_styledComponents.css)(["cursor:progress;","{animation:"," 1s linear infinite;}"],SpinContainer,RotateAnimation)});exports.LoadMoreButtonStyles=LoadMoreButtonStyles;var BackButtonStyles=(0,_styledComponents.default)(_dropdownItemStyles.DropdownItemStyles).withConfig({displayName:"dropdownOverlayStyles__BackButtonStyles",componentId:"sc-1ehdlkz-8"})([""," gap:8px;","{pointer-events:none;cursor:inherit;}&:hover{","{background-color:",";}}"],(0,_elvisTypography.getTypographyCss)("text-md-strong"),_elvisToolbox.IconButton,_elvisToolbox.IconButton,(0,_elvisColors.getColor)("elvia-charge"));exports.BackButtonStyles=BackButtonStyles;
//# sourceMappingURL=dropdownOverlayStyles.js.map
{
"name": "@elvia/elvis-dropdown",
"version": "5.1.3",
"version": "5.1.4",
"main": "web_component.js",

@@ -18,3 +18,3 @@ "license": "MIT",

"@elvia/elvis-icon": "^1.3.7",
"@elvia/elvis-toolbox": "^7.0.0",
"@elvia/elvis-toolbox": "^7.2.0",
"@elvia/elvis-tooltip": "^1.1.6",

@@ -21,0 +21,0 @@ "@elvia/elvis-typography": "^2.3.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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