@jamsrui/menu 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3TXNSYIT.mjs +1 -0
- package/dist/chunk-4DRJMVOY.mjs +1 -0
- package/dist/chunk-4QOOXBEL.mjs +1 -0
- package/dist/chunk-5DZZ6VC5.mjs +1 -0
- package/dist/chunk-6RHOGA5S.mjs +1 -0
- package/dist/chunk-A4ENIW42.mjs +1 -0
- package/dist/chunk-BDCGHIJW.mjs +1 -0
- package/dist/chunk-DHAF5YKZ.mjs +1 -0
- package/dist/chunk-EDFHOYYY.mjs +1 -0
- package/dist/chunk-GBR7YVTW.mjs +1 -0
- package/dist/chunk-IP6JQ5TM.mjs +1 -0
- package/dist/chunk-LSC54BQQ.mjs +1 -0
- package/dist/chunk-MCQCEY2U.mjs +1 -0
- package/dist/chunk-MFCNUSNC.mjs +1 -0
- package/dist/chunk-SNAXAYWZ.mjs +1 -0
- package/dist/chunk-VDALF5ID.mjs +1 -0
- package/dist/chunk-W6Z5NYJV.mjs +1 -0
- package/dist/chunk-WYIM2S4D.mjs +1 -0
- package/dist/chunk-Z3M52LAZ.mjs +1 -0
- package/dist/index.d.mts +11 -3
- package/dist/index.mjs +1 -1
- package/dist/{menu-CptFvNqD.d.mts → menu-BQP9o4yc.d.mts} +13 -13
- package/dist/menu-checkbox-item.d.mts +25 -0
- package/dist/menu-checkbox-item.mjs +1 -0
- package/dist/menu-config.d.mts +7 -4
- package/dist/menu-config.mjs +1 -1
- package/dist/menu-content.mjs +1 -1
- package/dist/menu-content2.d.mts +10 -0
- package/dist/menu-content2.mjs +1 -0
- package/dist/menu-context.d.mts +6 -3
- package/dist/menu-context.mjs +1 -1
- package/dist/menu-floating-context.mjs +1 -1
- package/dist/menu-group-label.d.mts +10 -0
- package/dist/menu-group-label.mjs +1 -0
- package/dist/menu-group.d.mts +10 -0
- package/dist/menu-group.mjs +1 -0
- package/dist/menu-item-inner.mjs +1 -1
- package/dist/menu-item.d.mts +6 -3
- package/dist/menu-item.mjs +1 -1
- package/dist/menu-radio-group-context.d.mts +13 -0
- package/dist/menu-radio-group-context.mjs +1 -0
- package/dist/menu-radio-group.d.mts +14 -0
- package/dist/menu-radio-group.mjs +1 -0
- package/dist/menu-radio-item.d.mts +23 -0
- package/dist/menu-radio-item.mjs +1 -0
- package/dist/menu-root.d.mts +10 -0
- package/dist/menu-root.mjs +1 -0
- package/dist/menu-separator.d.mts +5 -0
- package/dist/menu-separator.mjs +1 -0
- package/dist/menu-trigger.mjs +1 -1
- package/dist/menu.d.mts +7 -4
- package/dist/menu.mjs +1 -1
- package/dist/styles.d.mts +13 -8
- package/dist/styles.mjs +1 -1
- package/dist/use-menu.d.mts +7 -4
- package/dist/use-menu.mjs +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-IP6JQ5TM.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var u=r=>{let{getMenuGroupProps:o}=e();return t("div",{props:[o(r)]})};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u}from"./chunk-6RHOGA5S.mjs";import{a as r}from"./chunk-IP6JQ5TM.mjs";import{FloatingNode as a,FloatingTree as i,useFloatingParentNodeId as d}from"@floating-ui/react";import{jsx as n}from"react/jsx-runtime";var c=e=>{let t=u(e),{children:o}=e,{getNodeProps:s}=t;return n(r,{value:t,children:n(a,{...s(),children:o})})},g=e=>{let t=d(),{children:o}=e;return t===null?n(i,{children:n(c,{...e,children:o})}):n(c,{...e,children:o})};export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e,use as t}from"react";var o=e({setHasFocusInside:()=>{},activeIndex:null,getItemProps:()=>({})}),s=()=>t(o);export{o as a,s as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createConfigContext as o}from"@jamsrui/utils";var[n,r]=o({displayName:"MenuConfigContext"});export{n as a,r as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-VDALF5ID.mjs";import{b as Q}from"./chunk-4QOOXBEL.mjs";import{useCallback as s,useEffect as W,useMemo as X,useRef as N,useState as Y}from"react";import{arrow as ye,autoUpdate as Me,flip as be,offset as ve,safePolygon as Ne,shift as Fe,size as he,useClick as Oe,useDismiss as xe,useFloating as Ce,useFloatingNodeId as Ge,useFloatingParentNodeId as we,useFloatingTree as Re,useHover as ke,useInteractions as Le,useListItem as Se,useListNavigation as Ee,useRole as Ae,useTypeahead as De}from"@floating-ui/react";import{useControlledState as Te,useMergeRefs as He}from"@jamsrui/hooks";import{cn as c,dataAttrDev as i,mapPropsVariants as Ve}from"@jamsrui/utils";var Je=Z=>{let p=we(),t=p!==null,[_,ee]=Ve(Z,v.variantKeys),{closeDelay:te=0,closeOnEscapeKey:oe=!0,closeOnOutsidePress:ne=!0,isOpen:se,lockScroll:F=!0,offset:re=4,openDelay:ae=75,placement:I=t?"right-start":"bottom",defaultOpen:le=!1,onOpenChange:ie,triggerOn:ue="click",classNames:o,hideArrow:y=!!t}=_,l=Re(),u=Ge(),M=Se(),me=y?0:7,[r=!1,d]=Te({defaultProp:le,onChange:ie,prop:se}),[pe,h]=Y(!1),[g,O]=Y(null),x=N(null),C=N([]),G=N([]),{floatingStyles:w,refs:b,context:a}=Ce({nodeId:u,open:r,onOpenChange:d,placement:I,middleware:[ve({mainAxis:re+me,alignmentAxis:t?-4:0}),be(),Fe({padding:5}),ye({element:x}),he({apply({availableHeight:e,elements:m,availableWidth:P}){m.floating.style.setProperty("--available-width",`${P}px`),m.floating.style.setProperty("--available-height",`${e}px`),m.floating.style.setProperty("--transform-origin","top center")}})],whileElementsMounted:Me}),ce=ke(a,{enabled:ue==="hover"||t,delay:{open:ae,close:te},handleClose:Ne({blockPointerEvents:!0})}),de=Oe(a,{event:"mousedown",toggle:!t,ignoreMouse:t}),ge=Ae(a,{role:"menu"}),fe=xe(a,{bubbles:!0,escapeKey:oe,outsidePress:ne}),Pe=Ee(a,{listRef:C,activeIndex:g,nested:t,onNavigate:O}),Ie=De(a,{enabled:r,listRef:G,onMatch:O,activeIndex:g}),{getReferenceProps:R,getFloatingProps:k,getItemProps:L}=Le([ce,de,ge,fe,Pe,Ie]);W(()=>{if(!l)return;function e(){d(!1)}function m(P){P.nodeId!==u&&P.parentId===p&&d(!1)}return l.events.on("click",e),l.events.on("menuopen",m),()=>{l.events.off("click",e),l.events.off("menuopen",m)}},[l,u,p,d,r]),W(()=>{r&&l&&l.events.emit("menuopen",{parentId:p,nodeId:u})},[l,r,u,p]);let n=v(ee),S=r&&pe&&t,E=He([b.setReference,M.ref]),f=Q(),A=s(()=>({ref:E,tabIndex:t?f.activeIndex===M.index?0:-1:void 0,"data-slot":i("trigger"),role:t?"menuitem":void 0,"data-active":S,"data-nested":t,"data-open":r,...R({...f.getItemProps({onMouseEnter(){h(!1),f.setHasFocusInside(!0)}})})}),[R,S,t,r,M.index,E,f]),D=s(()=>({lockScroll:F,"data-slot":i("overlay"),className:n.backdrop({className:o?.backdrop})}),[o?.backdrop,F,n]),T=s(()=>({context:a,modal:!0,initialFocus:1,returnFocus:!t,disabled:!1}),[a,t]),H=s(e=>({...e,"data-component":i("menu"),"data-slot":i("root"),className:n.root({className:o?.root}),ref:b.setFloating,style:w,...k()}),[o?.root,w,k,b.setFloating,n]),V=s(()=>({className:n.content({className:c(o?.content)})}),[o?.content,n]),K=s(()=>({context:a,ref:x,className:n.arrow({className:o?.arrow})}),[o?.arrow,a,n]),U=s(()=>({id:u}),[u]),$=s(()=>({elementsRef:C,labelsRef:G}),[]),j=X(()=>({activeIndex:g,getItemProps:L,setHasFocusInside:h}),[g,L]),z=s(e=>({...e,"data-slot":i("menu-item"),className:n.menuItem({className:c(o?.menuItem,e.className),color:e.color}),role:"menuitem"}),[o?.menuItem,n]),q=s(e=>({...e,"data-slot":i("menu-item-inner"),className:n.menuItemInner({className:c(o?.menuItemInner,e.className)})}),[o?.menuItemInner,n]),B=s(e=>({...e,"data-slot":i("menu-group"),className:n.menuItemInner({className:c(o?.menuGroup,e.className)})}),[o?.menuGroup,n]),J=s(e=>({...e,"data-slot":i("menu-group-label"),className:n.menuGroupLabel({className:c(o?.menuGroupLabel,e.className)})}),[o?.menuGroupLabel,n]);return X(()=>({getOverlayProps:D,getFocusManagerProps:T,getContentProps:V,getArrowProps:K,getNodeProps:U,isOpen:r,getTriggerProps:A,getFloatingListProps:$,hideArrow:y,floatingCtx:j,getRootProps:H,getMenuItemProps:z,isNested:t,getMenuItemInnerProps:q,getMenuGroupProps:B,getMenuGroupLabelProps:J,placement:I}),[D,T,V,K,U,r,A,$,y,j,H,z,t,q,B,J,I])};export{Je as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r}from"./chunk-IP6JQ5TM.mjs";import{cloneElement as o,isValidElement as i}from"react";var s=n=>{let{children:e}=n,{getTriggerProps:t}=r();return i(e)?o(e,t()):(console.warn("Invalid children passed to MenuTrigger"),null)};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-MFCNUSNC.mjs";import{a as e}from"./chunk-LSC54BQQ.mjs";import{a as n}from"./chunk-4QOOXBEL.mjs";import{b as t}from"./chunk-IP6JQ5TM.mjs";import{FloatingArrow as c,FloatingFocusManager as f,FloatingList as C,FloatingOverlay as x,FloatingPortal as d}from"@floating-ui/react";import{AnimatePresence as A}from"motion/react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var I=a=>{let{getFloatingListProps:s,isOpen:l,getFocusManagerProps:p,getOverlayProps:u,hideArrow:g,getArrowProps:m,floatingCtx:F,isNested:M}=t(),{children:P}=a;return o(n,{value:F,children:o(C,{...s(),children:o(A,{children:l?i(d,{children:[M?null:o(x,{...u()}),o(f,{...p(),children:o(r,{children:i(e,{children:[g?null:o(c,{...m()}),P]})})})]}):null})})})};export{I as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-IP6JQ5TM.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var u=r=>{let{getMenuGroupLabelProps:o}=e();return t("div",{props:[o(r)]})};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk-MCQCEY2U.mjs";import{a as r}from"./chunk-Z3M52LAZ.mjs";import{useCallback as m}from"react";import{CheckIcon as p}from"@jamsrui/icons";import{jsx as n}from"react/jsx-runtime";var d=t=>{let{isChecked:e}=t;return n("span",{className:"size-4",children:e?n(p,{}):null})},M=t=>{let{value:e,tickPlacement:o,...l}=t,{value:s,isDisabled:a,setValue:i}=c(),u=m(()=>{a||i(e)},[a,e,i]);return n(r,{preventCloseOnClick:!0,onClick:u,endContent:o==="end"?n(d,{isChecked:s===e}):void 0,startContent:o==="start"?n(d,{isChecked:s===e}):void 0,...l})};export{M as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-Z3M52LAZ.mjs";import{useCallback as l}from"react";import{useControlledState as p}from"@jamsrui/hooks";import{CheckIcon as m}from"@jamsrui/icons";import{jsx as e}from"react/jsx-runtime";var C=n=>{let{isChecked:o}=n;return e("span",{className:"size-4",children:o?e(m,{}):null})},P=n=>{let{isChecked:o,onCheckedChange:r,defaultChecked:a,tickPlacement:t,...k}=n,[c=!1,s]=p({defaultProp:a,onChange:r,prop:o}),h=l(()=>{s(i=>!i)},[s]);return e(d,{preventCloseOnClick:!0,onClick:h,endContent:t==="end"?e(C,{isChecked:c}):void 0,startContent:t==="start"?e(C,{isChecked:c}):void 0,...k})};export{P as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as t,use as n}from"react";var o=t(null),r=()=>{let e=n(o);if(!e)throw new Error("useMenuContext must be used within MenuContext");return e};export{o as a,r as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"./chunk-IP6JQ5TM.mjs";import{motion as r}from"motion/react";import{jsx as p}from"react/jsx-runtime";var m=o=>{let{children:e,...n}=o,{getContentProps:i,isNested:s}=t();return p(r.div,{...s?{}:{exit:{opacity:0,scale:.8},initial:{opacity:0,scale:.8},transition:{type:"spring",stiffness:300,damping:25},animate:{opacity:1,scale:1,x:0,y:0}},...i(n),children:e})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as t,use as o}from"react";var n=t(null),u=()=>{let e=o(n);if(!e)throw new Error("useMenuRadioGroupContext must be used within a MenuRadioGroup");return e};export{n as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-IP6JQ5TM.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var m=o=>{let{getRootProps:r}=e();return t("div",{props:[r(o)]})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-MCQCEY2U.mjs";import{useMemo as s}from"react";import{useControlledState as d}from"@jamsrui/hooks";import{jsx as c}from"react/jsx-runtime";var v=u=>{let{children:n,defaultValue:r,isDisabled:e,onValueChange:l,value:p}=u,[o="",a]=d({defaultProp:r,onChange:l,prop:p}),i=s(()=>({isDisabled:e,value:o,setValue:a}),[e,a,o]);return c(t,{value:i,children:n})};export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{radiusVariant as e,tv as r}from"@jamsrui/utils";var n=r({slots:{arrow:"fill-background-secondary",backdrop:"z-backdrop",root:"min-w-[150px] z-popover outline-none outline-0",content:["relative z-popover box-border inline-flex w-full flex-col justify-center bg-surface p-1 text-sm shadow-md outline-none","shadow-lg origin-(--transform-origin)"],menuItem:["relative box-border flex size-full select-none items-center gap-2 px-2 py-1.5 text-left outline-none ui-disabled:cursor-not-allowed ui-disabled:opacity-60","ui-active:bg-surface-secondary"],menuGroup:[""],menuGroupLabel:"pl-2 text-foreground-secondary py-1",menuItemInner:"grow"},variants:{radius:e(["content","menuItem"]),backdrop:{transparent:{backdrop:""},opaque:{backdrop:"bg-black/50"},blur:{backdrop:"bg-black/30 backdrop-blur-md backdrop-saturate-150"}},color:{default:{menuItem:"ui-hover:bg-surface-secondary ui-hover:text-foreground"},primary:{menuItem:"ui-hover:bg-primary ui-hover:text-primary-foreground"},secondary:{menuItem:"ui-hover:bg-secondary ui-hover:text-secondary-foreground"},success:{menuItem:"ui-hover:bg-success ui-hover:text-success-foreground"},warning:{menuItem:"ui-hover:bg-warning ui-hover:text-warning-foreground"},danger:{menuItem:"ui-hover:bg-danger ui-hover:text-danger-foreground"}}},defaultVariants:{backdrop:"transparent",radius:"md",color:"default"}});export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-IP6JQ5TM.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var m=n=>{let{getMenuItemInnerProps:r}=e();return t("span",{props:[r(n)]})};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Divider as r}from"@jamsrui/divider";import{jsx as o}from"react/jsx-runtime";var a=()=>o(r,{className:"my-1.5"});export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-W6Z5NYJV.mjs";import{b as i}from"./chunk-4QOOXBEL.mjs";import{b as s}from"./chunk-IP6JQ5TM.mjs";import{useFloatingTree as b,useListItem as x}from"@floating-ui/react";import{useMergeRefs as P,useRenderElement as g}from"@jamsrui/hooks";import{Fragment as R,jsx as v,jsxs as k}from"react/jsx-runtime";var O=m=>{let{getMenuItemProps:c}=s(),l=b(),{textValue:d,children:e,isDisabled:t,startContent:u,endContent:p,preventCloseOnClick:f,...I}=m,n=i(),o=x({label:d??(typeof e=="string"?e:void 0)}),r=o.index===n.activeIndex,C=P([o.ref]),M=k(R,{children:[u,v(a,{children:e}),p]});return g("button",{props:[c(I),{children:M,disabled:t,"data-disabled":t,"data-active":r,"aria-disabled":t,ref:C,tabIndex:r?0:-1,onClick(){f||l?.events.emit("click")},onMouseEnter(){n.setHasFocusInside(!0)}}]})};export{O as a};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
export { M as Menu, a as MenuItem } from './menu-
|
|
1
|
+
export { M as Menu, a as MenuItem } from './menu-BQP9o4yc.mjs';
|
|
2
|
+
export { MenuCheckboxItem } from './menu-checkbox-item.mjs';
|
|
2
3
|
export { MenuConfig, useMenuConfig } from './menu-config.mjs';
|
|
3
4
|
export { MenuContent } from './menu-content.mjs';
|
|
5
|
+
export { MenuGroup } from './menu-group.mjs';
|
|
6
|
+
export { MenuGroupLabel } from './menu-group-label.mjs';
|
|
7
|
+
export { MenuRadioGroup } from './menu-radio-group.mjs';
|
|
8
|
+
export { MenuRadioItem } from './menu-radio-item.mjs';
|
|
9
|
+
export { MenuSeparator } from './menu-separator.mjs';
|
|
4
10
|
export { MenuTrigger } from './menu-trigger.mjs';
|
|
5
11
|
import 'react/jsx-runtime';
|
|
6
|
-
import 'react';
|
|
7
12
|
import '@floating-ui/react';
|
|
8
13
|
import '@jamsrui/utils';
|
|
14
|
+
import 'react';
|
|
15
|
+
import './menu-content2.mjs';
|
|
16
|
+
import 'motion/react';
|
|
9
17
|
import './menu-floating-context.mjs';
|
|
10
18
|
import './menu-item-inner.mjs';
|
|
19
|
+
import './menu-root.mjs';
|
|
11
20
|
import './styles.mjs';
|
|
12
|
-
import 'tailwind-variants';
|
|
13
21
|
import '@jamsrui/core';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{a as i}from"./chunk-A4ENIW42.mjs";import{a as e}from"./chunk-4DRJMVOY.mjs";import"./chunk-6RHOGA5S.mjs";import"./chunk-VDALF5ID.mjs";import{a as p}from"./chunk-3TXNSYIT.mjs";import{a as f}from"./chunk-SNAXAYWZ.mjs";import{a as x}from"./chunk-EDFHOYYY.mjs";import"./chunk-MCQCEY2U.mjs";import{a as M}from"./chunk-WYIM2S4D.mjs";import{a as r}from"./chunk-GBR7YVTW.mjs";import{a as o}from"./chunk-Z3M52LAZ.mjs";import"./chunk-W6Z5NYJV.mjs";import{a as t,b as n}from"./chunk-5DZZ6VC5.mjs";import{a as u}from"./chunk-BDCGHIJW.mjs";import"./chunk-MFCNUSNC.mjs";import"./chunk-LSC54BQQ.mjs";import"./chunk-4QOOXBEL.mjs";import{a as m}from"./chunk-DHAF5YKZ.mjs";import"./chunk-IP6JQ5TM.mjs";export{e as Menu,r as MenuCheckboxItem,t as MenuConfig,u as MenuContent,p as MenuGroup,m as MenuGroupLabel,o as MenuItem,f as MenuRadioGroup,x as MenuRadioItem,M as MenuSeparator,i as MenuTrigger,n as useMenuConfig};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
import { ComponentProps } from 'react';
|
|
4
2
|
import { FloatingOverlayProps, FloatingFocusManagerProps, FloatingArrowProps, FloatingNodeProps, FloatingList, Placement } from '@floating-ui/react';
|
|
5
3
|
import { UIProps, PropGetter, SlotsToClassNames } from '@jamsrui/utils';
|
|
6
|
-
import
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
import { ComponentProps } from 'react';
|
|
6
|
+
import { MenuContent2 } from './menu-content2.mjs';
|
|
7
7
|
import { MenuFloatingContext } from './menu-floating-context.mjs';
|
|
8
|
+
import { MenuGroup } from './menu-group.mjs';
|
|
9
|
+
import { MenuGroupLabel } from './menu-group-label.mjs';
|
|
8
10
|
import { MenuItemInner } from './menu-item-inner.mjs';
|
|
11
|
+
import { MenuRoot } from './menu-root.mjs';
|
|
9
12
|
import { MenuVariantProps, MenuSlots } from './styles.mjs';
|
|
10
13
|
|
|
11
14
|
declare const MenuItem: (props: MenuItem.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
@@ -23,24 +26,21 @@ declare namespace MenuItem {
|
|
|
23
26
|
declare const useMenu: (props: useMenu.Props) => {
|
|
24
27
|
getOverlayProps: () => FloatingOverlayProps & UIProps<"div">;
|
|
25
28
|
getFocusManagerProps: () => Omit<FloatingFocusManagerProps, "children">;
|
|
26
|
-
getContentProps: PropGetter<
|
|
29
|
+
getContentProps: PropGetter<MenuContent2.Props>;
|
|
27
30
|
getArrowProps: () => FloatingArrowProps;
|
|
28
31
|
getNodeProps: () => FloatingNodeProps;
|
|
29
32
|
isOpen: boolean;
|
|
30
33
|
getTriggerProps: () => UIProps<"div">;
|
|
31
34
|
getFloatingListProps: () => Omit<ComponentProps<typeof FloatingList>, "children">;
|
|
32
|
-
|
|
35
|
+
hideArrow: boolean;
|
|
33
36
|
floatingCtx: MenuFloatingContext.Props;
|
|
34
|
-
getRootProps:
|
|
35
|
-
"data-component": string | undefined;
|
|
36
|
-
"data-slot": string | undefined;
|
|
37
|
-
className: string;
|
|
38
|
-
ref: ((node: HTMLElement | null) => void) & ((node: HTMLElement | null) => void);
|
|
39
|
-
style: react.CSSProperties;
|
|
40
|
-
};
|
|
37
|
+
getRootProps: PropGetter<MenuRoot.Props>;
|
|
41
38
|
getMenuItemProps: PropGetter<MenuItem.Props>;
|
|
42
39
|
isNested: boolean;
|
|
43
40
|
getMenuItemInnerProps: PropGetter<MenuItemInner.Props>;
|
|
41
|
+
getMenuGroupProps: PropGetter<MenuGroup.Props>;
|
|
42
|
+
getMenuGroupLabelProps: PropGetter<MenuGroupLabel.Props>;
|
|
43
|
+
placement: Placement;
|
|
44
44
|
};
|
|
45
45
|
declare namespace useMenu {
|
|
46
46
|
interface Props extends MenuVariantProps {
|
|
@@ -56,7 +56,7 @@ declare namespace useMenu {
|
|
|
56
56
|
lockScroll?: boolean;
|
|
57
57
|
placement?: Placement;
|
|
58
58
|
offset?: number;
|
|
59
|
-
|
|
59
|
+
hideArrow?: boolean;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as MenuItem } from './menu-BQP9o4yc.mjs';
|
|
3
|
+
import '@floating-ui/react';
|
|
4
|
+
import '@jamsrui/utils';
|
|
5
|
+
import 'react';
|
|
6
|
+
import './menu-content2.mjs';
|
|
7
|
+
import 'motion/react';
|
|
8
|
+
import './menu-floating-context.mjs';
|
|
9
|
+
import './menu-group.mjs';
|
|
10
|
+
import './menu-group-label.mjs';
|
|
11
|
+
import './menu-item-inner.mjs';
|
|
12
|
+
import './menu-root.mjs';
|
|
13
|
+
import './styles.mjs';
|
|
14
|
+
|
|
15
|
+
declare const MenuCheckboxItem: (props: MenuCheckboxItem.Props) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare namespace MenuCheckboxItem {
|
|
17
|
+
interface Props extends MenuItem.Props {
|
|
18
|
+
isChecked?: boolean;
|
|
19
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
tickPlacement?: "start" | "end";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { MenuCheckboxItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-GBR7YVTW.mjs";import"./chunk-Z3M52LAZ.mjs";import"./chunk-W6Z5NYJV.mjs";import"./chunk-4QOOXBEL.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuCheckboxItem};
|
package/dist/menu-config.d.mts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { GlobalConfigProps } from '@jamsrui/core';
|
|
3
|
-
import { M as Menu } from './menu-
|
|
4
|
-
import 'react';
|
|
3
|
+
import { M as Menu } from './menu-BQP9o4yc.mjs';
|
|
5
4
|
import '@floating-ui/react';
|
|
6
5
|
import '@jamsrui/utils';
|
|
7
|
-
import '
|
|
6
|
+
import 'react';
|
|
7
|
+
import './menu-content2.mjs';
|
|
8
|
+
import 'motion/react';
|
|
8
9
|
import './menu-floating-context.mjs';
|
|
10
|
+
import './menu-group.mjs';
|
|
11
|
+
import './menu-group-label.mjs';
|
|
9
12
|
import './menu-item-inner.mjs';
|
|
13
|
+
import './menu-root.mjs';
|
|
10
14
|
import './styles.mjs';
|
|
11
|
-
import 'tailwind-variants';
|
|
12
15
|
|
|
13
16
|
declare const useMenuConfig: () => MenuConfig.Props;
|
|
14
17
|
declare const MenuConfig: (props: Omit<Partial<MenuConfig.Props>, "children"> & {
|
package/dist/menu-config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b}from"./chunk-5DZZ6VC5.mjs";export{a as MenuConfig,b as useMenuConfig};
|
package/dist/menu-content.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-BDCGHIJW.mjs";import"./chunk-MFCNUSNC.mjs";import"./chunk-LSC54BQQ.mjs";import"./chunk-4QOOXBEL.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuContent};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
|
+
|
|
4
|
+
declare const MenuContent2: (props: MenuContent2.Props) => react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare namespace MenuContent2 {
|
|
6
|
+
interface Props extends HTMLMotionProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { MenuContent2 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-LSC54BQQ.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuContent2};
|
package/dist/menu-context.d.mts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { u as useMenu } from './menu-
|
|
2
|
+
import { u as useMenu } from './menu-BQP9o4yc.mjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '@floating-ui/react';
|
|
5
5
|
import '@jamsrui/utils';
|
|
6
|
-
import './menu-
|
|
6
|
+
import './menu-content2.mjs';
|
|
7
|
+
import 'motion/react';
|
|
7
8
|
import './menu-floating-context.mjs';
|
|
9
|
+
import './menu-group.mjs';
|
|
10
|
+
import './menu-group-label.mjs';
|
|
8
11
|
import './menu-item-inner.mjs';
|
|
12
|
+
import './menu-root.mjs';
|
|
9
13
|
import './styles.mjs';
|
|
10
|
-
import 'tailwind-variants';
|
|
11
14
|
|
|
12
15
|
declare const useMenuContext: () => MenuContext.Props;
|
|
13
16
|
declare const MenuContext: react.Context<MenuContext.Props | null>;
|
package/dist/menu-context.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b}from"./chunk-IP6JQ5TM.mjs";export{a as MenuContext,b as useMenuContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a,b}from"./chunk-4QOOXBEL.mjs";export{a as MenuFloatingContext,b as useMenuFloatingContext};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const MenuGroupLabel: (props: MenuGroupLabel.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace MenuGroupLabel {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { MenuGroupLabel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-DHAF5YKZ.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuGroupLabel};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const MenuGroup: (props: MenuGroup.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace MenuGroup {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { MenuGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-3TXNSYIT.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuGroup};
|
package/dist/menu-item-inner.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-W6Z5NYJV.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuItemInner};
|
package/dist/menu-item.d.mts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import '@jamsrui/utils';
|
|
3
|
-
export { a as MenuItem } from './menu-
|
|
3
|
+
export { a as MenuItem } from './menu-BQP9o4yc.mjs';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import '@floating-ui/react';
|
|
6
|
-
import './menu-
|
|
6
|
+
import './menu-content2.mjs';
|
|
7
|
+
import 'motion/react';
|
|
7
8
|
import './menu-floating-context.mjs';
|
|
9
|
+
import './menu-group.mjs';
|
|
10
|
+
import './menu-group-label.mjs';
|
|
8
11
|
import './menu-item-inner.mjs';
|
|
12
|
+
import './menu-root.mjs';
|
|
9
13
|
import './styles.mjs';
|
|
10
|
-
import 'tailwind-variants';
|
package/dist/menu-item.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-Z3M52LAZ.mjs";import"./chunk-W6Z5NYJV.mjs";import"./chunk-4QOOXBEL.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuItem};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare const useMenuRadioGroupContext: () => MenuRadioGroupContext.Props;
|
|
4
|
+
declare const MenuRadioGroupContext: react.Context<MenuRadioGroupContext.Props | null>;
|
|
5
|
+
declare namespace MenuRadioGroupContext {
|
|
6
|
+
interface Props {
|
|
7
|
+
isDisabled: boolean | undefined;
|
|
8
|
+
value: string;
|
|
9
|
+
setValue: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { MenuRadioGroupContext, useMenuRadioGroupContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-MCQCEY2U.mjs";export{a as MenuRadioGroupContext,b as useMenuRadioGroupContext};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const MenuRadioGroup: (props: MenuRadioGroup.Props) => react_jsx_runtime.JSX.Element;
|
|
4
|
+
declare namespace MenuRadioGroup {
|
|
5
|
+
interface Props {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { MenuRadioGroup };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-SNAXAYWZ.mjs";import"./chunk-MCQCEY2U.mjs";export{a as MenuRadioGroup};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as MenuItem } from './menu-BQP9o4yc.mjs';
|
|
3
|
+
import '@floating-ui/react';
|
|
4
|
+
import '@jamsrui/utils';
|
|
5
|
+
import 'react';
|
|
6
|
+
import './menu-content2.mjs';
|
|
7
|
+
import 'motion/react';
|
|
8
|
+
import './menu-floating-context.mjs';
|
|
9
|
+
import './menu-group.mjs';
|
|
10
|
+
import './menu-group-label.mjs';
|
|
11
|
+
import './menu-item-inner.mjs';
|
|
12
|
+
import './menu-root.mjs';
|
|
13
|
+
import './styles.mjs';
|
|
14
|
+
|
|
15
|
+
declare const MenuRadioItem: (props: MenuRadioItem.Props) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare namespace MenuRadioItem {
|
|
17
|
+
interface Props extends MenuItem.Props {
|
|
18
|
+
value: string;
|
|
19
|
+
tickPlacement?: "start" | "end";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { MenuRadioItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-EDFHOYYY.mjs";import"./chunk-MCQCEY2U.mjs";import"./chunk-Z3M52LAZ.mjs";import"./chunk-W6Z5NYJV.mjs";import"./chunk-4QOOXBEL.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuRadioItem};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
|
+
|
|
4
|
+
declare const MenuRoot: (props: MenuRoot.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
|
+
declare namespace MenuRoot {
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { MenuRoot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-MFCNUSNC.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuRoot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-WYIM2S4D.mjs";export{a as MenuSeparator};
|
package/dist/menu-trigger.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-A4ENIW42.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as MenuTrigger};
|
package/dist/menu.d.mts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
|
-
export { M as Menu } from './menu-
|
|
3
|
-
import 'react';
|
|
2
|
+
export { M as Menu } from './menu-BQP9o4yc.mjs';
|
|
4
3
|
import '@floating-ui/react';
|
|
5
4
|
import '@jamsrui/utils';
|
|
6
|
-
import '
|
|
5
|
+
import 'react';
|
|
6
|
+
import './menu-content2.mjs';
|
|
7
|
+
import 'motion/react';
|
|
7
8
|
import './menu-floating-context.mjs';
|
|
9
|
+
import './menu-group.mjs';
|
|
10
|
+
import './menu-group-label.mjs';
|
|
8
11
|
import './menu-item-inner.mjs';
|
|
12
|
+
import './menu-root.mjs';
|
|
9
13
|
import './styles.mjs';
|
|
10
|
-
import 'tailwind-variants';
|
package/dist/menu.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-4DRJMVOY.mjs";import"./chunk-6RHOGA5S.mjs";import"./chunk-VDALF5ID.mjs";import"./chunk-4QOOXBEL.mjs";import"./chunk-IP6JQ5TM.mjs";export{a as Menu};
|
package/dist/styles.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
2
|
import { VariantProps } from '@jamsrui/utils';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
declare const menuVariants: tailwind_variants.TVReturnType<{
|
|
4
|
+
declare const menuVariants: _jamsrui_utils.TVReturnType<{
|
|
6
5
|
radius: {
|
|
7
6
|
sm: {};
|
|
8
7
|
md: {};
|
|
@@ -48,8 +47,10 @@ declare const menuVariants: tailwind_variants.TVReturnType<{
|
|
|
48
47
|
arrow: string;
|
|
49
48
|
backdrop: string;
|
|
50
49
|
root: string;
|
|
51
|
-
content: string;
|
|
50
|
+
content: string[];
|
|
52
51
|
menuItem: string[];
|
|
52
|
+
menuGroup: string[];
|
|
53
|
+
menuGroupLabel: string;
|
|
53
54
|
menuItemInner: string;
|
|
54
55
|
}, undefined, {
|
|
55
56
|
radius: {
|
|
@@ -97,10 +98,12 @@ declare const menuVariants: tailwind_variants.TVReturnType<{
|
|
|
97
98
|
arrow: string;
|
|
98
99
|
backdrop: string;
|
|
99
100
|
root: string;
|
|
100
|
-
content: string;
|
|
101
|
+
content: string[];
|
|
101
102
|
menuItem: string[];
|
|
103
|
+
menuGroup: string[];
|
|
104
|
+
menuGroupLabel: string;
|
|
102
105
|
menuItemInner: string;
|
|
103
|
-
},
|
|
106
|
+
}, _jamsrui_utils.TVReturnType<{
|
|
104
107
|
radius: {
|
|
105
108
|
sm: {};
|
|
106
109
|
md: {};
|
|
@@ -146,11 +149,13 @@ declare const menuVariants: tailwind_variants.TVReturnType<{
|
|
|
146
149
|
arrow: string;
|
|
147
150
|
backdrop: string;
|
|
148
151
|
root: string;
|
|
149
|
-
content: string;
|
|
152
|
+
content: string[];
|
|
150
153
|
menuItem: string[];
|
|
154
|
+
menuGroup: string[];
|
|
155
|
+
menuGroupLabel: string;
|
|
151
156
|
menuItemInner: string;
|
|
152
157
|
}, undefined, unknown, unknown, undefined>>;
|
|
153
158
|
type MenuVariantProps = VariantProps<typeof menuVariants>;
|
|
154
159
|
type MenuSlots = keyof ReturnType<typeof menuVariants>;
|
|
155
160
|
|
|
156
|
-
export { type MenuSlots, type MenuVariantProps, menuVariants
|
|
161
|
+
export { type MenuSlots, type MenuVariantProps, menuVariants };
|
package/dist/styles.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-VDALF5ID.mjs";export{a as menuVariants};
|
package/dist/use-menu.d.mts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import 'react';
|
|
2
1
|
import '@floating-ui/react';
|
|
3
2
|
import '@jamsrui/utils';
|
|
4
|
-
import '
|
|
3
|
+
import 'react';
|
|
4
|
+
import './menu-content2.mjs';
|
|
5
5
|
import './menu-floating-context.mjs';
|
|
6
|
-
|
|
6
|
+
import './menu-group.mjs';
|
|
7
|
+
import './menu-group-label.mjs';
|
|
8
|
+
export { u as useMenu } from './menu-BQP9o4yc.mjs';
|
|
7
9
|
import './menu-item-inner.mjs';
|
|
10
|
+
import './menu-root.mjs';
|
|
8
11
|
import './styles.mjs';
|
|
9
12
|
import 'react/jsx-runtime';
|
|
10
|
-
import '
|
|
13
|
+
import 'motion/react';
|
package/dist/use-menu.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a}from"./chunk-6RHOGA5S.mjs";import"./chunk-VDALF5ID.mjs";import"./chunk-4QOOXBEL.mjs";export{a as useMenu};
|
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/menu",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
+
"motion": ">=12",
|
|
5
6
|
"react": ">=19"
|
|
6
7
|
},
|
|
7
8
|
"dependencies": {
|
|
8
9
|
"@floating-ui/react": ">=0.27",
|
|
9
|
-
"@jamsrui/
|
|
10
|
-
"@jamsrui/
|
|
11
|
-
"@jamsrui/
|
|
10
|
+
"@jamsrui/core": "^0.0.9",
|
|
11
|
+
"@jamsrui/hooks": "^0.0.10",
|
|
12
|
+
"@jamsrui/divider": "^0.0.10",
|
|
13
|
+
"@jamsrui/icons": "^0.0.9",
|
|
14
|
+
"@jamsrui/utils": "^0.0.10"
|
|
12
15
|
},
|
|
13
16
|
"exports": {
|
|
14
17
|
".": {
|
|
15
18
|
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/index.mjs"
|
|
17
|
-
"require": "./dist/index.js"
|
|
19
|
+
"import": "./dist/index.mjs"
|
|
18
20
|
}
|
|
19
21
|
},
|
|
20
22
|
"description": "A modern and beautiful Next.js UI components library.",
|