@bazza-ui/react 0.1.0-canary.15 → 0.1.0-canary.16

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.
Files changed (44) hide show
  1. package/dist/chunk-3HMQLMSF.js +2 -0
  2. package/dist/chunk-3HMQLMSF.js.map +1 -0
  3. package/dist/chunk-MPPIEWSL.js +2 -0
  4. package/dist/chunk-MPPIEWSL.js.map +1 -0
  5. package/dist/chunk-PCNHYMD6.cjs +2 -0
  6. package/dist/chunk-PCNHYMD6.cjs.map +1 -0
  7. package/dist/chunk-RTG6U56O.cjs +2 -0
  8. package/dist/chunk-RTG6U56O.cjs.map +1 -0
  9. package/dist/combobox/index.cjs +1 -1
  10. package/dist/combobox/index.cjs.map +1 -1
  11. package/dist/combobox/index.js +1 -1
  12. package/dist/combobox/index.js.map +1 -1
  13. package/dist/command-menu/index.cjs +1 -1
  14. package/dist/command-menu/index.cjs.map +1 -1
  15. package/dist/command-menu/index.js +1 -1
  16. package/dist/command-menu/index.js.map +1 -1
  17. package/dist/context-menu/index.cjs +1 -1
  18. package/dist/context-menu/index.cjs.map +1 -1
  19. package/dist/context-menu/index.js +1 -1
  20. package/dist/context-menu/index.js.map +1 -1
  21. package/dist/dropdown-menu/index.cjs +1 -1
  22. package/dist/dropdown-menu/index.cjs.map +1 -1
  23. package/dist/dropdown-menu/index.js +1 -1
  24. package/dist/dropdown-menu/index.js.map +1 -1
  25. package/dist/internal/popup-menu/index.cjs +1 -1
  26. package/dist/internal/popup-menu/index.cjs.map +1 -1
  27. package/dist/internal/popup-menu/index.js +1 -1
  28. package/dist/kbd/index.cjs +1 -1
  29. package/dist/kbd/index.cjs.map +1 -1
  30. package/dist/kbd/index.js +1 -1
  31. package/dist/kbd/index.js.map +1 -1
  32. package/dist/select/index.cjs +1 -1
  33. package/dist/select/index.cjs.map +1 -1
  34. package/dist/select/index.js +1 -1
  35. package/dist/select/index.js.map +1 -1
  36. package/dist/video-player/index.cjs +2 -2
  37. package/dist/video-player/index.cjs.map +1 -1
  38. package/dist/video-player/index.js +2 -2
  39. package/dist/video-player/index.js.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/chunk-BEWVWSAW.cjs +0 -2
  42. package/dist/chunk-BEWVWSAW.cjs.map +0 -1
  43. package/dist/chunk-EDZTZHQ4.js +0 -2
  44. package/dist/chunk-EDZTZHQ4.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkBEWVWSAWcjs = require('../chunk-BEWVWSAW.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var ge={};_chunkM4G6J7DPcjs.a.call(void 0, ge,{Backdrop:()=>se,CheckboxItem:()=>_chunkBEWVWSAWcjs.ha,CheckboxItemIndicator:()=>_chunkBEWVWSAWcjs.ia,Empty:()=>_chunkBEWVWSAWcjs.V,FocusZone:()=>_chunkBEWVWSAWcjs.pa,Footer:()=>_chunkBEWVWSAWcjs.qa,Group:()=>_chunkBEWVWSAWcjs.ra,GroupLabel:()=>_chunkBEWVWSAWcjs.X,Header:()=>_chunkBEWVWSAWcjs.ta,Icon:()=>_chunkBEWVWSAWcjs.U,Input:()=>de,Item:()=>_chunkBEWVWSAWcjs.ja,LinkItem:()=>_chunkBEWVWSAWcjs.ka,List:()=>_chunkBEWVWSAWcjs.ca,Loading:()=>_chunkBEWVWSAWcjs.da,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>_chunkBEWVWSAWcjs.ua,Shortcut:()=>_chunkBEWVWSAWcjs.va,Subpage:()=>Ce,SubpageBack:()=>_chunkBEWVWSAWcjs.Da,SubpageBackItem:()=>_chunkBEWVWSAWcjs.Ea,SubpageTrigger:()=>_chunkBEWVWSAWcjs.Fa,Surface:()=>_chunkBEWVWSAWcjs.ga,Trigger:()=>fe});var _dialog = require('@base-ui/react/dialog');var _react = require('react'); var y = _interopRequireWildcard(_react); var me = _interopRequireWildcard(_react); var s = _interopRequireWildcard(_react); var v = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Se = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=_chunkBEWVWSAWcjs.e.call(void 0, ),u=y.useCallback(m=>{_optionalChain([p, 'optionalCall', _2 => _2(m)]),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(_chunkXMZZ62VJcjs.a.outsidePress,m.nativeEvent)},[p,t]);return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.W,{ref:a,backspaceGoesBack:p,...r})});var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=_chunkBEWVWSAWcjs.d.call(void 0, ),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=_chunkBEWVWSAWcjs.r.call(void 0, {surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.f.Provider,{value:m,children:_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.k.Provider,{value:C,children:_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.z.Provider,{value:L,children:_jsxruntime.jsxs.call(void 0, _dialog.Dialog.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.J,{})]})})})})});var ce=_dialog.Dialog.Portal;function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=_chunkJFEVUUPCcjs.d.call(void 0, ),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=_optionalChain([a, 'optionalAccess', _3 => _3.enabled])!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!_optionalChain([i, 'optionalAccess', _4 => _4.allowInInput])&&Qe(n.target)||_e(n,t)&&(_optionalChain([i, 'optionalAccess', _5 => _5.preventDefault])!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=_chunkBEWVWSAWcjs.q.call(void 0, {onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(_nullishCoalesce(u, () => ("")),()=>f(!n.state.open,_chunkXMZZ62VJcjs.a.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),_optionalChain([n, 'access', _6 => _6.context, 'access', _7 => _7.onCloseComplete, 'optionalCall', _8 => _8()]),_optionalChain([n, 'access', _9 => _9.context, 'access', _10 => _10.onPopupCloseComplete, 'optionalCall', _11 => _11()])),_optionalChain([t, 'optionalCall', _12 => _12(l)])},[n,t]);return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.O,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:_jsxruntime.jsx.call(void 0, _dialog.Dialog.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return _jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.Ca,{closeRootOnEsc:o,...p,children:a})}var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=_chunkBEWVWSAWcjs.e.call(void 0, ),u=p||_optionalChain([t, 'optionalAccess', _13 => _13.disabled])||!1;return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});exports.CommandMenu = ge; exports.CommandMenuRadioGroupValue = _chunkBEWVWSAWcjs.ma; exports.DataListContext = _chunkBEWVWSAWcjs.C; exports.DataSurfaceContext = _chunkBEWVWSAWcjs.y; exports.defaultGetResolvedId = _chunkBEWVWSAWcjs.p; exports.defineRadioGroup = _chunkBEWVWSAWcjs.Y; exports.isDisplayGroupNode = _chunkBEWVWSAWcjs.Z; exports.isDisplayRadioGroupNode = _chunkBEWVWSAWcjs._; exports.isDisplayRowNode = _chunkBEWVWSAWcjs.aa; exports.isDisplaySeparatorNode = _chunkBEWVWSAWcjs.$; exports.isPopupMenuNode = _chunkBEWVWSAWcjs.o; exports.useAsyncMenuCoordinator = _chunkBEWVWSAWcjs.F; exports.useDataList = _chunkBEWVWSAWcjs.D; exports.useDataSurfaceContext = _chunkBEWVWSAWcjs.A; exports.useMaybeAsyncMenuCoordinator = _chunkBEWVWSAWcjs.G; exports.useMaybeDataList = _chunkBEWVWSAWcjs.E; exports.useMaybeDataSurfaceContext = _chunkBEWVWSAWcjs.B; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkJFEVUUPCcjs = require('../chunk-JFEVUUPC.cjs');var _chunkRTG6U56Ocjs = require('../chunk-RTG6U56O.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');require('../chunk-PCNHYMD6.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var ge={};_chunkM4G6J7DPcjs.a.call(void 0, ge,{Backdrop:()=>se,CheckboxItem:()=>_chunkRTG6U56Ocjs.ha,CheckboxItemIndicator:()=>_chunkRTG6U56Ocjs.ia,Empty:()=>_chunkRTG6U56Ocjs.V,FocusZone:()=>_chunkRTG6U56Ocjs.pa,Footer:()=>_chunkRTG6U56Ocjs.qa,Group:()=>_chunkRTG6U56Ocjs.ra,GroupLabel:()=>_chunkRTG6U56Ocjs.X,Header:()=>_chunkRTG6U56Ocjs.ta,Icon:()=>_chunkRTG6U56Ocjs.U,Input:()=>de,Item:()=>_chunkRTG6U56Ocjs.ja,LinkItem:()=>_chunkRTG6U56Ocjs.ka,List:()=>_chunkRTG6U56Ocjs.ca,Loading:()=>_chunkRTG6U56Ocjs.da,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>_chunkRTG6U56Ocjs.ua,Shortcut:()=>_chunkRTG6U56Ocjs.va,Subpage:()=>Ce,SubpageBack:()=>_chunkRTG6U56Ocjs.Da,SubpageBackItem:()=>_chunkRTG6U56Ocjs.Ea,SubpageTrigger:()=>_chunkRTG6U56Ocjs.Fa,Surface:()=>_chunkRTG6U56Ocjs.ga,Trigger:()=>fe});var _dialog = require('@base-ui/react/dialog');var _react = require('react'); var y = _interopRequireWildcard(_react); var me = _interopRequireWildcard(_react); var s = _interopRequireWildcard(_react); var v = _interopRequireWildcard(_react); var d = _interopRequireWildcard(_react); var Se = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=_chunkRTG6U56Ocjs.e.call(void 0, ),u=y.useCallback(m=>{_optionalChain([p, 'optionalCall', _2 => _2(m)]),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(_chunkXMZZ62VJcjs.a.outsidePress,m.nativeEvent)},[p,t]);return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return _jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.W,{ref:a,backspaceGoesBack:p,...r})});var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=_chunkRTG6U56Ocjs.d.call(void 0, ),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=_chunkRTG6U56Ocjs.r.call(void 0, {surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return _jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.f.Provider,{value:m,children:_jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.k.Provider,{value:C,children:_jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.z.Provider,{value:L,children:_jsxruntime.jsxs.call(void 0, _dialog.Dialog.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,_jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.J,{})]})})})})});var ce=_dialog.Dialog.Portal;function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=_chunkJFEVUUPCcjs.d.call(void 0, ),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>_chunkJFEVUUPCcjs.a.call(void 0, e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=_optionalChain([a, 'optionalAccess', _3 => _3.enabled])!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!_optionalChain([i, 'optionalAccess', _4 => _4.allowInInput])&&Qe(n.target)||_e(n,t)&&(_optionalChain([i, 'optionalAccess', _5 => _5.preventDefault])!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=_chunkRTG6U56Ocjs.q.call(void 0, {onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(_nullishCoalesce(u, () => ("")),()=>f(!n.state.open,_chunkXMZZ62VJcjs.a.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),_optionalChain([n, 'access', _6 => _6.context, 'access', _7 => _7.onCloseComplete, 'optionalCall', _8 => _8()]),_optionalChain([n, 'access', _9 => _9.context, 'access', _10 => _10.onPopupCloseComplete, 'optionalCall', _11 => _11()])),_optionalChain([t, 'optionalCall', _12 => _12(l)])},[n,t]);return _jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.O,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:_jsxruntime.jsx.call(void 0, _dialog.Dialog.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return _jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.Ca,{closeRootOnEsc:o,...p,children:a})}var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=_chunkRTG6U56Ocjs.e.call(void 0, ),u=p||_optionalChain([t, 'optionalAccess', _13 => _13.disabled])||!1;return _jsxruntime.jsx.call(void 0, _dialog.Dialog.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});exports.CommandMenu = ge; exports.CommandMenuRadioGroupValue = _chunkRTG6U56Ocjs.ma; exports.DataListContext = _chunkRTG6U56Ocjs.C; exports.DataSurfaceContext = _chunkRTG6U56Ocjs.y; exports.defaultGetResolvedId = _chunkRTG6U56Ocjs.p; exports.defineRadioGroup = _chunkRTG6U56Ocjs.Y; exports.isDisplayGroupNode = _chunkRTG6U56Ocjs.Z; exports.isDisplayRadioGroupNode = _chunkRTG6U56Ocjs._; exports.isDisplayRowNode = _chunkRTG6U56Ocjs.aa; exports.isDisplaySeparatorNode = _chunkRTG6U56Ocjs.$; exports.isPopupMenuNode = _chunkRTG6U56Ocjs.o; exports.useAsyncMenuCoordinator = _chunkRTG6U56Ocjs.F; exports.useDataList = _chunkRTG6U56Ocjs.D; exports.useDataSurfaceContext = _chunkRTG6U56Ocjs.A; exports.useMaybeAsyncMenuCoordinator = _chunkRTG6U56Ocjs.G; exports.useMaybeDataList = _chunkRTG6U56Ocjs.E; exports.useMaybeDataSurfaceContext = _chunkRTG6U56Ocjs.B; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","../../src/command-menu/index.parts.ts","../../src/command-menu/backdrop/backdrop.tsx","../../src/command-menu/input/input.tsx","../../src/command-menu/popup/popup.tsx","../../src/command-menu/portal/portal.tsx","../../src/command-menu/root/root.tsx","../../src/kbd/hooks/use-hotkey.ts","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx"],"names":["index_parts_exports","__export","CommandMenuBackdrop","PopupMenuCheckboxItem","PopupMenuCheckboxItemIndicator","PopupMenuEmpty","PopupMenuFocusZone","PopupMenuFooter","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuHeader","PopupMenuIcon","CommandMenuInput","PopupMenuItem","PopupMenuLinkItem","PopupMenuList","PopupMenuLoading","CommandMenuPopup","CommandMenuPortal","CommandMenuRoot","PopupMenuSeparator","PopupMenuShortcut","CommandMenuSubpage","PopupMenuSubpageBack","PopupMenuSubpageBackItem","PopupMenuSubpageTrigger","PopupMenuSurface","CommandMenuTrigger","props","forwardedRef","onPointerDown","rest","popupMenuContext","useMaybePopupMenuContext","handlePointerDown","event","reason_parts_exports","jsx","Dialog","backspaceGoesBack","PopupMenuInput","children","classNameProp","renderProp","surfaceId","usePopupMenuContext","subpageStackContextValue","isSubpageNavigating","hasOpenSubpage","subpageId","useSubpageStackState","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","className","render","popupProps","dataPopupContextValue","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","jsxs","DataSubpagesContent","isEditableTarget","target","getEventKey","key","matchesModifiers","chord","isApple","isApplePlatform","meta","ctrl","matchesChord","useHotkey","keys","handler","options","keybinding","parseKeybinding","firstChord","isSequence","enabled","handlerRef","optionsRef","handleKeyDown","currentOptions","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","hotkey","modal","disabled","getResolvedId","idScope","store","focusOwnerStore","openChainStore","registerSurface","closeAll","handleOpenChange","menuDisabled","menuTreeResolver","usePopupMenuRoot","openState","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","PopupMenuProviders","closeRootOnEsc","PopupMenuSubpage","isDisabled"],"mappings":"AAAA,4/BAAkD,yDAA8Y,yDAA0D,yDAA2C,ICAriBA,EAAAA,CAAA,CAAA,CAAA,CAAAC,iCAAAA,EAAAD,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAAE,EAAAA,CAAA,YAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,qBAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,mBAAAA,CAAA,SAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,EAAAC,oBA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AAgBD,CAAAA,CAAiB,GAAGnF,CAAAA,CACnD,QAAA,CAAAU,CAAAA,CACH,CAEJ,CClBA,IAUad,EAAAA,CAA2B,EAAA,CAAA,UAAA,CAGtC,QAAA,CAA4BC,CAAAA,CAAOC,CAAAA,CAAc,CACjD,GAAM,CAAE,QAAA,CAAAmE,CAAAA,CAAU,GAAGjE,CAAK,CAAA,CAAIH,CAAAA,CACxBI,CAAAA,CAAmBC,iCAAAA,CAAyB,CAC5CmF,CAAAA,CAAapB,CAAAA,kBAAYhE,CAAAA,+BAAkB,UAAA,EAAY,CAAA,CAAA,CAE7D,OACEK,6BAAAA,cAACC,CAAO,OAAA,CAAP,CACC,GAAA,CAAKT,CAAAA,CACJ,GAAGE,CAAAA,CACJ,QAAA,CAAUqF,CAAAA,CACV,2BAAA,CAA0B,EAAA,CAC5B,CAEJ,CAAC,CAAA,CAAA,47BAAA","file":"/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","sourcesContent":[null,"// ============================================================================\n// Command Menu Parts\n// ============================================================================\n\n// Pure aliases of the canonical resolved-node model (ADR-0001): narrow the\n// alias if a family ever needs to diverge — never edit the canonical type.\nexport type {\n NodeDef,\n PopupMenuNode as Node,\n} from '../internal/popup-menu/index.js'\n\nexport {\n PopupMenuCheckboxItem as CheckboxItem,\n PopupMenuCheckboxItemIndicator as CheckboxItemIndicator,\n PopupMenuEmpty as Empty,\n PopupMenuFocusZone as FocusZone,\n PopupMenuFooter as Footer,\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n PopupMenuHeader as Header,\n PopupMenuIcon as Icon,\n PopupMenuItem as Item,\n PopupMenuLinkItem as LinkItem,\n PopupMenuList as List,\n PopupMenuLoading as Loading,\n PopupMenuSeparator as Separator,\n PopupMenuShortcut as Shortcut,\n PopupMenuSubpageBack as SubpageBack,\n PopupMenuSubpageBackItem as SubpageBackItem,\n PopupMenuSubpageTrigger as SubpageTrigger,\n PopupMenuSurface as Surface,\n} from '../internal/popup-menu/index.js'\nexport { CommandMenuBackdrop as Backdrop } from './backdrop/backdrop.js'\nexport { CommandMenuInput as Input } from './input/input.js'\nexport { CommandMenuPopup as Popup } from './popup/popup.js'\nexport { CommandMenuPortal as Portal } from './portal/portal.js'\nexport { CommandMenuRoot as Root } from './root/root.js'\nexport { CommandMenuSubpage as Subpage } from './subpage/subpage.js'\nexport { CommandMenuTrigger as Trigger } from './trigger/trigger.js'\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}\nexport type CommandMenuBackdropState = Dialog.Backdrop.State\n\n/**\n * An overlay displayed beneath the command menu popup.\n *\n * Pressing down on the backdrop closes the menu immediately (pointerdown),\n * matching the outside-press behavior of the other menus, instead of waiting\n * for the Dialog's click-time dismissal. Consumers can opt out by calling\n * `event.preventDefault()` in their own `onPointerDown`.\n */\nexport const CommandMenuBackdrop = React.forwardRef<\n HTMLDivElement,\n CommandMenuBackdrop.Props\n>(function CommandMenuBackdrop(props, forwardedRef) {\n const { onPointerDown, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n\n const handlePointerDown = React.useCallback<\n NonNullable<Dialog.Backdrop.Props['onPointerDown']>\n >(\n (event) => {\n onPointerDown?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n if (popupMenuContext && !popupMenuContext.disabled) {\n popupMenuContext.closeAll(REASONS.outsidePress, event.nativeEvent)\n }\n },\n [onPointerDown, popupMenuContext],\n )\n\n return (\n <Dialog.Backdrop\n ref={forwardedRef}\n {...rest}\n onPointerDown={handlePointerDown}\n data-command-menu-backdrop=\"\"\n />\n )\n})\n\nexport namespace CommandMenuBackdrop {\n export interface Props extends CommandMenuBackdropProps {}\n export type State = CommandMenuBackdropState\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuInput,\n type PopupMenuInputProps,\n type PopupMenuInputState,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuInputProps extends PopupMenuInputProps {}\nexport type CommandMenuInputState = PopupMenuInputState\n\n/**\n * Search input for filtering command menu items.\n */\nexport const CommandMenuInput = React.forwardRef<\n HTMLInputElement,\n CommandMenuInput.Props\n>(function CommandMenuInput(props, forwardedRef) {\n const { backspaceGoesBack = true, ...rest } = props\n\n return (\n <PopupMenuInput\n ref={forwardedRef}\n backspaceGoesBack={backspaceGoesBack}\n {...rest}\n />\n )\n})\n\nexport namespace CommandMenuInput {\n export interface Props extends CommandMenuInputProps {}\n export type State = CommandMenuInputState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { PopupSurfaceIdContext } from '../../internal/popup-menu/contexts/popup-surface-id-context.js'\nimport { SubpageStackContext } from '../../internal/popup-menu/contexts/subpage-stack-context.js'\nimport {\n DataPopupContext,\n type DataSurfaceContextValue,\n type ResolvedNodesSlot,\n} from '../../internal/popup-menu/data-first/context.js'\nimport { DataSubpagesContent } from '../../internal/popup-menu/data-first/data-subpages.js'\nimport { useSubpageStackState } from '../../internal/popup-menu/hooks/use-subpage-stack-state.js'\nimport { usePopupMenuContext } from '../../internal/popup-menu/index.js'\nimport type { ComponentRenderFn } from '../../utils/types.js'\n\nexport interface CommandMenuPopupState extends Dialog.Popup.State {\n /**\n * Whether any non-root subpage is currently open.\n */\n hasOpenSubpage: boolean\n\n /**\n * Active subpage ID, or null when the root surface is active.\n */\n subpageId: string | null\n}\n\nexport interface CommandMenuPopupProps\n extends Omit<Dialog.Popup.Props, 'className' | 'render'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: CommandMenuPopupState) => string)\n\n /**\n * Allows replacing the popup element with a custom element.\n * The render state includes dialog popup + subpage navigation state.\n */\n render?:\n | React.ReactElement\n | ComponentRenderFn<\n React.HTMLAttributes<HTMLElement>,\n CommandMenuPopupState\n >\n}\n\n/**\n * A container for the command menu contents.\n * Wraps Dialog.Popup with popup-menu subpage and data providers.\n */\nexport const CommandMenuPopup = React.forwardRef<\n HTMLDivElement,\n CommandMenuPopup.Props\n>(function CommandMenuPopup(props, forwardedRef) {\n const {\n children,\n className: classNameProp,\n render: renderProp,\n ...rest\n } = props\n\n const surfaceId = React.useId()\n const popupMenuContext = usePopupMenuContext()\n\n const {\n subpageStackContextValue,\n isSubpageNavigating,\n hasOpenSubpage,\n subpageId,\n } = useSubpageStackState({\n surfaceId,\n store: popupMenuContext.store,\n })\n\n const [dataSurfaceContext, setDataSurfaceContext] =\n React.useState<DataSurfaceContextValue | null>(null)\n const [resolvedNodes, setResolvedNodes] =\n React.useState<ResolvedNodesSlot | null>(null)\n\n const toPopupState = React.useCallback(\n (baseState: Dialog.Popup.State): CommandMenuPopupState => ({\n ...baseState,\n hasOpenSubpage,\n subpageId,\n }),\n [hasOpenSubpage, subpageId],\n )\n\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: Dialog.Popup.State) => {\n return classNameProp(toPopupState(baseState))\n }\n }\n return classNameProp\n }, [classNameProp, toPopupState])\n\n const render = React.useMemo(() => {\n if (typeof renderProp === 'function') {\n return (\n popupProps: React.HTMLAttributes<HTMLElement>,\n baseState: Dialog.Popup.State,\n ) => renderProp(popupProps, toPopupState(baseState))\n }\n\n return renderProp\n }, [renderProp, toPopupState])\n\n const dataPopupContextValue = React.useMemo(\n () => ({\n dataSurfaceContext,\n setDataSurfaceContext,\n resolvedNodes,\n setResolvedNodes,\n }),\n [dataSurfaceContext, resolvedNodes],\n )\n\n return (\n <PopupSurfaceIdContext.Provider value={surfaceId}>\n <SubpageStackContext.Provider value={subpageStackContextValue}>\n <DataPopupContext.Provider value={dataPopupContextValue}>\n <Dialog.Popup\n ref={forwardedRef}\n className={className}\n render={render}\n data-command-menu-popup=\"\"\n data-navigating={isSubpageNavigating ? '' : undefined}\n data-has-open-subpage={hasOpenSubpage ? '' : undefined}\n {...rest}\n >\n {children}\n <DataSubpagesContent />\n </Dialog.Popup>\n </DataPopupContext.Provider>\n </SubpageStackContext.Provider>\n </PopupSurfaceIdContext.Provider>\n )\n})\n\nexport namespace CommandMenuPopup {\n export type Props = CommandMenuPopupProps\n export type State = CommandMenuPopupState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\n\nexport interface CommandMenuPortalProps extends Dialog.Portal.Props {}\nexport type CommandMenuPortalState = Dialog.Portal.State\n\n/**\n * A portal element that moves the command menu popup to a different part of the DOM.\n */\nexport const CommandMenuPortal = Dialog.Portal\n\nexport namespace CommandMenuPortal {\n export type Props = CommandMenuPortalProps\n export type State = CommandMenuPortalState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport type { PopupMenuOpenChangeReason } from '../../internal/popup-menu/events.js'\nimport {\n type GetResolvedIdFn,\n type PopupMenuIdScope,\n PopupMenuProviders,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport { useHotkey } from '../../kbd/hooks/use-hotkey.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuRootProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n onOpenChangeComplete?: (open: boolean) => void\n hotkey?: string\n modal?: boolean\n disabled?: boolean\n /**\n * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).\n * @default encoded surface Definition Path joined with `/`; `idScope=\"menu\"` uses the Definition Key\n * Read once when the menu root mounts — later changes have no effect. To retain the old dot-path default, use `node => node.def.id ?? node.definitionPath.join('.')`. This does not recreate former tree-item ancestry; exact compatibility requires walking `node.parent` and reproducing the old slug/key lineage.\n * @example\n * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />\n */\n getResolvedId?: GetResolvedIdFn\n /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */\n idScope?: PopupMenuIdScope\n}\n\n/**\n * Groups all parts of the command menu.\n * Manages open state and provides popup-menu context to children.\n * Doesn't render its own HTML element.\n */\nexport function CommandMenuRoot(props: CommandMenuRoot.Props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n hotkey,\n modal = true,\n disabled,\n getResolvedId,\n idScope = 'surface',\n } = props\n\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n handleOpenChange,\n disabled: menuDisabled,\n menuTreeResolver,\n } = usePopupMenuRoot({\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n disabled,\n closeOnOutsidePress: 'pointerdown',\n getResolvedId,\n idScope,\n })\n\n store.useControlledProp('openProp', openProp)\n\n const openState = store.useState('open')\n\n useHotkey(\n hotkey ?? '',\n () => handleOpenChange(!store.state.open, REASONS.imperativeAction),\n // allowInInput keeps the hotkey working as a *toggle*: while the menu is\n // open, focus sits in the search input, so the close press must be allowed\n // to fire from an editable target.\n { enabled: !!hotkey && !menuDisabled, allowInInput: true },\n )\n\n const handleDialogOpenChange = React.useCallback(\n (nextOpen: boolean, dialogDetails: Dialog.Root.ChangeEventDetails) => {\n handleOpenChange(\n nextOpen,\n dialogDetails.reason as PopupMenuOpenChangeReason,\n dialogDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n const handleDialogOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && store.context.clearSearchOnClose === 'after-exit') {\n store.clearSearch()\n store.setInputActive(false)\n }\n\n if (!nextOpen) {\n store.clearHighlight()\n store.context.onCloseComplete?.()\n store.context.onPopupCloseComplete?.()\n }\n\n onOpenChangeComplete?.(nextOpen)\n },\n [store, onOpenChangeComplete],\n )\n\n return (\n <PopupMenuProviders\n menuTreeResolver={menuTreeResolver}\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n explicitTabBehavior\n tabWithoutZones=\"inert\"\n registerSurface={registerSurface}\n menuType=\"dropdown\"\n closeOnOutsidePress=\"pointerdown\"\n componentName=\"command-menu\"\n >\n <Dialog.Root\n open={openState}\n onOpenChange={handleDialogOpenChange}\n onOpenChangeComplete={handleDialogOpenChangeComplete}\n modal={modal}\n >\n {children}\n </Dialog.Root>\n </PopupMenuProviders>\n )\n}\n\nexport namespace CommandMenuRoot {\n export interface Props extends CommandMenuRootProps {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { KeyChord } from '../utils/parse-keybinding.js'\nimport { parseKeybinding } from '../utils/parse-keybinding.js'\nimport { isApplePlatform } from '../utils/platform.js'\n\n/**\n * Options for the useHotkey global keydown listener.\n *\n * @internal Not part of the public API — used by CommandMenu's `hotkey` prop.\n */\nexport interface UseHotkeyOptions {\n /** @default true */\n enabled?: boolean\n /** @default true */\n preventDefault?: boolean\n /** Fire even when focus is in an input/textarea/select/contenteditable. @default false */\n allowInInput?: boolean\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n )\n}\n\nfunction getEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n\n return key === ' ' ? 'space' : key\n}\n\nfunction matchesModifiers(event: KeyboardEvent, chord: KeyChord): boolean {\n const isApple = isApplePlatform()\n const meta = chord.meta || (isApple && chord.mod)\n const ctrl = chord.ctrl || (!isApple && chord.mod)\n\n return (\n event.metaKey === meta &&\n event.ctrlKey === ctrl &&\n event.altKey === chord.alt &&\n event.shiftKey === chord.shift\n )\n}\n\nfunction matchesChord(event: KeyboardEvent, chord: KeyChord): boolean {\n return chord.key === getEventKey(event) && matchesModifiers(event, chord)\n}\n\n/**\n * Calls a handler when a single-chord keybinding is pressed anywhere in the\n * document.\n *\n * @internal Not part of the public API. Deliberately unexported from\n * `kbd/index.ts` — consumers get global-shortcut behavior through\n * `CommandMenu.Root`'s `hotkey` prop instead. Import via the file path if\n * another primitive needs it.\n */\nexport function useHotkey(\n keys: string,\n handler: (event: KeyboardEvent) => void,\n options?: UseHotkeyOptions,\n): void {\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n const [firstChord] = keybinding.chords\n const chord =\n keybinding.chords.length === 1 && firstChord !== undefined\n ? firstChord\n : null\n const isSequence = keybinding.chords.length > 1\n const enabled = options?.enabled !== false\n\n const handlerRef = React.useRef(handler)\n const optionsRef = React.useRef(options)\n\n handlerRef.current = handler\n optionsRef.current = options\n\n React.useEffect(() => {\n if (isSequence && process.env.NODE_ENV !== 'production') {\n console.warn(\n `useHotkey only supports single-chord keybindings. Received \"${keys}\", but sequences are not supported by useHotkey.`,\n )\n }\n }, [isSequence, keys])\n\n React.useEffect(() => {\n if (!enabled || chord === null || isSequence || chord.key === null) {\n return\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const currentOptions = optionsRef.current\n\n if (event.repeat) {\n return\n }\n\n if (!currentOptions?.allowInInput && isEditableTarget(event.target)) {\n return\n }\n\n if (!matchesChord(event, chord)) {\n return\n }\n\n if (currentOptions?.preventDefault !== false) {\n event.preventDefault()\n }\n\n handlerRef.current(event)\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [chord, enabled, isSequence])\n}\n","'use client'\n\nimport {\n PopupMenuSubpage,\n type PopupMenuSubpageProps,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}\n\n/**\n * Groups all parts of a command menu subpage.\n */\nexport function CommandMenuSubpage(props: CommandMenuSubpage.Props) {\n const { closeRootOnEsc = true, children, ...rest } = props\n\n return (\n <PopupMenuSubpage closeRootOnEsc={closeRootOnEsc} {...rest}>\n {children}\n </PopupMenuSubpage>\n )\n}\n\nexport namespace CommandMenuSubpage {\n export interface Props extends CommandMenuSubpageProps {}\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\n\nexport interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}\nexport type CommandMenuTriggerState = Dialog.Trigger.State\n\n/**\n * A button that opens the command menu.\n */\nexport const CommandMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n CommandMenuTrigger.Props\n>(function CommandMenuTrigger(props, forwardedRef) {\n const { disabled, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n const isDisabled = disabled || popupMenuContext?.disabled || false\n\n return (\n <Dialog.Trigger\n ref={forwardedRef}\n {...rest}\n disabled={isDisabled}\n data-command-menu-trigger=\"\"\n />\n )\n})\n\nexport namespace CommandMenuTrigger {\n export interface Props extends CommandMenuTriggerProps {}\n export type State = CommandMenuTriggerState\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","../../src/command-menu/index.parts.ts","../../src/command-menu/backdrop/backdrop.tsx","../../src/command-menu/input/input.tsx","../../src/command-menu/popup/popup.tsx","../../src/command-menu/portal/portal.tsx","../../src/command-menu/root/root.tsx","../../src/kbd/hooks/use-hotkey.ts","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx"],"names":["index_parts_exports","__export","CommandMenuBackdrop","PopupMenuCheckboxItem","PopupMenuCheckboxItemIndicator","PopupMenuEmpty","PopupMenuFocusZone","PopupMenuFooter","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuHeader","PopupMenuIcon","CommandMenuInput","PopupMenuItem","PopupMenuLinkItem","PopupMenuList","PopupMenuLoading","CommandMenuPopup","CommandMenuPortal","CommandMenuRoot","PopupMenuSeparator","PopupMenuShortcut","CommandMenuSubpage","PopupMenuSubpageBack","PopupMenuSubpageBackItem","PopupMenuSubpageTrigger","PopupMenuSurface","CommandMenuTrigger","props","forwardedRef","onPointerDown","rest","popupMenuContext","useMaybePopupMenuContext","handlePointerDown","event","reason_parts_exports","jsx","Dialog","backspaceGoesBack","PopupMenuInput","children","classNameProp","renderProp","surfaceId","usePopupMenuContext","subpageStackContextValue","isSubpageNavigating","hasOpenSubpage","subpageId","useSubpageStackState","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","className","render","popupProps","dataPopupContextValue","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","jsxs","DataSubpagesContent","isEditableTarget","target","getEventKey","key","matchesModifiers","chord","isApple","isApplePlatform","meta","ctrl","matchesChord","useHotkey","keys","handler","options","keybinding","parseKeybinding","firstChord","isSequence","enabled","handlerRef","optionsRef","handleKeyDown","currentOptions","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","hotkey","modal","disabled","getResolvedId","idScope","store","focusOwnerStore","openChainStore","registerSurface","closeAll","handleOpenChange","menuDisabled","menuTreeResolver","usePopupMenuRoot","openState","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","PopupMenuProviders","closeRootOnEsc","PopupMenuSubpage","isDisabled"],"mappings":"AAAA,4/BAAkD,yDAA8Y,yDAA0D,iCAA8B,yDAA2C,ICAnkBA,EAAAA,CAAA,CAAA,CAAA,CAAAC,iCAAAA,EAAAD,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAAE,EAAAA,CAAA,YAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,qBAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,mBAAAA,CAAA,SAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,UAAA,CAAA,CAAA,CAAA,EAAAC,mBAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,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,QAAA,CAA4BC,CAAAA,CAAOC,CAAAA,CAAc,CACjD,GAAM,CAAE,QAAA,CAAAmE,CAAAA,CAAU,GAAGjE,CAAK,CAAA,CAAIH,CAAAA,CACxBI,CAAAA,CAAmBC,iCAAAA,CAAyB,CAC5CmF,CAAAA,CAAapB,CAAAA,kBAAYhE,CAAAA,+BAAkB,UAAA,EAAY,CAAA,CAAA,CAE7D,OACEK,6BAAAA,cAACC,CAAO,OAAA,CAAP,CACC,GAAA,CAAKT,CAAAA,CACJ,GAAGE,CAAAA,CACJ,QAAA,CAAUqF,CAAAA,CACV,2BAAA,CAA0B,EAAA,CAC5B,CAEJ,CAAC,CAAA,CAAA,47BAAA","file":"/home/runner/work/ui/ui/packages/react/dist/command-menu/index.cjs","sourcesContent":[null,"// ============================================================================\n// Command Menu Parts\n// ============================================================================\n\n// Pure aliases of the canonical resolved-node model (ADR-0001): narrow the\n// alias if a family ever needs to diverge — never edit the canonical type.\nexport type {\n NodeDef,\n PopupMenuNode as Node,\n} from '../internal/popup-menu/index.js'\n\nexport {\n PopupMenuCheckboxItem as CheckboxItem,\n PopupMenuCheckboxItemIndicator as CheckboxItemIndicator,\n PopupMenuEmpty as Empty,\n PopupMenuFocusZone as FocusZone,\n PopupMenuFooter as Footer,\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n PopupMenuHeader as Header,\n PopupMenuIcon as Icon,\n PopupMenuItem as Item,\n PopupMenuLinkItem as LinkItem,\n PopupMenuList as List,\n PopupMenuLoading as Loading,\n PopupMenuSeparator as Separator,\n PopupMenuShortcut as Shortcut,\n PopupMenuSubpageBack as SubpageBack,\n PopupMenuSubpageBackItem as SubpageBackItem,\n PopupMenuSubpageTrigger as SubpageTrigger,\n PopupMenuSurface as Surface,\n} from '../internal/popup-menu/index.js'\nexport { CommandMenuBackdrop as Backdrop } from './backdrop/backdrop.js'\nexport { CommandMenuInput as Input } from './input/input.js'\nexport { CommandMenuPopup as Popup } from './popup/popup.js'\nexport { CommandMenuPortal as Portal } from './portal/portal.js'\nexport { CommandMenuRoot as Root } from './root/root.js'\nexport { CommandMenuSubpage as Subpage } from './subpage/subpage.js'\nexport { CommandMenuTrigger as Trigger } from './trigger/trigger.js'\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}\nexport type CommandMenuBackdropState = Dialog.Backdrop.State\n\n/**\n * An overlay displayed beneath the command menu popup.\n *\n * Pressing down on the backdrop closes the menu immediately (pointerdown),\n * matching the outside-press behavior of the other menus, instead of waiting\n * for the Dialog's click-time dismissal. Consumers can opt out by calling\n * `event.preventDefault()` in their own `onPointerDown`.\n */\nexport const CommandMenuBackdrop = React.forwardRef<\n HTMLDivElement,\n CommandMenuBackdrop.Props\n>(function CommandMenuBackdrop(props, forwardedRef) {\n const { onPointerDown, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n\n const handlePointerDown = React.useCallback<\n NonNullable<Dialog.Backdrop.Props['onPointerDown']>\n >(\n (event) => {\n onPointerDown?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n if (popupMenuContext && !popupMenuContext.disabled) {\n popupMenuContext.closeAll(REASONS.outsidePress, event.nativeEvent)\n }\n },\n [onPointerDown, popupMenuContext],\n )\n\n return (\n <Dialog.Backdrop\n ref={forwardedRef}\n {...rest}\n onPointerDown={handlePointerDown}\n data-command-menu-backdrop=\"\"\n />\n )\n})\n\nexport namespace CommandMenuBackdrop {\n export interface Props extends CommandMenuBackdropProps {}\n export type State = CommandMenuBackdropState\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuInput,\n type PopupMenuInputProps,\n type PopupMenuInputState,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuInputProps extends PopupMenuInputProps {}\nexport type CommandMenuInputState = PopupMenuInputState\n\n/**\n * Search input for filtering command menu items.\n */\nexport const CommandMenuInput = React.forwardRef<\n HTMLInputElement,\n CommandMenuInput.Props\n>(function CommandMenuInput(props, forwardedRef) {\n const { backspaceGoesBack = true, ...rest } = props\n\n return (\n <PopupMenuInput\n ref={forwardedRef}\n backspaceGoesBack={backspaceGoesBack}\n {...rest}\n />\n )\n})\n\nexport namespace CommandMenuInput {\n export interface Props extends CommandMenuInputProps {}\n export type State = CommandMenuInputState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { PopupSurfaceIdContext } from '../../internal/popup-menu/contexts/popup-surface-id-context.js'\nimport { SubpageStackContext } from '../../internal/popup-menu/contexts/subpage-stack-context.js'\nimport {\n DataPopupContext,\n type DataSurfaceContextValue,\n type ResolvedNodesSlot,\n} from '../../internal/popup-menu/data-first/context.js'\nimport { DataSubpagesContent } from '../../internal/popup-menu/data-first/data-subpages.js'\nimport { useSubpageStackState } from '../../internal/popup-menu/hooks/use-subpage-stack-state.js'\nimport { usePopupMenuContext } from '../../internal/popup-menu/index.js'\nimport type { ComponentRenderFn } from '../../utils/types.js'\n\nexport interface CommandMenuPopupState extends Dialog.Popup.State {\n /**\n * Whether any non-root subpage is currently open.\n */\n hasOpenSubpage: boolean\n\n /**\n * Active subpage ID, or null when the root surface is active.\n */\n subpageId: string | null\n}\n\nexport interface CommandMenuPopupProps\n extends Omit<Dialog.Popup.Props, 'className' | 'render'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: CommandMenuPopupState) => string)\n\n /**\n * Allows replacing the popup element with a custom element.\n * The render state includes dialog popup + subpage navigation state.\n */\n render?:\n | React.ReactElement\n | ComponentRenderFn<\n React.HTMLAttributes<HTMLElement>,\n CommandMenuPopupState\n >\n}\n\n/**\n * A container for the command menu contents.\n * Wraps Dialog.Popup with popup-menu subpage and data providers.\n */\nexport const CommandMenuPopup = React.forwardRef<\n HTMLDivElement,\n CommandMenuPopup.Props\n>(function CommandMenuPopup(props, forwardedRef) {\n const {\n children,\n className: classNameProp,\n render: renderProp,\n ...rest\n } = props\n\n const surfaceId = React.useId()\n const popupMenuContext = usePopupMenuContext()\n\n const {\n subpageStackContextValue,\n isSubpageNavigating,\n hasOpenSubpage,\n subpageId,\n } = useSubpageStackState({\n surfaceId,\n store: popupMenuContext.store,\n })\n\n const [dataSurfaceContext, setDataSurfaceContext] =\n React.useState<DataSurfaceContextValue | null>(null)\n const [resolvedNodes, setResolvedNodes] =\n React.useState<ResolvedNodesSlot | null>(null)\n\n const toPopupState = React.useCallback(\n (baseState: Dialog.Popup.State): CommandMenuPopupState => ({\n ...baseState,\n hasOpenSubpage,\n subpageId,\n }),\n [hasOpenSubpage, subpageId],\n )\n\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: Dialog.Popup.State) => {\n return classNameProp(toPopupState(baseState))\n }\n }\n return classNameProp\n }, [classNameProp, toPopupState])\n\n const render = React.useMemo(() => {\n if (typeof renderProp === 'function') {\n return (\n popupProps: React.HTMLAttributes<HTMLElement>,\n baseState: Dialog.Popup.State,\n ) => renderProp(popupProps, toPopupState(baseState))\n }\n\n return renderProp\n }, [renderProp, toPopupState])\n\n const dataPopupContextValue = React.useMemo(\n () => ({\n dataSurfaceContext,\n setDataSurfaceContext,\n resolvedNodes,\n setResolvedNodes,\n }),\n [dataSurfaceContext, resolvedNodes],\n )\n\n return (\n <PopupSurfaceIdContext.Provider value={surfaceId}>\n <SubpageStackContext.Provider value={subpageStackContextValue}>\n <DataPopupContext.Provider value={dataPopupContextValue}>\n <Dialog.Popup\n ref={forwardedRef}\n className={className}\n render={render}\n data-command-menu-popup=\"\"\n data-navigating={isSubpageNavigating ? '' : undefined}\n data-has-open-subpage={hasOpenSubpage ? '' : undefined}\n {...rest}\n >\n {children}\n <DataSubpagesContent />\n </Dialog.Popup>\n </DataPopupContext.Provider>\n </SubpageStackContext.Provider>\n </PopupSurfaceIdContext.Provider>\n )\n})\n\nexport namespace CommandMenuPopup {\n export type Props = CommandMenuPopupProps\n export type State = CommandMenuPopupState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\n\nexport interface CommandMenuPortalProps extends Dialog.Portal.Props {}\nexport type CommandMenuPortalState = Dialog.Portal.State\n\n/**\n * A portal element that moves the command menu popup to a different part of the DOM.\n */\nexport const CommandMenuPortal = Dialog.Portal\n\nexport namespace CommandMenuPortal {\n export type Props = CommandMenuPortalProps\n export type State = CommandMenuPortalState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport type { PopupMenuOpenChangeReason } from '../../internal/popup-menu/events.js'\nimport {\n type GetResolvedIdFn,\n type PopupMenuIdScope,\n PopupMenuProviders,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport { useHotkey } from '../../kbd/hooks/use-hotkey.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuRootProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n onOpenChangeComplete?: (open: boolean) => void\n hotkey?: string\n modal?: boolean\n disabled?: boolean\n /**\n * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).\n * @default encoded surface Definition Path joined with `/`; `idScope=\"menu\"` uses the Definition Key\n * Read once when the menu root mounts — later changes have no effect. To retain the old dot-path default, use `node => node.def.id ?? node.definitionPath.join('.')`. This does not recreate former tree-item ancestry; exact compatibility requires walking `node.parent` and reproducing the old slug/key lineage.\n * @example\n * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />\n */\n getResolvedId?: GetResolvedIdFn\n /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */\n idScope?: PopupMenuIdScope\n}\n\n/**\n * Groups all parts of the command menu.\n * Manages open state and provides popup-menu context to children.\n * Doesn't render its own HTML element.\n */\nexport function CommandMenuRoot(props: CommandMenuRoot.Props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n hotkey,\n modal = true,\n disabled,\n getResolvedId,\n idScope = 'surface',\n } = props\n\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n handleOpenChange,\n disabled: menuDisabled,\n menuTreeResolver,\n } = usePopupMenuRoot({\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n disabled,\n closeOnOutsidePress: 'pointerdown',\n getResolvedId,\n idScope,\n })\n\n store.useControlledProp('openProp', openProp)\n\n const openState = store.useState('open')\n\n useHotkey(\n hotkey ?? '',\n () => handleOpenChange(!store.state.open, REASONS.imperativeAction),\n // allowInInput keeps the hotkey working as a *toggle*: while the menu is\n // open, focus sits in the search input, so the close press must be allowed\n // to fire from an editable target.\n { enabled: !!hotkey && !menuDisabled, allowInInput: true },\n )\n\n const handleDialogOpenChange = React.useCallback(\n (nextOpen: boolean, dialogDetails: Dialog.Root.ChangeEventDetails) => {\n handleOpenChange(\n nextOpen,\n dialogDetails.reason as PopupMenuOpenChangeReason,\n dialogDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n const handleDialogOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && store.context.clearSearchOnClose === 'after-exit') {\n store.clearSearch()\n store.setInputActive(false)\n }\n\n if (!nextOpen) {\n store.clearHighlight()\n store.context.onCloseComplete?.()\n store.context.onPopupCloseComplete?.()\n }\n\n onOpenChangeComplete?.(nextOpen)\n },\n [store, onOpenChangeComplete],\n )\n\n return (\n <PopupMenuProviders\n menuTreeResolver={menuTreeResolver}\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n explicitTabBehavior\n tabWithoutZones=\"inert\"\n registerSurface={registerSurface}\n menuType=\"dropdown\"\n closeOnOutsidePress=\"pointerdown\"\n componentName=\"command-menu\"\n >\n <Dialog.Root\n open={openState}\n onOpenChange={handleDialogOpenChange}\n onOpenChangeComplete={handleDialogOpenChangeComplete}\n modal={modal}\n >\n {children}\n </Dialog.Root>\n </PopupMenuProviders>\n )\n}\n\nexport namespace CommandMenuRoot {\n export interface Props extends CommandMenuRootProps {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { KeyChord } from '../utils/parse-keybinding.js'\nimport { parseKeybinding } from '../utils/parse-keybinding.js'\nimport { isApplePlatform } from '../utils/platform.js'\n\n/**\n * Options for the useHotkey global keydown listener.\n *\n * @internal Not part of the public API — used by CommandMenu's `hotkey` prop.\n */\nexport interface UseHotkeyOptions {\n /** @default true */\n enabled?: boolean\n /** @default true */\n preventDefault?: boolean\n /** Fire even when focus is in an input/textarea/select/contenteditable. @default false */\n allowInInput?: boolean\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n )\n}\n\nfunction getEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n\n return key === ' ' ? 'space' : key\n}\n\nfunction matchesModifiers(event: KeyboardEvent, chord: KeyChord): boolean {\n const isApple = isApplePlatform()\n const meta = chord.meta || (isApple && chord.mod)\n const ctrl = chord.ctrl || (!isApple && chord.mod)\n\n return (\n event.metaKey === meta &&\n event.ctrlKey === ctrl &&\n event.altKey === chord.alt &&\n event.shiftKey === chord.shift\n )\n}\n\nfunction matchesChord(event: KeyboardEvent, chord: KeyChord): boolean {\n return chord.key === getEventKey(event) && matchesModifiers(event, chord)\n}\n\n/**\n * Calls a handler when a single-chord keybinding is pressed anywhere in the\n * document.\n *\n * @internal Not part of the public API. Deliberately unexported from\n * `kbd/index.ts` — consumers get global-shortcut behavior through\n * `CommandMenu.Root`'s `hotkey` prop instead. Import via the file path if\n * another primitive needs it.\n */\nexport function useHotkey(\n keys: string,\n handler: (event: KeyboardEvent) => void,\n options?: UseHotkeyOptions,\n): void {\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n const [firstChord] = keybinding.chords\n const chord =\n keybinding.chords.length === 1 && firstChord !== undefined\n ? firstChord\n : null\n const isSequence = keybinding.chords.length > 1\n const enabled = options?.enabled !== false\n\n const handlerRef = React.useRef(handler)\n const optionsRef = React.useRef(options)\n\n handlerRef.current = handler\n optionsRef.current = options\n\n React.useEffect(() => {\n if (isSequence && process.env.NODE_ENV !== 'production') {\n console.warn(\n `useHotkey only supports single-chord keybindings. Received \"${keys}\", but sequences are not supported by useHotkey.`,\n )\n }\n }, [isSequence, keys])\n\n React.useEffect(() => {\n if (!enabled || chord === null || isSequence || chord.key === null) {\n return\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const currentOptions = optionsRef.current\n\n if (event.repeat) {\n return\n }\n\n if (!currentOptions?.allowInInput && isEditableTarget(event.target)) {\n return\n }\n\n if (!matchesChord(event, chord)) {\n return\n }\n\n if (currentOptions?.preventDefault !== false) {\n event.preventDefault()\n }\n\n handlerRef.current(event)\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [chord, enabled, isSequence])\n}\n","'use client'\n\nimport {\n PopupMenuSubpage,\n type PopupMenuSubpageProps,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}\n\n/**\n * Groups all parts of a command menu subpage.\n */\nexport function CommandMenuSubpage(props: CommandMenuSubpage.Props) {\n const { closeRootOnEsc = true, children, ...rest } = props\n\n return (\n <PopupMenuSubpage closeRootOnEsc={closeRootOnEsc} {...rest}>\n {children}\n </PopupMenuSubpage>\n )\n}\n\nexport namespace CommandMenuSubpage {\n export interface Props extends CommandMenuSubpageProps {}\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\n\nexport interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}\nexport type CommandMenuTriggerState = Dialog.Trigger.State\n\n/**\n * A button that opens the command menu.\n */\nexport const CommandMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n CommandMenuTrigger.Props\n>(function CommandMenuTrigger(props, forwardedRef) {\n const { disabled, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n const isDisabled = disabled || popupMenuContext?.disabled || false\n\n return (\n <Dialog.Trigger\n ref={forwardedRef}\n {...rest}\n disabled={isDisabled}\n data-command-menu-trigger=\"\"\n />\n )\n})\n\nexport namespace CommandMenuTrigger {\n export interface Props extends CommandMenuTriggerProps {}\n export type State = CommandMenuTriggerState\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{a as re,d as ue}from"../chunk-LXXK4S4Q.js";import{$ as Ae,A as he,B as De,C as Le,Ca as ne,D as ve,Da as te,E as Ne,Ea as ae,F as Te,Fa as pe,G as Be,J as H,O as w,U as F,V as K,W as V,X as Z,Y as Ee,Z as Ge,_ as Oe,aa as He,ca as j,d as T,da as U,e as x,f as B,ga as Q,ha as q,ia as W,ja as _,k as E,ka as $,ma as we,o as ye,p as Ie,pa as z,q as G,qa as J,r as O,ra as X,ta as Y,ua as ee,va as oe,y as ke,z as A}from"../chunk-EDZTZHQ4.js";import{a as R,p as xe,q as Re}from"../chunk-A4Z5BY7H.js";import{a as be}from"../chunk-4C666HHU.js";var ge={};be(ge,{Backdrop:()=>se,CheckboxItem:()=>q,CheckboxItemIndicator:()=>W,Empty:()=>K,FocusZone:()=>z,Footer:()=>J,Group:()=>X,GroupLabel:()=>Z,Header:()=>Y,Icon:()=>F,Input:()=>de,Item:()=>_,LinkItem:()=>$,List:()=>j,Loading:()=>U,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>ee,Shortcut:()=>oe,Subpage:()=>Ce,SubpageBack:()=>te,SubpageBackItem:()=>ae,SubpageTrigger:()=>pe,Surface:()=>Q,Trigger:()=>fe});import{Dialog as Fe}from"@base-ui/react/dialog";import*as y from"react";import{jsx as Ke}from"react/jsx-runtime";var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=x(),u=y.useCallback(m=>{p?.(m),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(R.outsidePress,m.nativeEvent)},[p,t]);return Ke(Fe.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});import*as me from"react";import{jsx as Ve}from"react/jsx-runtime";var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return Ve(V,{ref:a,backspaceGoesBack:p,...r})});import{Dialog as Ze}from"@base-ui/react/dialog";import*as s from"react";import{jsx as I,jsxs as je}from"react/jsx-runtime";var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=T(),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=O({surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return I(B.Provider,{value:m,children:I(E.Provider,{value:C,children:I(A.Provider,{value:L,children:je(Ze.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,I(H,{})]})})})})});import{Dialog as Ue}from"@base-ui/react/dialog";var ce=Ue.Portal;import{Dialog as $e}from"@base-ui/react/dialog";import*as v from"react";import*as d from"react";function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=ue(),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>re(e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=a?.enabled!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!i?.allowInInput&&Qe(n.target)||_e(n,t)&&(i?.preventDefault!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}import{jsx as le}from"react/jsx-runtime";function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=G({onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(u??"",()=>f(!n.state.open,R.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),n.context.onCloseComplete?.(),n.context.onPopupCloseComplete?.()),t?.(l)},[n,t]);return le(w,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:le($e.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}import{jsx as ze}from"react/jsx-runtime";function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return ze(ne,{closeRootOnEsc:o,...p,children:a})}import{Dialog as Je}from"@base-ui/react/dialog";import*as Se from"react";import{jsx as Xe}from"react/jsx-runtime";var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=x(),u=p||t?.disabled||!1;return Xe(Je.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});export{ge as CommandMenu,we as CommandMenuRadioGroupValue,Le as DataListContext,ke as DataSurfaceContext,Ie as defaultGetResolvedId,Ee as defineRadioGroup,Ge as isDisplayGroupNode,Oe as isDisplayRadioGroupNode,He as isDisplayRowNode,Ae as isDisplaySeparatorNode,ye as isPopupMenuNode,Te as useAsyncMenuCoordinator,ve as useDataList,he as useDataSurfaceContext,Be as useMaybeAsyncMenuCoordinator,Ne as useMaybeDataList,De as useMaybeDataSurfaceContext,Re as useMaybeSurfaceContext,xe as useSurfaceContext};
