@radix-ui/react-popper
Advanced tools
Comparing version 0.1.1-rc.16 to 0.1.1-rc.17
@@ -7,3 +7,7 @@ import * as React from "react"; | ||
import { Measurable } from "@radix-ui/rect"; | ||
export const Popper: React.FC; | ||
export const createPopperScope: import("@radix-ui/react-context").CreateScope; | ||
export interface PopperProps { | ||
children?: React.ReactNode; | ||
} | ||
export const Popper: React.FC<PopperProps>; | ||
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>; | ||
@@ -28,3 +32,3 @@ export interface PopperAnchorProps extends PrimitiveDivProps { | ||
export const PopperArrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>; | ||
export const Root: React.FC<{}>; | ||
export const Root: React.FC<PopperProps>; | ||
export const Anchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>; | ||
@@ -31,0 +35,0 @@ export const Content: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>; |
@@ -1,2 +0,2 @@ | ||
var e,r=u({},require("@radix-ui/react-arrow")),t=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-use-size").useSize,o=require("@radix-ui/react-use-rect").useRect,i=require("@radix-ui/react-context").createContext,s=require("@radix-ui/react-compose-refs").useComposedRefs,a=require("@radix-ui/popper").getPlacementData,c=u({},require("react")),l=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function u(e,r){return Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e}const[d,p]=i("Popper"),f=({children:e})=>{const[r,t]=c.useState(null);/*#__PURE__*/return c.createElement(d,{anchor:r,onAnchorChange:t},e)};exports.Popper=f;const w=/*#__PURE__*/c.forwardRef(((e,r)=>{const{virtualRef:n,...o}=e,i=p("PopperAnchor"),a=c.useRef(null),u=s(r,a);return c.useEffect((()=>{i.onAnchorChange((null==n?void 0:n.current)||a.current)})),n?null:/*#__PURE__*/c.createElement(t.div,l({},o,{ref:u}))}));exports.PopperAnchor=w;const[h,m]=i("PopperContent"),v=/*#__PURE__*/c.forwardRef(((e,r)=>{const{side:i="bottom",sideOffset:u,align:d="center",alignOffset:f,collisionTolerance:w,avoidCollisions:m=!0,...v}=e,x=p("PopperContent"),[g,y]=c.useState(),E=o(x.anchor),[A,C]=c.useState(null),R=n(A),[S,P]=c.useState(null),O=n(S),q=s(r,(e=>C(e))),b=function(){const[e,r]=c.useState(void 0);return c.useEffect((()=>{let e;function t(){r({width:window.innerWidth,height:window.innerHeight})}function n(){window.clearTimeout(e),e=window.setTimeout(t,100)}return t(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[]),e}(),z=b?DOMRect.fromRect({...b,x:0,y:0}):void 0,{popperStyles:T,arrowStyles:_,placedSide:k,placedAlign:M}=a({anchorRect:E,popperSize:R,arrowSize:O,arrowOffset:g,side:i,sideOffset:u,align:d,alignOffset:f,shouldAvoidCollisions:m,collisionBoundariesRect:z,collisionTolerance:w}),j=void 0!==k;/*#__PURE__*/return c.createElement("div",{style:T,"data-radix-popper-content-wrapper":""},/*#__PURE__*/c.createElement(h,{arrowStyles:_,onArrowChange:P,onArrowOffsetChange:y},/*#__PURE__*/c.createElement(t.div,l({"data-side":k,"data-align":M},v,{style:{...v.style,animation:j?void 0:"none"},ref:q}))))}));exports.PopperContent=v;const x=/*#__PURE__*/c.forwardRef((function(e,t){const{offset:n,...o}=e,i=m("PopperArrow"),{onArrowOffsetChange:s}=i;return c.useEffect((()=>s(n)),[s,n]),/*#__PURE__*/c.createElement("span",{style:{...i.arrowStyles,pointerEvents:"none"}},/*#__PURE__*/c.createElement("span",{ref:i.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},/*#__PURE__*/c.createElement(r.Root,l({},o,{ref:t,style:{...o.style,display:"block"}}))))}));exports.PopperArrow=x;const g=f;exports.Root=g;const y=w;exports.Anchor=y;const E=v;exports.Content=E;const A=x;exports.Arrow=A; | ||
var e,r=l({},require("@radix-ui/react-arrow")),t=require("@radix-ui/react-primitive").Primitive,o=require("@radix-ui/react-use-size").useSize,n=require("@radix-ui/react-use-rect").useRect,i=require("@radix-ui/react-context").createContextScope,s=require("@radix-ui/react-compose-refs").useComposedRefs,a=require("@radix-ui/popper").getPlacementData,c=l({},require("react")),p=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function l(e,r){return Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e}const[u,d]=i("Popper");exports.createPopperScope=d;const[f,w]=u("Popper"),h=e=>{const{__scopePopper:r,children:t}=e,[o,n]=c.useState(null);/*#__PURE__*/return c.createElement(f,{scope:r,anchor:o,onAnchorChange:n},t)};exports.Popper=h;const m=/*#__PURE__*/c.forwardRef(((e,r)=>{const{__scopePopper:o,virtualRef:n,...i}=e,a=w("PopperAnchor",o),l=c.useRef(null),u=s(r,l);return c.useEffect((()=>{a.onAnchorChange((null==n?void 0:n.current)||l.current)})),n?null:/*#__PURE__*/c.createElement(t.div,p({},i,{ref:u}))}));exports.PopperAnchor=m;const[x,v]=u("PopperContent"),P=/*#__PURE__*/c.forwardRef(((e,r)=>{const{__scopePopper:i,side:l="bottom",sideOffset:u,align:d="center",alignOffset:f,collisionTolerance:h,avoidCollisions:m=!0,...v}=e,P=w("PopperContent",i),[g,y]=c.useState(),E=n(P.anchor),[A,S]=c.useState(null),C=o(A),[R,_]=c.useState(null),O=o(R),q=s(r,(e=>S(e))),b=function(){const[e,r]=c.useState(void 0);return c.useEffect((()=>{let e;function t(){r({width:window.innerWidth,height:window.innerHeight})}function o(){window.clearTimeout(e),e=window.setTimeout(t,100)}return t(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)}),[]),e}(),z=b?DOMRect.fromRect({...b,x:0,y:0}):void 0,{popperStyles:T,arrowStyles:k,placedSide:M,placedAlign:j}=a({anchorRect:E,popperSize:C,arrowSize:O,arrowOffset:g,side:l,sideOffset:u,align:d,alignOffset:f,shouldAvoidCollisions:m,collisionBoundariesRect:z,collisionTolerance:h}),D=void 0!==M;/*#__PURE__*/return c.createElement("div",{style:T,"data-radix-popper-content-wrapper":""},/*#__PURE__*/c.createElement(x,{scope:i,arrowStyles:k,onArrowChange:_,onArrowOffsetChange:y},/*#__PURE__*/c.createElement(t.div,p({"data-side":M,"data-align":j},v,{style:{...v.style,animation:D?void 0:"none"},ref:q}))))}));exports.PopperContent=P;const g=/*#__PURE__*/c.forwardRef((function(e,t){const{__scopePopper:o,offset:n,...i}=e,s=v("PopperArrow",o),{onArrowOffsetChange:a}=s;return c.useEffect((()=>a(n)),[a,n]),/*#__PURE__*/c.createElement("span",{style:{...s.arrowStyles,pointerEvents:"none"}},/*#__PURE__*/c.createElement("span",{ref:s.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},/*#__PURE__*/c.createElement(r.Root,p({},i,{ref:t,style:{...i.style,display:"block"}}))))}));exports.PopperArrow=g;const y=h;exports.Root=y;const E=m;exports.Anchor=E;const A=P;exports.Content=A;const S=g;exports.Arrow=S; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import*as e from"@radix-ui/react-arrow";import{Primitive as r}from"@radix-ui/react-primitive";import{useSize as o}from"@radix-ui/react-use-size";import{useRect as t}from"@radix-ui/react-use-rect";import{createContext as n}from"@radix-ui/react-context";import{useComposedRefs as i}from"@radix-ui/react-compose-refs";import{getPlacementData as a}from"@radix-ui/popper";import*as s from"react";import c from"@babel/runtime/helpers/esm/extends";const[p,l]=n("Popper");export const Popper=({children:e})=>{const[r,o]=s.useState(null);/*#__PURE__*/return s.createElement(p,{anchor:r,onAnchorChange:o},e)};/*#__PURE__*/export const PopperAnchor=/*#__PURE__*/s.forwardRef(((e,o)=>{const{virtualRef:t,...n}=e,a=l("PopperAnchor"),p=s.useRef(null),f=i(o,p);return s.useEffect((()=>{a.onAnchorChange((null==t?void 0:t.current)||p.current)})),t?null:/*#__PURE__*/s.createElement(r.div,c({},n,{ref:f}))}));/*#__PURE__*/const[f,d]=n("PopperContent");export const PopperContent=/*#__PURE__*/s.forwardRef(((e,n)=>{const{side:p="bottom",sideOffset:d,align:u="center",alignOffset:m,collisionTolerance:w,avoidCollisions:h=!0,...x}=e,v=l("PopperContent"),[A,g]=s.useState(),E=t(v.anchor),[y,C]=s.useState(null),P=o(y),[S,R]=s.useState(null),O=o(S),b=i(n,(e=>C(e))),z=function(){const[e,r]=s.useState(void 0);return s.useEffect((()=>{let e;function o(){r({width:window.innerWidth,height:window.innerHeight})}function t(){window.clearTimeout(e),e=window.setTimeout(o,100)}return o(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[]),e}(),T=z?DOMRect.fromRect({...z,x:0,y:0}):void 0,{popperStyles:k,arrowStyles:L,placedSide:B,placedAlign:D}=a({anchorRect:E,popperSize:P,arrowSize:O,arrowOffset:A,side:p,sideOffset:d,align:u,alignOffset:m,shouldAvoidCollisions:h,collisionBoundariesRect:T,collisionTolerance:w}),H=void 0!==B;/*#__PURE__*/return s.createElement("div",{style:k,"data-radix-popper-content-wrapper":""},/*#__PURE__*/s.createElement(f,{arrowStyles:L,onArrowChange:R,onArrowOffsetChange:g},/*#__PURE__*/s.createElement(r.div,c({"data-side":B,"data-align":D},x,{style:{...x.style,animation:H?void 0:"none"},ref:b}))))}));/*#__PURE__*/export const PopperArrow=/*#__PURE__*/s.forwardRef((function(r,o){const{offset:t,...n}=r,i=d("PopperArrow"),{onArrowOffsetChange:a}=i;return s.useEffect((()=>a(t)),[a,t]),/*#__PURE__*/s.createElement("span",{style:{...i.arrowStyles,pointerEvents:"none"}},/*#__PURE__*/s.createElement("span",{ref:i.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},/*#__PURE__*/s.createElement(e.Root,c({},n,{ref:o,style:{...n.style,display:"block"}}))))}));/*#__PURE__*/export const Root=Popper;export const Anchor=PopperAnchor;export const Content=PopperContent;export const Arrow=PopperArrow; | ||
import*as e from"@radix-ui/react-arrow";import{Primitive as o}from"@radix-ui/react-primitive";import{useSize as r}from"@radix-ui/react-use-size";import{useRect as t}from"@radix-ui/react-use-rect";import{createContextScope as n}from"@radix-ui/react-context";import{useComposedRefs as i}from"@radix-ui/react-compose-refs";import{getPlacementData as p}from"@radix-ui/popper";import*as s from"react";import a from"@babel/runtime/helpers/esm/extends";const[c,l]=n("Popper");export{l as createPopperScope};const[f,d]=c("Popper");export const Popper=e=>{const{__scopePopper:o,children:r}=e,[t,n]=s.useState(null);/*#__PURE__*/return s.createElement(f,{scope:o,anchor:t,onAnchorChange:n},r)};/*#__PURE__*/export const PopperAnchor=/*#__PURE__*/s.forwardRef(((e,r)=>{const{__scopePopper:t,virtualRef:n,...p}=e,c=d("PopperAnchor",t),l=s.useRef(null),f=i(r,l);return s.useEffect((()=>{c.onAnchorChange((null==n?void 0:n.current)||l.current)})),n?null:/*#__PURE__*/s.createElement(o.div,a({},p,{ref:f}))}));/*#__PURE__*/const[u,m]=c("PopperContent");export const PopperContent=/*#__PURE__*/s.forwardRef(((e,n)=>{const{__scopePopper:c,side:l="bottom",sideOffset:f,align:m="center",alignOffset:w,collisionTolerance:h,avoidCollisions:x=!0,...v}=e,P=d("PopperContent",c),[A,g]=s.useState(),E=t(P.anchor),[y,C]=s.useState(null),S=r(y),[R,O]=s.useState(null),_=r(R),b=i(n,(e=>C(e))),z=function(){const[e,o]=s.useState(void 0);return s.useEffect((()=>{let e;function r(){o({width:window.innerWidth,height:window.innerHeight})}function t(){window.clearTimeout(e),e=window.setTimeout(r,100)}return r(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[]),e}(),T=z?DOMRect.fromRect({...z,x:0,y:0}):void 0,{popperStyles:k,arrowStyles:L,placedSide:B,placedAlign:D}=p({anchorRect:E,popperSize:S,arrowSize:_,arrowOffset:A,side:l,sideOffset:f,align:m,alignOffset:w,shouldAvoidCollisions:x,collisionBoundariesRect:T,collisionTolerance:h}),H=void 0!==B;/*#__PURE__*/return s.createElement("div",{style:k,"data-radix-popper-content-wrapper":""},/*#__PURE__*/s.createElement(u,{scope:c,arrowStyles:L,onArrowChange:O,onArrowOffsetChange:g},/*#__PURE__*/s.createElement(o.div,a({"data-side":B,"data-align":D},v,{style:{...v.style,animation:H?void 0:"none"},ref:b}))))}));/*#__PURE__*/export const PopperArrow=/*#__PURE__*/s.forwardRef((function(o,r){const{__scopePopper:t,offset:n,...i}=o,p=m("PopperArrow",t),{onArrowOffsetChange:c}=p;return s.useEffect((()=>c(n)),[c,n]),/*#__PURE__*/s.createElement("span",{style:{...p.arrowStyles,pointerEvents:"none"}},/*#__PURE__*/s.createElement("span",{ref:p.onArrowChange,style:{display:"inline-block",verticalAlign:"top",pointerEvents:"auto"}},/*#__PURE__*/s.createElement(e.Root,a({},i,{ref:r,style:{...i.style,display:"block"}}))))}));/*#__PURE__*/export const Root=Popper;export const Anchor=PopperAnchor;export const Content=PopperContent;export const Arrow=PopperArrow; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-popper", | ||
"version": "0.1.1-rc.16", | ||
"version": "0.1.1-rc.17", | ||
"license": "MIT", | ||
@@ -21,9 +21,9 @@ "source": "src/index.ts", | ||
"@radix-ui/popper": "0.1.0", | ||
"@radix-ui/react-arrow": "0.1.1-rc.16", | ||
"@radix-ui/react-arrow": "0.1.1-rc.17", | ||
"@radix-ui/react-compose-refs": "0.1.0", | ||
"@radix-ui/react-context": "0.1.0", | ||
"@radix-ui/react-primitive": "0.1.1-rc.16", | ||
"@radix-ui/react-use-rect": "0.1.0", | ||
"@radix-ui/react-context": "0.1.1-rc.1", | ||
"@radix-ui/react-primitive": "0.1.1-rc.17", | ||
"@radix-ui/react-use-rect": "0.1.1-rc.1", | ||
"@radix-ui/react-use-size": "0.1.0", | ||
"@radix-ui/rect": "0.1.0" | ||
"@radix-ui/rect": "0.1.1-rc.1" | ||
}, | ||
@@ -30,0 +30,0 @@ "peerDependencies": { |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
38129
61
+ Added@radix-ui/react-arrow@0.1.1-rc.17(transitive)
+ Added@radix-ui/react-context@0.1.1-rc.1(transitive)
+ Added@radix-ui/react-primitive@0.1.1-rc.17(transitive)
+ Added@radix-ui/react-slot@0.1.1-rc.13(transitive)
+ Added@radix-ui/react-use-rect@0.1.1-rc.1(transitive)
+ Added@radix-ui/rect@0.1.1-rc.1(transitive)
- Removed@radix-ui/react-arrow@0.1.1-rc.16(transitive)
- Removed@radix-ui/react-context@0.1.0(transitive)
- Removed@radix-ui/react-primitive@0.1.1-rc.16(transitive)
- Removed@radix-ui/react-slot@0.1.1-rc.12(transitive)
- Removed@radix-ui/react-use-rect@0.1.0(transitive)
- Removed@radix-ui/rect@0.1.0(transitive)
Updated@radix-ui/rect@0.1.1-rc.1