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

@radix-ui/react-dropdown-menu

Package Overview
Dependencies
Maintainers
5
Versions
264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-dropdown-menu - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

2

dist/index.js

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

function e(e,o,n){Object.defineProperty(e,o,{get:n,enumerable:!0})}var o,n=require("@radix-ui/react-id").useId,r=require("@radix-ui/react-menu"),t=r.Root,u=r.Group,i=r.Label,p=r.Item,a=r.CheckboxItem,d=r.RadioGroup,s=r.RadioItem,c=r.ItemIndicator,l=r.Separator,w=r.Arrow,m=require("@radix-ui/react-primitive"),D=m.Primitive,f=m.extendPrimitive,x=require("@radix-ui/react-use-controllable-state").useControllableState,M=require("@radix-ui/react-context").createContext,g=require("@radix-ui/react-compose-refs").useComposedRefs,I=require("@radix-ui/primitive").composeEventHandlers,b=require("react"),C=b.useRef,R=b.createElement,v=b.useCallback,y=b.forwardRef,h=(o=require("@babel/runtime/helpers/extends"))&&o.__esModule?o.default:o,O={};const[G,N]=M("DropdownMenu"),A=e=>{const{children:o,open:r,defaultOpen:t,onOpenChange:u}=e,i=C(null),[p=!1,a]=x({prop:r,defaultProp:t,onChange:u});return R(G,{triggerRef:i,contentId:n(),open:p,onOpenChange:a,onOpenToggle:v((()=>a((e=>!e))),[a])},o)};exports.DropdownMenu=A,A.displayName="DropdownMenu";const k="button",q=y(((e,o)=>{const{as:n=k,...r}=e,t=N("DropdownMenuTrigger"),u=g(o,t.triggerRef);return R(D,h({type:"button","aria-haspopup":"menu","aria-expanded":!!t.open||void 0,"aria-controls":t.open?t.contentId:void 0,"data-state":t.open?"open":"closed"},r,{as:n,ref:u,onMouseDown:I(e.onMouseDown,(e=>{0===e.button&&!1===e.ctrlKey&&t.onOpenToggle()})),onKeyDown:I(e.onKeyDown,(e=>{[" ","Enter","ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),t.onOpenChange(!0))}))}))}));exports.DropdownMenuTrigger=q,q.displayName="DropdownMenuTrigger";const P=y(((e,o)=>{const{onCloseAutoFocus:n,disableOutsidePointerEvents:r=!0,disableOutsideScroll:u=!0,portalled:i=!0,...p}=e,a=N("DropdownMenuContent");return R(t,h({id:a.contentId},p,{ref:o,disableOutsidePointerEvents:r,disableOutsideScroll:u,portalled:i,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)"},open:a.open,onOpenChange:a.onOpenChange,anchorRef:e.anchorRef||a.triggerRef,trapFocus:!0,onCloseAutoFocus:I(n,(e=>{var o;e.preventDefault(),null===(o=a.triggerRef.current)||void 0===o||o.focus()})),onPointerDownOutside:I(e.onPointerDownOutside,(e=>{var o;(null===(o=a.triggerRef.current)||void 0===o?void 0:o.contains(e.target))&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)}))}));exports.DropdownMenuContent=P,P.displayName="DropdownMenuContent";const S=f(u,{displayName:"DropdownMenuGroup"});exports.DropdownMenuGroup=S;const T=f(i,{displayName:"DropdownMenuLabel"});exports.DropdownMenuLabel=T;const L=f(p,{displayName:"DropdownMenuItem"});exports.DropdownMenuItem=L;const E=f(a,{displayName:"DropdownMenuCheckboxItem"});exports.DropdownMenuCheckboxItem=E;const F=f(d,{displayName:"DropdownMenuRadioGroup"});exports.DropdownMenuRadioGroup=F;const K=f(s,{displayName:"DropdownMenuRadioItem"});exports.DropdownMenuRadioItem=K;const _=f(c,{displayName:"DropdownMenuItemIndicator"});exports.DropdownMenuItemIndicator=_;const j=f(l,{displayName:"DropdownMenuSeparator"});exports.DropdownMenuSeparator=j;const H=f(w,{displayName:"DropdownMenuArrow"});exports.DropdownMenuArrow=H;const U=A;exports.Root=U;const z=q;exports.Trigger=z;const B=P;exports.Content=B;const J=S;exports.Group=J;const Q=T;exports.Label=Q;const V=L;exports.Item=V;const W=E;exports.CheckboxItem=W;const X=F;exports.RadioGroup=X;const Y=K;exports.RadioItem=Y;const Z=_;exports.ItemIndicator=Z;const $=j;exports.Separator=$;const ee=H;exports.Arrow=ee,e(O,"Arrow",(function(){return ee})),e(O,"Separator",(function(){return $})),e(O,"ItemIndicator",(function(){return Z})),e(O,"RadioItem",(function(){return Y})),e(O,"RadioGroup",(function(){return X})),e(O,"CheckboxItem",(function(){return W})),e(O,"Item",(function(){return V})),e(O,"Label",(function(){return Q})),e(O,"Group",(function(){return J})),e(O,"Content",(function(){return B})),e(O,"Trigger",(function(){return z})),e(O,"Root",(function(){return U})),e(O,"DropdownMenuArrow",(function(){return H})),e(O,"DropdownMenuSeparator",(function(){return j})),e(O,"DropdownMenuItemIndicator",(function(){return _})),e(O,"DropdownMenuRadioItem",(function(){return K})),e(O,"DropdownMenuRadioGroup",(function(){return F})),e(O,"DropdownMenuCheckboxItem",(function(){return E})),e(O,"DropdownMenuItem",(function(){return L})),e(O,"DropdownMenuLabel",(function(){return T})),e(O,"DropdownMenuGroup",(function(){return S})),e(O,"DropdownMenuContent",(function(){return P})),e(O,"DropdownMenuTrigger",(function(){return q})),e(O,"DropdownMenu",(function(){return A}));
var e,o=require("@radix-ui/react-id").useId,r=l({},require("@radix-ui/react-menu")),n=require("@radix-ui/react-primitive"),t=n.Primitive,a=n.extendPrimitive,p=require("@radix-ui/react-use-controllable-state").useControllableState,s=require("@radix-ui/react-context").createContext,i=require("@radix-ui/react-compose-refs").useComposedRefs,d=require("@radix-ui/primitive").composeEventHandlers,u=l({},require("react")),c=(e=require("@babel/runtime/helpers/extends"))&&e.__esModule?e.default:e;function l(e,o){return Object.keys(o).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return o[r]}})})),e}const[m,w]=s("DropdownMenu"),x=e=>{const{children:r,open:n,defaultOpen:t,onOpenChange:a}=e,s=u.useRef(null),[i=!1,d]=p({prop:n,defaultProp:t,onChange:a});return u.createElement(m,{triggerRef:s,contentId:o(),open:i,onOpenChange:d,onOpenToggle:u.useCallback((()=>d((e=>!e))),[d])},r)};exports.DropdownMenu=x,x.displayName="DropdownMenu";const D="button",g=u.forwardRef(((e,o)=>{const{as:r=D,...n}=e,a=w("DropdownMenuTrigger"),p=i(o,a.triggerRef);return u.createElement(t,c({type:"button","aria-haspopup":"menu","aria-expanded":!!a.open||void 0,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed"},n,{as:r,ref:p,onMouseDown:d(e.onMouseDown,(e=>{0===e.button&&!1===e.ctrlKey&&a.onOpenToggle()})),onKeyDown:d(e.onKeyDown,(e=>{[" ","Enter","ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),a.onOpenChange(!0))}))}))}));exports.DropdownMenuTrigger=g,g.displayName="DropdownMenuTrigger";const f=u.forwardRef(((e,o)=>{const{onCloseAutoFocus:n,disableOutsidePointerEvents:t=!0,disableOutsideScroll:a=!0,portalled:p=!0,...s}=e,i=w("DropdownMenuContent");return u.createElement(r.Root,c({id:i.contentId},s,{ref:o,disableOutsidePointerEvents:t,disableOutsideScroll:a,portalled:p,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)"},open:i.open,onOpenChange:i.onOpenChange,anchorRef:e.anchorRef||i.triggerRef,trapFocus:!0,onCloseAutoFocus:d(n,(e=>{var o;e.preventDefault(),null===(o=i.triggerRef.current)||void 0===o||o.focus()})),onPointerDownOutside:d(e.onPointerDownOutside,(e=>{var o;(null===(o=i.triggerRef.current)||void 0===o?void 0:o.contains(e.target))&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)}))}));exports.DropdownMenuContent=f,f.displayName="DropdownMenuContent";const M=a(r.Group,{displayName:"DropdownMenuGroup"});exports.DropdownMenuGroup=M;const I=a(r.Label,{displayName:"DropdownMenuLabel"});exports.DropdownMenuLabel=I;const b=a(r.Item,{displayName:"DropdownMenuItem"});exports.DropdownMenuItem=b;const y=a(r.CheckboxItem,{displayName:"DropdownMenuCheckboxItem"});exports.DropdownMenuCheckboxItem=y;const C=a(r.RadioGroup,{displayName:"DropdownMenuRadioGroup"});exports.DropdownMenuRadioGroup=C;const R=a(r.RadioItem,{displayName:"DropdownMenuRadioItem"});exports.DropdownMenuRadioItem=R;const v=a(r.ItemIndicator,{displayName:"DropdownMenuItemIndicator"});exports.DropdownMenuItemIndicator=v;const h=a(r.Separator,{displayName:"DropdownMenuSeparator"});exports.DropdownMenuSeparator=h;const O=a(r.Arrow,{displayName:"DropdownMenuArrow"});exports.DropdownMenuArrow=O;const N=x;exports.Root=N;const q=g;exports.Trigger=q;const P=f;exports.Content=P;const k=M;exports.Group=k;const A=I;exports.Label=A;const E=b;exports.Item=E;const G=y;exports.CheckboxItem=G;const S=C;exports.RadioGroup=S;const T=R;exports.RadioItem=T;const F=v;exports.ItemIndicator=F;const L=h;exports.Separator=L;const _=O;exports.Arrow=_;
//# sourceMappingURL=index.js.map

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

function o(o,n,e){Object.defineProperty(o,n,{get:e,enumerable:!0})}import{useId as n}from"@radix-ui/react-id";import{Root as e,Group as r,Label as t,Item as p,CheckboxItem as u,RadioGroup as a,RadioItem as d,ItemIndicator as i,Separator as c,Arrow as s}from"@radix-ui/react-menu";import{Primitive as w,extendPrimitive as m}from"@radix-ui/react-primitive";import{useControllableState as D}from"@radix-ui/react-use-controllable-state";import{createContext as M}from"@radix-ui/react-context";import{useComposedRefs as l}from"@radix-ui/react-compose-refs";import{composeEventHandlers as f}from"@radix-ui/primitive";import{useRef as I,createElement as g,useCallback as x,forwardRef as b}from"react";import R from"@babel/runtime/helpers/esm/extends";var C={};const[h,y]=M("DropdownMenu");export const DropdownMenu=o=>{const{children:e,open:r,defaultOpen:t,onOpenChange:p}=o,u=I(null),[a=!1,d]=D({prop:r,defaultProp:t,onChange:p});return g(h,{triggerRef:u,contentId:n(),open:a,onOpenChange:d,onOpenToggle:x((()=>d((o=>!o))),[d])},e)};DropdownMenu.displayName="DropdownMenu";const G="button";export const DropdownMenuTrigger=b(((o,n)=>{const{as:e=G,...r}=o,t=y("DropdownMenuTrigger"),p=l(n,t.triggerRef);return g(w,R({type:"button","aria-haspopup":"menu","aria-expanded":!!t.open||void 0,"aria-controls":t.open?t.contentId:void 0,"data-state":t.open?"open":"closed"},r,{as:e,ref:p,onMouseDown:f(o.onMouseDown,(o=>{0===o.button&&!1===o.ctrlKey&&t.onOpenToggle()})),onKeyDown:f(o.onKeyDown,(o=>{[" ","Enter","ArrowUp","ArrowDown"].includes(o.key)&&(o.preventDefault(),t.onOpenChange(!0))}))}))}));DropdownMenuTrigger.displayName="DropdownMenuTrigger";export const DropdownMenuContent=b(((o,n)=>{const{onCloseAutoFocus:r,disableOutsidePointerEvents:t=!0,disableOutsideScroll:p=!0,portalled:u=!0,...a}=o,d=y("DropdownMenuContent");return g(e,R({id:d.contentId},a,{ref:n,disableOutsidePointerEvents:t,disableOutsideScroll:p,portalled:u,style:{...o.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)"},open:d.open,onOpenChange:d.onOpenChange,anchorRef:o.anchorRef||d.triggerRef,trapFocus:!0,onCloseAutoFocus:f(r,(o=>{var n;o.preventDefault(),null===(n=d.triggerRef.current)||void 0===n||n.focus()})),onPointerDownOutside:f(o.onPointerDownOutside,(o=>{var n;(null===(n=d.triggerRef.current)||void 0===n?void 0:n.contains(o.target))&&o.preventDefault()}),{checkForDefaultPrevented:!1}),onDismiss:()=>d.onOpenChange(!1)}))}));DropdownMenuContent.displayName="DropdownMenuContent";export const DropdownMenuGroup=m(r,{displayName:"DropdownMenuGroup"});export const DropdownMenuLabel=m(t,{displayName:"DropdownMenuLabel"});export const DropdownMenuItem=m(p,{displayName:"DropdownMenuItem"});export const DropdownMenuCheckboxItem=m(u,{displayName:"DropdownMenuCheckboxItem"});export const DropdownMenuRadioGroup=m(a,{displayName:"DropdownMenuRadioGroup"});export const DropdownMenuRadioItem=m(d,{displayName:"DropdownMenuRadioItem"});export const DropdownMenuItemIndicator=m(i,{displayName:"DropdownMenuItemIndicator"});export const DropdownMenuSeparator=m(c,{displayName:"DropdownMenuSeparator"});export const DropdownMenuArrow=m(s,{displayName:"DropdownMenuArrow"});export const Root=DropdownMenu;export const Trigger=DropdownMenuTrigger;export const Content=DropdownMenuContent;export const Group=DropdownMenuGroup;export const Label=DropdownMenuLabel;export const Item=DropdownMenuItem;export const CheckboxItem=DropdownMenuCheckboxItem;export const RadioGroup=DropdownMenuRadioGroup;export const RadioItem=DropdownMenuRadioItem;export const ItemIndicator=DropdownMenuItemIndicator;export const Separator=DropdownMenuSeparator;export const Arrow=DropdownMenuArrow;o(C,"Arrow",(function(){return Arrow})),o(C,"Separator",(function(){return Separator})),o(C,"ItemIndicator",(function(){return ItemIndicator})),o(C,"RadioItem",(function(){return RadioItem})),o(C,"RadioGroup",(function(){return RadioGroup})),o(C,"CheckboxItem",(function(){return CheckboxItem})),o(C,"Item",(function(){return Item})),o(C,"Label",(function(){return Label})),o(C,"Group",(function(){return Group})),o(C,"Content",(function(){return Content})),o(C,"Trigger",(function(){return Trigger})),o(C,"Root",(function(){return Root})),o(C,"DropdownMenuArrow",(function(){return DropdownMenuArrow})),o(C,"DropdownMenuSeparator",(function(){return DropdownMenuSeparator})),o(C,"DropdownMenuItemIndicator",(function(){return DropdownMenuItemIndicator})),o(C,"DropdownMenuRadioItem",(function(){return DropdownMenuRadioItem})),o(C,"DropdownMenuRadioGroup",(function(){return DropdownMenuRadioGroup})),o(C,"DropdownMenuCheckboxItem",(function(){return DropdownMenuCheckboxItem})),o(C,"DropdownMenuItem",(function(){return DropdownMenuItem})),o(C,"DropdownMenuLabel",(function(){return DropdownMenuLabel})),o(C,"DropdownMenuGroup",(function(){return DropdownMenuGroup})),o(C,"DropdownMenuContent",(function(){return DropdownMenuContent})),o(C,"DropdownMenuTrigger",(function(){return DropdownMenuTrigger})),o(C,"DropdownMenu",(function(){return DropdownMenu}));
import{useId as o}from"@radix-ui/react-id";import*as e from"@radix-ui/react-menu";import{Primitive as n,extendPrimitive as r}from"@radix-ui/react-primitive";import{useControllableState as t}from"@radix-ui/react-use-controllable-state";import{createContext as p}from"@radix-ui/react-context";import{useComposedRefs as a}from"@radix-ui/react-compose-refs";import{composeEventHandlers as d}from"@radix-ui/primitive";import*as i from"react";import u from"@babel/runtime/helpers/esm/extends";const[s,c]=p("DropdownMenu");export const DropdownMenu=e=>{const{children:n,open:r,defaultOpen:p,onOpenChange:a}=e,d=i.useRef(null),[u=!1,c]=t({prop:r,defaultProp:p,onChange:a});return i.createElement(s,{triggerRef:d,contentId:o(),open:u,onOpenChange:c,onOpenToggle:i.useCallback((()=>c((o=>!o))),[c])},n)};DropdownMenu.displayName="DropdownMenu";const m="button";export const DropdownMenuTrigger=i.forwardRef(((o,e)=>{const{as:r=m,...t}=o,p=c("DropdownMenuTrigger"),s=a(e,p.triggerRef);return i.createElement(n,u({type:"button","aria-haspopup":"menu","aria-expanded":!!p.open||void 0,"aria-controls":p.open?p.contentId:void 0,"data-state":p.open?"open":"closed"},t,{as:r,ref:s,onMouseDown:d(o.onMouseDown,(o=>{0===o.button&&!1===o.ctrlKey&&p.onOpenToggle()})),onKeyDown:d(o.onKeyDown,(o=>{[" ","Enter","ArrowUp","ArrowDown"].includes(o.key)&&(o.preventDefault(),p.onOpenChange(!0))}))}))}));DropdownMenuTrigger.displayName="DropdownMenuTrigger";export const DropdownMenuContent=i.forwardRef(((o,n)=>{const{onCloseAutoFocus:r,disableOutsidePointerEvents:t=!0,disableOutsideScroll:p=!0,portalled:a=!0,...s}=o,m=c("DropdownMenuContent");return i.createElement(e.Root,u({id:m.contentId},s,{ref:n,disableOutsidePointerEvents:t,disableOutsideScroll:p,portalled:a,style:{...o.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)"},open:m.open,onOpenChange:m.onOpenChange,anchorRef:o.anchorRef||m.triggerRef,trapFocus:!0,onCloseAutoFocus:d(r,(o=>{var e;o.preventDefault(),null===(e=m.triggerRef.current)||void 0===e||e.focus()})),onPointerDownOutside:d(o.onPointerDownOutside,(o=>{var e;(null===(e=m.triggerRef.current)||void 0===e?void 0:e.contains(o.target))&&o.preventDefault()}),{checkForDefaultPrevented:!1}),onDismiss:()=>m.onOpenChange(!1)}))}));DropdownMenuContent.displayName="DropdownMenuContent";export const DropdownMenuGroup=r(e.Group,{displayName:"DropdownMenuGroup"});export const DropdownMenuLabel=r(e.Label,{displayName:"DropdownMenuLabel"});export const DropdownMenuItem=r(e.Item,{displayName:"DropdownMenuItem"});export const DropdownMenuCheckboxItem=r(e.CheckboxItem,{displayName:"DropdownMenuCheckboxItem"});export const DropdownMenuRadioGroup=r(e.RadioGroup,{displayName:"DropdownMenuRadioGroup"});export const DropdownMenuRadioItem=r(e.RadioItem,{displayName:"DropdownMenuRadioItem"});export const DropdownMenuItemIndicator=r(e.ItemIndicator,{displayName:"DropdownMenuItemIndicator"});export const DropdownMenuSeparator=r(e.Separator,{displayName:"DropdownMenuSeparator"});export const DropdownMenuArrow=r(e.Arrow,{displayName:"DropdownMenuArrow"});export const Root=DropdownMenu;export const Trigger=DropdownMenuTrigger;export const Content=DropdownMenuContent;export const Group=DropdownMenuGroup;export const Label=DropdownMenuLabel;export const Item=DropdownMenuItem;export const CheckboxItem=DropdownMenuCheckboxItem;export const RadioGroup=DropdownMenuRadioGroup;export const RadioItem=DropdownMenuRadioItem;export const ItemIndicator=DropdownMenuItemIndicator;export const Separator=DropdownMenuSeparator;export const Arrow=DropdownMenuArrow;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-dropdown-menu",
"version": "0.0.14",
"version": "0.0.15",
"license": "MIT",

@@ -21,10 +21,10 @@ "source": "src/index.ts",

"@babel/runtime": "^7.13.10",
"@radix-ui/primitive": "0.0.3",
"@radix-ui/react-compose-refs": "0.0.3",
"@radix-ui/react-context": "0.0.3",
"@radix-ui/react-id": "0.0.3",
"@radix-ui/react-menu": "0.0.13",
"@radix-ui/react-polymorphic": "0.0.8",
"@radix-ui/react-primitive": "0.0.9",
"@radix-ui/react-use-controllable-state": "0.0.4"
"@radix-ui/primitive": "0.0.4",
"@radix-ui/react-compose-refs": "0.0.4",
"@radix-ui/react-context": "0.0.4",
"@radix-ui/react-id": "0.0.4",
"@radix-ui/react-menu": "0.0.14",
"@radix-ui/react-polymorphic": "0.0.9",
"@radix-ui/react-primitive": "0.0.10",
"@radix-ui/react-use-controllable-state": "0.0.5"
},

@@ -31,0 +31,0 @@ "peerDependencies": {

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