1
+ import{a as re,d as ue}from"../chunk-LXXK4S4Q.js";import{$ as Ae,A as he,B as De,C as Le,Ca as ne,D as ve,Da as te,E as Ne,Ea as ae,F as Te,Fa as pe,G as Be,J as H,O as w,U as F,V as K,W as V,X as Z,Y as Ee,Z as Ge,_ as Oe,aa as He,ca as j,d as T,da as U,e as x,f as B,ga as Q,ha as q,ia as W,ja as _,k as E,ka as $,ma as we,o as ye,p as Ie,pa as z,q as G,qa as J,r as O,ra as X,ta as Y,ua as ee,va as oe,y as ke,z as A}from"../chunk-3HMQLMSF.js";import{a as R,p as xe,q as Re}from"../chunk-A4Z5BY7H.js";import"../chunk-MPPIEWSL.js";import{a as be}from"../chunk-4C666HHU.js";var ge={};be(ge,{Backdrop:()=>se,CheckboxItem:()=>q,CheckboxItemIndicator:()=>W,Empty:()=>K,FocusZone:()=>z,Footer:()=>J,Group:()=>X,GroupLabel:()=>Z,Header:()=>Y,Icon:()=>F,Input:()=>de,Item:()=>_,LinkItem:()=>$,List:()=>j,Loading:()=>U,Popup:()=>ie,Portal:()=>ce,Root:()=>Me,Separator:()=>ee,Shortcut:()=>oe,Subpage:()=>Ce,SubpageBack:()=>te,SubpageBackItem:()=>ae,SubpageTrigger:()=>pe,Surface:()=>Q,Trigger:()=>fe});import{Dialog as Fe}from"@base-ui/react/dialog";import*as y from"react";import{jsx as Ke}from"react/jsx-runtime";var se=y.forwardRef(function(o,a){let{onPointerDown:p,...r}=o,t=x(),u=y.useCallback(m=>{p?.(m),!m.defaultPrevented&&t&&!t.disabled&&t.closeAll(R.outsidePress,m.nativeEvent)},[p,t]);return Ke(Fe.Backdrop,{ref:a,...r,onPointerDown:u,"data-command-menu-backdrop":""})});import*as me from"react";import{jsx as Ve}from"react/jsx-runtime";var de=me.forwardRef(function(o,a){let{backspaceGoesBack:p=!0,...r}=o;return Ve(V,{ref:a,backspaceGoesBack:p,...r})});import{Dialog as Ze}from"@base-ui/react/dialog";import*as s from"react";import{jsx as I,jsxs as je}from"react/jsx-runtime";var ie=s.forwardRef(function(o,a){let{children:p,className:r,render:t,...u}=o,m=s.useId(),M=T(),{subpageStackContextValue:C,isSubpageNavigating:S,hasOpenSubpage:n,subpageId:i}=O({surfaceId:m,store:M.store}),[g,k]=s.useState(null),[b,f]=s.useState(null),c=s.useCallback(P=>({...P,hasOpenSubpage:n,subpageId:i}),[n,i]),h=s.useMemo(()=>typeof r=="function"?P=>r(c(P)):r,[r,c]),D=s.useMemo(()=>typeof t=="function"?(P,l)=>t(P,c(l)):t,[t,c]),L=s.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:k,resolvedNodes:b,setResolvedNodes:f}),[g,b]);return I(B.Provider,{value:m,children:I(E.Provider,{value:C,children:I(A.Provider,{value:L,children:je(Ze.Popup,{ref:a,className:h,render:D,"data-command-menu-popup":"","data-navigating":S?"":void 0,"data-has-open-subpage":n?"":void 0,...u,children:[p,I(H,{})]})})})})});import{Dialog as Ue}from"@base-ui/react/dialog";var ce=Ue.Portal;import{Dialog as $e}from"@base-ui/react/dialog";import*as v from"react";import*as d from"react";function Qe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function qe(e){let o=e.key.toLowerCase();return o===" "?"space":o}function We(e,o){let a=ue(),p=o.meta||a&&o.mod,r=o.ctrl||!a&&o.mod;return e.metaKey===p&&e.ctrlKey===r&&e.altKey===o.alt&&e.shiftKey===o.shift}function _e(e,o){return o.key===qe(e)&&We(e,o)}function Pe(e,o,a){let p=d.useMemo(()=>re(e),[e]),[r]=p.chords,t=p.chords.length===1&&r!==void 0?r:null,u=p.chords.length>1,m=a?.enabled!==!1,M=d.useRef(o),C=d.useRef(a);M.current=o,C.current=a,d.useEffect(()=>{u&&process.env.NODE_ENV!=="production"&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[u,e]),d.useEffect(()=>{if(!m||t===null||u||t.key===null)return;let S=n=>{let i=C.current;n.repeat||!i?.allowInInput&&Qe(n.target)||_e(n,t)&&(i?.preventDefault!==!1&&n.preventDefault(),M.current(n))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[t,m,u])}import{jsx as le}from"react/jsx-runtime";function Me(e){let{children:o,open:a,defaultOpen:p=!1,onOpenChange:r,onOpenChangeComplete:t,hotkey:u,modal:m=!0,disabled:M,getResolvedId:C,idScope:S="surface"}=e,{store:n,focusOwnerStore:i,openChainStore:g,registerSurface:k,closeAll:b,handleOpenChange:f,disabled:c,menuTreeResolver:h}=G({onOpenChange:r,defaultOpen:p,disabled:M,closeOnOutsidePress:"pointerdown",getResolvedId:C,idScope:S});n.useControlledProp("openProp",a);let D=n.useState("open");Pe(u??"",()=>f(!n.state.open,R.imperativeAction),{enabled:!!u&&!c,allowInInput:!0});let L=v.useCallback((l,N)=>{f(l,N.reason,N.event)},[f]),P=v.useCallback(l=>{!l&&n.context.clearSearchOnClose==="after-exit"&&(n.clearSearch(),n.setInputActive(!1)),l||(n.clearHighlight(),n.context.onCloseComplete?.(),n.context.onPopupCloseComplete?.()),t?.(l)},[n,t]);return le(w,{menuTreeResolver:h,store:n,focusOwnerStore:i,openChainStore:g,disabled:c,depth:0,closeAll:b,explicitTabBehavior:!0,tabWithoutZones:"inert",registerSurface:k,menuType:"dropdown",closeOnOutsidePress:"pointerdown",componentName:"command-menu",children:le($e.Root,{open:D,onOpenChange:L,onOpenChangeComplete:P,modal:m,children:o})})}import{jsx as ze}from"react/jsx-runtime";function Ce(e){let{closeRootOnEsc:o=!0,children:a,...p}=e;return ze(ne,{closeRootOnEsc:o,...p,children:a})}import{Dialog as Je}from"@base-ui/react/dialog";import*as Se from"react";import{jsx as Xe}from"react/jsx-runtime";var fe=Se.forwardRef(function(o,a){let{disabled:p,...r}=o,t=x(),u=p||t?.disabled||!1;return Xe(Je.Trigger,{ref:a,...r,disabled:u,"data-command-menu-trigger":""})});export{ge as CommandMenu,we as CommandMenuRadioGroupValue,Le as DataListContext,ke as DataSurfaceContext,Ie as defaultGetResolvedId,Ee as defineRadioGroup,Ge as isDisplayGroupNode,Oe as isDisplayRadioGroupNode,He as isDisplayRowNode,Ae as isDisplaySeparatorNode,ye as isPopupMenuNode,Te as useAsyncMenuCoordinator,ve as useDataList,he as useDataSurfaceContext,Be as useMaybeAsyncMenuCoordinator,Ne as useMaybeDataList,De as useMaybeDataSurfaceContext,Re as useMaybeSurfaceContext,xe as useSurfaceContext};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/command-menu/index.parts.ts","../../src/command-menu/backdrop/backdrop.tsx","../../src/command-menu/input/input.tsx","../../src/command-menu/popup/popup.tsx","../../src/command-menu/portal/portal.tsx","../../src/command-menu/root/root.tsx","../../src/kbd/hooks/use-hotkey.ts","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx"],"sourcesContent":["// ============================================================================\n// Command Menu Parts\n// ============================================================================\n\n// Pure aliases of the canonical resolved-node model (ADR-0001): narrow the\n// alias if a family ever needs to diverge — never edit the canonical type.\nexport type {\n NodeDef,\n PopupMenuNode as Node,\n} from '../internal/popup-menu/index.js'\n\nexport {\n PopupMenuCheckboxItem as CheckboxItem,\n PopupMenuCheckboxItemIndicator as CheckboxItemIndicator,\n PopupMenuEmpty as Empty,\n PopupMenuFocusZone as FocusZone,\n PopupMenuFooter as Footer,\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n PopupMenuHeader as Header,\n PopupMenuIcon as Icon,\n PopupMenuItem as Item,\n PopupMenuLinkItem as LinkItem,\n PopupMenuList as List,\n PopupMenuLoading as Loading,\n PopupMenuSeparator as Separator,\n PopupMenuShortcut as Shortcut,\n PopupMenuSubpageBack as SubpageBack,\n PopupMenuSubpageBackItem as SubpageBackItem,\n PopupMenuSubpageTrigger as SubpageTrigger,\n PopupMenuSurface as Surface,\n} from '../internal/popup-menu/index.js'\nexport { CommandMenuBackdrop as Backdrop } from './backdrop/backdrop.js'\nexport { CommandMenuInput as Input } from './input/input.js'\nexport { CommandMenuPopup as Popup } from './popup/popup.js'\nexport { CommandMenuPortal as Portal } from './portal/portal.js'\nexport { CommandMenuRoot as Root } from './root/root.js'\nexport { CommandMenuSubpage as Subpage } from './subpage/subpage.js'\nexport { CommandMenuTrigger as Trigger } from './trigger/trigger.js'\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}\nexport type CommandMenuBackdropState = Dialog.Backdrop.State\n\n/**\n * An overlay displayed beneath the command menu popup.\n *\n * Pressing down on the backdrop closes the menu immediately (pointerdown),\n * matching the outside-press behavior of the other menus, instead of waiting\n * for the Dialog's click-time dismissal. Consumers can opt out by calling\n * `event.preventDefault()` in their own `onPointerDown`.\n */\nexport const CommandMenuBackdrop = React.forwardRef<\n HTMLDivElement,\n CommandMenuBackdrop.Props\n>(function CommandMenuBackdrop(props, forwardedRef) {\n const { onPointerDown, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n\n const handlePointerDown = React.useCallback<\n NonNullable<Dialog.Backdrop.Props['onPointerDown']>\n >(\n (event) => {\n onPointerDown?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n if (popupMenuContext && !popupMenuContext.disabled) {\n popupMenuContext.closeAll(REASONS.outsidePress, event.nativeEvent)\n }\n },\n [onPointerDown, popupMenuContext],\n )\n\n return (\n <Dialog.Backdrop\n ref={forwardedRef}\n {...rest}\n onPointerDown={handlePointerDown}\n data-command-menu-backdrop=\"\"\n />\n )\n})\n\nexport namespace CommandMenuBackdrop {\n export interface Props extends CommandMenuBackdropProps {}\n export type State = CommandMenuBackdropState\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuInput,\n type PopupMenuInputProps,\n type PopupMenuInputState,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuInputProps extends PopupMenuInputProps {}\nexport type CommandMenuInputState = PopupMenuInputState\n\n/**\n * Search input for filtering command menu items.\n */\nexport const CommandMenuInput = React.forwardRef<\n HTMLInputElement,\n CommandMenuInput.Props\n>(function CommandMenuInput(props, forwardedRef) {\n const { backspaceGoesBack = true, ...rest } = props\n\n return (\n <PopupMenuInput\n ref={forwardedRef}\n backspaceGoesBack={backspaceGoesBack}\n {...rest}\n />\n )\n})\n\nexport namespace CommandMenuInput {\n export interface Props extends CommandMenuInputProps {}\n export type State = CommandMenuInputState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { PopupSurfaceIdContext } from '../../internal/popup-menu/contexts/popup-surface-id-context.js'\nimport { SubpageStackContext } from '../../internal/popup-menu/contexts/subpage-stack-context.js'\nimport {\n DataPopupContext,\n type DataSurfaceContextValue,\n type ResolvedNodesSlot,\n} from '../../internal/popup-menu/data-first/context.js'\nimport { DataSubpagesContent } from '../../internal/popup-menu/data-first/data-subpages.js'\nimport { useSubpageStackState } from '../../internal/popup-menu/hooks/use-subpage-stack-state.js'\nimport { usePopupMenuContext } from '../../internal/popup-menu/index.js'\nimport type { ComponentRenderFn } from '../../utils/types.js'\n\nexport interface CommandMenuPopupState extends Dialog.Popup.State {\n /**\n * Whether any non-root subpage is currently open.\n */\n hasOpenSubpage: boolean\n\n /**\n * Active subpage ID, or null when the root surface is active.\n */\n subpageId: string | null\n}\n\nexport interface CommandMenuPopupProps\n extends Omit<Dialog.Popup.Props, 'className' | 'render'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: CommandMenuPopupState) => string)\n\n /**\n * Allows replacing the popup element with a custom element.\n * The render state includes dialog popup + subpage navigation state.\n */\n render?:\n | React.ReactElement\n | ComponentRenderFn<\n React.HTMLAttributes<HTMLElement>,\n CommandMenuPopupState\n >\n}\n\n/**\n * A container for the command menu contents.\n * Wraps Dialog.Popup with popup-menu subpage and data providers.\n */\nexport const CommandMenuPopup = React.forwardRef<\n HTMLDivElement,\n CommandMenuPopup.Props\n>(function CommandMenuPopup(props, forwardedRef) {\n const {\n children,\n className: classNameProp,\n render: renderProp,\n ...rest\n } = props\n\n const surfaceId = React.useId()\n const popupMenuContext = usePopupMenuContext()\n\n const {\n subpageStackContextValue,\n isSubpageNavigating,\n hasOpenSubpage,\n subpageId,\n } = useSubpageStackState({\n surfaceId,\n store: popupMenuContext.store,\n })\n\n const [dataSurfaceContext, setDataSurfaceContext] =\n React.useState<DataSurfaceContextValue | null>(null)\n const [resolvedNodes, setResolvedNodes] =\n React.useState<ResolvedNodesSlot | null>(null)\n\n const toPopupState = React.useCallback(\n (baseState: Dialog.Popup.State): CommandMenuPopupState => ({\n ...baseState,\n hasOpenSubpage,\n subpageId,\n }),\n [hasOpenSubpage, subpageId],\n )\n\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: Dialog.Popup.State) => {\n return classNameProp(toPopupState(baseState))\n }\n }\n return classNameProp\n }, [classNameProp, toPopupState])\n\n const render = React.useMemo(() => {\n if (typeof renderProp === 'function') {\n return (\n popupProps: React.HTMLAttributes<HTMLElement>,\n baseState: Dialog.Popup.State,\n ) => renderProp(popupProps, toPopupState(baseState))\n }\n\n return renderProp\n }, [renderProp, toPopupState])\n\n const dataPopupContextValue = React.useMemo(\n () => ({\n dataSurfaceContext,\n setDataSurfaceContext,\n resolvedNodes,\n setResolvedNodes,\n }),\n [dataSurfaceContext, resolvedNodes],\n )\n\n return (\n <PopupSurfaceIdContext.Provider value={surfaceId}>\n <SubpageStackContext.Provider value={subpageStackContextValue}>\n <DataPopupContext.Provider value={dataPopupContextValue}>\n <Dialog.Popup\n ref={forwardedRef}\n className={className}\n render={render}\n data-command-menu-popup=\"\"\n data-navigating={isSubpageNavigating ? '' : undefined}\n data-has-open-subpage={hasOpenSubpage ? '' : undefined}\n {...rest}\n >\n {children}\n <DataSubpagesContent />\n </Dialog.Popup>\n </DataPopupContext.Provider>\n </SubpageStackContext.Provider>\n </PopupSurfaceIdContext.Provider>\n )\n})\n\nexport namespace CommandMenuPopup {\n export type Props = CommandMenuPopupProps\n export type State = CommandMenuPopupState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\n\nexport interface CommandMenuPortalProps extends Dialog.Portal.Props {}\nexport type CommandMenuPortalState = Dialog.Portal.State\n\n/**\n * A portal element that moves the command menu popup to a different part of the DOM.\n */\nexport const CommandMenuPortal = Dialog.Portal\n\nexport namespace CommandMenuPortal {\n export type Props = CommandMenuPortalProps\n export type State = CommandMenuPortalState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport type { PopupMenuOpenChangeReason } from '../../internal/popup-menu/events.js'\nimport {\n type GetResolvedIdFn,\n type PopupMenuIdScope,\n PopupMenuProviders,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport { useHotkey } from '../../kbd/hooks/use-hotkey.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuRootProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n onOpenChangeComplete?: (open: boolean) => void\n hotkey?: string\n modal?: boolean\n disabled?: boolean\n /**\n * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).\n * @default encoded surface Definition Path joined with `/`; `idScope=\"menu\"` uses the Definition Key\n * Read once when the menu root mounts — later changes have no effect. To retain the old dot-path default, use `node => node.def.id ?? node.definitionPath.join('.')`. This does not recreate former tree-item ancestry; exact compatibility requires walking `node.parent` and reproducing the old slug/key lineage.\n * @example\n * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />\n */\n getResolvedId?: GetResolvedIdFn\n /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */\n idScope?: PopupMenuIdScope\n}\n\n/**\n * Groups all parts of the command menu.\n * Manages open state and provides popup-menu context to children.\n * Doesn't render its own HTML element.\n */\nexport function CommandMenuRoot(props: CommandMenuRoot.Props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n hotkey,\n modal = true,\n disabled,\n getResolvedId,\n idScope = 'surface',\n } = props\n\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n handleOpenChange,\n disabled: menuDisabled,\n menuTreeResolver,\n } = usePopupMenuRoot({\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n disabled,\n closeOnOutsidePress: 'pointerdown',\n getResolvedId,\n idScope,\n })\n\n store.useControlledProp('openProp', openProp)\n\n const openState = store.useState('open')\n\n useHotkey(\n hotkey ?? '',\n () => handleOpenChange(!store.state.open, REASONS.imperativeAction),\n // allowInInput keeps the hotkey working as a *toggle*: while the menu is\n // open, focus sits in the search input, so the close press must be allowed\n // to fire from an editable target.\n { enabled: !!hotkey && !menuDisabled, allowInInput: true },\n )\n\n const handleDialogOpenChange = React.useCallback(\n (nextOpen: boolean, dialogDetails: Dialog.Root.ChangeEventDetails) => {\n handleOpenChange(\n nextOpen,\n dialogDetails.reason as PopupMenuOpenChangeReason,\n dialogDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n const handleDialogOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && store.context.clearSearchOnClose === 'after-exit') {\n store.clearSearch()\n store.setInputActive(false)\n }\n\n if (!nextOpen) {\n store.clearHighlight()\n store.context.onCloseComplete?.()\n store.context.onPopupCloseComplete?.()\n }\n\n onOpenChangeComplete?.(nextOpen)\n },\n [store, onOpenChangeComplete],\n )\n\n return (\n <PopupMenuProviders\n menuTreeResolver={menuTreeResolver}\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n explicitTabBehavior\n tabWithoutZones=\"inert\"\n registerSurface={registerSurface}\n menuType=\"dropdown\"\n closeOnOutsidePress=\"pointerdown\"\n componentName=\"command-menu\"\n >\n <Dialog.Root\n open={openState}\n onOpenChange={handleDialogOpenChange}\n onOpenChangeComplete={handleDialogOpenChangeComplete}\n modal={modal}\n >\n {children}\n </Dialog.Root>\n </PopupMenuProviders>\n )\n}\n\nexport namespace CommandMenuRoot {\n export interface Props extends CommandMenuRootProps {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { KeyChord } from '../utils/parse-keybinding.js'\nimport { parseKeybinding } from '../utils/parse-keybinding.js'\nimport { isApplePlatform } from '../utils/platform.js'\n\n/**\n * Options for the useHotkey global keydown listener.\n *\n * @internal Not part of the public API — used by CommandMenu's `hotkey` prop.\n */\nexport interface UseHotkeyOptions {\n /** @default true */\n enabled?: boolean\n /** @default true */\n preventDefault?: boolean\n /** Fire even when focus is in an input/textarea/select/contenteditable. @default false */\n allowInInput?: boolean\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n )\n}\n\nfunction getEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n\n return key === ' ' ? 'space' : key\n}\n\nfunction matchesModifiers(event: KeyboardEvent, chord: KeyChord): boolean {\n const isApple = isApplePlatform()\n const meta = chord.meta || (isApple && chord.mod)\n const ctrl = chord.ctrl || (!isApple && chord.mod)\n\n return (\n event.metaKey === meta &&\n event.ctrlKey === ctrl &&\n event.altKey === chord.alt &&\n event.shiftKey === chord.shift\n )\n}\n\nfunction matchesChord(event: KeyboardEvent, chord: KeyChord): boolean {\n return chord.key === getEventKey(event) && matchesModifiers(event, chord)\n}\n\n/**\n * Calls a handler when a single-chord keybinding is pressed anywhere in the\n * document.\n *\n * @internal Not part of the public API. Deliberately unexported from\n * `kbd/index.ts` — consumers get global-shortcut behavior through\n * `CommandMenu.Root`'s `hotkey` prop instead. Import via the file path if\n * another primitive needs it.\n */\nexport function useHotkey(\n keys: string,\n handler: (event: KeyboardEvent) => void,\n options?: UseHotkeyOptions,\n): void {\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n const [firstChord] = keybinding.chords\n const chord =\n keybinding.chords.length === 1 && firstChord !== undefined\n ? firstChord\n : null\n const isSequence = keybinding.chords.length > 1\n const enabled = options?.enabled !== false\n\n const handlerRef = React.useRef(handler)\n const optionsRef = React.useRef(options)\n\n handlerRef.current = handler\n optionsRef.current = options\n\n React.useEffect(() => {\n if (isSequence && process.env.NODE_ENV !== 'production') {\n console.warn(\n `useHotkey only supports single-chord keybindings. Received \"${keys}\", but sequences are not supported by useHotkey.`,\n )\n }\n }, [isSequence, keys])\n\n React.useEffect(() => {\n if (!enabled || chord === null || isSequence || chord.key === null) {\n return\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const currentOptions = optionsRef.current\n\n if (event.repeat) {\n return\n }\n\n if (!currentOptions?.allowInInput && isEditableTarget(event.target)) {\n return\n }\n\n if (!matchesChord(event, chord)) {\n return\n }\n\n if (currentOptions?.preventDefault !== false) {\n event.preventDefault()\n }\n\n handlerRef.current(event)\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [chord, enabled, isSequence])\n}\n","'use client'\n\nimport {\n PopupMenuSubpage,\n type PopupMenuSubpageProps,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}\n\n/**\n * Groups all parts of a command menu subpage.\n */\nexport function CommandMenuSubpage(props: CommandMenuSubpage.Props) {\n const { closeRootOnEsc = true, children, ...rest } = props\n\n return (\n <PopupMenuSubpage closeRootOnEsc={closeRootOnEsc} {...rest}>\n {children}\n </PopupMenuSubpage>\n )\n}\n\nexport namespace CommandMenuSubpage {\n export interface Props extends CommandMenuSubpageProps {}\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\n\nexport interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}\nexport type CommandMenuTriggerState = Dialog.Trigger.State\n\n/**\n * A button that opens the command menu.\n */\nexport const CommandMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n CommandMenuTrigger.Props\n>(function CommandMenuTrigger(props, forwardedRef) {\n const { disabled, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n const isDisabled = disabled || popupMenuContext?.disabled || false\n\n return (\n <Dialog.Trigger\n ref={forwardedRef}\n {...rest}\n disabled={isDisabled}\n data-command-menu-trigger=\"\"\n />\n )\n})\n\nexport namespace CommandMenuTrigger {\n export interface Props extends CommandMenuTriggerProps {}\n export type State = CommandMenuTriggerState\n}\n"],"mappings":"kiBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,cAAAE,GAAA,iBAAAC,EAAA,0BAAAC,EAAA,UAAAC,EAAA,cAAAC,EAAA,WAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,WAAAC,EAAA,SAAAC,EAAA,UAAAC,GAAA,SAAAC,EAAA,aAAAC,EAAA,SAAAC,EAAA,YAAAC,EAAA,UAAAC,GAAA,WAAAC,GAAA,SAAAC,GAAA,cAAAC,GAAA,aAAAC,GAAA,YAAAC,GAAA,gBAAAC,GAAA,oBAAAC,GAAA,mBAAAC,GAAA,YAAAC,EAAA,YAAAC,KCEA,OAAS,UAAAC,OAAc,wBACvB,UAAYC,MAAW,QAwCnB,cAAAC,OAAA,oBAzBG,IAAMC,GAA4B,aAGvC,SAA6BC,EAAOC,EAAc,CAClD,GAAM,CAAE,cAAAC,EAAe,GAAGC,CAAK,EAAIH,EAC7BI,EAAmBC,EAAyB,EAE5CC,EAA0B,cAG7BC,GAAU,CACTL,IAAgBK,CAAK,EAEjB,CAAAA,EAAM,kBAINH,GAAoB,CAACA,EAAiB,UACxCA,EAAiB,SAASI,EAAQ,aAAcD,EAAM,WAAW,CAErE,EACA,CAACL,EAAeE,CAAgB,CAClC,EAEA,OACEN,GAACW,GAAO,SAAP,CACC,IAAKR,EACJ,GAAGE,EACJ,cAAeG,EACf,6BAA2B,GAC7B,CAEJ,CAAC,EChDD,UAAYI,OAAW,QAoBnB,cAAAC,OAAA,oBAPG,IAAMC,GAAyB,cAGpC,SAA0BC,EAAOC,EAAc,CAC/C,GAAM,CAAE,kBAAAC,EAAoB,GAAM,GAAGC,CAAK,EAAIH,EAE9C,OACEF,GAACM,EAAA,CACC,IAAKH,EACL,kBAAmBC,EAClB,GAAGC,EACN,CAEJ,CAAC,EC1BD,OAAS,UAAAE,OAAc,wBACvB,UAAYC,MAAW,Q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EAAc,OACdA,EAAc,KAChB,CACF,EACA,CAACT,CAAgB,CACnB,EAEMU,EAAuC,cAC1CF,GAAsB,CACjB,CAACA,GAAYb,EAAM,QAAQ,qBAAuB,eACpDA,EAAM,YAAY,EAClBA,EAAM,eAAe,EAAK,GAGvBa,IACHb,EAAM,eAAe,EACrBA,EAAM,QAAQ,kBAAkB,EAChCA,EAAM,QAAQ,uBAAuB,GAGvCN,IAAuBmB,CAAQ,CACjC,EACA,CAACb,EAAON,CAAoB,CAC9B,EAEA,OACEP,GAAC6B,EAAA,CACC,iBAAkBT,EAClB,MAAOP,EACP,gBAAiBC,EACjB,eAAgBC,EAChB,SAAUI,EACV,MAAO,EACP,SAAUF,EACV,oBAAmB,GACnB,gBAAgB,QAChB,gBAAiBD,EACjB,SAAS,WACT,oBAAoB,cACpB,cAAc,eAEd,SAAAhB,GAAC8B,GAAO,KAAP,CACC,KAAMR,EACN,aAAcG,EACd,qBAAsBG,EACtB,MAAOnB,EAEN,SAAAN,EACH,EACF,CAEJ,CE9HI,cAAA4B,OAAA,oBAJG,SAASC,GAAmBC,EAAiC,CAClE,GAAM,CAAE,eAAAC,EAAiB,GAAM,SAAAC,EAAU,GAAGC,CAAK,EAAIH,EAErD,OACEF,GAACM,GAAA,CAAiB,eAAgBH,EAAiB,GAAGE,EACnD,SAAAD,EACH,CAEJ,CClBA,OAAS,UAAAG,OAAc,wBACvB,UAAYC,OAAW,QAkBnB,cAAAC,OAAA,oBATG,IAAMC,GAA2B,cAGtC,SAA4BC,EAAOC,EAAc,CACjD,GAAM,CAAE,SAAAC,EAAU,GAAGC,CAAK,EAAIH,EACxBI,EAAmBC,EAAyB,EAC5CC,EAAaJ,GAAYE,GAAkB,UAAY,GAE7D,OACEN,GAACS,GAAO,QAAP,CACC,IAAKN,EACJ,GAAGE,EACJ,SAAUG,EACV,4BAA0B,GAC5B,CAEJ,CAAC","names":["index_parts_exports","__export","CommandMenuBackdrop","PopupMenuCheckboxItem","PopupMenuCheckboxItemIndicator","PopupMenuEmpty","PopupMenuFocusZone","PopupMenuFooter","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuHeader","PopupMenuIcon","CommandMenuInput","PopupMenuItem","PopupMenuLinkItem","PopupMenuList","PopupMenuLoading","CommandMenuPopup","CommandMenuPortal","CommandMenuRoot","PopupMenuSeparator","PopupMenuShortcut","CommandMenuSubpage","PopupMenuSubpageBack","PopupMenuSubpageBackItem","PopupMenuSubpageTrigger","PopupMenuSurface","CommandMenuTrigger","Dialog","React","jsx","CommandMenuBackdrop","props","forwardedRef","onPointerDown","rest","popupMenuContext","useMaybePopupMenuContext","handlePointerDown","event","reason_parts_exports","Dialog","React","jsx","CommandMenuInput","props","forwardedRef","backspaceGoesBack","rest","PopupMenuInput","Dialog","React","jsx","jsxs","CommandMenuPopup","props","forwardedRef","children","classNameProp","renderProp","rest","surfaceId","popupMenuContext","usePopupMenuContext","subpageStackContextValue","isSubpageNavigating","hasOpenSubpage","subpageId","useSubpageStackState","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","className","render","popupProps","dataPopupContextValue","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","Dialog","DataSubpagesContent","Dialog","CommandMenuPortal","Dialog","React","React","isEditableTarget","target","getEventKey","event","key","matchesModifiers","chord","isApple","isApplePlatform","meta","ctrl","matchesChord","useHotkey","keys","handler","options","keybinding","parseKeybinding","firstChord","isSequence","enabled","handlerRef","optionsRef","handleKeyDown","currentOptions","jsx","CommandMenuRoot","props","children","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","hotkey","modal","disabled","getResolvedId","idScope","store","focusOwnerStore","openChainStore","registerSurface","closeAll","handleOpenChange","menuDisabled","menuTreeResolver","usePopupMenuRoot","openState","useHotkey","reason_parts_exports","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","PopupMenuProviders","Dialog","jsx","CommandMenuSubpage","props","closeRootOnEsc","children","rest","PopupMenuSubpage","Dialog","React","jsx","CommandMenuTrigger","props","forwardedRef","disabled","rest","popupMenuContext","useMaybePopupMenuContext","isDisabled","Dialog"]}
1
+ {"version":3,"sources":["../../src/command-menu/index.parts.ts","../../src/command-menu/backdrop/backdrop.tsx","../../src/command-menu/input/input.tsx","../../src/command-menu/popup/popup.tsx","../../src/command-menu/portal/portal.tsx","../../src/command-menu/root/root.tsx","../../src/kbd/hooks/use-hotkey.ts","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx"],"sourcesContent":["// ============================================================================\n// Command Menu Parts\n// ============================================================================\n\n// Pure aliases of the canonical resolved-node model (ADR-0001): narrow the\n// alias if a family ever needs to diverge — never edit the canonical type.\nexport type {\n NodeDef,\n PopupMenuNode as Node,\n} from '../internal/popup-menu/index.js'\n\nexport {\n PopupMenuCheckboxItem as CheckboxItem,\n PopupMenuCheckboxItemIndicator as CheckboxItemIndicator,\n PopupMenuEmpty as Empty,\n PopupMenuFocusZone as FocusZone,\n PopupMenuFooter as Footer,\n PopupMenuGroup as Group,\n PopupMenuGroupLabel as GroupLabel,\n PopupMenuHeader as Header,\n PopupMenuIcon as Icon,\n PopupMenuItem as Item,\n PopupMenuLinkItem as LinkItem,\n PopupMenuList as List,\n PopupMenuLoading as Loading,\n PopupMenuSeparator as Separator,\n PopupMenuShortcut as Shortcut,\n PopupMenuSubpageBack as SubpageBack,\n PopupMenuSubpageBackItem as SubpageBackItem,\n PopupMenuSubpageTrigger as SubpageTrigger,\n PopupMenuSurface as Surface,\n} from '../internal/popup-menu/index.js'\nexport { CommandMenuBackdrop as Backdrop } from './backdrop/backdrop.js'\nexport { CommandMenuInput as Input } from './input/input.js'\nexport { CommandMenuPopup as Popup } from './popup/popup.js'\nexport { CommandMenuPortal as Portal } from './portal/portal.js'\nexport { CommandMenuRoot as Root } from './root/root.js'\nexport { CommandMenuSubpage as Subpage } from './subpage/subpage.js'\nexport { CommandMenuTrigger as Trigger } from './trigger/trigger.js'\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}\nexport type CommandMenuBackdropState = Dialog.Backdrop.State\n\n/**\n * An overlay displayed beneath the command menu popup.\n *\n * Pressing down on the backdrop closes the menu immediately (pointerdown),\n * matching the outside-press behavior of the other menus, instead of waiting\n * for the Dialog's click-time dismissal. Consumers can opt out by calling\n * `event.preventDefault()` in their own `onPointerDown`.\n */\nexport const CommandMenuBackdrop = React.forwardRef<\n HTMLDivElement,\n CommandMenuBackdrop.Props\n>(function CommandMenuBackdrop(props, forwardedRef) {\n const { onPointerDown, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n\n const handlePointerDown = React.useCallback<\n NonNullable<Dialog.Backdrop.Props['onPointerDown']>\n >(\n (event) => {\n onPointerDown?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n if (popupMenuContext && !popupMenuContext.disabled) {\n popupMenuContext.closeAll(REASONS.outsidePress, event.nativeEvent)\n }\n },\n [onPointerDown, popupMenuContext],\n )\n\n return (\n <Dialog.Backdrop\n ref={forwardedRef}\n {...rest}\n onPointerDown={handlePointerDown}\n data-command-menu-backdrop=\"\"\n />\n )\n})\n\nexport namespace CommandMenuBackdrop {\n export interface Props extends CommandMenuBackdropProps {}\n export type State = CommandMenuBackdropState\n}\n","'use client'\n\nimport * as React from 'react'\nimport {\n PopupMenuInput,\n type PopupMenuInputProps,\n type PopupMenuInputState,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuInputProps extends PopupMenuInputProps {}\nexport type CommandMenuInputState = PopupMenuInputState\n\n/**\n * Search input for filtering command menu items.\n */\nexport const CommandMenuInput = React.forwardRef<\n HTMLInputElement,\n CommandMenuInput.Props\n>(function CommandMenuInput(props, forwardedRef) {\n const { backspaceGoesBack = true, ...rest } = props\n\n return (\n <PopupMenuInput\n ref={forwardedRef}\n backspaceGoesBack={backspaceGoesBack}\n {...rest}\n />\n )\n})\n\nexport namespace CommandMenuInput {\n export interface Props extends CommandMenuInputProps {}\n export type State = CommandMenuInputState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { PopupSurfaceIdContext } from '../../internal/popup-menu/contexts/popup-surface-id-context.js'\nimport { SubpageStackContext } from '../../internal/popup-menu/contexts/subpage-stack-context.js'\nimport {\n DataPopupContext,\n type DataSurfaceContextValue,\n type ResolvedNodesSlot,\n} from '../../internal/popup-menu/data-first/context.js'\nimport { DataSubpagesContent } from '../../internal/popup-menu/data-first/data-subpages.js'\nimport { useSubpageStackState } from '../../internal/popup-menu/hooks/use-subpage-stack-state.js'\nimport { usePopupMenuContext } from '../../internal/popup-menu/index.js'\nimport type { ComponentRenderFn } from '../../utils/types.js'\n\nexport interface CommandMenuPopupState extends Dialog.Popup.State {\n /**\n * Whether any non-root subpage is currently open.\n */\n hasOpenSubpage: boolean\n\n /**\n * Active subpage ID, or null when the root surface is active.\n */\n subpageId: string | null\n}\n\nexport interface CommandMenuPopupProps\n extends Omit<Dialog.Popup.Props, 'className' | 'render'> {\n /**\n * CSS class applied to the element, or a function that\n * returns a class based on the component's state.\n */\n className?: string | ((state: CommandMenuPopupState) => string)\n\n /**\n * Allows replacing the popup element with a custom element.\n * The render state includes dialog popup + subpage navigation state.\n */\n render?:\n | React.ReactElement\n | ComponentRenderFn<\n React.HTMLAttributes<HTMLElement>,\n CommandMenuPopupState\n >\n}\n\n/**\n * A container for the command menu contents.\n * Wraps Dialog.Popup with popup-menu subpage and data providers.\n */\nexport const CommandMenuPopup = React.forwardRef<\n HTMLDivElement,\n CommandMenuPopup.Props\n>(function CommandMenuPopup(props, forwardedRef) {\n const {\n children,\n className: classNameProp,\n render: renderProp,\n ...rest\n } = props\n\n const surfaceId = React.useId()\n const popupMenuContext = usePopupMenuContext()\n\n const {\n subpageStackContextValue,\n isSubpageNavigating,\n hasOpenSubpage,\n subpageId,\n } = useSubpageStackState({\n surfaceId,\n store: popupMenuContext.store,\n })\n\n const [dataSurfaceContext, setDataSurfaceContext] =\n React.useState<DataSurfaceContextValue | null>(null)\n const [resolvedNodes, setResolvedNodes] =\n React.useState<ResolvedNodesSlot | null>(null)\n\n const toPopupState = React.useCallback(\n (baseState: Dialog.Popup.State): CommandMenuPopupState => ({\n ...baseState,\n hasOpenSubpage,\n subpageId,\n }),\n [hasOpenSubpage, subpageId],\n )\n\n const className = React.useMemo(() => {\n if (typeof classNameProp === 'function') {\n return (baseState: Dialog.Popup.State) => {\n return classNameProp(toPopupState(baseState))\n }\n }\n return classNameProp\n }, [classNameProp, toPopupState])\n\n const render = React.useMemo(() => {\n if (typeof renderProp === 'function') {\n return (\n popupProps: React.HTMLAttributes<HTMLElement>,\n baseState: Dialog.Popup.State,\n ) => renderProp(popupProps, toPopupState(baseState))\n }\n\n return renderProp\n }, [renderProp, toPopupState])\n\n const dataPopupContextValue = React.useMemo(\n () => ({\n dataSurfaceContext,\n setDataSurfaceContext,\n resolvedNodes,\n setResolvedNodes,\n }),\n [dataSurfaceContext, resolvedNodes],\n )\n\n return (\n <PopupSurfaceIdContext.Provider value={surfaceId}>\n <SubpageStackContext.Provider value={subpageStackContextValue}>\n <DataPopupContext.Provider value={dataPopupContextValue}>\n <Dialog.Popup\n ref={forwardedRef}\n className={className}\n render={render}\n data-command-menu-popup=\"\"\n data-navigating={isSubpageNavigating ? '' : undefined}\n data-has-open-subpage={hasOpenSubpage ? '' : undefined}\n {...rest}\n >\n {children}\n <DataSubpagesContent />\n </Dialog.Popup>\n </DataPopupContext.Provider>\n </SubpageStackContext.Provider>\n </PopupSurfaceIdContext.Provider>\n )\n})\n\nexport namespace CommandMenuPopup {\n export type Props = CommandMenuPopupProps\n export type State = CommandMenuPopupState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\n\nexport interface CommandMenuPortalProps extends Dialog.Portal.Props {}\nexport type CommandMenuPortalState = Dialog.Portal.State\n\n/**\n * A portal element that moves the command menu popup to a different part of the DOM.\n */\nexport const CommandMenuPortal = Dialog.Portal\n\nexport namespace CommandMenuPortal {\n export type Props = CommandMenuPortalProps\n export type State = CommandMenuPortalState\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport type { PopupMenuOpenChangeReason } from '../../internal/popup-menu/events.js'\nimport {\n type GetResolvedIdFn,\n type PopupMenuIdScope,\n PopupMenuProviders,\n type UsePopupMenuRootParams,\n usePopupMenuRoot,\n} from '../../internal/popup-menu/index.js'\nimport { useHotkey } from '../../kbd/hooks/use-hotkey.js'\nimport { REASONS } from '../../utils/events/index.js'\n\nexport interface CommandMenuRootProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n onOpenChangeComplete?: (open: boolean) => void\n hotkey?: string\n modal?: boolean\n disabled?: boolean\n /**\n * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).\n * @default encoded surface Definition Path joined with `/`; `idScope=\"menu\"` uses the Definition Key\n * Read once when the menu root mounts — later changes have no effect. To retain the old dot-path default, use `node => node.def.id ?? node.definitionPath.join('.')`. This does not recreate former tree-item ancestry; exact compatibility requires walking `node.parent` and reproducing the old slug/key lineage.\n * @example\n * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />\n */\n getResolvedId?: GetResolvedIdFn\n /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */\n idScope?: PopupMenuIdScope\n}\n\n/**\n * Groups all parts of the command menu.\n * Manages open state and provides popup-menu context to children.\n * Doesn't render its own HTML element.\n */\nexport function CommandMenuRoot(props: CommandMenuRoot.Props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n hotkey,\n modal = true,\n disabled,\n getResolvedId,\n idScope = 'surface',\n } = props\n\n const {\n store,\n focusOwnerStore,\n openChainStore,\n registerSurface,\n closeAll,\n handleOpenChange,\n disabled: menuDisabled,\n menuTreeResolver,\n } = usePopupMenuRoot({\n onOpenChange:\n onOpenChange as unknown as UsePopupMenuRootParams['onOpenChange'],\n defaultOpen,\n disabled,\n closeOnOutsidePress: 'pointerdown',\n getResolvedId,\n idScope,\n })\n\n store.useControlledProp('openProp', openProp)\n\n const openState = store.useState('open')\n\n useHotkey(\n hotkey ?? '',\n () => handleOpenChange(!store.state.open, REASONS.imperativeAction),\n // allowInInput keeps the hotkey working as a *toggle*: while the menu is\n // open, focus sits in the search input, so the close press must be allowed\n // to fire from an editable target.\n { enabled: !!hotkey && !menuDisabled, allowInInput: true },\n )\n\n const handleDialogOpenChange = React.useCallback(\n (nextOpen: boolean, dialogDetails: Dialog.Root.ChangeEventDetails) => {\n handleOpenChange(\n nextOpen,\n dialogDetails.reason as PopupMenuOpenChangeReason,\n dialogDetails.event,\n )\n },\n [handleOpenChange],\n )\n\n const handleDialogOpenChangeComplete = React.useCallback(\n (nextOpen: boolean) => {\n if (!nextOpen && store.context.clearSearchOnClose === 'after-exit') {\n store.clearSearch()\n store.setInputActive(false)\n }\n\n if (!nextOpen) {\n store.clearHighlight()\n store.context.onCloseComplete?.()\n store.context.onPopupCloseComplete?.()\n }\n\n onOpenChangeComplete?.(nextOpen)\n },\n [store, onOpenChangeComplete],\n )\n\n return (\n <PopupMenuProviders\n menuTreeResolver={menuTreeResolver}\n store={store}\n focusOwnerStore={focusOwnerStore}\n openChainStore={openChainStore}\n disabled={menuDisabled}\n depth={0}\n closeAll={closeAll}\n explicitTabBehavior\n tabWithoutZones=\"inert\"\n registerSurface={registerSurface}\n menuType=\"dropdown\"\n closeOnOutsidePress=\"pointerdown\"\n componentName=\"command-menu\"\n >\n <Dialog.Root\n open={openState}\n onOpenChange={handleDialogOpenChange}\n onOpenChangeComplete={handleDialogOpenChangeComplete}\n modal={modal}\n >\n {children}\n </Dialog.Root>\n </PopupMenuProviders>\n )\n}\n\nexport namespace CommandMenuRoot {\n export interface Props extends CommandMenuRootProps {}\n}\n","'use client'\n\nimport * as React from 'react'\nimport type { KeyChord } from '../utils/parse-keybinding.js'\nimport { parseKeybinding } from '../utils/parse-keybinding.js'\nimport { isApplePlatform } from '../utils/platform.js'\n\n/**\n * Options for the useHotkey global keydown listener.\n *\n * @internal Not part of the public API — used by CommandMenu's `hotkey` prop.\n */\nexport interface UseHotkeyOptions {\n /** @default true */\n enabled?: boolean\n /** @default true */\n preventDefault?: boolean\n /** Fire even when focus is in an input/textarea/select/contenteditable. @default false */\n allowInInput?: boolean\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLElement && target.isContentEditable)\n )\n}\n\nfunction getEventKey(event: KeyboardEvent): string {\n const key = event.key.toLowerCase()\n\n return key === ' ' ? 'space' : key\n}\n\nfunction matchesModifiers(event: KeyboardEvent, chord: KeyChord): boolean {\n const isApple = isApplePlatform()\n const meta = chord.meta || (isApple && chord.mod)\n const ctrl = chord.ctrl || (!isApple && chord.mod)\n\n return (\n event.metaKey === meta &&\n event.ctrlKey === ctrl &&\n event.altKey === chord.alt &&\n event.shiftKey === chord.shift\n )\n}\n\nfunction matchesChord(event: KeyboardEvent, chord: KeyChord): boolean {\n return chord.key === getEventKey(event) && matchesModifiers(event, chord)\n}\n\n/**\n * Calls a handler when a single-chord keybinding is pressed anywhere in the\n * document.\n *\n * @internal Not part of the public API. Deliberately unexported from\n * `kbd/index.ts` — consumers get global-shortcut behavior through\n * `CommandMenu.Root`'s `hotkey` prop instead. Import via the file path if\n * another primitive needs it.\n */\nexport function useHotkey(\n keys: string,\n handler: (event: KeyboardEvent) => void,\n options?: UseHotkeyOptions,\n): void {\n const keybinding = React.useMemo(() => parseKeybinding(keys), [keys])\n const [firstChord] = keybinding.chords\n const chord =\n keybinding.chords.length === 1 && firstChord !== undefined\n ? firstChord\n : null\n const isSequence = keybinding.chords.length > 1\n const enabled = options?.enabled !== false\n\n const handlerRef = React.useRef(handler)\n const optionsRef = React.useRef(options)\n\n handlerRef.current = handler\n optionsRef.current = options\n\n React.useEffect(() => {\n if (isSequence && process.env.NODE_ENV !== 'production') {\n console.warn(\n `useHotkey only supports single-chord keybindings. Received \"${keys}\", but sequences are not supported by useHotkey.`,\n )\n }\n }, [isSequence, keys])\n\n React.useEffect(() => {\n if (!enabled || chord === null || isSequence || chord.key === null) {\n return\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const currentOptions = optionsRef.current\n\n if (event.repeat) {\n return\n }\n\n if (!currentOptions?.allowInInput && isEditableTarget(event.target)) {\n return\n }\n\n if (!matchesChord(event, chord)) {\n return\n }\n\n if (currentOptions?.preventDefault !== false) {\n event.preventDefault()\n }\n\n handlerRef.current(event)\n }\n\n document.addEventListener('keydown', handleKeyDown)\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [chord, enabled, isSequence])\n}\n","'use client'\n\nimport {\n PopupMenuSubpage,\n type PopupMenuSubpageProps,\n} from '../../internal/popup-menu/index.js'\n\nexport interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}\n\n/**\n * Groups all parts of a command menu subpage.\n */\nexport function CommandMenuSubpage(props: CommandMenuSubpage.Props) {\n const { closeRootOnEsc = true, children, ...rest } = props\n\n return (\n <PopupMenuSubpage closeRootOnEsc={closeRootOnEsc} {...rest}>\n {children}\n </PopupMenuSubpage>\n )\n}\n\nexport namespace CommandMenuSubpage {\n export interface Props extends CommandMenuSubpageProps {}\n}\n","'use client'\n\nimport { Dialog } from '@base-ui/react/dialog'\nimport * as React from 'react'\nimport { useMaybePopupMenuContext } from '../../internal/popup-menu/contexts/popup-menu-context.js'\n\nexport interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}\nexport type CommandMenuTriggerState = Dialog.Trigger.State\n\n/**\n * A button that opens the command menu.\n */\nexport const CommandMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n CommandMenuTrigger.Props\n>(function CommandMenuTrigger(props, forwardedRef) {\n const { disabled, ...rest } = props\n const popupMenuContext = useMaybePopupMenuContext()\n const isDisabled = disabled || popupMenuContext?.disabled || false\n\n return (\n <Dialog.Trigger\n ref={forwardedRef}\n {...rest}\n disabled={isDisabled}\n data-command-menu-trigger=\"\"\n />\n )\n})\n\nexport namespace CommandMenuTrigger {\n export interface Props extends CommandMenuTriggerProps {}\n export type State = CommandMenuTriggerState\n}\n"],"mappings":"+jBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,cAAAE,GAAA,iBAAAC,EAAA,0BAAAC,EAAA,UAAAC,EAAA,cAAAC,EAAA,WAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,WAAAC,EAAA,SAAAC,EAAA,UAAAC,GAAA,SAAAC,EAAA,aAAAC,EAAA,SAAAC,EAAA,YAAAC,EAAA,UAAAC,GAAA,WAAAC,GAAA,SAAAC,GAAA,cAAAC,GAAA,aAAAC,GAAA,YAAAC,GAAA,gBAAAC,GAAA,oBAAAC,GAAA,mBAAAC,GAAA,YAAAC,EAAA,YAAAC,KCEA,OAAS,UAAAC,OAAc,wBACvB,UAAYC,MAAW,QAwCnB,cAAAC,OAAA,oBAzBG,IAAMC,GAA4B,aAGvC,SAA6BC,EAAOC,EAAc,CAClD,GAAM,CAAE,cAAAC,EAAe,GAAGC,CAAK,EAAIH,EAC7BI,EAAmBC,EAAyB,EAE5CC,EAA0B,cAG7BC,GAAU,CACTL,IAAgBK,CAAK,EAEjB,CAAAA,EAAM,kBAINH,GAAoB,CAACA,EAAiB,UACxCA,EAAiB,SAASI,EAAQ,aAAcD,EAAM,WAAW,CAErE,EACA,CAACL,EAAeE,CAAgB,CAClC,EAEA,OACEN,GAACW,GAAO,SAAP,CACC,IAAKR,EACJ,GAAGE,EACJ,cAAeG,EACf,6BAA2B,GAC7B,CAEJ,CAAC,EChDD,UAAYI,OAAW,QAoBnB,cAAAC,OAAA,oBAPG,IAAMC,GA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xBI,EAAmBC,EAAyB,EAC5CC,EAAaJ,GAAYE,GAAkB,UAAY,GAE7D,OACEN,GAACS,GAAO,QAAP,CACC,IAAKN,EACJ,GAAGE,EACJ,SAAUG,EACV,4BAA0B,GAC5B,CAEJ,CAAC","names":["index_parts_exports","__export","CommandMenuBackdrop","PopupMenuCheckboxItem","PopupMenuCheckboxItemIndicator","PopupMenuEmpty","PopupMenuFocusZone","PopupMenuFooter","PopupMenuGroup","PopupMenuGroupLabel","PopupMenuHeader","PopupMenuIcon","CommandMenuInput","PopupMenuItem","PopupMenuLinkItem","PopupMenuList","PopupMenuLoading","CommandMenuPopup","CommandMenuPortal","CommandMenuRoot","PopupMenuSeparator","PopupMenuShortcut","CommandMenuSubpage","PopupMenuSubpageBack","PopupMenuSubpageBackItem","PopupMenuSubpageTrigger","PopupMenuSurface","CommandMenuTrigger","Dialog","React","jsx","CommandMenuBackdrop","props","forwardedRef","onPointerDown","rest","popupMenuContext","useMaybePopupMenuContext","handlePointerDown","event","reason_parts_exports","Dialog","React","jsx","CommandMenuInput","props","forwardedRef","backspaceGoesBack","rest","PopupMenuInput","Dialog","React","jsx","jsxs","CommandMenuPopup","props","forwardedRef","children","classNameProp","renderProp","rest","surfaceId","popupMenuContext","usePopupMenuContext","subpageStackContextValue","isSubpageNavigating","hasOpenSubpage","subpageId","useSubpageStackState","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","className","render","popupProps","dataPopupContextValue","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","Dialog","DataSubpagesContent","Dialog","CommandMenuPortal","Dialog","React","React","isEditableTarget","target","getEventKey","event","key","matchesModifiers","chord","isApple","isApplePlatform","meta","ctrl","matchesChord","useHotkey","keys","handler","options","keybinding","parseKeybinding","firstChord","isSequence","enabled","handlerRef","optionsRef","handleKeyDown","currentOptions","jsx","CommandMenuRoot","props","children","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","hotkey","modal","disabled","getResolvedId","idScope","store","focusOwnerStore","openChainStore","registerSurface","closeAll","handleOpenChange","menuDisabled","menuTreeResolver","usePopupMenuRoot","openState","useHotkey","reason_parts_exports","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","PopupMenuProviders","Dialog","jsx","CommandMenuSubpage","props","closeRootOnEsc","children","rest","PopupMenuSubpage","Dialog","React","jsx","CommandMenuTrigger","props","forwardedRef","disabled","rest","popupMenuContext","useMaybePopupMenuContext","isDisabled","Dialog"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkBEWVWSAWcjs = require('../chunk-BEWVWSAW.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var He={};_chunkM4G6J7DPcjs.a.call(void 0, He,{Arrow:()=>_chunkBEWVWSAWcjs.s,Backdrop:()=>_chunkBEWVWSAWcjs.t,CheckboxItem:()=>_chunkBEWVWSAWcjs.ha,CheckboxItemIndicator:()=>_chunkBEWVWSAWcjs.ia,Empty:()=>_chunkBEWVWSAWcjs.V,FocusZone:()=>_chunkBEWVWSAWcjs.pa,Footer:()=>_chunkBEWVWSAWcjs.qa,Group:()=>_chunkBEWVWSAWcjs.ra,GroupLabel:()=>_chunkBEWVWSAWcjs.X,GroupValue:()=>_chunkBEWVWSAWcjs.sa,Header:()=>_chunkBEWVWSAWcjs.ta,Icon:()=>_chunkBEWVWSAWcjs.U,Input:()=>_chunkBEWVWSAWcjs.W,Item:()=>_chunkBEWVWSAWcjs.ja,LinkItem:()=>_chunkBEWVWSAWcjs.ka,List:()=>_chunkBEWVWSAWcjs.ca,Popup:()=>_chunkBEWVWSAWcjs.K,Portal:()=>_chunkBEWVWSAWcjs.L,Positioner:()=>_chunkBEWVWSAWcjs.N,RadioGroup:()=>_chunkBEWVWSAWcjs.la,RadioGroupValue:()=>_chunkBEWVWSAWcjs.ma,RadioItem:()=>_chunkBEWVWSAWcjs.na,RadioItemIndicator:()=>_chunkBEWVWSAWcjs.oa,Root:()=>Ee,ScrollDownArrow:()=>_chunkBEWVWSAWcjs.fa,ScrollUpArrow:()=>_chunkBEWVWSAWcjs.ea,Separator:()=>_chunkBEWVWSAWcjs.ua,Shortcut:()=>_chunkBEWVWSAWcjs.va,Submenu:()=>_chunkBEWVWSAWcjs.za,SubmenuTrigger:()=>_chunkBEWVWSAWcjs.Ba,SubmenuTriggerIndicator:()=>_chunkBEWVWSAWcjs.Aa,Subpage:()=>_chunkBEWVWSAWcjs.Ca,SubpageBack:()=>_chunkBEWVWSAWcjs.Da,SubpageBackItem:()=>_chunkBEWVWSAWcjs.Ea,SubpageTrigger:()=>_chunkBEWVWSAWcjs.Fa,Surface:()=>_chunkBEWVWSAWcjs.ga,Tree:()=>_chunkBEWVWSAWcjs.wa,TreeConnector:()=>_chunkBEWVWSAWcjs.xa,TreeItem:()=>_chunkBEWVWSAWcjs.ya,Trigger:()=>Ve,useAsyncMenuCoordinator:()=>_chunkBEWVWSAWcjs.F,useDataList:()=>_chunkBEWVWSAWcjs.D,useMaybeAsyncMenuCoordinator:()=>_chunkBEWVWSAWcjs.G,useMaybeDataList:()=>_chunkBEWVWSAWcjs.E});var _popover = require('@base-ui/react/popover');var _react = require('react'); var u = _interopRequireWildcard(_react); var a = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var we=u.createContext(null);function Oe(){let d=u.useContext(we);if(!d)throw new Error("ContextMenu components must be used within a ContextMenu.Root");return d}function Le(d,i,p=!1){let o=p?10:0;return{getBoundingClientRect(){return DOMRect.fromRect({width:o,height:o,x:d,y:i})}}}function Ee(d){let{open:i,onOpenChange:p,defaultOpen:o=!1,virtualized:m=!1,items:n,onHighlightChange:e,disabled:P=!1,modal:v=!0,closeOnOutsidePress:b="pointerdown",onOpenChangeComplete:f,actionsRef:R,getResolvedId:r,idScope:E="surface",debug:h,children:C}=d,{store:l,focusOwnerStore:z,openChainStore:M,registerSurface:G,closeAll:I,virtualization:S,handleOpenChange:s,disabled:c,setDisabled:L,menuTreeResolver:V}=_chunkBEWVWSAWcjs.q.call(void 0, {onOpenChange:p,defaultOpen:o,virtualized:m,items:n,onHighlightChange:e,closeOnOutsidePress:b,disabled:P,getResolvedId:r,idScope:E}),k=u.useRef(null);u.useImperativeHandle(R,()=>({close:()=>{_optionalChain([k, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.close, 'call', _4 => _4()])},unmount:()=>{_optionalChain([k, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.unmount, 'call', _7 => _7()])},setDisabled:L}),[L]),l.useControlledProp("openProp",i);let y=l.useState("open"),[H,F]=u.useState(()=>Le(0,0)),t=u.useCallback((g,O,so=!1)=>{F(Le(g,O,so))},[]),x=u.useCallback(()=>{c||l.setOpen(!0)},[l,c]),T=u.useCallback(()=>{s(!1)},[s]),w=u.useCallback(g=>{!g&&l.context.clearSearchOnClose==="after-exit"&&(l.clearSearch(),l.setInputActive(!1)),g||(l.clearHighlight(),_optionalChain([l, 'access', _8 => _8.context, 'access', _9 => _9.onCloseComplete, 'optionalCall', _10 => _10()]),_optionalChain([l, 'access', _11 => _11.context, 'access', _12 => _12.onPopupCloseComplete, 'optionalCall', _13 => _13()])),_optionalChain([f, 'optionalCall', _14 => _14(g)])},[l,f]),_=u.useCallback((g,O)=>{s(g,O.reason,O.event)},[s]),ro=u.useMemo(()=>({setAnchorPosition:t,openMenu:x,closeMenu:T,disabled:c,open:y}),[t,x,T,c,y]);return _jsxruntime.jsx.call(void 0, we.Provider,{value:ro,children:_jsxruntime.jsx.call(void 0, _chunkBEWVWSAWcjs.O,{menuTreeResolver:V,store:l,focusOwnerStore:z,openChainStore:M,disabled:c,depth:0,closeAll:I,explicitTabBehavior:!0,registerSurface:G,virtualization:S,virtualAnchor:H,menuType:"context",closeOnOutsidePress:b,componentName:"context-menu",debug:h,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{open:y,onOpenChange:_,onOpenChangeComplete:w,modal:v,actionsRef:R?k:void 0,children:C})})})}var _userender = require('@base-ui/react/use-render');var X=(m=>(m.slot="bazzaui-context-menu-trigger",m.popupOpen="data-popup-open",m.pressed="data-pressed",m.disabled="data-disabled",m))(X||{});var Zo=500,Yo=10,Xo={open:d=>d?{"data-popup-open":""}:null,pressed:d=>d?{"data-pressed":""}:null,disabled:d=>d?{"data-disabled":""}:null},Ve=a.forwardRef(function(i,p){let{disabled:o=!1,render:m,className:n,style:e,onContextMenu:P,onTouchStart:v,onTouchMove:b,onTouchEnd:f,onTouchCancel:R,children:r,...E}=i,{setAnchorPosition:h,openMenu:C,disabled:l,open:z}=Oe(),M=o||l,[G,I]=a.useState(!1),S=a.useRef(null),s=a.useRef(null),c=a.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),I(!1)},[]);a.useEffect(()=>()=>{c()},[c]);let L=a.useCallback(t=>{_optionalChain([P, 'optionalCall', _15 => _15(t)]),!t.defaultPrevented&&(M||(t.preventDefault(),h(t.clientX,t.clientY,!1),C()))},[P,M,h,C]),V=a.useCallback(t=>{if(_optionalChain([v, 'optionalCall', _16 => _16(t)]),t.defaultPrevented||M)return;let x=t.touches[0];x&&(s.current={x:x.clientX,y:x.clientY},I(!0),S.current=setTimeout(()=>{s.current&&(h(s.current.x,s.current.y,!0),C(),I(!1),s.current=null)},Zo))},[v,M,h,C]),k=a.useCallback(t=>{if(_optionalChain([b, 'optionalCall', _17 => _17(t)]),!s.current)return;let x=t.touches[0];if(!x)return;let T=x.clientX-s.current.x,w=x.clientY-s.current.y;Math.sqrt(T*T+w*w)>Yo&&(c(),s.current=null)},[b,c]),y=a.useCallback(t=>{_optionalChain([f, 'optionalCall', _18 => _18(t)]),c(),s.current=null},[f,c]),H=a.useCallback(t=>{_optionalChain([R, 'optionalCall', _19 => _19(t)]),c(),s.current=null},[R,c]),F=a.useMemo(()=>({open:z,pressed:G,disabled:M}),[z,G,M]);return _userender.useRender.call(void 0, {render:m,ref:p,state:F,stateAttributesMapping:Xo,props:{...E,"bazzaui-context-menu-trigger":"",onContextMenu:L,onTouchStart:V,onTouchMove:k,onTouchEnd:y,onTouchCancel:H,className:n,style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none",...e},children:r},defaultTagName:"div"})});var Fe=(e=>(e.slot="bazzaui-context-menu-arrow",e.open="data-open",e.closed="data-closed",e.side="data-side",e.align="data-align",e.uncentered="data-uncentered",e))(Fe||{});var Be=(n=>(n.slot="bazzaui-context-menu-backdrop",n.open="data-open",n.closed="data-closed",n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n))(Be||{});var Ne=(n=>(n.slot="bazzaui-context-menu-checkbox-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))(Ne||{}),je= exports.ContextMenuCheckboxItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-checkbox-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(je||{});var Ue=(i=>(i.slot="bazzaui-context-menu-empty",i))(Ue||{});var Ze=(i=>(i.slot="bazzaui-context-menu-group",i))(Ze||{});var Ye=(i=>(i.slot="bazzaui-context-menu-group-label",i))(Ye||{});var _o={slot:"bazzaui-context-menu-icon",open:"data-popup-open"};var Xe=(o=>(o.slot="bazzaui-context-menu-input",o.open="data-open",o.closed="data-closed",o))(Xe||{});var _e=(o=>(o.slot="bazzaui-context-menu-item",o.highlighted="data-highlighted",o.disabled="data-disabled",o))(_e||{});var We=(P=>(P.slot="bazzaui-context-menu-link-item",P.highlighted="data-highlighted",P.disabled="data-disabled",P.first="data-first",P.last="data-last",P.firstInGroup="data-first-in-group",P.lastInGroup="data-last-in-group",P))(We||{});var qe=(p=>(p.slot="bazzaui-context-menu-list",p.list="data-popup-menu-list",p))(qe||{});var Qe=(r=>(r.slot="bazzaui-context-menu-popup",r.open="data-open",r.closed="data-closed",r.side="data-side",r.align="data-align",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r.instant="data-instant",r.focused="data-focused",r.hasOpenSubmenu="data-has-open-submenu",r.submenu="data-submenu",r.navigating="data-navigating",r))(Qe||{});var Je=(e=>(e.slot="bazzaui-context-menu-positioner",e.open="data-open",e.closed="data-closed",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e))(Je||{});var Ke=(p=>(p.slot="bazzaui-context-menu-radio-group",p.disabled="data-disabled",p))(Ke||{});var $e=(n=>(n.slot="bazzaui-context-menu-radio-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))($e||{}),De= exports.ContextMenuRadioItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-radio-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(De||{});var Wo={slotUp:"bazzaui-context-menu-scroll-up-arrow",slotDown:"bazzaui-context-menu-scroll-down-arrow",direction:"data-direction",side:"data-side"};var Ae=(i=>(i.slot="bazzaui-context-menu-separator",i))(Ae||{});var eo=(p=>(p.slot="bazzaui-context-menu-shortcut",p.highlighted="data-highlighted",p))(eo||{});var oo=(e=>(e.slot="bazzaui-context-menu-submenu-trigger",e.submenuTrigger="data-submenu-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(oo||{}),no= exports.ContextMenuSubmenuTriggerIndicatorDataAttributes =(p=>(p.slot="bazzaui-context-menu-submenu-trigger-indicator",p.popupOpen="data-popup-open",p))(no||{});var to=(o=>(o.slot="bazzaui-context-menu-subpage-back",o.canGoBack="data-can-go-back",o.disabled="data-disabled",o))(to||{});var uo=(m=>(m.slot="bazzaui-context-menu-subpage-back-item",m.subpageBackItem="data-subpage-back-item",m.highlighted="data-highlighted",m.disabled="data-disabled",m))(uo||{});var ao=(e=>(e.slot="bazzaui-context-menu-subpage-trigger",e.subpageTrigger="data-subpage-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(ao||{});var po=(i=>(i.slot="bazzaui-context-menu-surface",i))(po||{});exports.ContextMenu = He; exports.ContextMenuArrowDataAttributes = Fe; exports.ContextMenuBackdropDataAttributes = Be; exports.ContextMenuCheckboxItemDataAttributes = Ne; exports.ContextMenuCheckboxItemIndicatorDataAttributes = je; exports.ContextMenuEmptyDataAttributes = Ue; exports.ContextMenuGroupDataAttributes = Ze; exports.ContextMenuGroupLabelDataAttributes = Ye; exports.ContextMenuIconDataAttributes = _o; exports.ContextMenuInputDataAttributes = Xe; exports.ContextMenuItemDataAttributes = _e; exports.ContextMenuLinkItemDataAttributes = We; exports.ContextMenuListCssVars = _chunkBEWVWSAWcjs.ba; exports.ContextMenuListDataAttributes = qe; exports.ContextMenuPopupDataAttributes = Qe; exports.ContextMenuPositionerCssVars = _chunkBEWVWSAWcjs.M; exports.ContextMenuPositionerDataAttributes = Je; exports.ContextMenuRadioGroupDataAttributes = Ke; exports.ContextMenuRadioGroupValue = _chunkBEWVWSAWcjs.ma; exports.ContextMenuRadioItemDataAttributes = $e; exports.ContextMenuRadioItemIndicatorDataAttributes = De; exports.ContextMenuScrollArrowDataAttributes = Wo; exports.ContextMenuSeparatorDataAttributes = Ae; exports.ContextMenuShortcutDataAttributes = eo; exports.ContextMenuStore = _chunkXMZZ62VJcjs.y; exports.ContextMenuSubmenuTriggerDataAttributes = oo; exports.ContextMenuSubmenuTriggerIndicatorDataAttributes = no; exports.ContextMenuSubpageBackDataAttributes = to; exports.ContextMenuSubpageBackItemDataAttributes = uo; exports.ContextMenuSubpageTriggerDataAttributes = ao; exports.ContextMenuSurfaceDataAttributes = po; exports.ContextMenuTriggerDataAttributes = X; exports.DataListContext = _chunkBEWVWSAWcjs.C; exports.DataSurfaceContext = _chunkBEWVWSAWcjs.y; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.defaultGetResolvedId = _chunkBEWVWSAWcjs.p; exports.defineRadioGroup = _chunkBEWVWSAWcjs.Y; exports.isDisplayGroupNode = _chunkBEWVWSAWcjs.Z; exports.isDisplayRadioGroupNode = _chunkBEWVWSAWcjs._; exports.isDisplayRowNode = _chunkBEWVWSAWcjs.aa; exports.isPopupMenuNode = _chunkBEWVWSAWcjs.o; exports.isTreeItemDef = _chunkBEWVWSAWcjs.I; exports.useAsyncMenuCoordinator = _chunkBEWVWSAWcjs.F; exports.useDataList = _chunkBEWVWSAWcjs.D; exports.useDataSurfaceContext = _chunkBEWVWSAWcjs.A; exports.useItem = _chunkBEWVWSAWcjs.P; exports.useItemContext = _chunkXMZZ62VJcjs.g; exports.useMaybeAsyncMenuCoordinator = _chunkBEWVWSAWcjs.G; exports.useMaybeDataList = _chunkBEWVWSAWcjs.E; exports.useMaybeDataSurfaceContext = _chunkBEWVWSAWcjs.B; exports.useMaybeItemContext = _chunkXMZZ62VJcjs.h; exports.useMaybeRootContext = _chunkBEWVWSAWcjs.e; exports.useMaybeSubmenuContext = _chunkBEWVWSAWcjs.h; exports.useMaybeSubpageContext = _chunkBEWVWSAWcjs.j; exports.useMaybeSubpageStack = _chunkBEWVWSAWcjs.m; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useRootContext = _chunkBEWVWSAWcjs.d; exports.useSubmenuContext = _chunkBEWVWSAWcjs.g; exports.useSubpageContext = _chunkBEWVWSAWcjs.i; exports.useSubpageStack = _chunkBEWVWSAWcjs.l; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkRTG6U56Ocjs = require('../chunk-RTG6U56O.cjs');var _chunkXMZZ62VJcjs = require('../chunk-XMZZ62VJ.cjs');var _chunkPCNHYMD6cjs = require('../chunk-PCNHYMD6.cjs');var _chunkM4G6J7DPcjs = require('../chunk-M4G6J7DP.cjs');var Ne={};_chunkM4G6J7DPcjs.a.call(void 0, Ne,{Arrow:()=>_chunkRTG6U56Ocjs.s,Backdrop:()=>_chunkRTG6U56Ocjs.t,CheckboxItem:()=>_chunkRTG6U56Ocjs.ha,CheckboxItemIndicator:()=>_chunkRTG6U56Ocjs.ia,Empty:()=>_chunkRTG6U56Ocjs.V,FocusZone:()=>_chunkRTG6U56Ocjs.pa,Footer:()=>_chunkRTG6U56Ocjs.qa,Group:()=>_chunkRTG6U56Ocjs.ra,GroupLabel:()=>_chunkRTG6U56Ocjs.X,GroupValue:()=>_chunkRTG6U56Ocjs.sa,Header:()=>_chunkRTG6U56Ocjs.ta,Icon:()=>_chunkRTG6U56Ocjs.U,Input:()=>_chunkRTG6U56Ocjs.W,Item:()=>_chunkRTG6U56Ocjs.ja,LinkItem:()=>_chunkRTG6U56Ocjs.ka,List:()=>_chunkRTG6U56Ocjs.ca,Popup:()=>_chunkRTG6U56Ocjs.K,Portal:()=>_chunkRTG6U56Ocjs.L,Positioner:()=>_chunkRTG6U56Ocjs.N,RadioGroup:()=>_chunkRTG6U56Ocjs.la,RadioGroupValue:()=>_chunkRTG6U56Ocjs.ma,RadioItem:()=>_chunkRTG6U56Ocjs.na,RadioItemIndicator:()=>_chunkRTG6U56Ocjs.oa,Root:()=>He,ScrollDownArrow:()=>_chunkRTG6U56Ocjs.fa,ScrollUpArrow:()=>_chunkRTG6U56Ocjs.ea,Separator:()=>_chunkRTG6U56Ocjs.ua,Shortcut:()=>_chunkRTG6U56Ocjs.va,Submenu:()=>_chunkRTG6U56Ocjs.za,SubmenuTrigger:()=>_chunkRTG6U56Ocjs.Ba,SubmenuTriggerIndicator:()=>_chunkRTG6U56Ocjs.Aa,Subpage:()=>_chunkRTG6U56Ocjs.Ca,SubpageBack:()=>_chunkRTG6U56Ocjs.Da,SubpageBackItem:()=>_chunkRTG6U56Ocjs.Ea,SubpageTrigger:()=>_chunkRTG6U56Ocjs.Fa,Surface:()=>_chunkRTG6U56Ocjs.ga,Tree:()=>_chunkRTG6U56Ocjs.wa,TreeConnector:()=>_chunkRTG6U56Ocjs.xa,TreeItem:()=>_chunkRTG6U56Ocjs.ya,Trigger:()=>Fe,useAsyncMenuCoordinator:()=>_chunkRTG6U56Ocjs.F,useDataList:()=>_chunkRTG6U56Ocjs.D,useMaybeAsyncMenuCoordinator:()=>_chunkRTG6U56Ocjs.G,useMaybeDataList:()=>_chunkRTG6U56Ocjs.E});var _popover = require('@base-ui/react/popover');var _react = require('react'); var u = _interopRequireWildcard(_react); var a = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var Ee=u.createContext(null);function Ve(){let d=u.useContext(Ee);if(!d)throw new Error("ContextMenu components must be used within a ContextMenu.Root");return d}function Oe(d,i,p=!1){let o=p?10:0;return{getBoundingClientRect(){return DOMRect.fromRect({width:o,height:o,x:d,y:i})}}}function He(d){let{open:i,onOpenChange:p,defaultOpen:o=!1,virtualized:m=!1,items:n,onHighlightChange:e,disabled:P=!1,modal:z=!0,closeOnOutsidePress:b="pointerdown",onOpenChangeComplete:f,actionsRef:R,getResolvedId:r,idScope:V="surface",debug:h,children:C}=d,{store:l,focusOwnerStore:G,openChainStore:M,registerSurface:L,closeAll:I,virtualization:S,handleOpenChange:s,disabled:c,setDisabled:w,menuTreeResolver:H}=_chunkRTG6U56Ocjs.q.call(void 0, {onOpenChange:p,defaultOpen:o,virtualized:m,items:n,onHighlightChange:e,closeOnOutsidePress:b,disabled:P,getResolvedId:r,idScope:V}),y=u.useRef(null);u.useImperativeHandle(R,()=>({close:()=>{_optionalChain([y, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.close, 'call', _4 => _4()])},unmount:()=>{_optionalChain([y, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.unmount, 'call', _7 => _7()])},setDisabled:w}),[w]),l.useControlledProp("openProp",i);let k=l.useState("open"),[F,T]=u.useState(()=>Oe(0,0)),t=u.useCallback((g,E,lo=!1)=>{T(Oe(g,E,lo))},[]),x=u.useCallback(()=>{c||l.setOpen(!0)},[l,c]),v=u.useCallback(()=>{s(!1)},[s]),O=u.useCallback(g=>{!g&&l.context.clearSearchOnClose==="after-exit"&&(l.clearSearch(),l.setInputActive(!1)),g||(l.clearHighlight(),_optionalChain([l, 'access', _8 => _8.context, 'access', _9 => _9.onCloseComplete, 'optionalCall', _10 => _10()]),_optionalChain([l, 'access', _11 => _11.context, 'access', _12 => _12.onPopupCloseComplete, 'optionalCall', _13 => _13()])),_optionalChain([f, 'optionalCall', _14 => _14(g)])},[l,f]),_=u.useCallback((g,E)=>{s(g,E.reason,E.event)},[s]),io=u.useMemo(()=>({setAnchorPosition:t,openMenu:x,closeMenu:v,disabled:c,open:k}),[t,x,v,c,k]);return _jsxruntime.jsx.call(void 0, Ee.Provider,{value:io,children:_jsxruntime.jsx.call(void 0, _chunkRTG6U56Ocjs.O,{menuTreeResolver:H,store:l,focusOwnerStore:G,openChainStore:M,disabled:c,depth:0,closeAll:I,explicitTabBehavior:!0,registerSurface:L,virtualization:S,virtualAnchor:F,menuType:"context",closeOnOutsidePress:b,componentName:"context-menu",debug:h,children:_jsxruntime.jsx.call(void 0, _popover.Popover.Root,{open:k,onOpenChange:_,onOpenChangeComplete:O,modal:z,actionsRef:R?y:void 0,children:C})})})}var _userender = require('@base-ui/react/use-render');var X=(m=>(m.slot="bazzaui-context-menu-trigger",m.popupOpen="data-popup-open",m.pressed="data-pressed",m.disabled="data-disabled",m))(X||{});var Xo=500,_o=10,Wo={open:d=>d?{"data-popup-open":""}:null,pressed:d=>d?{"data-pressed":""}:null,disabled:d=>d?{"data-disabled":""}:null},Fe=a.forwardRef(function(i,p){let{disabled:o=!1,render:m,className:n,style:e,onContextMenu:P,onTouchStart:z,onTouchMove:b,onTouchEnd:f,onTouchCancel:R,children:r,...V}=i,{setAnchorPosition:h,openMenu:C,disabled:l,open:G}=Ve(),M=o||l,[L,I]=a.useState(!1),S=a.useRef(null),s=a.useRef(null),c=a.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),I(!1)},[]);a.useEffect(()=>()=>{c()},[c]);let w=a.useCallback(t=>{_optionalChain([P, 'optionalCall', _15 => _15(t)]),!t.defaultPrevented&&(M||(t.preventDefault(),h(t.clientX,t.clientY,!1),C()))},[P,M,h,C]),H=a.useCallback(t=>{if(_optionalChain([z, 'optionalCall', _16 => _16(t)]),t.defaultPrevented||M)return;let x=t.touches[0];x&&(s.current={x:x.clientX,y:x.clientY},I(!0),S.current=setTimeout(()=>{s.current&&(h(s.current.x,s.current.y,!0),C(),I(!1),s.current=null)},Xo))},[z,M,h,C]),y=a.useCallback(t=>{if(_optionalChain([b, 'optionalCall', _17 => _17(t)]),!s.current)return;let x=t.touches[0];if(!x)return;let v=x.clientX-s.current.x,O=x.clientY-s.current.y;Math.sqrt(v*v+O*O)>_o&&(c(),s.current=null)},[b,c]),k=a.useCallback(t=>{_optionalChain([f, 'optionalCall', _18 => _18(t)]),c(),s.current=null},[f,c]),F=a.useCallback(t=>{_optionalChain([R, 'optionalCall', _19 => _19(t)]),c(),s.current=null},[R,c]),T=a.useMemo(()=>({open:G,pressed:L,disabled:M}),[G,L,M]);return _userender.useRender.call(void 0, {render:m,ref:p,state:T,stateAttributesMapping:Wo,props:{...V,"bazzaui-context-menu-trigger":"",onContextMenu:w,onTouchStart:H,onTouchMove:y,onTouchEnd:k,onTouchCancel:F,className:_chunkPCNHYMD6cjs.a.call(void 0, n,T),style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none",..._chunkPCNHYMD6cjs.b.call(void 0, e,T)},children:r},defaultTagName:"div"})});var Be=(e=>(e.slot="bazzaui-context-menu-arrow",e.open="data-open",e.closed="data-closed",e.side="data-side",e.align="data-align",e.uncentered="data-uncentered",e))(Be||{});var je=(n=>(n.slot="bazzaui-context-menu-backdrop",n.open="data-open",n.closed="data-closed",n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n))(je||{});var Ue=(n=>(n.slot="bazzaui-context-menu-checkbox-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))(Ue||{}),Ze= exports.ContextMenuCheckboxItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-checkbox-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(Ze||{});var Ye=(i=>(i.slot="bazzaui-context-menu-empty",i))(Ye||{});var Xe=(i=>(i.slot="bazzaui-context-menu-group",i))(Xe||{});var _e=(i=>(i.slot="bazzaui-context-menu-group-label",i))(_e||{});var qo={slot:"bazzaui-context-menu-icon",open:"data-popup-open"};var We=(o=>(o.slot="bazzaui-context-menu-input",o.open="data-open",o.closed="data-closed",o))(We||{});var qe=(o=>(o.slot="bazzaui-context-menu-item",o.highlighted="data-highlighted",o.disabled="data-disabled",o))(qe||{});var Qe=(P=>(P.slot="bazzaui-context-menu-link-item",P.highlighted="data-highlighted",P.disabled="data-disabled",P.first="data-first",P.last="data-last",P.firstInGroup="data-first-in-group",P.lastInGroup="data-last-in-group",P))(Qe||{});var Je=(p=>(p.slot="bazzaui-context-menu-list",p.list="data-popup-menu-list",p))(Je||{});var Ke=(r=>(r.slot="bazzaui-context-menu-popup",r.open="data-open",r.closed="data-closed",r.side="data-side",r.align="data-align",r.startingStyle="data-starting-style",r.endingStyle="data-ending-style",r.instant="data-instant",r.focused="data-focused",r.hasOpenSubmenu="data-has-open-submenu",r.submenu="data-submenu",r.navigating="data-navigating",r))(Ke||{});var $e=(e=>(e.slot="bazzaui-context-menu-positioner",e.open="data-open",e.closed="data-closed",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e))($e||{});var De=(p=>(p.slot="bazzaui-context-menu-radio-group",p.disabled="data-disabled",p))(De||{});var Ae=(n=>(n.slot="bazzaui-context-menu-radio-item",n.checked="data-checked",n.unchecked="data-unchecked",n.highlighted="data-highlighted",n.disabled="data-disabled",n))(Ae||{}),eo= exports.ContextMenuRadioItemIndicatorDataAttributes =(o=>(o.slot="bazzaui-context-menu-radio-item-indicator",o.checked="data-checked",o.unchecked="data-unchecked",o))(eo||{});var Qo={slotUp:"bazzaui-context-menu-scroll-up-arrow",slotDown:"bazzaui-context-menu-scroll-down-arrow",direction:"data-direction",side:"data-side"};var oo=(i=>(i.slot="bazzaui-context-menu-separator",i))(oo||{});var no=(p=>(p.slot="bazzaui-context-menu-shortcut",p.highlighted="data-highlighted",p))(no||{});var to=(e=>(e.slot="bazzaui-context-menu-submenu-trigger",e.submenuTrigger="data-submenu-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(to||{}),uo= exports.ContextMenuSubmenuTriggerIndicatorDataAttributes =(p=>(p.slot="bazzaui-context-menu-submenu-trigger-indicator",p.popupOpen="data-popup-open",p))(uo||{});var ao=(o=>(o.slot="bazzaui-context-menu-subpage-back",o.canGoBack="data-can-go-back",o.disabled="data-disabled",o))(ao||{});var po=(m=>(m.slot="bazzaui-context-menu-subpage-back-item",m.subpageBackItem="data-subpage-back-item",m.highlighted="data-highlighted",m.disabled="data-disabled",m))(po||{});var ro=(e=>(e.slot="bazzaui-context-menu-subpage-trigger",e.subpageTrigger="data-subpage-trigger",e.popupOpen="data-popup-open",e.popupFocused="data-popup-focused",e.highlighted="data-highlighted",e.disabled="data-disabled",e))(ro||{});var so=(i=>(i.slot="bazzaui-context-menu-surface",i))(so||{});exports.ContextMenu = Ne; exports.ContextMenuArrowDataAttributes = Be; exports.ContextMenuBackdropDataAttributes = je; exports.ContextMenuCheckboxItemDataAttributes = Ue; exports.ContextMenuCheckboxItemIndicatorDataAttributes = Ze; exports.ContextMenuEmptyDataAttributes = Ye; exports.ContextMenuGroupDataAttributes = Xe; exports.ContextMenuGroupLabelDataAttributes = _e; exports.ContextMenuIconDataAttributes = qo; exports.ContextMenuInputDataAttributes = We; exports.ContextMenuItemDataAttributes = qe; exports.ContextMenuLinkItemDataAttributes = Qe; exports.ContextMenuListCssVars = _chunkRTG6U56Ocjs.ba; exports.ContextMenuListDataAttributes = Je; exports.ContextMenuPopupDataAttributes = Ke; exports.ContextMenuPositionerCssVars = _chunkRTG6U56Ocjs.M; exports.ContextMenuPositionerDataAttributes = $e; exports.ContextMenuRadioGroupDataAttributes = De; exports.ContextMenuRadioGroupValue = _chunkRTG6U56Ocjs.ma; exports.ContextMenuRadioItemDataAttributes = Ae; exports.ContextMenuRadioItemIndicatorDataAttributes = eo; exports.ContextMenuScrollArrowDataAttributes = Qo; exports.ContextMenuSeparatorDataAttributes = oo; exports.ContextMenuShortcutDataAttributes = no; exports.ContextMenuStore = _chunkXMZZ62VJcjs.y; exports.ContextMenuSubmenuTriggerDataAttributes = to; exports.ContextMenuSubmenuTriggerIndicatorDataAttributes = uo; exports.ContextMenuSubpageBackDataAttributes = ao; exports.ContextMenuSubpageBackItemDataAttributes = po; exports.ContextMenuSubpageTriggerDataAttributes = ro; exports.ContextMenuSurfaceDataAttributes = so; exports.ContextMenuTriggerDataAttributes = X; exports.DataListContext = _chunkRTG6U56Ocjs.C; exports.DataSurfaceContext = _chunkRTG6U56Ocjs.y; exports.commandScore = _chunkXMZZ62VJcjs.w; exports.defaultFilter = _chunkXMZZ62VJcjs.x; exports.defaultGetResolvedId = _chunkRTG6U56Ocjs.p; exports.defineRadioGroup = _chunkRTG6U56Ocjs.Y; exports.isDisplayGroupNode = _chunkRTG6U56Ocjs.Z; exports.isDisplayRadioGroupNode = _chunkRTG6U56Ocjs._; exports.isDisplayRowNode = _chunkRTG6U56Ocjs.aa; exports.isPopupMenuNode = _chunkRTG6U56Ocjs.o; exports.isTreeItemDef = _chunkRTG6U56Ocjs.I; exports.useAsyncMenuCoordinator = _chunkRTG6U56Ocjs.F; exports.useDataList = _chunkRTG6U56Ocjs.D; exports.useDataSurfaceContext = _chunkRTG6U56Ocjs.A; exports.useItem = _chunkRTG6U56Ocjs.P; exports.useItemContext = _chunkXMZZ62VJcjs.g; exports.useMaybeAsyncMenuCoordinator = _chunkRTG6U56Ocjs.G; exports.useMaybeDataList = _chunkRTG6U56Ocjs.E; exports.useMaybeDataSurfaceContext = _chunkRTG6U56Ocjs.B; exports.useMaybeItemContext = _chunkXMZZ62VJcjs.h; exports.useMaybeRootContext = _chunkRTG6U56Ocjs.e; exports.useMaybeSubmenuContext = _chunkRTG6U56Ocjs.h; exports.useMaybeSubpageContext = _chunkRTG6U56Ocjs.j; exports.useMaybeSubpageStack = _chunkRTG6U56Ocjs.m; exports.useMaybeSurfaceContext = _chunkXMZZ62VJcjs.q; exports.useRootContext = _chunkRTG6U56Ocjs.d; exports.useSubmenuContext = _chunkRTG6U56Ocjs.g; exports.useSubpageContext = _chunkRTG6U56Ocjs.i; exports.useSubpageStack = _chunkRTG6U56Ocjs.l; exports.useSurfaceContext = _chunkXMZZ62VJcjs.p;
2
2
  //# sourceMappingURL=index.cjs.map