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

@leafygreen-ui/popover

Package Overview
Dependencies
Maintainers
4
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/popover - npm Package Compare versions

Comparing version 7.0.1 to 7.1.0

13

CHANGELOG.md
# @leafygreen-ui/popover
## 7.1.0
### Minor Changes
- c18f16e6: Improves compatibility with React v17
### Patch Changes
- Updated dependencies [c18f16e6]
- Updated dependencies [9ee1d5fc]
- @leafygreen-ui/hooks@6.0.0
- @leafygreen-ui/lib@6.1.1
## 7.0.1

@@ -4,0 +17,0 @@

2

dist/esm/index.js

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

import t,{useState as e,useCallback as n,useMemo as r,Fragment as o}from"react";import i from"prop-types";import{Transition as c}from"react-transition-group";import{css as a,cx as l}from"@leafygreen-ui/emotion";import s from"@leafygreen-ui/portal";import{useElementNode as u,useViewportSize as f,useMutationObserver as d,useObjectDependency as p,usePrevious as g,useIsomorphicLayoutEffect as h}from"@leafygreen-ui/hooks";function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(){return(y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){m(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function P(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(t,e)||O(t,e)||function(){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 j(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return S(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var C,x,D,H,V,R,M,T,B={Top:"top",Bottom:"bottom",Left:"left",Right:"right",CenterVertical:"center-vertical",CenterHorizontal:"center-horizontal"},F={Start:"start",Middle:"middle",End:"end",Fit:"fit"};function W(t){var e=t.useRelativePositioning,n=t.spacing,r=t.align,o=t.justify,i=t.referenceElViewportPos,c=void 0===i?L:i,a=t.referenceElDocumentPos,l=void 0===a?L:a,s=t.contentElViewportPos,u=void 0===s?L:s,f=t.contentElDocumentPos,d=void 0===f?L:f,p=t.windowHeight,g=void 0===p?window.innerHeight:p,h=t.windowWidth,m=void 0===h?window.innerWidth:h,y={windowWidth:m,windowHeight:g,referenceElViewportPos:c,contentElViewportPos:u,spacing:n},w=function(t,e){var n=e.spacing,r=e.windowWidth,o=e.windowHeight,i=e.contentElViewportPos,c=e.referenceElViewportPos;return[t].concat(j(Z[t])).find((function(t){return[B.Top,B.Bottom,B.CenterVertical].includes(t)?Q({top:G({align:t,contentElPos:i,referenceElPos:c,spacing:n}),windowHeight:o,contentHeight:i.height}):!![B.Left,B.Right,B.CenterHorizontal].includes(t)&&K({left:J({align:t,contentElPos:i,referenceElPos:c,spacing:n}),windowWidth:r,contentWidth:i.width})}))||t}(r,y),E=function(t,e,n){var r,o,i=n.spacing,c=n.windowWidth,a=n.windowHeight,l=n.contentElViewportPos,s=n.referenceElViewportPos,u=[t].concat(j(_[t]));switch(e){case B.Top:case B.Bottom:case B.CenterVertical:return null!==(r=u.find((function(t){return K({contentWidth:t===F.Fit?s.width:l.width,windowWidth:c,left:J({contentElPos:l,referenceElPos:s,spacing:i,align:e,justify:t})})})))&&void 0!==r?r:_[t][0];case B.Left:case B.Right:case B.CenterHorizontal:return null!==(o=u.find((function(t){return Q({contentHeight:t===F.Fit?s.height:l.height,windowHeight:a,top:G({contentElPos:l,referenceElPos:s,spacing:i,align:e,justify:t})})})))&&void 0!==o?o:_[t][0]}}(o,w,y),P=function(t){var e,n,r=t.align,o=t.justify,i=k[r],c=null!==(e=i.x)&&void 0!==e?e:I[o],a=null!==(n=i.y)&&void 0!==n?n:A[o];return"".concat(c," ").concat(a)}({align:w,justify:E}),b=function(t,e){var n=.8;switch(t){case B.Top:return"translate3d(0, ".concat(e,"px, 0) scale(").concat(n,")");case B.Bottom:return"translate3d(0, -".concat(e,"px, 0) scale(").concat(n,")");case B.Left:return"translate3d(".concat(e,"px, 0, 0) scale(").concat(n,")");case B.Right:return"translate3d(-".concat(e,"px, 0, 0) scale(").concat(n,")");case B.CenterHorizontal:case B.CenterVertical:return"scale(".concat(n,")")}}(w,n);return e?{align:w,justify:E,positionCSS:v({},$({align:w,justify:E,referenceElDocumentPos:l,contentElDocumentPos:d,spacing:n}),{transformOrigin:P,transform:b})}:{align:w,justify:E,positionCSS:v({},q({align:w,justify:E,referenceElDocumentPos:l,contentElDocumentPos:d,spacing:n,windowHeight:g,windowWidth:m}),{transformOrigin:P,transform:b})}}var L={top:0,bottom:0,left:0,right:0,height:0,width:0};function z(t){if(!t)return L;var e=t.getBoundingClientRect(),n=e.top,r=e.bottom,o=e.left,i=e.right,c=t.offsetHeight,a=t.offsetWidth,l=window,s=l.scrollX,u=l.scrollY;return{top:n+u,bottom:r+u,left:o+s,right:i+s,height:c,width:a}}function N(t){if(!t)return L;var e=t.getBoundingClientRect();return{top:e.top,bottom:e.bottom,left:e.left,right:e.right,height:t.offsetHeight,width:t.offsetWidth}}var A=(m(C={},F.Start,"top"),m(C,F.Middle,"center"),m(C,F.End,"bottom"),m(C,F.Fit,"center"),C),I=(m(x={},F.Start,"left"),m(x,F.Middle,"center"),m(x,F.End,"right"),m(x,F.Fit,"center"),x),k=(m(D={},B.Left,{x:"right"}),m(D,B.Right,{x:"left"}),m(D,B.Top,{y:"bottom"}),m(D,B.Bottom,{y:"top"}),m(D,B.CenterHorizontal,{x:"center"}),m(D,B.CenterVertical,{y:"center"}),D);var U=(m(H={},F.Start,{top:0}),m(H,F.End,{bottom:0}),m(H,F.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{top:"".concat(n.height/2-e.height/2,"px")}})),m(H,F.Fit,{top:0,bottom:0}),H),X=(m(V={},F.Start,{left:0}),m(V,F.End,{right:0}),m(V,F.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{left:"".concat(n.width/2-e.width/2,"px")}})),m(V,F.Fit,{left:0,right:0}),V),Y=(m(R={},B.Top,{constant:function(t){var e=t.spacing;return{bottom:"calc(100% + ".concat(e,"px)")}},justifyPositions:X}),m(R,B.Bottom,{constant:function(t){var e=t.spacing;return{top:"calc(100% + ".concat(e,"px)")}},justifyPositions:X}),m(R,B.CenterVertical,{constant:function(t){var e=t.referenceElDocumentPos;return{top:"calc(".concat(e.height/2,"px - 50%)")}},justifyPositions:X}),m(R,B.Left,{constant:function(t){var e=t.spacing;return{right:"calc(100% + ".concat(e,"px)")}},justifyPositions:U}),m(R,B.Right,{constant:function(t){var e=t.spacing;return{left:"calc(100% + ".concat(e,"px)")}},justifyPositions:U}),m(R,B.CenterHorizontal,{constant:function(t){var e=t.referenceElDocumentPos;return{left:"calc(".concat(e.width/2,"px - 50%)")}},justifyPositions:U}),R);function $(t){var e,n=t.align,r=t.justify,o=t.referenceElDocumentPos,i=t.contentElDocumentPos,c=t.spacing,a=Y[n],l=a.justifyPositions[r],s={contentElDocumentPos:i,referenceElDocumentPos:o,spacing:c};return v({},null===(e=a.constant)||void 0===e?void 0:e.call(a,s),{},"function"==typeof l?l(s):l)}function q(t){var e=t.align,n=t.justify,r=t.referenceElDocumentPos,o=t.contentElDocumentPos,i=t.spacing,c=t.windowWidth,a=t.windowHeight,l="".concat(J({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px"),s="".concat(G({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px");return n!==F.Fit?{left:l,top:s}:[B.Left,B.Right,B.CenterHorizontal].includes(e)?{left:l,top:s,bottom:"".concat(a-r.bottom,"px")}:{left:l,top:s,right:"".concat(c-r.right,"px")}}function G(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case B.Left:case B.Right:case B.CenterHorizontal:switch(n){case F.Start:case F.Fit:return o.top;case F.End:return o.top+o.height-r.height;case F.Middle:default:return o.top-(r.height-o.height)/2}case B.CenterVertical:return o.top-(r.height-o.height)/2;case B.Top:return o.top-r.height-i;case B.Bottom:default:return o.top+o.height+i}}function J(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case B.Top:case B.Bottom:case B.CenterVertical:switch(n){case F.End:return o.left+o.width-r.width;case F.Middle:return o.left-(r.width-o.width)/2;case F.Start:case F.Fit:default:return o.left}case B.Left:return o.left-r.width-i;case B.Right:return o.left+o.width+i;case B.CenterHorizontal:default:return o.left-(r.width-o.width)/2}}function K(t){var e=t.left,n=t.windowWidth,r=t.contentWidth;return e>=0&&!(e+r>n)}function Q(t){var e=t.top,n=t.windowHeight,r=t.contentHeight;return e>=0&&!(e+r>n)}var Z=(m(M={},B.Top,[B.Bottom]),m(M,B.Bottom,[B.Top]),m(M,B.Left,[B.Right]),m(M,B.Right,[B.Left]),m(M,B.CenterHorizontal,[B.Left,B.Right]),m(M,B.CenterVertical,[B.Top,B.Bottom]),M);var _=(m(T={},F.Start,[F.End,F.Middle]),m(T,F.Middle,[F.End,F.Start]),m(T,F.End,[F.Start,F.Middle]),m(T,F.Fit,[F.Middle,F.Start,F.End]),T);function tt(){var t=P(["\n display: none;\n "]);return tt=function(){return t},t}function et(){var t=P(["\n transform: translate3d(0, 0, 0) scale(1);\n opacity: 1;\n position: ",";\n pointer-events: initial;\n "]);return et=function(){return t},t}function nt(){var t=P(["\n transition: transform 150ms ease-in-out, opacity 150ms ease-in-out;\n position: absolute;\n opacity: 0;\n"]);return nt=function(){return t},t}var rt=a(nt()),ot={attributes:!0,characterData:!0,childList:!0,subtree:!0};function it(i){var w=i.active,v=void 0!==w&&w,P=i.usePortal,j=void 0===P||P,O=i.spacing,S=void 0===O?10:O,C=i.align,x=void 0===C?B.Bottom:C,D=i.justify,H=void 0===D?F.Start:D,V=i.adjustOnMutation,R=void 0!==V&&V,M=i.children,T=i.className,L=i.portalClassName,A=i.refEl,I=E(i,["active","usePortal","spacing","align","justify","adjustOnMutation","children","className","portalClassName","refEl"]),k=b(u(),2),U=k[0],X=k[1],Y=b(u(),2),$=Y[0],q=Y[1],G=b(e(0),2),J=G[0],K=G[1],Q=t.useRef($);Q.current=$;var Z=null;if(A&&A.current)Z=A.current;else if(U){var _=U.parentNode;_&&_ instanceof HTMLElement&&(Z=_)}var nt=f(),it=R&&v,ct=d(Z,ot,n(Date.now,[]),it),at=d($,ot,n(Date.now,[]),it),lt=p(N(Z)),st=p(N($)),ut=p(r((function(){return z(Z)}),[Z,nt,ct,v,x,H,J])),ft=p(r((function(){return z($)}),[$,nt,at,v,x,H,J])),dt=g(H),pt=g(x),gt=dt!==H&&(H===F.Fit||dt===F.Fit)||pt!==x&&H===F.Fit;h((function(){gt&&K((function(t){return t+1}))}),[gt]);var ht=b(e(!1),2),mt=ht[0],yt=ht[1];if(h((function(){return yt(!0)}),[]),!mt)return null;var wt,vt=W({useRelativePositioning:!j,spacing:S,align:x,justify:H,referenceElViewportPos:lt,referenceElDocumentPos:ut,contentElViewportPos:st,contentElDocumentPos:ft}),Et=vt.align,Pt=vt.justify,bt=vt.positionCSS,jt=a(et(),j?"":"absolute"),Ot=j?s:o,St=j?{className:L}:{};return wt=null==M?null:"function"==typeof M?M({align:Et,justify:Pt,referenceElPos:ut}):M,t.createElement(c,{nodeRef:Q,in:v,timeout:{exit:150},mountOnEnter:!0,unmountOnExit:!0},(function(e){return t.createElement(t.Fragment,null,t.createElement("div",{ref:X,className:a(tt())}),t.createElement(Ot,St,t.createElement("div",y({},I,{className:l(rt,a(bt),m({},jt,"entered"===e),T)}),t.createElement("div",{ref:q},wt))))}))}it.displayName="Popover",it.propTypes={children:i.oneOfType([i.node,i.func]),active:i.bool,className:i.string,align:i.oneOf(Object.values(B)),justify:i.oneOf(Object.values(F)),refEl:i.shape({current:"undefined"!=typeof window?i.instanceOf(Element):i.any}),usePortal:i.bool,portalClassName:i.string,spacing:i.number,adjustOnMutation:i.bool},it.defaultProps={children:void 0,align:B.Bottom,justify:F.Start,active:!1,usePortal:!0,spacing:10,adjustOnMutation:!1};export default it;export{B as Align,F as Justify};
import t,{useState as e,useCallback as n,useMemo as r,Fragment as o}from"react";import i from"prop-types";import{Transition as c}from"react-transition-group";import{css as a,cx as l}from"@leafygreen-ui/emotion";import s from"@leafygreen-ui/portal";import{useViewportSize as u,useMutationObserver as f,useObjectDependency as d,usePrevious as p,useIsomorphicLayoutEffect as g}from"@leafygreen-ui/hooks";function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){h(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function v(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function E(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function P(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}(t,e)||j(t,e)||function(){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 b(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||j(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){if(t){if("string"==typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var S,C,x,D,H,V,R,M,T={Top:"top",Bottom:"bottom",Left:"left",Right:"right",CenterVertical:"center-vertical",CenterHorizontal:"center-horizontal"},B={Start:"start",Middle:"middle",End:"end",Fit:"fit"};function F(t){var e=t.useRelativePositioning,n=t.spacing,r=t.align,o=t.justify,i=t.referenceElViewportPos,c=void 0===i?W:i,a=t.referenceElDocumentPos,l=void 0===a?W:a,s=t.contentElViewportPos,u=void 0===s?W:s,f=t.contentElDocumentPos,d=void 0===f?W:f,p=t.windowHeight,g=void 0===p?window.innerHeight:p,h=t.windowWidth,m=void 0===h?window.innerWidth:h,y={windowWidth:m,windowHeight:g,referenceElViewportPos:c,contentElViewportPos:u,spacing:n},v=function(t,e){var n=e.spacing,r=e.windowWidth,o=e.windowHeight,i=e.contentElViewportPos,c=e.referenceElViewportPos;return[t].concat(b(Q[t])).find((function(t){return[T.Top,T.Bottom,T.CenterVertical].includes(t)?K({top:q({align:t,contentElPos:i,referenceElPos:c,spacing:n}),windowHeight:o,contentHeight:i.height}):!![T.Left,T.Right,T.CenterHorizontal].includes(t)&&J({left:G({align:t,contentElPos:i,referenceElPos:c,spacing:n}),windowWidth:r,contentWidth:i.width})}))||t}(r,y),E=function(t,e,n){var r,o,i=n.spacing,c=n.windowWidth,a=n.windowHeight,l=n.contentElViewportPos,s=n.referenceElViewportPos,u=[t].concat(b(Z[t]));switch(e){case T.Top:case T.Bottom:case T.CenterVertical:return null!==(r=u.find((function(t){return J({contentWidth:t===B.Fit?s.width:l.width,windowWidth:c,left:G({contentElPos:l,referenceElPos:s,spacing:i,align:e,justify:t})})})))&&void 0!==r?r:Z[t][0];case T.Left:case T.Right:case T.CenterHorizontal:return null!==(o=u.find((function(t){return K({contentHeight:t===B.Fit?s.height:l.height,windowHeight:a,top:q({contentElPos:l,referenceElPos:s,spacing:i,align:e,justify:t})})})))&&void 0!==o?o:Z[t][0]}}(o,v,y),P=function(t){var e,n,r=t.align,o=t.justify,i=I[r],c=null!==(e=i.x)&&void 0!==e?e:A[o],a=null!==(n=i.y)&&void 0!==n?n:N[o];return"".concat(c," ").concat(a)}({align:v,justify:E}),j=function(t,e){var n=.8;switch(t){case T.Top:return"translate3d(0, ".concat(e,"px, 0) scale(").concat(n,")");case T.Bottom:return"translate3d(0, -".concat(e,"px, 0) scale(").concat(n,")");case T.Left:return"translate3d(".concat(e,"px, 0, 0) scale(").concat(n,")");case T.Right:return"translate3d(-".concat(e,"px, 0, 0) scale(").concat(n,")");case T.CenterHorizontal:case T.CenterVertical:return"scale(".concat(n,")")}}(v,n);return e?{align:v,justify:E,positionCSS:w({},Y({align:v,justify:E,referenceElDocumentPos:l,contentElDocumentPos:d,spacing:n}),{transformOrigin:P,transform:j})}:{align:v,justify:E,positionCSS:w({},$({align:v,justify:E,referenceElDocumentPos:l,contentElDocumentPos:d,spacing:n,windowHeight:g,windowWidth:m}),{transformOrigin:P,transform:j})}}var W={top:0,bottom:0,left:0,right:0,height:0,width:0};function L(t){if(!t)return W;var e=t.getBoundingClientRect(),n=e.top,r=e.bottom,o=e.left,i=e.right,c=t.offsetHeight,a=t.offsetWidth,l=window,s=l.scrollX,u=l.scrollY;return{top:n+u,bottom:r+u,left:o+s,right:i+s,height:c,width:a}}function z(t){if(!t)return W;var e=t.getBoundingClientRect();return{top:e.top,bottom:e.bottom,left:e.left,right:e.right,height:t.offsetHeight,width:t.offsetWidth}}var N=(h(S={},B.Start,"top"),h(S,B.Middle,"center"),h(S,B.End,"bottom"),h(S,B.Fit,"center"),S),A=(h(C={},B.Start,"left"),h(C,B.Middle,"center"),h(C,B.End,"right"),h(C,B.Fit,"center"),C),I=(h(x={},T.Left,{x:"right"}),h(x,T.Right,{x:"left"}),h(x,T.Top,{y:"bottom"}),h(x,T.Bottom,{y:"top"}),h(x,T.CenterHorizontal,{x:"center"}),h(x,T.CenterVertical,{y:"center"}),x);var k=(h(D={},B.Start,{top:0}),h(D,B.End,{bottom:0}),h(D,B.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{top:"".concat(n.height/2-e.height/2,"px")}})),h(D,B.Fit,{top:0,bottom:0}),D),U=(h(H={},B.Start,{left:0}),h(H,B.End,{right:0}),h(H,B.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{left:"".concat(n.width/2-e.width/2,"px")}})),h(H,B.Fit,{left:0,right:0}),H),X=(h(V={},T.Top,{constant:function(t){var e=t.spacing;return{bottom:"calc(100% + ".concat(e,"px)")}},justifyPositions:U}),h(V,T.Bottom,{constant:function(t){var e=t.spacing;return{top:"calc(100% + ".concat(e,"px)")}},justifyPositions:U}),h(V,T.CenterVertical,{constant:function(t){var e=t.referenceElDocumentPos;return{top:"calc(".concat(e.height/2,"px - 50%)")}},justifyPositions:U}),h(V,T.Left,{constant:function(t){var e=t.spacing;return{right:"calc(100% + ".concat(e,"px)")}},justifyPositions:k}),h(V,T.Right,{constant:function(t){var e=t.spacing;return{left:"calc(100% + ".concat(e,"px)")}},justifyPositions:k}),h(V,T.CenterHorizontal,{constant:function(t){var e=t.referenceElDocumentPos;return{left:"calc(".concat(e.width/2,"px - 50%)")}},justifyPositions:k}),V);function Y(t){var e,n=t.align,r=t.justify,o=t.referenceElDocumentPos,i=t.contentElDocumentPos,c=t.spacing,a=X[n],l=a.justifyPositions[r],s={contentElDocumentPos:i,referenceElDocumentPos:o,spacing:c};return w({},null===(e=a.constant)||void 0===e?void 0:e.call(a,s),{},"function"==typeof l?l(s):l)}function $(t){var e=t.align,n=t.justify,r=t.referenceElDocumentPos,o=t.contentElDocumentPos,i=t.spacing,c=t.windowWidth,a=t.windowHeight,l="".concat(G({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px"),s="".concat(q({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px");return n!==B.Fit?{left:l,top:s}:[T.Left,T.Right,T.CenterHorizontal].includes(e)?{left:l,top:s,bottom:"".concat(a-r.bottom,"px")}:{left:l,top:s,right:"".concat(c-r.right,"px")}}function q(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case T.Left:case T.Right:case T.CenterHorizontal:switch(n){case B.Start:case B.Fit:return o.top;case B.End:return o.top+o.height-r.height;case B.Middle:default:return o.top-(r.height-o.height)/2}case T.CenterVertical:return o.top-(r.height-o.height)/2;case T.Top:return o.top-r.height-i;case T.Bottom:default:return o.top+o.height+i}}function G(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case T.Top:case T.Bottom:case T.CenterVertical:switch(n){case B.End:return o.left+o.width-r.width;case B.Middle:return o.left-(r.width-o.width)/2;case B.Start:case B.Fit:default:return o.left}case T.Left:return o.left-r.width-i;case T.Right:return o.left+o.width+i;case T.CenterHorizontal:default:return o.left-(r.width-o.width)/2}}function J(t){var e=t.left,n=t.windowWidth,r=t.contentWidth;return e>=0&&!(e+r>n)}function K(t){var e=t.top,n=t.windowHeight,r=t.contentHeight;return e>=0&&!(e+r>n)}var Q=(h(R={},T.Top,[T.Bottom]),h(R,T.Bottom,[T.Top]),h(R,T.Left,[T.Right]),h(R,T.Right,[T.Left]),h(R,T.CenterHorizontal,[T.Left,T.Right]),h(R,T.CenterVertical,[T.Top,T.Bottom]),R);var Z=(h(M={},B.Start,[B.End,B.Middle]),h(M,B.Middle,[B.End,B.Start]),h(M,B.End,[B.Start,B.Middle]),h(M,B.Fit,[B.Middle,B.Start,B.End]),M);function _(){var t=E(["\n display: none;\n "]);return _=function(){return t},t}function tt(){var t=E(["\n transform: translate3d(0, 0, 0) scale(1);\n opacity: 1;\n position: ",";\n pointer-events: initial;\n "]);return tt=function(){return t},t}function et(){var t=E(["\n transition: transform 150ms ease-in-out, opacity 150ms ease-in-out;\n position: absolute;\n opacity: 0;\n"]);return et=function(){return t},t}var nt=a(et()),rt={attributes:!0,characterData:!0,childList:!0,subtree:!0};function ot(i){var y=i.active,w=void 0!==y&&y,E=i.usePortal,b=void 0===E||E,j=i.spacing,O=void 0===j?10:j,S=i.align,C=void 0===S?T.Bottom:S,x=i.justify,D=void 0===x?B.Start:x,H=i.adjustOnMutation,V=void 0!==H&&H,R=i.children,M=i.className,W=i.portalClassName,N=i.refEl,A=v(i,["active","usePortal","spacing","align","justify","adjustOnMutation","children","className","portalClassName","refEl"]),I=P(e(null),2),k=I[0],U=I[1],X=P(e(null),2),Y=X[0],$=X[1],q=P(e(0),2),G=q[0],J=q[1],K=t.useRef(Y);K.current=Y;var Q=null;if(N&&N.current)Q=N.current;else if(k){var Z=k.parentNode;Z&&Z instanceof HTMLElement&&(Q=Z)}var et=u(),ot=V&&w,it=f(Q,rt,n(Date.now,[]),ot),ct=f(Y,rt,n(Date.now,[]),ot),at=d(z(Q)),lt=d(z(Y)),st=d(r((function(){return L(Q)}),[Q,et,it,w,C,D,G])),ut=d(r((function(){return L(Y)}),[Y,et,ct,w,C,D,G])),ft=p(D),dt=p(C),pt=ft!==D&&(D===B.Fit||ft===B.Fit)||dt!==C&&D===B.Fit;g((function(){pt&&J((function(t){return t+1}))}),[pt]);var gt=P(e(!1),2),ht=gt[0],mt=gt[1];if(g((function(){return mt(!0)}),[]),!ht)return null;var yt,wt=F({useRelativePositioning:!b,spacing:O,align:C,justify:D,referenceElViewportPos:at,referenceElDocumentPos:st,contentElViewportPos:lt,contentElDocumentPos:ut}),vt=wt.align,Et=wt.justify,Pt=wt.positionCSS,bt=a(tt(),b?"":"absolute"),jt=b?s:o,Ot=b?{className:W}:{};return yt=null==R?null:"function"==typeof R?R({align:vt,justify:Et,referenceElPos:st}):R,t.createElement(c,{nodeRef:K,in:w,timeout:{exit:150},mountOnEnter:!0,unmountOnExit:!0},(function(e){return t.createElement(t.Fragment,null,t.createElement("div",{ref:U,className:a(_())}),t.createElement(jt,Ot,t.createElement("div",m({},A,{className:l(nt,a(Pt),h({},bt,"entered"===e),M)}),t.createElement("div",{ref:$},yt))))}))}ot.displayName="Popover",ot.propTypes={children:i.oneOfType([i.node,i.func]),active:i.bool,className:i.string,align:i.oneOf(Object.values(T)),justify:i.oneOf(Object.values(B)),refEl:i.shape({current:"undefined"!=typeof window?i.instanceOf(Element):i.any}),usePortal:i.bool,portalClassName:i.string,spacing:i.number,adjustOnMutation:i.bool},ot.defaultProps={children:void 0,align:T.Bottom,justify:B.Start,active:!1,usePortal:!0,spacing:10,adjustOnMutation:!1};export default ot;export{T as Align,B as Justify};
//# sourceMappingURL=index.js.map

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("react-transition-group"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/portal"),require("@leafygreen-ui/hooks")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-transition-group","@leafygreen-ui/emotion","@leafygreen-ui/portal","@leafygreen-ui/hooks"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@leafygreen-ui/popover"]={},t.React,t.PropTypes,t.reactTransitionGroup,t["@leafygreen-ui/emotion"],t["@leafygreen-ui/portal"],t["@leafygreen-ui/hooks"])}(this,(function(t,e,n,r,o,i,a){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=c(e),l=c(n),s=c(i);function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function y(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||w(t,e)||function(){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 v(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||w(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){if(t){if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var E,P,j,O,S,D,C,x,H={Top:"top",Bottom:"bottom",Left:"left",Right:"right",CenterVertical:"center-vertical",CenterHorizontal:"center-horizontal"},M={Start:"start",Middle:"middle",End:"end",Fit:"fit"};function T(t){var e=t.useRelativePositioning,n=t.spacing,r=t.align,o=t.justify,i=t.referenceElViewportPos,a=void 0===i?V:i,c=t.referenceElDocumentPos,u=void 0===c?V:c,l=t.contentElViewportPos,s=void 0===l?V:l,f=t.contentElDocumentPos,d=void 0===f?V:f,p=t.windowHeight,h=void 0===p?window.innerHeight:p,y=t.windowWidth,m=void 0===y?window.innerWidth:y,w={windowWidth:m,windowHeight:h,referenceElViewportPos:a,contentElViewportPos:s,spacing:n},b=function(t,e){var n=e.spacing,r=e.windowWidth,o=e.windowHeight,i=e.contentElViewportPos,a=e.referenceElViewportPos;return[t].concat(v(U[t])).find((function(t){return[H.Top,H.Bottom,H.CenterVertical].includes(t)?J({top:q({align:t,contentElPos:i,referenceElPos:a,spacing:n}),windowHeight:o,contentHeight:i.height}):!![H.Left,H.Right,H.CenterHorizontal].includes(t)&&G({left:_({align:t,contentElPos:i,referenceElPos:a,spacing:n}),windowWidth:r,contentWidth:i.width})}))||t}(r,w),E=function(t,e,n){var r,o,i=n.spacing,a=n.windowWidth,c=n.windowHeight,u=n.contentElViewportPos,l=n.referenceElViewportPos,s=[t].concat(v(X[t]));switch(e){case H.Top:case H.Bottom:case H.CenterVertical:return null!==(r=s.find((function(t){return G({contentWidth:t===M.Fit?l.width:u.width,windowWidth:a,left:_({contentElPos:u,referenceElPos:l,spacing:i,align:e,justify:t})})})))&&void 0!==r?r:X[t][0];case H.Left:case H.Right:case H.CenterHorizontal:return null!==(o=s.find((function(t){return J({contentHeight:t===M.Fit?l.height:u.height,windowHeight:c,top:q({contentElPos:u,referenceElPos:l,spacing:i,align:e,justify:t})})})))&&void 0!==o?o:X[t][0]}}(o,b,w),P=function(t){var e,n,r=t.align,o=t.justify,i=W[r],a=null!==(e=i.x)&&void 0!==e?e:B[o],c=null!==(n=i.y)&&void 0!==n?n:L[o];return"".concat(a," ").concat(c)}({align:b,justify:E}),j=function(t,e){var n=.8;switch(t){case H.Top:return"translate3d(0, ".concat(e,"px, 0) scale(").concat(n,")");case H.Bottom:return"translate3d(0, -".concat(e,"px, 0) scale(").concat(n,")");case H.Left:return"translate3d(".concat(e,"px, 0, 0) scale(").concat(n,")");case H.Right:return"translate3d(-".concat(e,"px, 0, 0) scale(").concat(n,")");case H.CenterHorizontal:case H.CenterVertical:return"scale(".concat(n,")")}}(b,n);return e?{align:b,justify:E,positionCSS:g({},I({align:b,justify:E,referenceElDocumentPos:u,contentElDocumentPos:d,spacing:n}),{transformOrigin:P,transform:j})}:{align:b,justify:E,positionCSS:g({},k({align:b,justify:E,referenceElDocumentPos:u,contentElDocumentPos:d,spacing:n,windowHeight:h,windowWidth:m}),{transformOrigin:P,transform:j})}}var V={top:0,bottom:0,left:0,right:0,height:0,width:0};function R(t){if(!t)return V;var e=t.getBoundingClientRect(),n=e.top,r=e.bottom,o=e.left,i=e.right,a=t.offsetHeight,c=t.offsetWidth,u=window,l=u.scrollX,s=u.scrollY;return{top:n+s,bottom:r+s,left:o+l,right:i+l,height:a,width:c}}function F(t){if(!t)return V;var e=t.getBoundingClientRect();return{top:e.top,bottom:e.bottom,left:e.left,right:e.right,height:t.offsetHeight,width:t.offsetWidth}}var L=(f(E={},M.Start,"top"),f(E,M.Middle,"center"),f(E,M.End,"bottom"),f(E,M.Fit,"center"),E),B=(f(P={},M.Start,"left"),f(P,M.Middle,"center"),f(P,M.End,"right"),f(P,M.Fit,"center"),P),W=(f(j={},H.Left,{x:"right"}),f(j,H.Right,{x:"left"}),f(j,H.Top,{y:"bottom"}),f(j,H.Bottom,{y:"top"}),f(j,H.CenterHorizontal,{x:"center"}),f(j,H.CenterVertical,{y:"center"}),j);var z=(f(O={},M.Start,{top:0}),f(O,M.End,{bottom:0}),f(O,M.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{top:"".concat(n.height/2-e.height/2,"px")}})),f(O,M.Fit,{top:0,bottom:0}),O),N=(f(S={},M.Start,{left:0}),f(S,M.End,{right:0}),f(S,M.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{left:"".concat(n.width/2-e.width/2,"px")}})),f(S,M.Fit,{left:0,right:0}),S),A=(f(D={},H.Top,{constant:function(t){var e=t.spacing;return{bottom:"calc(100% + ".concat(e,"px)")}},justifyPositions:N}),f(D,H.Bottom,{constant:function(t){var e=t.spacing;return{top:"calc(100% + ".concat(e,"px)")}},justifyPositions:N}),f(D,H.CenterVertical,{constant:function(t){var e=t.referenceElDocumentPos;return{top:"calc(".concat(e.height/2,"px - 50%)")}},justifyPositions:N}),f(D,H.Left,{constant:function(t){var e=t.spacing;return{right:"calc(100% + ".concat(e,"px)")}},justifyPositions:z}),f(D,H.Right,{constant:function(t){var e=t.spacing;return{left:"calc(100% + ".concat(e,"px)")}},justifyPositions:z}),f(D,H.CenterHorizontal,{constant:function(t){var e=t.referenceElDocumentPos;return{left:"calc(".concat(e.width/2,"px - 50%)")}},justifyPositions:z}),D);function I(t){var e,n=t.align,r=t.justify,o=t.referenceElDocumentPos,i=t.contentElDocumentPos,a=t.spacing,c=A[n],u=c.justifyPositions[r],l={contentElDocumentPos:i,referenceElDocumentPos:o,spacing:a};return g({},null===(e=c.constant)||void 0===e?void 0:e.call(c,l),{},"function"==typeof u?u(l):u)}function k(t){var e=t.align,n=t.justify,r=t.referenceElDocumentPos,o=t.contentElDocumentPos,i=t.spacing,a=t.windowWidth,c=t.windowHeight,u="".concat(_({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px"),l="".concat(q({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px");return n!==M.Fit?{left:u,top:l}:[H.Left,H.Right,H.CenterHorizontal].includes(e)?{left:u,top:l,bottom:"".concat(c-r.bottom,"px")}:{left:u,top:l,right:"".concat(a-r.right,"px")}}function q(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case H.Left:case H.Right:case H.CenterHorizontal:switch(n){case M.Start:case M.Fit:return o.top;case M.End:return o.top+o.height-r.height;case M.Middle:default:return o.top-(r.height-o.height)/2}case H.CenterVertical:return o.top-(r.height-o.height)/2;case H.Top:return o.top-r.height-i;case H.Bottom:default:return o.top+o.height+i}}function _(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case H.Top:case H.Bottom:case H.CenterVertical:switch(n){case M.End:return o.left+o.width-r.width;case M.Middle:return o.left-(r.width-o.width)/2;case M.Start:case M.Fit:default:return o.left}case H.Left:return o.left-r.width-i;case H.Right:return o.left+o.width+i;case H.CenterHorizontal:default:return o.left-(r.width-o.width)/2}}function G(t){var e=t.left,n=t.windowWidth,r=t.contentWidth;return e>=0&&!(e+r>n)}function J(t){var e=t.top,n=t.windowHeight,r=t.contentHeight;return e>=0&&!(e+r>n)}var U=(f(C={},H.Top,[H.Bottom]),f(C,H.Bottom,[H.Top]),f(C,H.Left,[H.Right]),f(C,H.Right,[H.Left]),f(C,H.CenterHorizontal,[H.Left,H.Right]),f(C,H.CenterVertical,[H.Top,H.Bottom]),C);var X=(f(x={},M.Start,[M.End,M.Middle]),f(x,M.Middle,[M.End,M.Start]),f(x,M.End,[M.Start,M.Middle]),f(x,M.Fit,[M.Middle,M.Start,M.End]),x);function Y(){var t=y(["\n display: none;\n "]);return Y=function(){return t},t}function $(){var t=y(["\n transform: translate3d(0, 0, 0) scale(1);\n opacity: 1;\n position: ",";\n pointer-events: initial;\n "]);return $=function(){return t},t}function K(){var t=y(["\n transition: transform 150ms ease-in-out, opacity 150ms ease-in-out;\n position: absolute;\n opacity: 0;\n"]);return K=function(){return t},t}var Q=o.css(K()),Z={attributes:!0,characterData:!0,childList:!0,subtree:!0};function tt(t){var n=t.active,i=void 0!==n&&n,c=t.usePortal,l=void 0===c||c,p=t.spacing,g=void 0===p?10:p,y=t.align,v=void 0===y?H.Bottom:y,w=t.justify,b=void 0===w?M.Start:w,E=t.adjustOnMutation,P=void 0!==E&&E,j=t.children,O=t.className,S=t.portalClassName,D=t.refEl,C=h(t,["active","usePortal","spacing","align","justify","adjustOnMutation","children","className","portalClassName","refEl"]),x=m(a.useElementNode(),2),V=x[0],L=x[1],B=m(a.useElementNode(),2),W=B[0],z=B[1],N=m(e.useState(0),2),A=N[0],I=N[1],k=u.default.useRef(W);k.current=W;var q=null;if(D&&D.current)q=D.current;else if(V){var _=V.parentNode;_&&_ instanceof HTMLElement&&(q=_)}var G=a.useViewportSize(),J=P&&i,U=a.useMutationObserver(q,Z,e.useCallback(Date.now,[]),J),X=a.useMutationObserver(W,Z,e.useCallback(Date.now,[]),J),K=a.useObjectDependency(F(q)),tt=a.useObjectDependency(F(W)),et=a.useObjectDependency(e.useMemo((function(){return R(q)}),[q,G,U,i,v,b,A])),nt=a.useObjectDependency(e.useMemo((function(){return R(W)}),[W,G,X,i,v,b,A])),rt=a.usePrevious(b),ot=a.usePrevious(v),it=rt!==b&&(b===M.Fit||rt===M.Fit)||ot!==v&&b===M.Fit;a.useIsomorphicLayoutEffect((function(){it&&I((function(t){return t+1}))}),[it]);var at=m(e.useState(!1),2),ct=at[0],ut=at[1];if(a.useIsomorphicLayoutEffect((function(){return ut(!0)}),[]),!ct)return null;var lt,st=T({useRelativePositioning:!l,spacing:g,align:v,justify:b,referenceElViewportPos:K,referenceElDocumentPos:et,contentElViewportPos:tt,contentElDocumentPos:nt}),ft=st.align,dt=st.justify,pt=st.positionCSS,gt=o.css($(),l?"":"absolute"),ht=l?s.default:e.Fragment,yt=l?{className:S}:{};return lt=null==j?null:"function"==typeof j?j({align:ft,justify:dt,referenceElPos:et}):j,u.default.createElement(r.Transition,{nodeRef:k,in:i,timeout:{exit:150},mountOnEnter:!0,unmountOnExit:!0},(function(t){return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{ref:L,className:o.css(Y())}),u.default.createElement(ht,yt,u.default.createElement("div",d({},C,{className:o.cx(Q,o.css(pt),f({},gt,"entered"===t),O)}),u.default.createElement("div",{ref:z},lt))))}))}tt.displayName="Popover",tt.propTypes={children:l.default.oneOfType([l.default.node,l.default.func]),active:l.default.bool,className:l.default.string,align:l.default.oneOf(Object.values(H)),justify:l.default.oneOf(Object.values(M)),refEl:l.default.shape({current:"undefined"!=typeof window?l.default.instanceOf(Element):l.default.any}),usePortal:l.default.bool,portalClassName:l.default.string,spacing:l.default.number,adjustOnMutation:l.default.bool},tt.defaultProps={children:void 0,align:H.Bottom,justify:M.Start,active:!1,usePortal:!0,spacing:10,adjustOnMutation:!1},t.Align=H,t.Justify=M,t.default=tt,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("react-transition-group"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/portal"),require("@leafygreen-ui/hooks")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-transition-group","@leafygreen-ui/emotion","@leafygreen-ui/portal","@leafygreen-ui/hooks"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@leafygreen-ui/popover"]={},t.React,t.PropTypes,t.reactTransitionGroup,t["@leafygreen-ui/emotion"],t["@leafygreen-ui/portal"],t["@leafygreen-ui/hooks"])}(this,(function(t,e,n,r,o,i,a){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=c(e),l=c(n),s=c(i);function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function h(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function y(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||w(t,e)||function(){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 v(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||w(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){if(t){if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var P,E,j,O,S,D,C,x,H={Top:"top",Bottom:"bottom",Left:"left",Right:"right",CenterVertical:"center-vertical",CenterHorizontal:"center-horizontal"},M={Start:"start",Middle:"middle",End:"end",Fit:"fit"};function T(t){var e=t.useRelativePositioning,n=t.spacing,r=t.align,o=t.justify,i=t.referenceElViewportPos,a=void 0===i?V:i,c=t.referenceElDocumentPos,u=void 0===c?V:c,l=t.contentElViewportPos,s=void 0===l?V:l,f=t.contentElDocumentPos,d=void 0===f?V:f,p=t.windowHeight,h=void 0===p?window.innerHeight:p,y=t.windowWidth,m=void 0===y?window.innerWidth:y,w={windowWidth:m,windowHeight:h,referenceElViewportPos:a,contentElViewportPos:s,spacing:n},b=function(t,e){var n=e.spacing,r=e.windowWidth,o=e.windowHeight,i=e.contentElViewportPos,a=e.referenceElViewportPos;return[t].concat(v(U[t])).find((function(t){return[H.Top,H.Bottom,H.CenterVertical].includes(t)?J({top:q({align:t,contentElPos:i,referenceElPos:a,spacing:n}),windowHeight:o,contentHeight:i.height}):!![H.Left,H.Right,H.CenterHorizontal].includes(t)&&G({left:_({align:t,contentElPos:i,referenceElPos:a,spacing:n}),windowWidth:r,contentWidth:i.width})}))||t}(r,w),P=function(t,e,n){var r,o,i=n.spacing,a=n.windowWidth,c=n.windowHeight,u=n.contentElViewportPos,l=n.referenceElViewportPos,s=[t].concat(v(X[t]));switch(e){case H.Top:case H.Bottom:case H.CenterVertical:return null!==(r=s.find((function(t){return G({contentWidth:t===M.Fit?l.width:u.width,windowWidth:a,left:_({contentElPos:u,referenceElPos:l,spacing:i,align:e,justify:t})})})))&&void 0!==r?r:X[t][0];case H.Left:case H.Right:case H.CenterHorizontal:return null!==(o=s.find((function(t){return J({contentHeight:t===M.Fit?l.height:u.height,windowHeight:c,top:q({contentElPos:u,referenceElPos:l,spacing:i,align:e,justify:t})})})))&&void 0!==o?o:X[t][0]}}(o,b,w),E=function(t){var e,n,r=t.align,o=t.justify,i=W[r],a=null!==(e=i.x)&&void 0!==e?e:B[o],c=null!==(n=i.y)&&void 0!==n?n:L[o];return"".concat(a," ").concat(c)}({align:b,justify:P}),j=function(t,e){var n=.8;switch(t){case H.Top:return"translate3d(0, ".concat(e,"px, 0) scale(").concat(n,")");case H.Bottom:return"translate3d(0, -".concat(e,"px, 0) scale(").concat(n,")");case H.Left:return"translate3d(".concat(e,"px, 0, 0) scale(").concat(n,")");case H.Right:return"translate3d(-".concat(e,"px, 0, 0) scale(").concat(n,")");case H.CenterHorizontal:case H.CenterVertical:return"scale(".concat(n,")")}}(b,n);return e?{align:b,justify:P,positionCSS:g({},I({align:b,justify:P,referenceElDocumentPos:u,contentElDocumentPos:d,spacing:n}),{transformOrigin:E,transform:j})}:{align:b,justify:P,positionCSS:g({},k({align:b,justify:P,referenceElDocumentPos:u,contentElDocumentPos:d,spacing:n,windowHeight:h,windowWidth:m}),{transformOrigin:E,transform:j})}}var V={top:0,bottom:0,left:0,right:0,height:0,width:0};function R(t){if(!t)return V;var e=t.getBoundingClientRect(),n=e.top,r=e.bottom,o=e.left,i=e.right,a=t.offsetHeight,c=t.offsetWidth,u=window,l=u.scrollX,s=u.scrollY;return{top:n+s,bottom:r+s,left:o+l,right:i+l,height:a,width:c}}function F(t){if(!t)return V;var e=t.getBoundingClientRect();return{top:e.top,bottom:e.bottom,left:e.left,right:e.right,height:t.offsetHeight,width:t.offsetWidth}}var L=(f(P={},M.Start,"top"),f(P,M.Middle,"center"),f(P,M.End,"bottom"),f(P,M.Fit,"center"),P),B=(f(E={},M.Start,"left"),f(E,M.Middle,"center"),f(E,M.End,"right"),f(E,M.Fit,"center"),E),W=(f(j={},H.Left,{x:"right"}),f(j,H.Right,{x:"left"}),f(j,H.Top,{y:"bottom"}),f(j,H.Bottom,{y:"top"}),f(j,H.CenterHorizontal,{x:"center"}),f(j,H.CenterVertical,{y:"center"}),j);var z=(f(O={},M.Start,{top:0}),f(O,M.End,{bottom:0}),f(O,M.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{top:"".concat(n.height/2-e.height/2,"px")}})),f(O,M.Fit,{top:0,bottom:0}),O),N=(f(S={},M.Start,{left:0}),f(S,M.End,{right:0}),f(S,M.Middle,(function(t){var e=t.contentElDocumentPos,n=t.referenceElDocumentPos;return{left:"".concat(n.width/2-e.width/2,"px")}})),f(S,M.Fit,{left:0,right:0}),S),A=(f(D={},H.Top,{constant:function(t){var e=t.spacing;return{bottom:"calc(100% + ".concat(e,"px)")}},justifyPositions:N}),f(D,H.Bottom,{constant:function(t){var e=t.spacing;return{top:"calc(100% + ".concat(e,"px)")}},justifyPositions:N}),f(D,H.CenterVertical,{constant:function(t){var e=t.referenceElDocumentPos;return{top:"calc(".concat(e.height/2,"px - 50%)")}},justifyPositions:N}),f(D,H.Left,{constant:function(t){var e=t.spacing;return{right:"calc(100% + ".concat(e,"px)")}},justifyPositions:z}),f(D,H.Right,{constant:function(t){var e=t.spacing;return{left:"calc(100% + ".concat(e,"px)")}},justifyPositions:z}),f(D,H.CenterHorizontal,{constant:function(t){var e=t.referenceElDocumentPos;return{left:"calc(".concat(e.width/2,"px - 50%)")}},justifyPositions:z}),D);function I(t){var e,n=t.align,r=t.justify,o=t.referenceElDocumentPos,i=t.contentElDocumentPos,a=t.spacing,c=A[n],u=c.justifyPositions[r],l={contentElDocumentPos:i,referenceElDocumentPos:o,spacing:a};return g({},null===(e=c.constant)||void 0===e?void 0:e.call(c,l),{},"function"==typeof u?u(l):u)}function k(t){var e=t.align,n=t.justify,r=t.referenceElDocumentPos,o=t.contentElDocumentPos,i=t.spacing,a=t.windowWidth,c=t.windowHeight,u="".concat(_({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px"),l="".concat(q({align:e,justify:n,referenceElPos:r,contentElPos:o,spacing:i}),"px");return n!==M.Fit?{left:u,top:l}:[H.Left,H.Right,H.CenterHorizontal].includes(e)?{left:u,top:l,bottom:"".concat(c-r.bottom,"px")}:{left:u,top:l,right:"".concat(a-r.right,"px")}}function q(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case H.Left:case H.Right:case H.CenterHorizontal:switch(n){case M.Start:case M.Fit:return o.top;case M.End:return o.top+o.height-r.height;case M.Middle:default:return o.top-(r.height-o.height)/2}case H.CenterVertical:return o.top-(r.height-o.height)/2;case H.Top:return o.top-r.height-i;case H.Bottom:default:return o.top+o.height+i}}function _(t){var e=t.align,n=t.justify,r=t.contentElPos,o=t.referenceElPos,i=t.spacing;switch(e){case H.Top:case H.Bottom:case H.CenterVertical:switch(n){case M.End:return o.left+o.width-r.width;case M.Middle:return o.left-(r.width-o.width)/2;case M.Start:case M.Fit:default:return o.left}case H.Left:return o.left-r.width-i;case H.Right:return o.left+o.width+i;case H.CenterHorizontal:default:return o.left-(r.width-o.width)/2}}function G(t){var e=t.left,n=t.windowWidth,r=t.contentWidth;return e>=0&&!(e+r>n)}function J(t){var e=t.top,n=t.windowHeight,r=t.contentHeight;return e>=0&&!(e+r>n)}var U=(f(C={},H.Top,[H.Bottom]),f(C,H.Bottom,[H.Top]),f(C,H.Left,[H.Right]),f(C,H.Right,[H.Left]),f(C,H.CenterHorizontal,[H.Left,H.Right]),f(C,H.CenterVertical,[H.Top,H.Bottom]),C);var X=(f(x={},M.Start,[M.End,M.Middle]),f(x,M.Middle,[M.End,M.Start]),f(x,M.End,[M.Start,M.Middle]),f(x,M.Fit,[M.Middle,M.Start,M.End]),x);function Y(){var t=y(["\n display: none;\n "]);return Y=function(){return t},t}function $(){var t=y(["\n transform: translate3d(0, 0, 0) scale(1);\n opacity: 1;\n position: ",";\n pointer-events: initial;\n "]);return $=function(){return t},t}function K(){var t=y(["\n transition: transform 150ms ease-in-out, opacity 150ms ease-in-out;\n position: absolute;\n opacity: 0;\n"]);return K=function(){return t},t}var Q=o.css(K()),Z={attributes:!0,characterData:!0,childList:!0,subtree:!0};function tt(t){var n=t.active,i=void 0!==n&&n,c=t.usePortal,l=void 0===c||c,p=t.spacing,g=void 0===p?10:p,y=t.align,v=void 0===y?H.Bottom:y,w=t.justify,b=void 0===w?M.Start:w,P=t.adjustOnMutation,E=void 0!==P&&P,j=t.children,O=t.className,S=t.portalClassName,D=t.refEl,C=h(t,["active","usePortal","spacing","align","justify","adjustOnMutation","children","className","portalClassName","refEl"]),x=m(e.useState(null),2),V=x[0],L=x[1],B=m(e.useState(null),2),W=B[0],z=B[1],N=m(e.useState(0),2),A=N[0],I=N[1],k=u.default.useRef(W);k.current=W;var q=null;if(D&&D.current)q=D.current;else if(V){var _=V.parentNode;_&&_ instanceof HTMLElement&&(q=_)}var G=a.useViewportSize(),J=E&&i,U=a.useMutationObserver(q,Z,e.useCallback(Date.now,[]),J),X=a.useMutationObserver(W,Z,e.useCallback(Date.now,[]),J),K=a.useObjectDependency(F(q)),tt=a.useObjectDependency(F(W)),et=a.useObjectDependency(e.useMemo((function(){return R(q)}),[q,G,U,i,v,b,A])),nt=a.useObjectDependency(e.useMemo((function(){return R(W)}),[W,G,X,i,v,b,A])),rt=a.usePrevious(b),ot=a.usePrevious(v),it=rt!==b&&(b===M.Fit||rt===M.Fit)||ot!==v&&b===M.Fit;a.useIsomorphicLayoutEffect((function(){it&&I((function(t){return t+1}))}),[it]);var at=m(e.useState(!1),2),ct=at[0],ut=at[1];if(a.useIsomorphicLayoutEffect((function(){return ut(!0)}),[]),!ct)return null;var lt,st=T({useRelativePositioning:!l,spacing:g,align:v,justify:b,referenceElViewportPos:K,referenceElDocumentPos:et,contentElViewportPos:tt,contentElDocumentPos:nt}),ft=st.align,dt=st.justify,pt=st.positionCSS,gt=o.css($(),l?"":"absolute"),ht=l?s.default:e.Fragment,yt=l?{className:S}:{};return lt=null==j?null:"function"==typeof j?j({align:ft,justify:dt,referenceElPos:et}):j,u.default.createElement(r.Transition,{nodeRef:k,in:i,timeout:{exit:150},mountOnEnter:!0,unmountOnExit:!0},(function(t){return u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{ref:L,className:o.css(Y())}),u.default.createElement(ht,yt,u.default.createElement("div",d({},C,{className:o.cx(Q,o.css(pt),f({},gt,"entered"===t),O)}),u.default.createElement("div",{ref:z},lt))))}))}tt.displayName="Popover",tt.propTypes={children:l.default.oneOfType([l.default.node,l.default.func]),active:l.default.bool,className:l.default.string,align:l.default.oneOf(Object.values(H)),justify:l.default.oneOf(Object.values(M)),refEl:l.default.shape({current:"undefined"!=typeof window?l.default.instanceOf(Element):l.default.any}),usePortal:l.default.bool,portalClassName:l.default.string,spacing:l.default.number,adjustOnMutation:l.default.bool},tt.defaultProps={children:void 0,align:H.Bottom,justify:M.Start,active:!1,usePortal:!0,spacing:10,adjustOnMutation:!1},t.Align=H,t.Justify=M,t.default=tt,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.js.map
{
"name": "@leafygreen-ui/popover",
"version": "7.0.1",
"version": "7.1.0",
"description": "LeafyGreen UI Kit Popover",

@@ -24,4 +24,4 @@ "main": "./dist/index.js",

"react-transition-group": "^4.4.1",
"@leafygreen-ui/hooks": "^5.0.1",
"@leafygreen-ui/lib": "^6.0.1",
"@leafygreen-ui/hooks": "^6.0.0",
"@leafygreen-ui/lib": "^6.1.1",
"@leafygreen-ui/portal": "^3.0.1",

@@ -31,5 +31,5 @@ "lodash": "^4.17.20"

"devDependencies": {
"@leafygreen-ui/palette": "^3.0.1"
"@leafygreen-ui/palette": "^3.1.0"
},
"gitHead": "dd71a2d404218ccec2e657df9c0263dc1c15b9e0"
}

@@ -60,20 +60,21 @@ # Popover

| Prop | Type | Description | Default |
| ------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| `active` | `boolean` | Determines whether the Popover is active or inactive | `false` |
| `align` | `'top'`, `'bottom'`, `'left'`, `'right'`, `'center-horizontal'`, `'center-vertical'` | A string that determines the alignment of the popover relative to the `refEl`. | `'bottom'` |
| `justify` | `'start'`, `'middle'`, `'end'`, `'fit'` | A string that determines the justification of the popover relative to the `refEl`. Justification will be defined relative to the `align` prop | `'start'` |
| `children` | `node` | Content that will appear inside of the `<Popver />` component | |
| `usePortal` | `boolean` | Will position Popover's children relative to its parent without using a Portal, if `usePortal` is set to false. NOTE: The parent element should be CSS position `relative`, `fixed`, or `absolute` if using this option. | `true` |
| `spacing` | `number` | Specifies the amount of spacing (in pixels) between the trigger element and the content element. | `10` |
| `className` | `string` | Classname to apply to popover-content container | |
| `adjustOnMutation` | `boolean` | Should the Popover auto adjust its content when the DOM changes (using MutationObserver). | `false` |
| `onClick` | `function` | Function that will be called when popover content is clicked. | |
## Properties
| Prop | Type | Description | Default |
| ------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| `active` | `boolean` | Determines whether the Popover is active or inactive | `false` |
| `align` | `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'center-horizontal'` \| `'center-vertical'` | A string that determines the alignment of the popover relative to the `refEl`. | `'bottom'` |
| `justify` | `'start'` \| `'middle'` \| `'end'` \| `'fit'` | A string that determines the justification of the popover relative to the `refEl`. Justification will be defined relative to the `align` prop | `'start'` |
| `children` | `node` | Content that will appear inside of the `<Popver />` component | |
| `usePortal` | `boolean` | Will position Popover's children relative to its parent without using a Portal, if `usePortal` is set to false. NOTE: The parent element should be CSS position `relative`, `fixed`, or `absolute` if using this option. | `true` |
| `spacing` | `number` | Specifies the amount of spacing (in pixels) between the trigger element and the content element. | `10` |
| `className` | `string` | Classname to apply to popover-content container | |
| `adjustOnMutation` | `boolean` | Should the Popover auto adjust its content when the DOM changes (using MutationObserver). | `false` |
| `onClick` | `function` | Function that will be called when popover content is clicked. | |
| ... | | Any other properties will be spread on the popover-content container | |
## Advanced Use Case
| Prop | Type | Description | Default |
| ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `refEl` | `object` | You can supply a `refEl` prop, if you do not want the popover to be positioned relative to it's nearest parent. Ref to the element to which the popover component should be positioned relative to. | `null` |
_Any other properties will be spread on the popover-content container_
| Prop | Type | Description | Default |
| ------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `refEl` | `HTMLElement` | You can supply a `refEl` prop, if you do not want the popover to be positioned relative to it's nearest parent. Ref to the element to which the popover component should be positioned relative to. | `null` |

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

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