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

@radix-ui/react-menu

Package Overview
Dependencies
Maintainers
5
Versions
262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.0.8 to 0.0.9

12

dist/index.d.ts

@@ -80,5 +80,2 @@ import * as React from "react";

declare const MenuImpl: MenuImplPrimitive;
type MenuGroupOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type MenuGroupPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, MenuGroupOwnProps>;
export const MenuGroup: MenuGroupPrimitive;
type MenuItemOwnProps = Polymorphic.Merge<Polymorphic.OwnProps<typeof Primitive>, {

@@ -118,6 +115,5 @@ disabled?: boolean;

export const MenuItemIndicator: MenuItemIndicatorPrimitive;
type MenuSeparatorOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type MenuSeparatorPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, MenuSeparatorOwnProps>;
export const MenuSeparator: MenuSeparatorPrimitive;
export const MenuGroup: Polymorphic.ForwardRefComponent<"div", {}>;
export const MenuLabel: Polymorphic.ForwardRefComponent<"div", {}>;
export const MenuSeparator: Polymorphic.ForwardRefComponent<"div", {}>;
export const MenuArrow: Polymorphic.ForwardRefComponent<"svg", Polymorphic.Merge<{}, {

@@ -127,3 +123,3 @@ offset?: number | undefined;

export const Root: MenuPrimitive;
export const Group: MenuGroupPrimitive;
export const Group: Polymorphic.ForwardRefComponent<"div", {}>;
export const Label: Polymorphic.ForwardRefComponent<"div", {}>;

@@ -135,3 +131,3 @@ export const Item: MenuItemPrimitive;

export const ItemIndicator: MenuItemIndicatorPrimitive;
export const Separator: MenuSeparatorPrimitive;
export const Separator: Polymorphic.ForwardRefComponent<"div", {}>;
export const Arrow: Polymorphic.ForwardRefComponent<"svg", Polymorphic.Merge<{}, {

@@ -138,0 +134,0 @@ offset?: number | undefined;

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

var e=require("aria-hidden").hideOthers,r=require("react-remove-scroll").RemoveScroll,t=require("@radix-ui/react-focus-guards").useFocusGuards,n=require("@radix-ui/react-portal").Portal,o=require("@radix-ui/react-focus-scope").FocusScope,a=require("@radix-ui/react-dismissable-layer").DismissableLayer,u=O({},require("@radix-ui/react-popper")),c=require("@radix-ui/react-roving-focus"),i=c.RovingFocusGroup,l=c.useRovingFocus,s=require("@radix-ui/react-primitive"),f=s.Primitive,d=s.extendPrimitive,p=require("@radix-ui/react-presence").Presence,v=require("@radix-ui/react-use-callback-ref").useCallbackRef,m=require("@radix-ui/react-context").createContext,y=require("@radix-ui/react-compose-refs"),b=y.composeRefs,h=y.useComposedRefs,w=require("@radix-ui/primitive").composeEventHandlers,x=O({},require("react"));function O(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 g(){var e=x.useRef(0),r=x.useRef(""),t=x.useCallback((function(n){r.current=n,window.clearTimeout(e.current),e.current=window.setTimeout((function(){return t("")}),1e3)}),[]);return{onKeyDownCapture:function(e){if(1===e.key.length&&!(e.ctrlKey||e.altKey||e.metaKey)){var n=e.currentTarget;t(r.current+e.key)," "!==e.key||r.current.startsWith(" ")||e.stopPropagation();var o=document.activeElement,a=o?C(o):void 0,u=function(e,r,t){var n=r.length>1&&Array.from(r).every((function(e){return e===r[0]}))?r[0]:r,o=t?e.indexOf(t):-1,a=(u=e,c=Math.max(o,0),u.map((function(e,r){return u[(c+r)%u.length]})));var u,c;1===n.length&&(a=a.filter((function(e){return e!==t})));var i=a.find((function(e){return e.toLowerCase().startsWith(n.toLowerCase())}));return i!==t?i:void 0}(Array.from(n.querySelectorAll("[".concat(M,"]"))).map(C),r.current,a),c=n.querySelector("[".concat(M,'="').concat(u,'"]'));c&&setTimeout((function(){return c.focus()}))}}}}var C=function(e){var r;return null!==(r=e.getAttribute(M))&&void 0!==r?r:""},M="data-radix-menu-typeahead-item";function E(e){var r,t,n,o=e.textValue,a=e.disabled;return n=a?void 0:o,(t=M)in(r={})?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function D(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function P(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?D(Object(t),!0).forEach((function(r){S(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function S(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function R(){return(R=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function k(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function F(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=[],n=!0,o=!1,a=void 0;try{for(var u,c=e[Symbol.iterator]();!(n=(u=c.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return I(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 I(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 I(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var j=["ArrowDown","PageUp","Home"],A=[].concat(j,["ArrowUp","PageDown","End"]),q=F(m("Menu"),2),K=q[0],L=q[1],T=x.forwardRef((function(e,r){var t=e.forceMount,n=e.open,o=void 0!==n&&n,a=k(e,["forceMount","open"]);return x.createElement(p,{present:t||o},x.createElement(G,R({"data-state":Y(o)},a,{ref:r,open:o})))}));exports.Menu=T;var G=x.forwardRef((function(c,l){var s=c.open,f=c.onOpenChange,d=c.anchorRef,p=c.loop,m=c.trapFocus,y=c.onOpenAutoFocus,h=c.onCloseAutoFocus,O=c.disableOutsidePointerEvents,C=c.onEscapeKeyDown,M=c.onPointerDownOutside,E=c.onFocusOutside,D=c.onInteractOutside,S=c.onDismiss,I=c.disableOutsideScroll,q=c.portalled,L=k(c,["open","onOpenChange","anchorRef","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll","portalled"]),T=v(f),G=x.useRef(null),N=F(x.useState(0),2),U=N[0],B=N[1],H=F(x.useState(!1),2),W=H[0],_=H[1],z=g();x.useEffect((function(){B(W?-1:0)}),[W]);var $=F(x.useState(!1),2),J=$[0],Q=$[1],X=q?n:x.Fragment,Y=I?r:x.Fragment;return t(),x.useEffect((function(){var r=G.current;if(r)return e(r)}),[]),x.createElement(X,null,x.createElement(Y,null,x.createElement(K,{menuRef:G,onItemsReachableChange:_,onOpenChange:T},x.createElement(i,{reachable:W,onReachableChange:_,orientation:"vertical",loop:p},x.createElement(o,{trapped:!J&&(m&&s),onMountAutoFocus:y,onUnmountAutoFocus:function(e){J?e.preventDefault():null==h||h(e)}},(function(e){return x.createElement(a,{disableOutsidePointerEvents:O,onEscapeKeyDown:C,onPointerDownOutside:w(M,(function(e){var r=0===e.button&&!1===e.ctrlKey;Q(!O&&r),e.defaultPrevented&&Q(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:w(E,(function(e){m&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:D,onDismiss:S},(function(r){return x.createElement(u.Root,R({role:"menu"},L,{ref:b(l,G,e.ref,r.ref),anchorRef:d,tabIndex:U,style:P(P({},r.style),{},{outline:"none"},L.style),onBlurCapture:w(L.onBlurCapture,r.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:w(L.onFocusCapture,r.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:w(L.onMouseDownCapture,r.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:w(L.onTouchStartCapture,r.onTouchStartCapture,{checkForDefaultPrevented:!1}),onKeyDownCapture:w(L.onKeyDownCapture,z.onKeyDownCapture),onKeyDown:w(L.onKeyDown,(function(e){var r=G.current;if(e.target===r&&A.includes(e.key)){e.preventDefault();var t=Array.from(r.querySelectorAll(V)),n=j.includes(e.key)?t[0]:t.reverse()[0];null==n||n.focus()}}))}))}))}))))))}));T.displayName="Menu";var N=x.forwardRef((function(e,r){return x.createElement(f,R({role:"group"},e,{ref:r}))}));exports.MenuGroup=N,N.displayName="MenuGroup";var V="[".concat("data-radix-menu-item","]:not([data-disabled])"),U=x.forwardRef((function(e,r){var t=e.disabled,n=e.textValue,o=e.onSelect,a=k(e,["disabled","textValue","onSelect"]),u=x.useRef(null),c=h(r,u),i=L("MenuItem"),s=l({disabled:t}),d=F(x.useState(""),2),p=d[0],v=d[1];x.useEffect((function(){var e,r=u.current;r&&v((null!==(e=r.textContent)&&void 0!==e?e:"").trim())}),[a.children]);var m=E({textValue:null!=n?n:p,disabled:t}),y=function(){var e=u.current;if(!t&&e){var r,n=new Event("menu.itemSelect",{bubbles:!0,cancelable:!0});if(e.dispatchEvent(n),n.defaultPrevented)return;null===(r=i.onOpenChange)||void 0===r||r.call(i,!1)}};return x.useEffect((function(){var e=u.current;if(e){var r=function(e){return null==o?void 0:o(e)};return e.addEventListener("menu.itemSelect",r),function(){return e.removeEventListener("menu.itemSelect",r)}}}),[o]),x.createElement(f,R({role:"menuitem","aria-disabled":t||void 0},a,s,m,S({},"data-radix-menu-item",""),{ref:c,"data-disabled":t?"":void 0,onFocus:w(a.onFocus,s.onFocus),onKeyDown:w(a.onKeyDown,w(s.onKeyDown,(function(e){t||"Enter"!==e.key&&" "!==e.key||y()}))),onMouseDown:w(a.onMouseDown,s.onMouseDown),onMouseUp:w(a.onMouseUp,y),onMouseMove:w(a.onMouseMove,(function(e){t||e.currentTarget.focus()})),onBlur:w(a.onBlur,(function(e){i.onItemsReachableChange(!1)})),onMouseLeave:w(a.onMouseLeave,(function(e){var r;null===(r=i.menuRef.current)||void 0===r||r.focus()}))}))}));exports.MenuItem=U,U.displayName="MenuItem";var B=x.forwardRef((function(e,r){var t=e.checked,n=void 0!==t&&t,o=e.onCheckedChange,a=k(e,["checked","onCheckedChange"]);return x.createElement(z.Provider,{value:n},x.createElement(U,R({role:"menuitemcheckbox","aria-checked":n},a,{ref:r,"data-state":Z(n),onSelect:w(a.onSelect,(function(){return null==o?void 0:o(!n)}),{checkForDefaultPrevented:!1})})))}));exports.MenuCheckboxItem=B,B.displayName="MenuCheckboxItem";var H=x.createContext({}),W=x.forwardRef((function(e,r){var t=e.value,n=e.onValueChange,o=k(e,["value","onValueChange"]),a=v(n),u=x.useMemo((function(){return{value:t,onValueChange:a}}),[t,a]);return x.createElement(H.Provider,{value:u},x.createElement(N,R({},o,{ref:r})))}));exports.MenuRadioGroup=W,W.displayName="MenuRadioGroup";var _=x.forwardRef((function(e,r){var t=e.value,n=k(e,["value"]),o=x.useContext(H),a=t===o.value;return x.createElement(z.Provider,{value:a},x.createElement(U,R({role:"menuitemradio","aria-checked":a},n,{ref:r,"data-state":Z(a),onSelect:w(n.onSelect,(function(){var e;return null===(e=o.onValueChange)||void 0===e?void 0:e.call(o,t)}),{checkForDefaultPrevented:!1})})))}));exports.MenuRadioItem=_,_.displayName="MenuRadioItem";var z=x.createContext(!1),$=x.forwardRef((function(e,r){var t=e.as,n=void 0===t?"span":t,o=e.forceMount,a=k(e,["as","forceMount"]),u=x.useContext(z);return x.createElement(p,{present:o||u},x.createElement(f,R({},a,{as:n,ref:r,"data-state":Z(u)})))}));exports.MenuItemIndicator=$,$.displayName="MenuItemIndicator";var J=x.forwardRef((function(e,r){return x.createElement(f,R({role:"separator","aria-orientation":"horizontal"},e,{ref:r}))}));exports.MenuSeparator=J,J.displayName="MenuSeparator";var Q=d(f,"MenuLabel");exports.MenuLabel=Q;var X=d(u.Arrow,"MenuArrow");function Y(e){return e?"open":"closed"}function Z(e){return e?"checked":"unchecked"}exports.MenuArrow=X;var ee=T;exports.Root=ee;var re=N;exports.Group=re;var te=Q;exports.Label=te;var ne=U;exports.Item=ne;var oe=B;exports.CheckboxItem=oe;var ae=W;exports.RadioGroup=ae;var ue=_;exports.RadioItem=ue;var ce=$;exports.ItemIndicator=ce;var ie=J;exports.Separator=ie;var le=X;exports.Arrow=le;
var e=require("aria-hidden").hideOthers,r=require("react-remove-scroll").RemoveScroll,t=require("@radix-ui/react-focus-guards").useFocusGuards,n=require("@radix-ui/react-portal").Portal,o=require("@radix-ui/react-focus-scope").FocusScope,a=require("@radix-ui/react-dismissable-layer").DismissableLayer,u=O({},require("@radix-ui/react-popper")),i=require("@radix-ui/react-roving-focus"),c=i.RovingFocusGroup,l=i.useRovingFocus,s=require("@radix-ui/react-primitive"),f=s.Primitive,d=s.extendPrimitive,p=require("@radix-ui/react-presence").Presence,v=require("@radix-ui/react-use-callback-ref").useCallbackRef,m=require("@radix-ui/react-context").createContext,y=require("@radix-ui/react-compose-refs"),b=y.composeRefs,h=y.useComposedRefs,w=require("@radix-ui/primitive").composeEventHandlers,x=O({},require("react"));function O(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 g(){var e=x.useRef(0),r=x.useRef(""),t=x.useCallback((function(n){r.current=n,window.clearTimeout(e.current),e.current=window.setTimeout((function(){return t("")}),1e3)}),[]);return{onKeyDownCapture:function(e){if(1===e.key.length&&!(e.ctrlKey||e.altKey||e.metaKey)){var n=e.currentTarget;t(r.current+e.key)," "!==e.key||r.current.startsWith(" ")||e.stopPropagation();var o=document.activeElement,a=o?C(o):void 0,u=function(e,r,t){var n=r.length>1&&Array.from(r).every((function(e){return e===r[0]}))?r[0]:r,o=t?e.indexOf(t):-1,a=(u=e,i=Math.max(o,0),u.map((function(e,r){return u[(i+r)%u.length]})));var u,i;1===n.length&&(a=a.filter((function(e){return e!==t})));var c=a.find((function(e){return e.toLowerCase().startsWith(n.toLowerCase())}));return c!==t?c:void 0}(Array.from(n.querySelectorAll("[".concat(M,"]"))).map(C),r.current,a),i=n.querySelector("[".concat(M,'="').concat(u,'"]'));i&&setTimeout((function(){return i.focus()}))}}}}var C=function(e){var r;return null!==(r=e.getAttribute(M))&&void 0!==r?r:""},M="data-radix-menu-typeahead-item";function D(e){var r,t,n,o=e.textValue,a=e.disabled;return n=a?void 0:o,(t=M)in(r={})?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}function P(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function E(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){S(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 S(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function k(){return(k=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function R(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function F(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=[],n=!0,o=!1,a=void 0;try{for(var u,i=e[Symbol.iterator]();!(n=(u=i.next()).done)&&(t.push(u.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return I(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 I(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 I(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var j=["ArrowDown","PageUp","Home"],A=[].concat(j,["ArrowUp","PageDown","End"]),q=F(m("Menu"),2),K=q[0],L=q[1],N=x.forwardRef((function(e,r){var t=e.forceMount,n=e.open,o=void 0!==n&&n,a=R(e,["forceMount","open"]);return x.createElement(p,{present:t||o},x.createElement(T,k({"data-state":Y(o)},a,{ref:r,open:o})))}));exports.Menu=N;var T=x.forwardRef((function(i,l){var s=i.open,f=i.onOpenChange,d=i.anchorRef,p=i.loop,m=i.trapFocus,y=i.onOpenAutoFocus,h=i.onCloseAutoFocus,O=i.disableOutsidePointerEvents,C=i.onEscapeKeyDown,M=i.onPointerDownOutside,D=i.onFocusOutside,P=i.onInteractOutside,S=i.onDismiss,I=i.disableOutsideScroll,q=i.portalled,L=R(i,["open","onOpenChange","anchorRef","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll","portalled"]),N=v(f),T=x.useRef(null),V=F(x.useState(0),2),U=V[0],B=V[1],H=F(x.useState(!1),2),W=H[0],_=H[1],z=g();x.useEffect((function(){B(W?-1:0)}),[W]);var $=F(x.useState(!1),2),J=$[0],Q=$[1],X=q?n:x.Fragment,Y=I?r:x.Fragment;return t(),x.useEffect((function(){var r=T.current;if(r)return e(r)}),[]),x.createElement(X,null,x.createElement(Y,null,x.createElement(K,{menuRef:T,onItemsReachableChange:_,onOpenChange:N},x.createElement(c,{reachable:W,onReachableChange:_,orientation:"vertical",loop:p},x.createElement(o,{trapped:!J&&(m&&s),onMountAutoFocus:y,onUnmountAutoFocus:function(e){J?e.preventDefault():null==h||h(e)}},(function(e){return x.createElement(a,{disableOutsidePointerEvents:O,onEscapeKeyDown:C,onPointerDownOutside:w(M,(function(e){var r=0===e.button&&!1===e.ctrlKey;Q(!O&&r),e.defaultPrevented&&Q(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:w(D,(function(e){m&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:P,onDismiss:S},(function(r){return x.createElement(u.Root,k({role:"menu"},L,{ref:b(l,T,e.ref,r.ref),anchorRef:d,tabIndex:U,style:E(E({},r.style),{},{outline:"none"},L.style),onBlurCapture:w(L.onBlurCapture,r.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:w(L.onFocusCapture,r.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:w(L.onMouseDownCapture,r.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:w(L.onTouchStartCapture,r.onTouchStartCapture,{checkForDefaultPrevented:!1}),onKeyDownCapture:w(L.onKeyDownCapture,z.onKeyDownCapture),onKeyDown:w(L.onKeyDown,(function(e){var r=T.current;if(e.target===r&&A.includes(e.key)){e.preventDefault();var t=Array.from(r.querySelectorAll(G)),n=j.includes(e.key)?t[0]:t.reverse()[0];null==n||n.focus()}}))}))}))}))))))}));N.displayName="Menu";var G="[".concat("data-radix-menu-item","]:not([data-disabled])"),V=x.forwardRef((function(e,r){var t=e.disabled,n=e.textValue,o=e.onSelect,a=R(e,["disabled","textValue","onSelect"]),u=x.useRef(null),i=h(r,u),c=L("MenuItem"),s=l({disabled:t}),d=F(x.useState(""),2),p=d[0],v=d[1];x.useEffect((function(){var e,r=u.current;r&&v((null!==(e=r.textContent)&&void 0!==e?e:"").trim())}),[a.children]);var m=D({textValue:null!=n?n:p,disabled:t}),y=function(){var e=u.current;if(!t&&e){var r,n=new Event("menu.itemSelect",{bubbles:!0,cancelable:!0});if(e.dispatchEvent(n),n.defaultPrevented)return;null===(r=c.onOpenChange)||void 0===r||r.call(c,!1)}};return x.useEffect((function(){var e=u.current;if(e){var r=function(e){return null==o?void 0:o(e)};return e.addEventListener("menu.itemSelect",r),function(){return e.removeEventListener("menu.itemSelect",r)}}}),[o]),x.createElement(f,k({role:"menuitem","aria-disabled":t||void 0},a,s,m,S({},"data-radix-menu-item",""),{ref:i,"data-disabled":t?"":void 0,onFocus:w(a.onFocus,s.onFocus),onKeyDown:w(a.onKeyDown,w(s.onKeyDown,(function(e){t||"Enter"!==e.key&&" "!==e.key||y()}))),onMouseDown:w(a.onMouseDown,s.onMouseDown),onMouseUp:w(a.onMouseUp,y),onMouseMove:w(a.onMouseMove,(function(e){t||e.currentTarget.focus()})),onBlur:w(a.onBlur,(function(e){c.onItemsReachableChange(!1)})),onMouseLeave:w(a.onMouseLeave,(function(e){var r;null===(r=c.menuRef.current)||void 0===r||r.focus()}))}))}));exports.MenuItem=V,V.displayName="MenuItem";var U=x.forwardRef((function(e,r){var t=e.checked,n=void 0!==t&&t,o=e.onCheckedChange,a=R(e,["checked","onCheckedChange"]);return x.createElement(_.Provider,{value:n},x.createElement(V,k({role:"menuitemcheckbox","aria-checked":n},a,{ref:r,"data-state":Z(n),onSelect:w(a.onSelect,(function(){return null==o?void 0:o(!n)}),{checkForDefaultPrevented:!1})})))}));exports.MenuCheckboxItem=U,U.displayName="MenuCheckboxItem";var B=x.createContext({}),H=x.forwardRef((function(e,r){var t=e.value,n=e.onValueChange,o=R(e,["value","onValueChange"]),a=v(n),u=x.useMemo((function(){return{value:t,onValueChange:a}}),[t,a]);return x.createElement(B.Provider,{value:u},x.createElement($,k({},o,{ref:r})))}));exports.MenuRadioGroup=H,H.displayName="MenuRadioGroup";var W=x.forwardRef((function(e,r){var t=e.value,n=R(e,["value"]),o=x.useContext(B),a=t===o.value;return x.createElement(_.Provider,{value:a},x.createElement(V,k({role:"menuitemradio","aria-checked":a},n,{ref:r,"data-state":Z(a),onSelect:w(n.onSelect,(function(){var e;return null===(e=o.onValueChange)||void 0===e?void 0:e.call(o,t)}),{checkForDefaultPrevented:!1})})))}));exports.MenuRadioItem=W,W.displayName="MenuRadioItem";var _=x.createContext(!1),z=x.forwardRef((function(e,r){var t=e.as,n=void 0===t?"span":t,o=e.forceMount,a=R(e,["as","forceMount"]),u=x.useContext(_);return x.createElement(p,{present:o||u},x.createElement(f,k({},a,{as:n,ref:r,"data-state":Z(u)})))}));exports.MenuItemIndicator=z,z.displayName="MenuItemIndicator";var $=d(f,{defaultProps:{role:"group"},displayName:"MenuGroup"});exports.MenuGroup=$;var J=d(f,{displayName:"MenuLabel"});exports.MenuLabel=J;var Q=d(f,{defaultProps:{role:"separator","aria-orientation":"horizontal"},displayName:"MenuSeparator "});exports.MenuSeparator=Q;var X=d(u.Arrow,{displayName:"MenuArrow"});function Y(e){return e?"open":"closed"}function Z(e){return e?"checked":"unchecked"}exports.MenuArrow=X;var ee=N;exports.Root=ee;var re=$;exports.Group=re;var te=J;exports.Label=te;var ne=V;exports.Item=ne;var oe=U;exports.CheckboxItem=oe;var ae=H;exports.RadioGroup=ae;var ue=W;exports.RadioItem=ue;var ie=z;exports.ItemIndicator=ie;var ce=Q;exports.Separator=ce;var le=X;exports.Arrow=le;
//# sourceMappingURL=index.js.map

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

import{hideOthers as e}from"aria-hidden";import{RemoveScroll as t}from"react-remove-scroll";import{useFocusGuards as o}from"@radix-ui/react-focus-guards";import{Portal as r}from"@radix-ui/react-portal";import{FocusScope as n}from"@radix-ui/react-focus-scope";import{DismissableLayer as a}from"@radix-ui/react-dismissable-layer";import*as u from"@radix-ui/react-popper";import{RovingFocusGroup as c,useRovingFocus as s}from"@radix-ui/react-roving-focus";import{Primitive as i,extendPrimitive as l}from"@radix-ui/react-primitive";import{Presence as d}from"@radix-ui/react-presence";import{useCallbackRef as m}from"@radix-ui/react-use-callback-ref";import{createContext as p}from"@radix-ui/react-context";import{composeRefs as f,useComposedRefs as v}from"@radix-ui/react-compose-refs";import{composeEventHandlers as M}from"@radix-ui/primitive";import*as h from"react";function x(){const e=h.useRef(0),t=h.useRef(""),o=h.useCallback((r=>{t.current=r,window.clearTimeout(e.current),e.current=window.setTimeout((()=>o("")),1e3)}),[]);return{onKeyDownCapture:e=>{if(1===e.key.length&&!(e.ctrlKey||e.altKey||e.metaKey)){const r=e.currentTarget;o(t.current+e.key)," "!==e.key||t.current.startsWith(" ")||e.stopPropagation();const n=document.activeElement,a=n?w(n):void 0,u=function(e,t,o){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,n=o?e.indexOf(o):-1;let a=(u=e,c=Math.max(n,0),u.map(((e,t)=>u[(c+t)%u.length])));var u,c;1===r.length&&(a=a.filter((e=>e!==o)));const s=a.find((e=>e.toLowerCase().startsWith(r.toLowerCase())));return s!==o?s:void 0}(Array.from(r.querySelectorAll("[".concat(y,"]"))).map(w),t.current,a),c=r.querySelector("[".concat(y,'="').concat(u,'"]'));c&&setTimeout((()=>c.focus()))}}}}const w=e=>{var t;return null!==(t=e.getAttribute(y))&&void 0!==t?t:""},y="data-radix-menu-typeahead-item";function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}const b=["ArrowDown","PageUp","Home"],E=[...b,"ArrowUp","PageDown","End"],[D,I]=p("Menu");export const Menu=h.forwardRef(((e,t)=>{const{forceMount:o,open:r=!1,...n}=e;return h.createElement(d,{present:o||r},h.createElement(R,C({"data-state":P(r)},n,{ref:t,open:r})))}));const R=h.forwardRef(((s,i)=>{const{open:l,onOpenChange:d,anchorRef:p,loop:v,trapFocus:w,onOpenAutoFocus:y,onCloseAutoFocus:I,disableOutsidePointerEvents:R,onEscapeKeyDown:g,onPointerDownOutside:S,onFocusOutside:F,onInteractOutside:P,onDismiss:A,disableOutsideScroll:O,portalled:K,...G}=s,L=m(d),N=h.useRef(null),[T,V]=h.useState(0),[B,U]=h.useState(!1),q=x();h.useEffect((()=>{V(B?-1:0)}),[B]);const[j,W]=h.useState(!1),z=K?r:h.Fragment,H=O?t:h.Fragment;return o(),h.useEffect((()=>{const t=N.current;if(t)return e(t)}),[]),h.createElement(z,null,h.createElement(H,null,h.createElement(D,{menuRef:N,onItemsReachableChange:U,onOpenChange:L},h.createElement(c,{reachable:B,onReachableChange:U,orientation:"vertical",loop:v},h.createElement(n,{trapped:!j&&(w&&l),onMountAutoFocus:y,onUnmountAutoFocus:e=>{j?e.preventDefault():null==I||I(e)}},(e=>h.createElement(a,{disableOutsidePointerEvents:R,onEscapeKeyDown:g,onPointerDownOutside:M(S,(e=>{const t=0===e.button&&!1===e.ctrlKey;W(!R&&t),e.defaultPrevented&&W(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:M(F,(e=>{w&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:P,onDismiss:A},(t=>h.createElement(u.Root,C({role:"menu"},G,{ref:f(i,N,e.ref,t.ref),anchorRef:p,tabIndex:T,style:{...t.style,outline:"none",...G.style},onBlurCapture:M(G.onBlurCapture,t.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:M(G.onFocusCapture,t.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:M(G.onMouseDownCapture,t.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:M(G.onTouchStartCapture,t.onTouchStartCapture,{checkForDefaultPrevented:!1}),onKeyDownCapture:M(G.onKeyDownCapture,q.onKeyDownCapture),onKeyDown:M(G.onKeyDown,(e=>{const t=N.current;if(e.target===t&&E.includes(e.key)){e.preventDefault();const o=Array.from(t.querySelectorAll(k)),r=b.includes(e.key)?o[0]:o.reverse()[0];null==r||r.focus()}}))}))))))))))}));Menu.displayName="Menu";export const MenuGroup=h.forwardRef(((e,t)=>h.createElement(i,C({role:"group"},e,{ref:t}))));MenuGroup.displayName="MenuGroup";const k="[".concat("data-radix-menu-item","]:not([data-disabled])");export const MenuItem=h.forwardRef(((e,t)=>{const{disabled:o,textValue:r,onSelect:n,...a}=e,u=h.useRef(null),c=v(t,u),l=I("MenuItem"),d=s({disabled:o}),[m,p]=h.useState("");h.useEffect((()=>{const e=u.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[a.children]);const f=function({textValue:e,disabled:t}){return{[y]:t?void 0:e}}({textValue:null!=r?r:m,disabled:o}),x=()=>{const e=u.current;if(!o&&e){var t;const o=new Event("menu.itemSelect",{bubbles:!0,cancelable:!0});if(e.dispatchEvent(o),o.defaultPrevented)return;null===(t=l.onOpenChange)||void 0===t||t.call(l,!1)}};return h.useEffect((()=>{const e=u.current;if(e){const t=e=>null==n?void 0:n(e);return e.addEventListener("menu.itemSelect",t),()=>e.removeEventListener("menu.itemSelect",t)}}),[n]),h.createElement(i,C({role:"menuitem","aria-disabled":o||void 0},a,d,f,{"data-radix-menu-item":"",ref:c,"data-disabled":o?"":void 0,onFocus:M(a.onFocus,d.onFocus),onKeyDown:M(a.onKeyDown,M(d.onKeyDown,(e=>{o||"Enter"!==e.key&&" "!==e.key||x()}))),onMouseDown:M(a.onMouseDown,d.onMouseDown),onMouseUp:M(a.onMouseUp,x),onMouseMove:M(a.onMouseMove,(e=>{if(!o){e.currentTarget.focus()}})),onBlur:M(a.onBlur,(e=>{l.onItemsReachableChange(!1)})),onMouseLeave:M(a.onMouseLeave,(e=>{var t;null===(t=l.menuRef.current)||void 0===t||t.focus()}))}))}));MenuItem.displayName="MenuItem";export const MenuCheckboxItem=h.forwardRef(((e,t)=>{const{checked:o=!1,onCheckedChange:r,...n}=e;return h.createElement(F.Provider,{value:o},h.createElement(MenuItem,C({role:"menuitemcheckbox","aria-checked":o},n,{ref:t,"data-state":A(o),onSelect:M(n.onSelect,(()=>null==r?void 0:r(!o)),{checkForDefaultPrevented:!1})})))}));MenuCheckboxItem.displayName="MenuCheckboxItem";const g=h.createContext({});export const MenuRadioGroup=h.forwardRef(((e,t)=>{const{value:o,onValueChange:r,...n}=e,a=m(r),u=h.useMemo((()=>({value:o,onValueChange:a})),[o,a]);return h.createElement(g.Provider,{value:u},h.createElement(MenuGroup,C({},n,{ref:t})))}));MenuRadioGroup.displayName="MenuRadioGroup";export const MenuRadioItem=h.forwardRef(((e,t)=>{const{value:o,...r}=e,n=h.useContext(g),a=o===n.value;return h.createElement(F.Provider,{value:a},h.createElement(MenuItem,C({role:"menuitemradio","aria-checked":a},r,{ref:t,"data-state":A(a),onSelect:M(r.onSelect,(()=>{var e;return null===(e=n.onValueChange)||void 0===e?void 0:e.call(n,o)}),{checkForDefaultPrevented:!1})})))}));MenuRadioItem.displayName="MenuRadioItem";const S="span",F=h.createContext(!1);export const MenuItemIndicator=h.forwardRef(((e,t)=>{const{as:o=S,forceMount:r,...n}=e,a=h.useContext(F);return h.createElement(d,{present:r||a},h.createElement(i,C({},n,{as:o,ref:t,"data-state":A(a)})))}));MenuItemIndicator.displayName="MenuItemIndicator";export const MenuSeparator=h.forwardRef(((e,t)=>h.createElement(i,C({role:"separator","aria-orientation":"horizontal"},e,{ref:t}))));MenuSeparator.displayName="MenuSeparator";export const MenuLabel=l(i,"MenuLabel");export const MenuArrow=l(u.Arrow,"MenuArrow");function P(e){return e?"open":"closed"}function A(e){return e?"checked":"unchecked"}export const Root=Menu;export const Group=MenuGroup;export const Label=MenuLabel;export const Item=MenuItem;export const CheckboxItem=MenuCheckboxItem;export const RadioGroup=MenuRadioGroup;export const RadioItem=MenuRadioItem;export const ItemIndicator=MenuItemIndicator;export const Separator=MenuSeparator;export const Arrow=MenuArrow;
import{hideOthers as e}from"aria-hidden";import{RemoveScroll as t}from"react-remove-scroll";import{useFocusGuards as o}from"@radix-ui/react-focus-guards";import{Portal as r}from"@radix-ui/react-portal";import{FocusScope as n}from"@radix-ui/react-focus-scope";import{DismissableLayer as a}from"@radix-ui/react-dismissable-layer";import*as u from"@radix-ui/react-popper";import{RovingFocusGroup as c,useRovingFocus as s}from"@radix-ui/react-roving-focus";import{Primitive as i,extendPrimitive as l}from"@radix-ui/react-primitive";import{Presence as d}from"@radix-ui/react-presence";import{useCallbackRef as m}from"@radix-ui/react-use-callback-ref";import{createContext as p}from"@radix-ui/react-context";import{composeRefs as f,useComposedRefs as v}from"@radix-ui/react-compose-refs";import{composeEventHandlers as M}from"@radix-ui/primitive";import*as h from"react";function x(){const e=h.useRef(0),t=h.useRef(""),o=h.useCallback((r=>{t.current=r,window.clearTimeout(e.current),e.current=window.setTimeout((()=>o("")),1e3)}),[]);return{onKeyDownCapture:e=>{if(1===e.key.length&&!(e.ctrlKey||e.altKey||e.metaKey)){const r=e.currentTarget;o(t.current+e.key)," "!==e.key||t.current.startsWith(" ")||e.stopPropagation();const n=document.activeElement,a=n?y(n):void 0,u=function(e,t,o){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,n=o?e.indexOf(o):-1;let a=(u=e,c=Math.max(n,0),u.map(((e,t)=>u[(c+t)%u.length])));var u,c;1===r.length&&(a=a.filter((e=>e!==o)));const s=a.find((e=>e.toLowerCase().startsWith(r.toLowerCase())));return s!==o?s:void 0}(Array.from(r.querySelectorAll("[".concat(w,"]"))).map(y),t.current,a),c=r.querySelector("[".concat(w,'="').concat(u,'"]'));c&&setTimeout((()=>c.focus()))}}}}const y=e=>{var t;return null!==(t=e.getAttribute(w))&&void 0!==t?t:""},w="data-radix-menu-typeahead-item";function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e}).apply(this,arguments)}const b=["ArrowDown","PageUp","Home"],D=[...b,"ArrowUp","PageDown","End"],[E,I]=p("Menu");export const Menu=h.forwardRef(((e,t)=>{const{forceMount:o,open:r=!1,...n}=e;return h.createElement(d,{present:o||r},h.createElement(R,C({"data-state":S(r)},n,{ref:t,open:r})))}));const R=h.forwardRef(((s,i)=>{const{open:l,onOpenChange:d,anchorRef:p,loop:v,trapFocus:y,onOpenAutoFocus:w,onCloseAutoFocus:I,disableOutsidePointerEvents:R,onEscapeKeyDown:g,onPointerDownOutside:F,onFocusOutside:P,onInteractOutside:S,onDismiss:A,disableOutsideScroll:O,portalled:K,...G}=s,L=m(d),N=h.useRef(null),[T,V]=h.useState(0),[B,U]=h.useState(!1),q=x();h.useEffect((()=>{V(B?-1:0)}),[B]);const[j,W]=h.useState(!1),z=K?r:h.Fragment,H=O?t:h.Fragment;return o(),h.useEffect((()=>{const t=N.current;if(t)return e(t)}),[]),h.createElement(z,null,h.createElement(H,null,h.createElement(E,{menuRef:N,onItemsReachableChange:U,onOpenChange:L},h.createElement(c,{reachable:B,onReachableChange:U,orientation:"vertical",loop:v},h.createElement(n,{trapped:!j&&(y&&l),onMountAutoFocus:w,onUnmountAutoFocus:e=>{j?e.preventDefault():null==I||I(e)}},(e=>h.createElement(a,{disableOutsidePointerEvents:R,onEscapeKeyDown:g,onPointerDownOutside:M(F,(e=>{const t=0===e.button&&!1===e.ctrlKey;W(!R&&t),e.defaultPrevented&&W(!1)}),{checkForDefaultPrevented:!1}),onFocusOutside:M(P,(e=>{y&&e.preventDefault()}),{checkForDefaultPrevented:!1}),onInteractOutside:S,onDismiss:A},(t=>h.createElement(u.Root,C({role:"menu"},G,{ref:f(i,N,e.ref,t.ref),anchorRef:p,tabIndex:T,style:{...t.style,outline:"none",...G.style},onBlurCapture:M(G.onBlurCapture,t.onBlurCapture,{checkForDefaultPrevented:!1}),onFocusCapture:M(G.onFocusCapture,t.onFocusCapture,{checkForDefaultPrevented:!1}),onMouseDownCapture:M(G.onMouseDownCapture,t.onMouseDownCapture,{checkForDefaultPrevented:!1}),onTouchStartCapture:M(G.onTouchStartCapture,t.onTouchStartCapture,{checkForDefaultPrevented:!1}),onKeyDownCapture:M(G.onKeyDownCapture,q.onKeyDownCapture),onKeyDown:M(G.onKeyDown,(e=>{const t=N.current;if(e.target===t&&D.includes(e.key)){e.preventDefault();const o=Array.from(t.querySelectorAll(k)),r=b.includes(e.key)?o[0]:o.reverse()[0];null==r||r.focus()}}))}))))))))))}));Menu.displayName="Menu";const k="[".concat("data-radix-menu-item","]:not([data-disabled])");export const MenuItem=h.forwardRef(((e,t)=>{const{disabled:o,textValue:r,onSelect:n,...a}=e,u=h.useRef(null),c=v(t,u),l=I("MenuItem"),d=s({disabled:o}),[m,p]=h.useState("");h.useEffect((()=>{const e=u.current;var t;e&&p((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}),[a.children]);const f=function({textValue:e,disabled:t}){return{[w]:t?void 0:e}}({textValue:null!=r?r:m,disabled:o}),x=()=>{const e=u.current;if(!o&&e){var t;const o=new Event("menu.itemSelect",{bubbles:!0,cancelable:!0});if(e.dispatchEvent(o),o.defaultPrevented)return;null===(t=l.onOpenChange)||void 0===t||t.call(l,!1)}};return h.useEffect((()=>{const e=u.current;if(e){const t=e=>null==n?void 0:n(e);return e.addEventListener("menu.itemSelect",t),()=>e.removeEventListener("menu.itemSelect",t)}}),[n]),h.createElement(i,C({role:"menuitem","aria-disabled":o||void 0},a,d,f,{"data-radix-menu-item":"",ref:c,"data-disabled":o?"":void 0,onFocus:M(a.onFocus,d.onFocus),onKeyDown:M(a.onKeyDown,M(d.onKeyDown,(e=>{o||"Enter"!==e.key&&" "!==e.key||x()}))),onMouseDown:M(a.onMouseDown,d.onMouseDown),onMouseUp:M(a.onMouseUp,x),onMouseMove:M(a.onMouseMove,(e=>{if(!o){e.currentTarget.focus()}})),onBlur:M(a.onBlur,(e=>{l.onItemsReachableChange(!1)})),onMouseLeave:M(a.onMouseLeave,(e=>{var t;null===(t=l.menuRef.current)||void 0===t||t.focus()}))}))}));MenuItem.displayName="MenuItem";export const MenuCheckboxItem=h.forwardRef(((e,t)=>{const{checked:o=!1,onCheckedChange:r,...n}=e;return h.createElement(P.Provider,{value:o},h.createElement(MenuItem,C({role:"menuitemcheckbox","aria-checked":o},n,{ref:t,"data-state":A(o),onSelect:M(n.onSelect,(()=>null==r?void 0:r(!o)),{checkForDefaultPrevented:!1})})))}));MenuCheckboxItem.displayName="MenuCheckboxItem";const g=h.createContext({});export const MenuRadioGroup=h.forwardRef(((e,t)=>{const{value:o,onValueChange:r,...n}=e,a=m(r),u=h.useMemo((()=>({value:o,onValueChange:a})),[o,a]);return h.createElement(g.Provider,{value:u},h.createElement(MenuGroup,C({},n,{ref:t})))}));MenuRadioGroup.displayName="MenuRadioGroup";export const MenuRadioItem=h.forwardRef(((e,t)=>{const{value:o,...r}=e,n=h.useContext(g),a=o===n.value;return h.createElement(P.Provider,{value:a},h.createElement(MenuItem,C({role:"menuitemradio","aria-checked":a},r,{ref:t,"data-state":A(a),onSelect:M(r.onSelect,(()=>{var e;return null===(e=n.onValueChange)||void 0===e?void 0:e.call(n,o)}),{checkForDefaultPrevented:!1})})))}));MenuRadioItem.displayName="MenuRadioItem";const F="span",P=h.createContext(!1);export const MenuItemIndicator=h.forwardRef(((e,t)=>{const{as:o=F,forceMount:r,...n}=e,a=h.useContext(P);return h.createElement(d,{present:r||a},h.createElement(i,C({},n,{as:o,ref:t,"data-state":A(a)})))}));MenuItemIndicator.displayName="MenuItemIndicator";export const MenuGroup=l(i,{defaultProps:{role:"group"},displayName:"MenuGroup"});export const MenuLabel=l(i,{displayName:"MenuLabel"});export const MenuSeparator=l(i,{defaultProps:{role:"separator","aria-orientation":"horizontal"},displayName:"MenuSeparator "});export const MenuArrow=l(u.Arrow,{displayName:"MenuArrow"});function S(e){return e?"open":"closed"}function A(e){return e?"checked":"unchecked"}export const Root=Menu;export const Group=MenuGroup;export const Label=MenuLabel;export const Item=MenuItem;export const CheckboxItem=MenuCheckboxItem;export const RadioGroup=MenuRadioGroup;export const RadioItem=MenuRadioItem;export const ItemIndicator=MenuItemIndicator;export const Separator=MenuSeparator;export const Arrow=MenuArrow;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-menu",
"version": "0.0.8",
"version": "0.0.9",
"license": "MIT",

@@ -26,6 +26,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-roving-focus": "0.0.6",

@@ -32,0 +32,0 @@ "@radix-ui/react-use-callback-ref": "0.0.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

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