@radix-ui/react-popover
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,2 +0,2 @@ | ||
var e=require("aria-hidden").hideOthers,r=require("react-remove-scroll").RemoveScroll,t=require("@radix-ui/react-id").useId,o=require("@radix-ui/react-primitive"),n=o.Primitive,a=o.extendPrimitive,u=require("@radix-ui/react-presence").Presence,i=require("@radix-ui/react-focus-guards").useFocusGuards,c=require("@radix-ui/react-portal").Portal,s=require("@radix-ui/react-focus-scope").FocusScope,l=require("@radix-ui/react-dismissable-layer").DismissableLayer,p=m({},require("@radix-ui/react-popper")),f=require("@radix-ui/react-use-controllable-state").useControllableState,d=require("@radix-ui/react-context").createContext,v=require("@radix-ui/react-compose-refs"),O=v.useComposedRefs,y=v.composeRefs,b=require("@radix-ui/primitive").composeEventHandlers,g=m({},require("react"));function m(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}function P(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?P(Object(t),!0).forEach((function(r){C(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function C(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function w(){return(w=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}function x(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function j(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],o=!0,n=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(o=(u=i.next()).done)&&(t.push(u.value),!r||t.length!==r);o=!0);}catch(e){n=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(n)throw a}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return D(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return D(e,r)}(e,r)||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 D(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}var F=j(d("Popover"),2),E=F[0],S=F[1],R=function(e){var r=e.children,o=e.open,n=e.defaultOpen,a=e.onOpenChange,u=g.useRef(null),i=j(f({prop:o,defaultProp:n,onChange:a}),2),c=i[0],s=void 0!==c&&c,l=i[1];return g.createElement(E,{contentId:t(),triggerRef:u,open:s,onOpenChange:l,onOpenToggle:g.useCallback((function(){return l((function(e){return!e}))}),[l])},r)};exports.Popover=R,R.displayName="Popover";var A=g.forwardRef((function(e,r){var t=e.as,o=void 0===t?"button":t,a=x(e,["as"]),u=S("PopoverTrigger"),i=O(r,u.triggerRef);return g.createElement(n,w({type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.contentId,"data-state":u.open?"open":"closed"},a,{as:o,ref:i,onClick:b(e.onClick,u.onOpenToggle)}))}));exports.PopoverTrigger=A,A.displayName="PopoverTrigger";var q=g.forwardRef((function(e,r){var t=e.forceMount,o=x(e,["forceMount"]),n=S("PopoverContent");return g.createElement(u,{present:t||n.open},g.createElement(k,w({"data-state":n.open?"open":"closed"},o,{ref:r})))}));exports.PopoverContent=q;var k=g.forwardRef((function(t,o){var n=t.anchorRef,a=t.trapFocus,u=void 0===a||a,f=t.onOpenAutoFocus,d=t.onCloseAutoFocus,v=t.disableOutsidePointerEvents,O=void 0!==v&&v,m=t.onEscapeKeyDown,P=t.onPointerDownOutside,D=t.onFocusOutside,F=t.onInteractOutside,E=t.disableOutsideScroll,R=void 0!==E&&E,A=t.portalled,q=void 0===A||A,k=x(t,["anchorRef","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","disableOutsideScroll","portalled"]),I=S("PopoverContent"),T=j(g.useState(!1),2),M=T[0],K=T[1],N=q?c:g.Fragment,B=R?r:g.Fragment;i();var U=g.useRef(null);return g.useEffect((function(){var r=U.current;if(r)return e(r)}),[]),g.createElement(N,null,g.createElement(B,null,g.createElement(s,{trapped:!M&&(u&&I.open),onMountAutoFocus:f,onUnmountAutoFocus:function(e){M?e.preventDefault():null==d||d(e)}},(function(e){return g.createElement(l,{disableOutsidePointerEvents:O,onEscapeKeyDown:m,onPointerDownOutside:b(P,(function(e){var r,t=null===(r=I.triggerRef.current)||void 0===r?void 0:r.contains(e.target),o=0===e.button&&!1===e.ctrlKey;K(!O&&o),t&&e.preventDefault(),e.defaultPrevented&&K(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:b(D,(function(e){u&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:F,onDismiss:function(){return I.onOpenChange(!1)}},(function(r){return g.createElement(p.Root,w({role:"dialog","aria-modal":!0,id:I.contentId},k,{ref:y(o,U,e.ref,r.ref),anchorRef:n||I.triggerRef,style:h(h(h({},r.style),k.style),{},C({},"--radix-popover-content-transform-origin","var(--radix-popper-transform-origin)")),onBlurCapture:b(k.onBlurCapture,r.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:b(k.onFocusCapture,r.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:b(k.onMouseDownCapture,r.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:b(k.onTouchStartCapture,r.onTouchStartCapture,{checkForDefaultPrevented:!1})}))}))}))))}));q.displayName="PopoverContent";var I=g.forwardRef((function(e,r){var t=e.as,o=void 0===t?"button":t,a=x(e,["as"]),u=S("PopoverClose");return g.createElement(n,w({type:"button"},a,{as:o,ref:r,onClick:b(e.onClick,(function(){return u.onOpenChange(!1)}))}))}));exports.PopoverClose=I,I.displayName="PopoverClose";var T=a(p.Arrow,"PopoverArrow");exports.PopoverArrow=T;var M=R;exports.Root=M;var K=A;exports.Trigger=K;var N=q;exports.Content=N;var B=I;exports.Close=B;var U=T;exports.Arrow=U; | ||
var e=require("aria-hidden").hideOthers,r=require("react-remove-scroll").RemoveScroll,t=require("@radix-ui/react-id").useId,o=require("@radix-ui/react-primitive"),n=o.Primitive,a=o.extendPrimitive,u=require("@radix-ui/react-presence").Presence,i=require("@radix-ui/react-focus-guards").useFocusGuards,c=require("@radix-ui/react-portal").Portal,s=require("@radix-ui/react-focus-scope").FocusScope,l=require("@radix-ui/react-dismissable-layer").DismissableLayer,p=m({},require("@radix-ui/react-popper")),f=require("@radix-ui/react-use-controllable-state").useControllableState,d=require("@radix-ui/react-context").createContext,v=require("@radix-ui/react-compose-refs"),y=v.useComposedRefs,O=v.composeRefs,b=require("@radix-ui/primitive").composeEventHandlers,g=m({},require("react"));function m(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}function P(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?P(Object(t),!0).forEach((function(r){C(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function C(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function w(){return(w=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}function x(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function j(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],o=!0,n=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(o=(u=i.next()).done)&&(t.push(u.value),!r||t.length!==r);o=!0);}catch(e){n=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(n)throw a}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return D(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return D(e,r)}(e,r)||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 D(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}var F=j(d("Popover"),2),E=F[0],S=F[1],R=function(e){var r=e.children,o=e.open,n=e.defaultOpen,a=e.onOpenChange,u=g.useRef(null),i=j(f({prop:o,defaultProp:n,onChange:a}),2),c=i[0],s=void 0!==c&&c,l=i[1];return g.createElement(E,{contentId:t(),triggerRef:u,open:s,onOpenChange:l,onOpenToggle:g.useCallback((function(){return l((function(e){return!e}))}),[l])},r)};exports.Popover=R,R.displayName="Popover";var A=g.forwardRef((function(e,r){var t=e.as,o=void 0===t?"button":t,a=x(e,["as"]),u=S("PopoverTrigger"),i=y(r,u.triggerRef);return g.createElement(n,w({type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.contentId,"data-state":u.open?"open":"closed"},a,{as:o,ref:i,onClick:b(e.onClick,u.onOpenToggle)}))}));exports.PopoverTrigger=A,A.displayName="PopoverTrigger";var q=g.forwardRef((function(e,r){var t=e.forceMount,o=x(e,["forceMount"]),n=S("PopoverContent");return g.createElement(u,{present:t||n.open},g.createElement(k,w({"data-state":n.open?"open":"closed"},o,{ref:r})))}));exports.PopoverContent=q;var k=g.forwardRef((function(t,o){var n=t.anchorRef,a=t.trapFocus,u=void 0===a||a,f=t.onOpenAutoFocus,d=t.onCloseAutoFocus,v=t.disableOutsidePointerEvents,y=void 0!==v&&v,m=t.onEscapeKeyDown,P=t.onPointerDownOutside,D=t.onFocusOutside,F=t.onInteractOutside,E=t.disableOutsideScroll,R=void 0!==E&&E,A=t.portalled,q=void 0===A||A,k=x(t,["anchorRef","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","disableOutsideScroll","portalled"]),I=S("PopoverContent"),T=j(g.useState(!1),2),M=T[0],N=T[1],K=q?c:g.Fragment,B=R?r:g.Fragment;i();var U=g.useRef(null);return g.useEffect((function(){var r=U.current;if(r)return e(r)}),[]),g.createElement(K,null,g.createElement(B,null,g.createElement(s,{trapped:!M&&(u&&I.open),onMountAutoFocus:f,onUnmountAutoFocus:function(e){M?e.preventDefault():null==d||d(e)}},(function(e){return g.createElement(l,{disableOutsidePointerEvents:y,onEscapeKeyDown:m,onPointerDownOutside:b(P,(function(e){var r,t=null===(r=I.triggerRef.current)||void 0===r?void 0:r.contains(e.target),o=0===e.button&&!1===e.ctrlKey;N(!y&&o),t&&e.preventDefault(),e.defaultPrevented&&N(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:b(D,(function(e){u&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:F,onDismiss:function(){return I.onOpenChange(!1)}},(function(r){return g.createElement(p.Root,w({role:"dialog","aria-modal":!0,id:I.contentId},k,{ref:O(o,U,e.ref,r.ref),anchorRef:n||I.triggerRef,style:h(h(h({},r.style),k.style),{},C({},"--radix-popover-content-transform-origin","var(--radix-popper-transform-origin)")),onBlurCapture:b(k.onBlurCapture,r.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:b(k.onFocusCapture,r.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:b(k.onMouseDownCapture,r.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:b(k.onTouchStartCapture,r.onTouchStartCapture,{checkForDefaultPrevented:!1})}))}))}))))}));q.displayName="PopoverContent";var I=g.forwardRef((function(e,r){var t=e.as,o=void 0===t?"button":t,a=x(e,["as"]),u=S("PopoverClose");return g.createElement(n,w({type:"button"},a,{as:o,ref:r,onClick:b(e.onClick,(function(){return u.onOpenChange(!1)}))}))}));exports.PopoverClose=I,I.displayName="PopoverClose";var T=a(p.Arrow,{displayName:"PopoverArrow"});exports.PopoverArrow=T;var M=R;exports.Root=M;var N=A;exports.Trigger=N;var K=q;exports.Content=K;var B=I;exports.Close=B;var U=T;exports.Arrow=U; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{hideOthers as e}from"aria-hidden";import{RemoveScroll as o}from"react-remove-scroll";import{useId as r}from"@radix-ui/react-id";import{Primitive as t,extendPrimitive as n}from"@radix-ui/react-primitive";import{Presence as a}from"@radix-ui/react-presence";import{useFocusGuards as p}from"@radix-ui/react-focus-guards";import{Portal as c}from"@radix-ui/react-portal";import{FocusScope as i}from"@radix-ui/react-focus-scope";import{DismissableLayer as s}from"@radix-ui/react-dismissable-layer";import*as u from"@radix-ui/react-popper";import{useControllableState as l}from"@radix-ui/react-use-controllable-state";import{createContext as d}from"@radix-ui/react-context";import{useComposedRefs as f,composeRefs as m}from"@radix-ui/react-compose-refs";import{composeEventHandlers as v}from"@radix-ui/primitive";import*as g from"react";function P(){return(P=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}const[C,x]=d("Popover");export const Popover=e=>{const{children:o,open:t,defaultOpen:n,onOpenChange:a}=e,p=g.useRef(null),[c=!1,i]=l({prop:t,defaultProp:n,onChange:a});return g.createElement(C,{contentId:r(),triggerRef:p,open:c,onOpenChange:i,onOpenToggle:g.useCallback((()=>i((e=>!e))),[i])},o)};Popover.displayName="Popover";const h="button";export const PopoverTrigger=g.forwardRef(((e,o)=>{const{as:r=h,...n}=e,a=x("PopoverTrigger"),p=f(o,a.triggerRef);return g.createElement(t,P({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":a.open?"open":"closed"},n,{as:r,ref:p,onClick:v(e.onClick,a.onOpenToggle)}))}));PopoverTrigger.displayName="PopoverTrigger";export const PopoverContent=g.forwardRef(((e,o)=>{const{forceMount:r,...t}=e,n=x("PopoverContent");return g.createElement(a,{present:r||n.open},g.createElement(O,P({"data-state":n.open?"open":"closed"},t,{ref:o})))}));const O=g.forwardRef(((r,t)=>{const{anchorRef:n,trapFocus:a=!0,onOpenAutoFocus:l,onCloseAutoFocus:d,disableOutsidePointerEvents:f=!1,onEscapeKeyDown:C,onPointerDownOutside:h,onFocusOutside:O,onInteractOutside:F,disableOutsideScroll:w=!1,portalled:D=!0,...y}=r,E=x("PopoverContent"),[R,b]=g.useState(!1),k=D?c:g.Fragment,T=w?o:g.Fragment;p();const A=g.useRef(null);return g.useEffect((()=>{const o=A.current;if(o)return e(o)}),[]),g.createElement(k,null,g.createElement(T,null,g.createElement(i,{trapped:!R&&(a&&E.open),onMountAutoFocus:l,onUnmountAutoFocus:e=>{R?e.preventDefault():null==d||d(e)}},(e=>g.createElement(s,{disableOutsidePointerEvents:f,onEscapeKeyDown:C,onPointerDownOutside:v(h,(e=>{var o;const r=null===(o=E.triggerRef.current)||void 0===o?void 0:o.contains(e.target),t=0===e.button&&!1===e.ctrlKey;b(!f&&t),r&&e.preventDefault(),e.defaultPrevented&&b(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:v(O,(e=>{a&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:F,onDismiss:()=>E.onOpenChange(!1)},(o=>g.createElement(u.Root,P({role:"dialog","aria-modal":!0,id:E.contentId},y,{ref:m(t,A,e.ref,o.ref),anchorRef:n||E.triggerRef,style:{...o.style,...y.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"},onBlurCapture:v(y.onBlurCapture,o.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:v(y.onFocusCapture,o.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:v(y.onMouseDownCapture,o.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:v(y.onTouchStartCapture,o.onTouchStartCapture,{checkForDefaultPrevented:!1})}))))))))}));PopoverContent.displayName="PopoverContent";const F="button";export const PopoverClose=g.forwardRef(((e,o)=>{const{as:r=F,...n}=e,a=x("PopoverClose");return g.createElement(t,P({type:"button"},n,{as:r,ref:o,onClick:v(e.onClick,(()=>a.onOpenChange(!1)))}))}));PopoverClose.displayName="PopoverClose";export const PopoverArrow=n(u.Arrow,"PopoverArrow");export const Root=Popover;export const Trigger=PopoverTrigger;export const Content=PopoverContent;export const Close=PopoverClose;export const Arrow=PopoverArrow; | ||
import{hideOthers as e}from"aria-hidden";import{RemoveScroll as o}from"react-remove-scroll";import{useId as r}from"@radix-ui/react-id";import{Primitive as t,extendPrimitive as n}from"@radix-ui/react-primitive";import{Presence as a}from"@radix-ui/react-presence";import{useFocusGuards as p}from"@radix-ui/react-focus-guards";import{Portal as i}from"@radix-ui/react-portal";import{FocusScope as c}from"@radix-ui/react-focus-scope";import{DismissableLayer as s}from"@radix-ui/react-dismissable-layer";import*as u from"@radix-ui/react-popper";import{useControllableState as l}from"@radix-ui/react-use-controllable-state";import{createContext as d}from"@radix-ui/react-context";import{useComposedRefs as f,composeRefs as m}from"@radix-ui/react-compose-refs";import{composeEventHandlers as v}from"@radix-ui/primitive";import*as g from"react";function P(){return(P=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e}).apply(this,arguments)}const[C,x]=d("Popover");export const Popover=e=>{const{children:o,open:t,defaultOpen:n,onOpenChange:a}=e,p=g.useRef(null),[i=!1,c]=l({prop:t,defaultProp:n,onChange:a});return g.createElement(C,{contentId:r(),triggerRef:p,open:i,onOpenChange:c,onOpenToggle:g.useCallback((()=>c((e=>!e))),[c])},o)};Popover.displayName="Popover";const h="button";export const PopoverTrigger=g.forwardRef(((e,o)=>{const{as:r=h,...n}=e,a=x("PopoverTrigger"),p=f(o,a.triggerRef);return g.createElement(t,P({type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":a.open?"open":"closed"},n,{as:r,ref:p,onClick:v(e.onClick,a.onOpenToggle)}))}));PopoverTrigger.displayName="PopoverTrigger";export const PopoverContent=g.forwardRef(((e,o)=>{const{forceMount:r,...t}=e,n=x("PopoverContent");return g.createElement(a,{present:r||n.open},g.createElement(O,P({"data-state":n.open?"open":"closed"},t,{ref:o})))}));const O=g.forwardRef(((r,t)=>{const{anchorRef:n,trapFocus:a=!0,onOpenAutoFocus:l,onCloseAutoFocus:d,disableOutsidePointerEvents:f=!1,onEscapeKeyDown:C,onPointerDownOutside:h,onFocusOutside:O,onInteractOutside:F,disableOutsideScroll:w=!1,portalled:y=!0,...D}=r,E=x("PopoverContent"),[R,b]=g.useState(!1),k=y?i:g.Fragment,T=w?o:g.Fragment;p();const A=g.useRef(null);return g.useEffect((()=>{const o=A.current;if(o)return e(o)}),[]),g.createElement(k,null,g.createElement(T,null,g.createElement(c,{trapped:!R&&(a&&E.open),onMountAutoFocus:l,onUnmountAutoFocus:e=>{R?e.preventDefault():null==d||d(e)}},(e=>g.createElement(s,{disableOutsidePointerEvents:f,onEscapeKeyDown:C,onPointerDownOutside:v(h,(e=>{var o;const r=null===(o=E.triggerRef.current)||void 0===o?void 0:o.contains(e.target),t=0===e.button&&!1===e.ctrlKey;b(!f&&t),r&&e.preventDefault(),e.defaultPrevented&&b(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:v(O,(e=>{a&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:F,onDismiss:()=>E.onOpenChange(!1)},(o=>g.createElement(u.Root,P({role:"dialog","aria-modal":!0,id:E.contentId},D,{ref:m(t,A,e.ref,o.ref),anchorRef:n||E.triggerRef,style:{...o.style,...D.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"},onBlurCapture:v(D.onBlurCapture,o.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:v(D.onFocusCapture,o.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:v(D.onMouseDownCapture,o.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:v(D.onTouchStartCapture,o.onTouchStartCapture,{checkForDefaultPrevented:!1})}))))))))}));PopoverContent.displayName="PopoverContent";const F="button";export const PopoverClose=g.forwardRef(((e,o)=>{const{as:r=F,...n}=e,a=x("PopoverClose");return g.createElement(t,P({type:"button"},n,{as:r,ref:o,onClick:v(e.onClick,(()=>a.onOpenChange(!1)))}))}));PopoverClose.displayName="PopoverClose";export const PopoverArrow=n(u.Arrow,{displayName:"PopoverArrow"});export const Root=Popover;export const Trigger=PopoverTrigger;export const Content=PopoverContent;export const Close=PopoverClose;export const Arrow=PopoverArrow; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-popover", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"license": "MIT", | ||
@@ -27,6 +27,6 @@ "source": "src/index.ts", | ||
"@radix-ui/react-polymorphic": "0.0.6", | ||
"@radix-ui/react-popper": "0.0.7", | ||
"@radix-ui/react-popper": "0.0.8", | ||
"@radix-ui/react-portal": "0.0.6", | ||
"@radix-ui/react-presence": "0.0.6", | ||
"@radix-ui/react-primitive": "0.0.5", | ||
"@radix-ui/react-presence": "0.0.7", | ||
"@radix-ui/react-primitive": "0.0.6", | ||
"@radix-ui/react-use-controllable-state": "0.0.1", | ||
@@ -33,0 +33,0 @@ "aria-hidden": "^1.1.1", |
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
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
60847
+ Added@radix-ui/react-popper@0.0.8(transitive)
+ Added@radix-ui/react-presence@0.0.7(transitive)
+ Added@radix-ui/react-primitive@0.0.6(transitive)
- Removed@radix-ui/react-popper@0.0.7(transitive)
- Removed@radix-ui/react-presence@0.0.6(transitive)
Updated@radix-ui/react-popper@0.0.8