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

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 (146) hide show
  1. package/dist/combobox/index.cjs +1 -1
  2. package/dist/combobox/index.cjs.map +1 -1
  3. package/dist/combobox/index.d.ts +842 -834
  4. package/dist/combobox/index.js +1 -1
  5. package/dist/combobox/index.js.map +1 -1
  6. package/dist/command-menu/index.cjs +1 -1
  7. package/dist/command-menu/index.cjs.map +1 -1
  8. package/dist/command-menu/index.d.ts +123 -96
  9. package/dist/command-menu/index.js +1 -1
  10. package/dist/command-menu/index.js.map +1 -1
  11. package/dist/context-menu/index.cjs +1 -1
  12. package/dist/context-menu/index.cjs.map +1 -1
  13. package/dist/context-menu/index.d.ts +701 -658
  14. package/dist/context-menu/index.js +1 -1
  15. package/dist/context-menu/index.js.map +1 -1
  16. package/dist/dropdown-menu/index.cjs +1 -1
  17. package/dist/dropdown-menu/index.cjs.map +1 -1
  18. package/dist/dropdown-menu/index.d.ts +723 -680
  19. package/dist/dropdown-menu/index.js +1 -1
  20. package/dist/dropdown-menu/index.js.map +1 -1
  21. package/dist/events-DDOsDu4X.d.ts +2091 -0
  22. package/dist/index-Cabqj7qI.d.ts +2003 -0
  23. package/dist/index-D8OrKThQ.d.ts +977 -0
  24. package/dist/internal/listbox/index.cjs +1 -2
  25. package/dist/internal/listbox/index.d.ts +2 -272
  26. package/dist/internal/listbox/index.js +1 -2
  27. package/dist/internal/popup-menu/index.cjs +1 -2
  28. package/dist/internal/popup-menu/index.d.ts +4 -238
  29. package/dist/internal/popup-menu/index.js +1 -2
  30. package/dist/items-CD2hw6-3.js +2 -0
  31. package/dist/items-CD2hw6-3.js.map +1 -0
  32. package/dist/items-DYDljwnt.cjs +2 -0
  33. package/dist/items-DYDljwnt.cjs.map +1 -0
  34. package/dist/{items-B6HeFO_8.d.cts → items-ceX--VIv.d.ts} +21 -19
  35. package/dist/kbd/index.cjs +1 -1
  36. package/dist/kbd/index.cjs.map +1 -1
  37. package/dist/kbd/index.d.ts +35 -35
  38. package/dist/kbd/index.js +1 -1
  39. package/dist/kbd/index.js.map +1 -1
  40. package/dist/listbox-CnwUlLZA.js +2 -0
  41. package/dist/listbox-CnwUlLZA.js.map +1 -0
  42. package/dist/listbox-DYvJTiF6.cjs +2 -0
  43. package/dist/listbox-DYvJTiF6.cjs.map +1 -0
  44. package/dist/loaders/index.cjs +1 -1
  45. package/dist/loaders/index.cjs.map +1 -1
  46. package/dist/loaders/index.d.ts +218 -188
  47. package/dist/loaders/index.js +1 -1
  48. package/dist/loaders/index.js.map +1 -1
  49. package/dist/merge-element-props-0mpNO7ZH.cjs +2 -0
  50. package/dist/merge-element-props-0mpNO7ZH.cjs.map +1 -0
  51. package/dist/merge-element-props-PxUvRHax.js +2 -0
  52. package/dist/merge-element-props-PxUvRHax.js.map +1 -0
  53. package/dist/platform-C-sxBTRa.cjs +2 -0
  54. package/dist/platform-C-sxBTRa.cjs.map +1 -0
  55. package/dist/platform-C4_cGUkS.js +2 -0
  56. package/dist/platform-C4_cGUkS.js.map +1 -0
  57. package/dist/popup-menu-BBAzAXIe.cjs +2 -0
  58. package/dist/popup-menu-BBAzAXIe.cjs.map +1 -0
  59. package/dist/popup-menu-HmBMJEZc.js +2 -0
  60. package/dist/popup-menu-HmBMJEZc.js.map +1 -0
  61. package/dist/resolve-state-props-C-zbhdXd.cjs +2 -0
  62. package/dist/resolve-state-props-C-zbhdXd.cjs.map +1 -0
  63. package/dist/resolve-state-props-D31kizRZ.js +2 -0
  64. package/dist/resolve-state-props-D31kizRZ.js.map +1 -0
  65. package/dist/rolldown-runtime-5lHFv1cW.cjs +1 -0
  66. package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
  67. package/dist/select/index.cjs +1 -1
  68. package/dist/select/index.cjs.map +1 -1
  69. package/dist/select/index.d.ts +835 -828
  70. package/dist/select/index.js +1 -1
  71. package/dist/select/index.js.map +1 -1
  72. package/dist/suggestion-menu/index.cjs +4 -0
  73. package/dist/suggestion-menu/index.cjs.map +1 -0
  74. package/dist/suggestion-menu/index.d.ts +359 -0
  75. package/dist/suggestion-menu/index.js +4 -0
  76. package/dist/suggestion-menu/index.js.map +1 -0
  77. package/dist/types-BbN28E3_.d.ts +50 -0
  78. package/dist/video-player/index.cjs +2 -2
  79. package/dist/video-player/index.cjs.map +1 -1
  80. package/dist/video-player/index.d.ts +964 -1000
  81. package/dist/video-player/index.js +2 -2
  82. package/dist/video-player/index.js.map +1 -1
  83. package/package.json +14 -5
  84. package/dist/ListboxStore-B8oTpM57.d.cts +0 -453
  85. package/dist/ListboxStore-CV5vPUUc.d.ts +0 -453
  86. package/dist/chunk-4C666HHU.js +0 -2
  87. package/dist/chunk-4C666HHU.js.map +0 -1
  88. package/dist/chunk-5T5B5SPR.cjs +0 -2
  89. package/dist/chunk-5T5B5SPR.cjs.map +0 -1
  90. package/dist/chunk-A4Z5BY7H.js +0 -2
  91. package/dist/chunk-A4Z5BY7H.js.map +0 -1
  92. package/dist/chunk-BEWVWSAW.cjs +0 -2
  93. package/dist/chunk-BEWVWSAW.cjs.map +0 -1
  94. package/dist/chunk-EDZTZHQ4.js +0 -2
  95. package/dist/chunk-EDZTZHQ4.js.map +0 -1
  96. package/dist/chunk-IT372NHF.js +0 -2
  97. package/dist/chunk-IT372NHF.js.map +0 -1
  98. package/dist/chunk-JFEVUUPC.cjs +0 -2
  99. package/dist/chunk-JFEVUUPC.cjs.map +0 -1
  100. package/dist/chunk-KO3DXT3Y.js +0 -2
  101. package/dist/chunk-KO3DXT3Y.js.map +0 -1
  102. package/dist/chunk-LXXK4S4Q.js +0 -2
  103. package/dist/chunk-LXXK4S4Q.js.map +0 -1
  104. package/dist/chunk-M4G6J7DP.cjs +0 -2
  105. package/dist/chunk-M4G6J7DP.cjs.map +0 -1
  106. package/dist/chunk-SCDHQZFI.cjs +0 -2
  107. package/dist/chunk-SCDHQZFI.cjs.map +0 -1
  108. package/dist/chunk-XMZZ62VJ.cjs +0 -2
  109. package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
  110. package/dist/combobox/index.d.cts +0 -1066
  111. package/dist/command-menu/index.d.cts +0 -154
  112. package/dist/command-score-CTJ9NV6n.d.cts +0 -23
  113. package/dist/command-score-CTJ9NV6n.d.ts +0 -23
  114. package/dist/context-menu/index.d.cts +0 -696
  115. package/dist/dropdown-menu/index.d.cts +0 -723
  116. package/dist/events-BTHQ2OoH.d.ts +0 -1860
  117. package/dist/events-DVcrtGe3.d.cts +0 -1860
  118. package/dist/input-C95v6jB0.d.cts +0 -46
  119. package/dist/input-CYweYB_i.d.ts +0 -46
  120. package/dist/internal/listbox/index.cjs.map +0 -1
  121. package/dist/internal/listbox/index.d.cts +0 -272
  122. package/dist/internal/listbox/index.js.map +0 -1
  123. package/dist/internal/popup-menu/index.cjs.map +0 -1
  124. package/dist/internal/popup-menu/index.d.cts +0 -238
  125. package/dist/internal/popup-menu/index.js.map +0 -1
  126. package/dist/items-B6HeFO_8.d.ts +0 -37
  127. package/dist/kbd/index.d.cts +0 -61
  128. package/dist/loaders/index.d.cts +0 -363
  129. package/dist/loading-C6WZGUc3.d.cts +0 -29
  130. package/dist/loading-CC4n55sR.d.ts +0 -29
  131. package/dist/resolve-B-j0eW24.d.cts +0 -406
  132. package/dist/resolve-B1F-a3P1.d.ts +0 -406
  133. package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
  134. package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
  135. package/dist/select/index.d.cts +0 -1005
  136. package/dist/separator-Dn15rte3.d.ts +0 -275
  137. package/dist/separator-NjsBVzek.d.cts +0 -275
  138. package/dist/surface-context-CGLDpMej.d.ts +0 -14
  139. package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
  140. package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
  141. package/dist/type-guards-C0e_GpeY.d.ts +0 -351
  142. package/dist/types-DT4FOOa2.d.cts +0 -51
  143. package/dist/types-DT4FOOa2.d.ts +0 -51
  144. package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
  145. package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
  146. package/dist/video-player/index.d.cts +0 -1391
@@ -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.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../rolldown-runtime-5lHFv1cW.cjs"),t=require("../popup-menu-BBAzAXIe.cjs"),n=require("../listbox-DYvJTiF6.cjs"),r=require("../platform-C-sxBTRa.cjs");let i=require("react");i=e.n(i,1);let a=require("react/jsx-runtime"),o=require("@base-ui/react/dialog");const s=i.forwardRef(function(e,r){let{onPointerDown:s,...c}=e,l=t.Ft(),u=i.useCallback(e=>{s?.(e),!e.defaultPrevented&&l&&!l.disabled&&l.closeAll(n.M,e.nativeEvent)},[s,l]);return/* @__PURE__ */ (0,a.jsx)(o.Dialog.Backdrop,{ref:r,...c,onPointerDown:u,"data-command-menu-backdrop":``})}),c=i.forwardRef(function(e,n){let{backspaceGoesBack:r=!0,...i}=e;return/* @__PURE__ */ (0,a.jsx)(t.H,{ref:n,backspaceGoesBack:r,...i})}),l=i.forwardRef(function(e,n){let{children:r,className:s,render:c,...l}=e,u=i.useId(),d=t.It(),{subpageStackContextValue:f,isSubpageNavigating:p,hasOpenSubpage:m,subpageId:h}=t.xt({surfaceId:u,store:d.store}),[g,_]=i.useState(null),[v,y]=i.useState(null),b=i.useCallback(e=>({...e,hasOpenSubpage:m,subpageId:h}),[m,h]),x=i.useMemo(()=>typeof s==`function`?e=>s(b(e)):s,[s,b]),S=i.useMemo(()=>typeof c==`function`?(e,t)=>c(e,b(t)):c,[c,b]),C=i.useMemo(()=>({dataSurfaceContext:g,setDataSurfaceContext:_,resolvedNodes:v,setResolvedNodes:y}),[g,v]);return/* @__PURE__ */ (0,a.jsx)(t.Nt.Provider,{value:u,children:/* @__PURE__ */ (0,a.jsx)(t.Et.Provider,{value:f,children:/* @__PURE__ */ (0,a.jsx)(t.lt.Provider,{value:C,children:/* @__PURE__ */ (0,a.jsxs)(o.Dialog.Popup,{ref:n,className:x,render:S,"data-command-menu-popup":``,"data-navigating":p?``:void 0,"data-has-open-subpage":m?``:void 0,...l,children:[r,/* @__PURE__ */ (0,a.jsx)(t.nt,{})]})})})})}),u=o.Dialog.Portal;function d(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function f(e){let t=e.key.toLowerCase();return t===` `?`space`:t}function p(e,t){let n=r.t(),i=t.meta||n&&t.mod,a=t.ctrl||!n&&t.mod;return e.metaKey===i&&e.ctrlKey===a&&e.altKey===t.alt&&e.shiftKey===t.shift}function m(e,t){return t.key===f(e)&&p(e,t)}function h(e,t,n){let a=i.useMemo(()=>r.a(e),[e]),[o]=a.chords,s=a.chords.length===1&&o!==void 0?o:null,c=a.chords.length>1,l=n?.enabled!==!1,u=i.useRef(t),f=i.useRef(n);u.current=t,f.current=n,i.useEffect(()=>{c&&process.env.NODE_ENV!==`production`&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[c,e]),i.useEffect(()=>{if(!l||s===null||c||s.key===null)return;let e=e=>{let t=f.current;e.repeat||(t?.allowInInput||!d(e.target))&&m(e,s)&&(t?.preventDefault!==!1&&e.preventDefault(),u.current(e))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[s,l,c])}function g(e){let{children:r,open:s,defaultOpen:c=!1,onOpenChange:l,onOpenChangeComplete:u,hotkey:d,modal:f=!0,disabled:p,getResolvedId:m,idScope:g=`surface`,rangeSelection:_=!0,dragSelection:v=!1,getAriaSelectionText:y}=e,{store:b,focusOwnerStore:x,openChainStore:S,registerSurface:C,closeAll:w,handleOpenChange:T,disabled:E,menuTreeResolver:D}=t.St({onOpenChange:l,defaultOpen:c,disabled:p,closeOnOutsidePress:`pointerdown`,getResolvedId:m,idScope:g});b.useControlledProp(`openProp`,s);let O=b.useState(`open`);h(d??``,()=>T(!b.select(`open`),n.O),{enabled:!!d&&!E,allowInInput:!0});let k=i.useCallback((e,t)=>{T(e,t.reason,t.event)},[T]),A=i.useCallback(e=>{!e&&b.context.clearSearchOnClose===`after-exit`&&(b.clearSearch(),b.setInputActive(!1)),e||(b.clearHighlight(),b.context.onCloseComplete?.(),b.context.onPopupCloseComplete?.()),u?.(e)},[b,u]);return/* @__PURE__ */ (0,a.jsx)(t.Z,{menuTreeResolver:D,store:b,focusOwnerStore:x,openChainStore:S,disabled:E,depth:0,closeAll:w,explicitTabBehavior:!0,tabWithoutZones:`inert`,registerSurface:C,menuType:`dropdown`,closeOnOutsidePress:`pointerdown`,rangeSelection:_,dragSelection:v,getAriaSelectionText:y,componentName:`command-menu`,children:/* @__PURE__ */ (0,a.jsx)(o.Dialog.Root,{open:O,onOpenChange:k,onOpenChangeComplete:A,modal:f,children:r})})}function _(e){let{closeRootOnEsc:n=!0,children:r,...i}=e;return/* @__PURE__ */ (0,a.jsx)(t.i,{closeRootOnEsc:n,...i,children:r})}const v=i.forwardRef(function(e,n){let{disabled:r,...i}=e,s=t.Ft(),c=r||s?.disabled||!1;return/* @__PURE__ */ (0,a.jsx)(o.Dialog.Trigger,{ref:n,...i,disabled:c,"data-command-menu-trigger":``})});var y=/* @__PURE__ */ e.t({Backdrop:()=>s,CheckboxGroup:()=>t.E,CheckboxGroupValue:()=>t.st,CheckboxItem:()=>t.T,CheckboxItemIndicator:()=>t.w,Empty:()=>t.U,FocusZone:()=>t._,Footer:()=>t.g,Group:()=>t.h,GroupLabel:()=>t.V,Header:()=>t.p,Icon:()=>t.W,Input:()=>c,Item:()=>t.C,LinkItem:()=>t.S,List:()=>t.M,Loading:()=>t.j,Popup:()=>l,Portal:()=>u,Root:()=>g,Separator:()=>t.f,Shortcut:()=>t.d,Subpage:()=>_,SubpageBack:()=>t.r,SubpageBackItem:()=>t.n,SubpageTrigger:()=>t.t,Surface:()=>t.D,Trigger:()=>v});Object.defineProperty(exports,"CommandMenu",{enumerable:!0,get:function(){return y}}),exports.CommandMenuCheckboxGroupValue=t.st,exports.CommandMenuRadioGroupValue=t.b,exports.DataListContext=t.ct,exports.DataSurfaceContext=t.ut,exports.defaultGetResolvedId=t.Ct,exports.defineCheckboxGroup=t.P,exports.defineRadioGroup=t.F,exports.isDisplayCheckboxGroupNode=t.I,exports.isDisplayGroupNode=t.L,exports.isDisplayRadioGroupNode=t.R,exports.isDisplayRowNode=t.z,exports.isDisplaySeparatorNode=t.B,exports.isPopupMenuNode=t.wt,exports.useAsyncMenuCoordinator=t.at,exports.useDataList=t.dt,exports.useDataSurfaceContext=t.ft,exports.useMaybeAsyncMenuCoordinator=t.ot,exports.useMaybeDataList=t.pt,exports.useMaybeDataSurfaceContext=t.mt,exports.useMaybeSurfaceContext=n.u,exports.useSurfaceContext=n.d;
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,oBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,UAAA,CAAA,CAAA,CAAA,EAAAC,mBAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAAC,mBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,EAAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAAC,oBAAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAAC,EAAAA,CAAA,MAAA,CAAA,CAAA,CAAA,EAAAC,EAAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAAC,EAAAA,CAAA,SAA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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,"file":"index.cjs","names":["React","useMaybePopupMenuContext","Dialog","React","PopupMenuInput","React","usePopupMenuContext","useSubpageStackState","PopupSurfaceIdContext","SubpageStackContext","DataPopupContext","Dialog","DataSubpagesContent","Dialog","isApplePlatform","React","parseKeybinding","usePopupMenuRoot","React","PopupMenuProviders","Dialog","PopupMenuSubpage","React","useMaybePopupMenuContext","Dialog","require_rolldown_runtime","require_popup_menu","require_listbox","require_platform","react","react_jsx_runtime","_base_ui_react_dialog","CommandMenuBackdrop","rest","props","popupMenuContext","handlePointerDown","onPointerDown","event","forwardedRef","CommandMenuInput","CommandMenuPopup","classNameProp","renderProp","surfaceId","dataSurfaceContext","setDataSurfaceContext","resolvedNodes","setResolvedNodes","toPopupState","baseState","hasOpenSubpage","subpageId","className","render","popupProps","dataPopupContextValue","subpageStackContextValue","isSubpageNavigating","children","CommandMenuPortal","isEditableTarget","target","getEventKey","key","matchesModifiers","isApple","meta","chord","ctrl","matchesChord","useHotkey","keybinding","keys","firstChord","isSequence","enabled","options","handlerRef","handler","optionsRef","handleKeyDown","currentOptions","CommandMenuRoot","openProp","menuDisabled","store","openState","hotkey","handleOpenChange","handleDialogOpenChange","nextOpen","dialogDetails","handleDialogOpenChangeComplete","onOpenChangeComplete","CommandMenuSubpage","CommandMenuTrigger","isDisabled","disabled","index_parts_exports"],"sources":["../../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/kbd/hooks/use-hotkey.ts","../../src/command-menu/root/root.tsx","../../src/command-menu/subpage/subpage.tsx","../../src/command-menu/trigger/trigger.tsx","../../src/command-menu/index.parts.ts"],"sourcesContent":["'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 * 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 { 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 /** Whether the command menu is open. To render an uncontrolled menu, use `defaultOpen` instead. */\n open?: boolean\n /**\n * Whether the command menu is open when it first renders. To render a controlled menu, use `open` instead.\n * @default false\n */\n defaultOpen?: boolean\n /** Called when the command menu opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** Called after the open or close animation finishes. */\n onOpenChangeComplete?: (open: boolean) => void\n /**\n * A keyboard shortcut that toggles the menu from anywhere on the page, such as `'mod+k'`.\n * `mod` is Command on Apple platforms and Control elsewhere. It also works while focus is in `CommandMenu.Input`, so the same shortcut closes the menu.\n */\n hotkey?: string\n /**\n * Whether the menu is modal: page scroll is locked and outside elements can't be interacted with while it's open.\n * @default true\n */\n modal?: boolean\n /**\n * Whether the menu ignores the user opening or closing it: the trigger is disabled and the `hotkey` does nothing.\n * @default false\n */\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 * Whether shift-clicking a checkbox item (or pressing Shift+Enter on the\n * highlighted one) sets every checkbox item between it and the last\n * checkbox item you interacted with to the same checked state. Also\n * enables the keyboard span: hold Shift while moving the highlight, release\n * Shift to apply.\n * @default true\n */\n rangeSelection?: boolean\n /**\n * Lets the user press a checkbox item and drag across others to set them all\n * to the pressed item's new state. Off by default. `'keep'` keeps rows set\n * once the pointer has reached them; `'rubber-band'` returns rows outside the\n * current span to their previous state. Mouse and pen only.\n * @default false\n */\n dragSelection?: false | 'keep' | 'rubber-band'\n /**\n * Returns the text announced to screen readers after a range or drag\n * selection changes rows, for localization. `count` is the number of rows\n * changed and `checked` the state they were set to. Defaults to English\n * (\"3 items checked\", \"1 item unchecked\").\n */\n getAriaSelectionText?: (count: number, checked: boolean) => string\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 rangeSelection = true,\n dragSelection = false,\n getAriaSelectionText,\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.select('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 rangeSelection={rangeSelection}\n dragSelection={dragSelection}\n getAriaSelectionText={getAriaSelectionText}\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 {\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","// ============================================================================\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 PopupMenuCheckboxGroup as CheckboxGroup,\n PopupMenuCheckboxGroupValue as CheckboxGroupValue,\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"],"mappings":"2XAkBA,MAAagC,EAAsBhC,EAAM,WAGvC,SAA6B,EAAO,EAAc,CAClD,GAAM,CAAE,gBAAe,GAAGiC,GAASC,EAC7BC,EAAmBlC,EAAAA,GAAyB,EAE5CmC,EAAoBpC,EAAM,YAG7B,GAAU,CACTqC,IAAgBC,CAAK,EAEjB,GAAM,kBAINH,GAAoB,CAACA,EAAiB,UACxCA,EAAiB,SAAAR,EAAA,EAA+BW,EAAM,WAAW,CAErE,EACA,CAACD,EAAeF,CAAgB,CAClC,EA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C0E,EAAaC,GAAY/D,GAAkB,UAAY,GAE7D,MACE,iBAAA,EAAAL,EAAA,IAAA,CAACN,EAAAA,OAAO,QAAR,CACE,IAAKe,EACL,GAAIN,EACJ,SAAUgE,EACV,4BAA0B,EAC3B,CAAA,CAEL,CAAC"}
@@ -1,23 +1,11 @@
1
- import { h as GetResolvedIdFn, j as PopupMenuIdScope, m as PopupMenuCheckboxItem, q as PopupMenuItem, r as PopupMenuLinkItem, u as PopupMenuNode, N as NodeDef, y as PopupMenuSubpageTrigger } from '../events-BTHQ2OoH.js';
2
- export { R as AsyncLoaderConfig, S as AsyncLoaderFetchStatus, T as AsyncLoaderLoadingPhase, U as AsyncLoaderResult, V as AsyncLoaderSource, W as AsyncLoaderStatus, X as AsyncNodesConfig, Y as AsyncRenderState, Z as AsyncResultBehavior, _ as AsyncState, $ as BreadcrumbNode, a0 as CheckboxItemDef, a1 as CheckboxItemRenderParams, a2 as CheckboxItemRenderProps, z as CommandMenuCheckboxItemProps, A as CommandMenuCheckboxItemState, B as CommandMenuItemProps, D as CommandMenuItemState, E as CommandMenuLinkItemProps, F as CommandMenuLinkItemState, O as CommandMenuSubpageTriggerProps, Q as CommandMenuSubpageTriggerState, a3 as DataListChildrenState, a4 as DeepSearchConfig, a5 as DisabledBranchBehavior, a6 as DisplayGroupNode, a7 as DisplayNode, a8 as DisplayRadioGroupNode, a9 as DisplayRowNode, aa as DisplaySeparatorNode, ab as DisplaySubpageNode, ac as GroupBehavior, ad as GroupDef, af as GroupRenderContext, ag as GroupRenderParams, ah as IncludeInDeepSearch, ai as InitialQueryBehavior, aj as ItemDef, ak as ItemRenderParams, al as ItemRenderProps, am as LinkItemDef, an as LinkItemRenderParams, ao as LinkItemRenderProps, ap as LoaderComponentProps, aq as QueryAsyncNodesConfig, ar as QueryLoaderConfig, as as RadioGroupBehavior, at as RadioGroupDef, av as RadioGroupRenderParams, aw as RadioGroupRenderProps, ax as RadioItemDef, ay as RadioItemRenderParams, az as RadioItemRenderProps, aA as RowRenderContext, aB as ScoredNode, aC as SeparatorDef, aD as SeparatorRenderParams, aE as StaticAsyncNodesConfig, aF as StaticLoaderConfig, aG as SubmenuDef, aH as SubmenuRenderParams, aI as SubmenuRenderProps, aJ as SubpageContentRenderParams, aK as SubpageDef, aL as SubpageTriggerRenderParams, aM as SubpageTriggerRenderProps, aQ as UnresolvedMenuNode, aR as defineRadioGroup, aS as isDisplayGroupNode, aT as isDisplayRadioGroupNode, aU as isDisplayRowNode, aV as isDisplaySeparatorNode } from '../events-BTHQ2OoH.js';
3
- export { S as SurfaceContextValue, u as useMaybeSurfaceContext, a as useSurfaceContext } from '../surface-context-CGLDpMej.js';
4
- import { P as PopupMenuEmpty, a as PopupMenuGroup, b as PopupMenuGroupLabel, c as PopupMenuIcon, d as PopupMenuList, e as PopupMenuSeparator, f as PopupMenuSurface } from '../separator-Dn15rte3.js';
5
- export { g as CommandMenuEmptyProps, h as CommandMenuEmptyState, i as CommandMenuGroupLabelProps, j as CommandMenuGroupLabelState, k as CommandMenuGroupProps, l as CommandMenuGroupState, m as CommandMenuIconProps, n as CommandMenuIconState, o as CommandMenuListChildrenState, p as CommandMenuListProps, q as CommandMenuListState, r as CommandMenuSeparatorProps, s as CommandMenuSeparatorState, t as CommandMenuSurfaceProps, u as CommandMenuSurfaceState } from '../separator-Dn15rte3.js';
6
- import { P as PopupMenuLoading } from '../loading-CC4n55sR.js';
7
- export { a as CommandMenuLoadingProps, b as CommandMenuLoadingState } from '../loading-CC4n55sR.js';
8
- import { A as PopupMenuSubpageProps, P as PopupMenuCheckboxItemIndicator, a as PopupMenuFocusZone, b as PopupMenuFooter, c as PopupMenuHeader, e as PopupMenuShortcut, g as PopupMenuSubpageBack, h as PopupMenuSubpageBackItem } from '../resolve-B1F-a3P1.js';
9
- export { B as AsyncMenuCoordinatorValue, l as CommandMenuCheckboxItemIndicatorProps, m as CommandMenuCheckboxItemIndicatorState, n as CommandMenuFocusZoneProps, o as CommandMenuFocusZoneState, p as CommandMenuFooterProps, q as CommandMenuFooterState, r as CommandMenuHeaderProps, s as CommandMenuHeaderState, d as CommandMenuRadioGroupValue, C as CommandMenuRadioGroupValueProps, t as CommandMenuShortcutProps, v as CommandMenuShortcutState, w as CommandMenuSubpageBackItemProps, x as CommandMenuSubpageBackItemState, y as CommandMenuSubpageBackProps, z as CommandMenuSubpageBackState, E as DataListContext, F as DataSurfaceContext, D as DataSurfaceContextValue, R as RenderNodeFn, G as defaultGetResolvedId, H as isPopupMenuNode, u as useAsyncMenuCoordinator, i as useDataList, I as useDataSurfaceContext, j as useMaybeAsyncMenuCoordinator, k as useMaybeDataList, J as useMaybeDataSurfaceContext } from '../resolve-B1F-a3P1.js';
10
- import * as _base_ui_react_dialog from '@base-ui/react/dialog';
11
- import { Dialog } from '@base-ui/react/dialog';
12
- import * as React from 'react';
13
- import { a as PopupMenuInputProps, b as PopupMenuInputState } from '../input-CYweYB_i.js';
14
- import { a as ComponentRenderFn } from '../types-DT4FOOa2.js';
15
- import * as react_jsx_runtime from 'react/jsx-runtime';
16
- import '../ListboxStore-CV5vPUUc.js';
17
- import '@base-ui/utils/store';
18
-
19
- interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {
20
- }
1
+ import { b as useMaybeSurfaceContext, x as useSurfaceContext, y as SurfaceContextValue } from "../index-D8OrKThQ.js";
2
+ import { $ as LinkItemRenderParams, $t as PopupMenuItemState, A as CheckboxItemRenderProps, At as defineRadioGroup, B as DisplaySeparatorNode, C as CheckboxGroupBehavior, Ct as SubpageDef, D as CheckboxGroupRenderProps, E as CheckboxGroupRenderParams, F as DisplayCheckboxGroupNode, Ft as isDisplaySeparatorNode, G as GroupRenderContext, H as GroupBehavior, I as DisplayGroupNode, It as PopupMenuSubpageTrigger, J as InitialQueryBehavior, Jt as PopupMenuLinkItem, K as GroupRenderParams, L as DisplayNode, Lt as PopupMenuSubpageTriggerProps, Mt as isDisplayGroupNode, N as DeepSearchConfig, Nt as isDisplayRadioGroupNode, O as CheckboxItemDef, P as DisabledBranchBehavior, Pt as isDisplayRowNode, Q as LinkItemDef, Qt as PopupMenuItemProps, R as DisplayRadioGroupNode, Rt as PopupMenuSubpageTriggerState, S as BreadcrumbNode, St as SubpageContentRenderParams, T as CheckboxGroupLabelRenderParams, Tt as SubpageTriggerRenderProps, U as GroupDef, V as DisplaySubpageNode, X as ItemRenderParams, Xt as PopupMenuLinkItemState, Y as ItemDef, Yt as PopupMenuLinkItemProps, Z as ItemRenderProps, Zt as PopupMenuItem, _ as AsyncLoaderStatus, _t as StaticAsyncNodesConfig, an as PopupMenuCheckboxGroupState, at as RadioGroupBehavior, b as AsyncResultBehavior, bt as SubmenuRenderParams, c as PopupMenuIdScope, ct as RadioGroupRenderParams, d as AsyncContentMode, dt as RadioItemRenderParams, en as PopupMenuCheckboxItem, et as LinkItemRenderProps, f as AsyncLoaderConfig, ft as RadioItemRenderProps, g as AsyncLoaderSource, gt as SeparatorRenderParams, h as AsyncLoaderResult, ht as SeparatorDef, in as PopupMenuCheckboxGroupProps, it as QueryLoaderConfig, j as DataListChildrenState, jt as isDisplayCheckboxGroupNode, k as CheckboxItemRenderParams, kt as defineCheckboxGroup, l as PopupMenuNode, lt as RadioGroupRenderProps, m as AsyncLoaderLoadingPhase, mt as ScoredNode, nn as PopupMenuCheckboxItemState, nt as NodeDef, ot as RadioGroupDef, p as AsyncLoaderFetchStatus, pt as RowRenderContext, q as IncludeInDeepSearch, rn as PopupMenuCheckboxGroup, rt as QueryAsyncNodesConfig, s as GetResolvedIdFn, tn as PopupMenuCheckboxItemProps, tt as LoaderComponentProps, u as UnresolvedMenuNode, ut as RadioItemDef, v as AsyncNodesConfig, vt as StaticLoaderConfig, w as CheckboxGroupDef, wt as SubpageTriggerRenderParams, x as AsyncState, xt as SubmenuRenderProps, y as AsyncRenderState, yt as SubmenuDef, z as DisplayRowNode } from "../events-DDOsDu4X.js";
3
+ import { n as ComponentRenderFn } from "../types-BbN28E3_.js";
4
+ import { $ as PopupMenuFocusZoneProps, At as PopupMenuInputState, B as PopupMenuHeaderProps, Ct as PopupMenuList, Et as PopupMenuListState, F as PopupMenuShortcutState, Ft as PopupMenuIconProps, H as PopupMenuGroupLabel, I as PopupMenuSeparator, It as PopupMenuIconState, J as PopupMenuGroupState, K as PopupMenuGroup, L as PopupMenuSeparatorProps, Mt as PopupMenuEmptyProps, N as PopupMenuShortcut, Nt as PopupMenuEmptyState, P as PopupMenuShortcutProps, Pt as PopupMenuIcon, Q as PopupMenuFocusZone, R as PopupMenuSeparatorState, S as PopupMenuSubpageBackState, St as PopupMenuLoadingState, Tt as PopupMenuListProps, U as PopupMenuGroupLabelProps, V as PopupMenuHeaderState, W as PopupMenuGroupLabelState, X as PopupMenuFooterProps, Y as PopupMenuFooter, Z as PopupMenuFooterState, _ as PopupMenuSubpageBackItem, a as DataListContext, at as PopupMenuRadioGroupValueProps, b as PopupMenuSubpageBack, bt as PopupMenuLoading, c as DataSurfaceContextValue, ct as PopupMenuCheckboxItemIndicatorState, d as useDataSurfaceContext, dt as PopupMenuSurface, et as PopupMenuFocusZoneState, f as useMaybeDataList, ft as PopupMenuSurfaceProps, g as useMaybeAsyncMenuCoordinator, h as useAsyncMenuCoordinator, it as PopupMenuRadioGroupValue, jt as PopupMenuEmpty, kt as PopupMenuInputProps, l as RenderNodeFn, lt as PopupMenuCheckboxGroupValue, m as AsyncMenuCoordinatorValue, n as isPopupMenuNode, ot as PopupMenuCheckboxItemIndicator, p as useMaybeDataSurfaceContext, pt as PopupMenuSurfaceState, q as PopupMenuGroupProps, s as DataSurfaceContext, st as PopupMenuCheckboxItemIndicatorProps, t as defaultGetResolvedId, u as useDataList, ut as PopupMenuCheckboxGroupValueProps, v as PopupMenuSubpageBackItemProps, w as PopupMenuSubpageProps, wt as PopupMenuListChildrenState, x as PopupMenuSubpageBackProps, xt as PopupMenuLoadingProps, y as PopupMenuSubpageBackItemState, z as PopupMenuHeader } from "../index-Cabqj7qI.js";
5
+ import * as React from "react";
6
+ import { Dialog } from "@base-ui/react/dialog";
7
+ //#region src/command-menu/backdrop/backdrop.d.ts
8
+ interface CommandMenuBackdropProps extends Dialog.Backdrop.Props {}
21
9
  type CommandMenuBackdropState = Dialog.Backdrop.State;
22
10
  /**
23
11
  * An overlay displayed beneath the command menu popup.
@@ -29,45 +17,44 @@ type CommandMenuBackdropState = Dialog.Backdrop.State;
29
17
  */
30
18
  declare const CommandMenuBackdrop: React.ForwardRefExoticComponent<Omit<CommandMenuBackdrop.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
31
19
  declare namespace CommandMenuBackdrop {
32
- interface Props extends CommandMenuBackdropProps {
33
- }
34
- type State = CommandMenuBackdropState;
35
- }
36
-
37
- interface CommandMenuInputProps extends PopupMenuInputProps {
20
+ interface Props extends CommandMenuBackdropProps {}
21
+ type State = CommandMenuBackdropState;
38
22
  }
23
+ //#endregion
24
+ //#region src/command-menu/input/input.d.ts
25
+ interface CommandMenuInputProps extends PopupMenuInputProps {}
39
26
  type CommandMenuInputState = PopupMenuInputState;
40
27
  /**
41
28
  * Search input for filtering command menu items.
42
29
  */
43
30
  declare const CommandMenuInput: React.ForwardRefExoticComponent<Omit<CommandMenuInput.Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
44
31
  declare namespace CommandMenuInput {
45
- interface Props extends CommandMenuInputProps {
46
- }
47
- type State = CommandMenuInputState;
32
+ interface Props extends CommandMenuInputProps {}
33
+ type State = CommandMenuInputState;
48
34
  }
49
-
35
+ //#endregion
36
+ //#region src/command-menu/popup/popup.d.ts
50
37
  interface CommandMenuPopupState extends Dialog.Popup.State {
51
- /**
52
- * Whether any non-root subpage is currently open.
53
- */
54
- hasOpenSubpage: boolean;
55
- /**
56
- * Active subpage ID, or null when the root surface is active.
57
- */
58
- subpageId: string | null;
38
+ /**
39
+ * Whether any non-root subpage is currently open.
40
+ */
41
+ hasOpenSubpage: boolean;
42
+ /**
43
+ * Active subpage ID, or null when the root surface is active.
44
+ */
45
+ subpageId: string | null;
59
46
  }
60
47
  interface CommandMenuPopupProps extends Omit<Dialog.Popup.Props, 'className' | 'render'> {
61
- /**
62
- * CSS class applied to the element, or a function that
63
- * returns a class based on the component's state.
64
- */
65
- className?: string | ((state: CommandMenuPopupState) => string);
66
- /**
67
- * Allows replacing the popup element with a custom element.
68
- * The render state includes dialog popup + subpage navigation state.
69
- */
70
- render?: React.ReactElement | ComponentRenderFn<React.HTMLAttributes<HTMLElement>, CommandMenuPopupState>;
48
+ /**
49
+ * CSS class applied to the element, or a function that
50
+ * returns a class based on the component's state.
51
+ */
52
+ className?: string | ((state: CommandMenuPopupState) => string);
53
+ /**
54
+ * Allows replacing the popup element with a custom element.
55
+ * The render state includes dialog popup + subpage navigation state.
56
+ */
57
+ render?: React.ReactElement | ComponentRenderFn<React.HTMLAttributes<HTMLElement>, CommandMenuPopupState>;
71
58
  }
72
59
  /**
73
60
  * A container for the command menu contents.
@@ -75,80 +62,120 @@ interface CommandMenuPopupProps extends Omit<Dialog.Popup.Props, 'className' | '
75
62
  */
76
63
  declare const CommandMenuPopup: React.ForwardRefExoticComponent<Omit<CommandMenuPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
77
64
  declare namespace CommandMenuPopup {
78
- type Props = CommandMenuPopupProps;
79
- type State = CommandMenuPopupState;
80
- }
81
-
82
- interface CommandMenuPortalProps extends Dialog.Portal.Props {
65
+ type Props = CommandMenuPopupProps;
66
+ type State = CommandMenuPopupState;
83
67
  }
68
+ //#endregion
69
+ //#region src/command-menu/portal/portal.d.ts
70
+ interface CommandMenuPortalProps extends Dialog.Portal.Props {}
84
71
  type CommandMenuPortalState = Dialog.Portal.State;
85
72
  /**
86
73
  * A portal element that moves the command menu popup to a different part of the DOM.
87
74
  */
88
- declare const CommandMenuPortal: React.ForwardRefExoticComponent<Omit<_base_ui_react_dialog.DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
75
+ declare const CommandMenuPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/dialog").DialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
89
76
  declare namespace CommandMenuPortal {
90
- type Props = CommandMenuPortalProps;
91
- type State = CommandMenuPortalState;
77
+ type Props = CommandMenuPortalProps;
78
+ type State = CommandMenuPortalState;
92
79
  }
93
-
80
+ //#endregion
81
+ //#region src/command-menu/root/root.d.ts
94
82
  interface CommandMenuRootProps {
95
- children: React.ReactNode;
96
- open?: boolean;
97
- defaultOpen?: boolean;
98
- onOpenChange?: (open: boolean) => void;
99
- onOpenChangeComplete?: (open: boolean) => void;
100
- hotkey?: string;
101
- modal?: boolean;
102
- disabled?: boolean;
103
- /**
104
- * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).
105
- * @default encoded surface Definition Path joined with `/`; `idScope="menu"` uses the Definition Key
106
- * 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.
107
- * @example
108
- * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />
109
- */
110
- getResolvedId?: GetResolvedIdFn;
111
- /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */
112
- idScope?: PopupMenuIdScope;
83
+ children: React.ReactNode;
84
+ /** Whether the command menu is open. To render an uncontrolled menu, use `defaultOpen` instead. */
85
+ open?: boolean;
86
+ /**
87
+ * Whether the command menu is open when it first renders. To render a controlled menu, use `open` instead.
88
+ * @default false
89
+ */
90
+ defaultOpen?: boolean;
91
+ /** Called when the command menu opens or closes. */
92
+ onOpenChange?: (open: boolean) => void;
93
+ /** Called after the open or close animation finishes. */
94
+ onOpenChangeComplete?: (open: boolean) => void;
95
+ /**
96
+ * A keyboard shortcut that toggles the menu from anywhere on the page, such as `'mod+k'`.
97
+ * `mod` is Command on Apple platforms and Control elsewhere. It also works while focus is in `CommandMenu.Input`, so the same shortcut closes the menu.
98
+ */
99
+ hotkey?: string;
100
+ /**
101
+ * Whether the menu is modal: page scroll is locked and outside elements can't be interacted with while it's open.
102
+ * @default true
103
+ */
104
+ modal?: boolean;
105
+ /**
106
+ * Whether the menu ignores the user opening or closing it: the trigger is disabled and the `hotkey` does nothing.
107
+ * @default false
108
+ */
109
+ disabled?: boolean;
110
+ /**
111
+ * Computes canonical Resolved IDs for data-first content from the Unresolved Menu Node (definitional facts only).
112
+ * @default encoded surface Definition Path joined with `/`; `idScope="menu"` uses the Definition Key
113
+ * 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.
114
+ * @example
115
+ * <CommandMenu.Root getResolvedId={(node) => node.def.id ?? node.definitionPath.join('.')} />
116
+ */
117
+ getResolvedId?: GetResolvedIdFn;
118
+ /** Definition Key uniqueness scope. Read once when the menu root mounts. @default 'surface' */
119
+ idScope?: PopupMenuIdScope;
120
+ /**
121
+ * Whether shift-clicking a checkbox item (or pressing Shift+Enter on the
122
+ * highlighted one) sets every checkbox item between it and the last
123
+ * checkbox item you interacted with to the same checked state. Also
124
+ * enables the keyboard span: hold Shift while moving the highlight, release
125
+ * Shift to apply.
126
+ * @default true
127
+ */
128
+ rangeSelection?: boolean;
129
+ /**
130
+ * Lets the user press a checkbox item and drag across others to set them all
131
+ * to the pressed item's new state. Off by default. `'keep'` keeps rows set
132
+ * once the pointer has reached them; `'rubber-band'` returns rows outside the
133
+ * current span to their previous state. Mouse and pen only.
134
+ * @default false
135
+ */
136
+ dragSelection?: false | 'keep' | 'rubber-band';
137
+ /**
138
+ * Returns the text announced to screen readers after a range or drag
139
+ * selection changes rows, for localization. `count` is the number of rows
140
+ * changed and `checked` the state they were set to. Defaults to English
141
+ * ("3 items checked", "1 item unchecked").
142
+ */
143
+ getAriaSelectionText?: (count: number, checked: boolean) => string;
113
144
  }
114
145
  /**
115
146
  * Groups all parts of the command menu.
116
147
  * Manages open state and provides popup-menu context to children.
117
148
  * Doesn't render its own HTML element.
118
149
  */
119
- declare function CommandMenuRoot(props: CommandMenuRoot.Props): react_jsx_runtime.JSX.Element;
150
+ declare function CommandMenuRoot(props: CommandMenuRoot.Props): React.JSX.Element;
120
151
  declare namespace CommandMenuRoot {
121
- interface Props extends CommandMenuRootProps {
122
- }
123
- }
124
-
125
- interface CommandMenuSubpageProps extends PopupMenuSubpageProps {
152
+ interface Props extends CommandMenuRootProps {}
126
153
  }
154
+ //#endregion
155
+ //#region src/command-menu/subpage/subpage.d.ts
156
+ interface CommandMenuSubpageProps extends PopupMenuSubpageProps {}
127
157
  /**
128
158
  * Groups all parts of a command menu subpage.
129
159
  */
130
- declare function CommandMenuSubpage(props: CommandMenuSubpage.Props): react_jsx_runtime.JSX.Element;
160
+ declare function CommandMenuSubpage(props: CommandMenuSubpage.Props): import("react").JSX.Element;
131
161
  declare namespace CommandMenuSubpage {
132
- interface Props extends CommandMenuSubpageProps {
133
- }
134
- }
135
-
136
- interface CommandMenuTriggerProps extends Dialog.Trigger.Props {
162
+ interface Props extends CommandMenuSubpageProps {}
137
163
  }
164
+ //#endregion
165
+ //#region src/command-menu/trigger/trigger.d.ts
166
+ interface CommandMenuTriggerProps extends Dialog.Trigger.Props {}
138
167
  type CommandMenuTriggerState = Dialog.Trigger.State;
139
168
  /**
140
169
  * A button that opens the command menu.
141
170
  */
142
171
  declare const CommandMenuTrigger: React.ForwardRefExoticComponent<Omit<CommandMenuTrigger.Props, "ref"> & React.RefAttributes<HTMLButtonElement>>;
143
172
  declare namespace CommandMenuTrigger {
144
- interface Props extends CommandMenuTriggerProps {
145
- }
146
- type State = CommandMenuTriggerState;
173
+ interface Props extends CommandMenuTriggerProps {}
174
+ type State = CommandMenuTriggerState;
147
175
  }
148
-
149
- declare const index_parts_NodeDef: typeof NodeDef;
150
- declare namespace index_parts {
151
- export { CommandMenuBackdrop as Backdrop, PopupMenuCheckboxItem as CheckboxItem, PopupMenuCheckboxItemIndicator as CheckboxItemIndicator, PopupMenuEmpty as Empty, PopupMenuFocusZone as FocusZone, PopupMenuFooter as Footer, PopupMenuGroup as Group, PopupMenuGroupLabel as GroupLabel, PopupMenuHeader as Header, PopupMenuIcon as Icon, CommandMenuInput as Input, PopupMenuItem as Item, PopupMenuLinkItem as LinkItem, PopupMenuList as List, PopupMenuLoading as Loading, PopupMenuNode as Node, index_parts_NodeDef as NodeDef, CommandMenuPopup as Popup, CommandMenuPortal as Portal, CommandMenuRoot as Root, PopupMenuSeparator as Separator, PopupMenuShortcut as Shortcut, CommandMenuSubpage as Subpage, PopupMenuSubpageBack as SubpageBack, PopupMenuSubpageBackItem as SubpageBackItem, PopupMenuSubpageTrigger as SubpageTrigger, PopupMenuSurface as Surface, CommandMenuTrigger as Trigger };
176
+ declare namespace index_parts_d_exports {
177
+ export { CommandMenuBackdrop as Backdrop, PopupMenuCheckboxGroup as CheckboxGroup, PopupMenuCheckboxGroupValue as CheckboxGroupValue, PopupMenuCheckboxItem as CheckboxItem, PopupMenuCheckboxItemIndicator as CheckboxItemIndicator, PopupMenuEmpty as Empty, PopupMenuFocusZone as FocusZone, PopupMenuFooter as Footer, PopupMenuGroup as Group, PopupMenuGroupLabel as GroupLabel, PopupMenuHeader as Header, PopupMenuIcon as Icon, CommandMenuInput as Input, PopupMenuItem as Item, PopupMenuLinkItem as LinkItem, PopupMenuList as List, PopupMenuLoading as Loading, PopupMenuNode as Node, NodeDef, CommandMenuPopup as Popup, CommandMenuPortal as Portal, CommandMenuRoot as Root, PopupMenuSeparator as Separator, PopupMenuShortcut as Shortcut, CommandMenuSubpage as Subpage, PopupMenuSubpageBack as SubpageBack, PopupMenuSubpageBackItem as SubpageBackItem, PopupMenuSubpageTrigger as SubpageTrigger, PopupMenuSurface as Surface, CommandMenuTrigger as Trigger };
152
178
  }
153
-
154
- export { index_parts as CommandMenu, type CommandMenuBackdropProps, type CommandMenuBackdropState, PopupMenuFocusZone as CommandMenuFocusZone, PopupMenuFooter as CommandMenuFooter, PopupMenuHeader as CommandMenuHeader, type CommandMenuInputProps, type CommandMenuInputState, type CommandMenuPopupProps, type CommandMenuPopupState, type CommandMenuPortalProps, type CommandMenuPortalState, type CommandMenuRootProps, type CommandMenuSubpageProps, type CommandMenuTriggerProps, type CommandMenuTriggerState, GetResolvedIdFn, NodeDef, PopupMenuIdScope, PopupMenuNode };
179
+ //#endregion
180
+ export { type AsyncContentMode, type AsyncLoaderConfig, type AsyncLoaderFetchStatus, type AsyncLoaderLoadingPhase, type AsyncLoaderResult, type AsyncLoaderSource, type AsyncLoaderStatus, type AsyncMenuCoordinatorValue, type AsyncNodesConfig, type AsyncRenderState, type AsyncResultBehavior, type AsyncState, type BreadcrumbNode, type CheckboxGroupBehavior, type CheckboxGroupDef, type CheckboxGroupLabelRenderParams, type CheckboxGroupRenderParams, type CheckboxGroupRenderProps, type CheckboxItemDef, type CheckboxItemRenderParams, type CheckboxItemRenderProps, index_parts_d_exports as CommandMenu, type CommandMenuBackdropProps, type CommandMenuBackdropState, type PopupMenuCheckboxGroupProps as CommandMenuCheckboxGroupProps, type PopupMenuCheckboxGroupState as CommandMenuCheckboxGroupState, PopupMenuCheckboxGroupValue as CommandMenuCheckboxGroupValue, type PopupMenuCheckboxGroupValueProps as CommandMenuCheckboxGroupValueProps, type PopupMenuCheckboxItemIndicatorProps as CommandMenuCheckboxItemIndicatorProps, type PopupMenuCheckboxItemIndicatorState as CommandMenuCheckboxItemIndicatorState, type PopupMenuCheckboxItemProps as CommandMenuCheckboxItemProps, type PopupMenuCheckboxItemState as CommandMenuCheckboxItemState, type PopupMenuEmptyProps as CommandMenuEmptyProps, type PopupMenuEmptyState as CommandMenuEmptyState, type PopupMenuFocusZone as CommandMenuFocusZone, type PopupMenuFocusZoneProps as CommandMenuFocusZoneProps, type PopupMenuFocusZoneState as CommandMenuFocusZoneState, type PopupMenuFooter as CommandMenuFooter, type PopupMenuFooterProps as CommandMenuFooterProps, type PopupMenuFooterState as CommandMenuFooterState, type PopupMenuGroupLabelProps as CommandMenuGroupLabelProps, type PopupMenuGroupLabelState as CommandMenuGroupLabelState, type PopupMenuGroupProps as CommandMenuGroupProps, type PopupMenuGroupState as CommandMenuGroupState, type PopupMenuHeader as CommandMenuHeader, type PopupMenuHeaderProps as CommandMenuHeaderProps, type PopupMenuHeaderState as CommandMenuHeaderState, type PopupMenuIconProps as CommandMenuIconProps, type PopupMenuIconState as CommandMenuIconState, type CommandMenuInputProps, type CommandMenuInputState, type PopupMenuItemProps as CommandMenuItemProps, type PopupMenuItemState as CommandMenuItemState, type PopupMenuLinkItemProps as CommandMenuLinkItemProps, type PopupMenuLinkItemState as CommandMenuLinkItemState, type PopupMenuListChildrenState as CommandMenuListChildrenState, type PopupMenuListProps as CommandMenuListProps, type PopupMenuListState as CommandMenuListState, type PopupMenuLoadingProps as CommandMenuLoadingProps, type PopupMenuLoadingState as CommandMenuLoadingState, type CommandMenuPopupProps, type CommandMenuPopupState, type CommandMenuPortalProps, type CommandMenuPortalState, PopupMenuRadioGroupValue as CommandMenuRadioGroupValue, type PopupMenuRadioGroupValueProps as CommandMenuRadioGroupValueProps, type CommandMenuRootProps, type PopupMenuSeparatorProps as CommandMenuSeparatorProps, type PopupMenuSeparatorState as CommandMenuSeparatorState, type PopupMenuShortcutProps as CommandMenuShortcutProps, type PopupMenuShortcutState as CommandMenuShortcutState, type PopupMenuSubpageBackItemProps as CommandMenuSubpageBackItemProps, type PopupMenuSubpageBackItemState as CommandMenuSubpageBackItemState, type PopupMenuSubpageBackProps as CommandMenuSubpageBackProps, type PopupMenuSubpageBackState as CommandMenuSubpageBackState, type CommandMenuSubpageProps, type PopupMenuSubpageTriggerProps as CommandMenuSubpageTriggerProps, type PopupMenuSubpageTriggerState as CommandMenuSubpageTriggerState, type PopupMenuSurfaceProps as CommandMenuSurfaceProps, type PopupMenuSurfaceState as CommandMenuSurfaceState, type CommandMenuTriggerProps, type CommandMenuTriggerState, type DataListChildrenState, DataListContext, DataSurfaceContext, type DataSurfaceContextValue, type DeepSearchConfig, type DisabledBranchBehavior, type DisplayCheckboxGroupNode, type DisplayGroupNode, type DisplayNode, type DisplayRadioGroupNode, type DisplayRowNode, type DisplaySeparatorNode, type DisplaySubpageNode, type GetResolvedIdFn, type GroupBehavior, type GroupDef, type GroupRenderContext, type GroupRenderParams, type IncludeInDeepSearch, type InitialQueryBehavior, type ItemDef, type ItemRenderParams, type ItemRenderProps, type LinkItemDef, type LinkItemRenderParams, type LinkItemRenderProps, type LoaderComponentProps, type NodeDef, type PopupMenuIdScope, type PopupMenuNode, type QueryAsyncNodesConfig, type QueryLoaderConfig, type RadioGroupBehavior, type RadioGroupDef, type RadioGroupRenderParams, type RadioGroupRenderProps, type RadioItemDef, type RadioItemRenderParams, type RadioItemRenderProps, type RenderNodeFn, type RowRenderContext, type ScoredNode, type SeparatorDef, type SeparatorRenderParams, type StaticAsyncNodesConfig, type StaticLoaderConfig, type SubmenuDef, type SubmenuRenderParams, type SubmenuRenderProps, type SubpageContentRenderParams, type SubpageDef, type SubpageTriggerRenderParams, type SubpageTriggerRenderProps, type SurfaceContextValue, type UnresolvedMenuNode, defaultGetResolvedId, defineCheckboxGroup, defineRadioGroup, isDisplayCheckboxGroupNode, isDisplayGroupNode, isDisplayRadioGroupNode, isDisplayRowNode, isDisplaySeparatorNode, isPopupMenuNode, useAsyncMenuCoordinator, useDataList, useDataSurfaceContext, useMaybeAsyncMenuCoordinator, useMaybeDataList, useMaybeDataSurfaceContext, useMaybeSurfaceContext, useSurfaceContext };
181
+ //# sourceMappingURL=index.d.ts.map
@@ -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{t as e}from"../rolldown-runtime-DK3Fl9T5.js";import{B as t,C as n,Ct as r,D as i,E as a,Et as o,F as s,Ft as c,H as l,I as u,It as d,L as f,M as p,Nt as m,P as h,R as g,S as _,St as v,T as y,U as b,V as x,W as S,Z as C,_ as w,at as T,b as E,ct as ee,d as te,dt as ne,f as re,ft as D,g as O,h as k,i as A,j,lt as M,mt as N,n as P,nt as F,ot as I,p as L,pt as R,r as z,st as B,t as V,ut as H,w as U,wt as W,xt as G,z as K}from"../popup-menu-HmBMJEZc.js";import{M as ie,O as q,d as J,u as Y}from"../listbox-CnwUlLZA.js";import{a as ae,t as oe}from"../platform-C4_cGUkS.js";import*as X from"react";import{jsx as Z,jsxs as se}from"react/jsx-runtime";import{Dialog as Q}from"@base-ui/react/dialog";const ce=X.forwardRef(function(e,t){let{onPointerDown:n,...r}=e,i=c(),a=X.useCallback(e=>{n?.(e),!e.defaultPrevented&&i&&!i.disabled&&i.closeAll(ie,e.nativeEvent)},[n,i]);return/* @__PURE__ */ Z(Q.Backdrop,{ref:t,...r,onPointerDown:a,"data-command-menu-backdrop":``})}),le=X.forwardRef(function(e,t){let{backspaceGoesBack:n=!0,...r}=e;return/* @__PURE__ */ Z(l,{ref:t,backspaceGoesBack:n,...r})}),ue=X.forwardRef(function(e,t){let{children:n,className:r,render:i,...a}=e,s=X.useId(),c=d(),{subpageStackContextValue:l,isSubpageNavigating:u,hasOpenSubpage:f,subpageId:p}=G({surfaceId:s,store:c.store}),[h,g]=X.useState(null),[_,v]=X.useState(null),y=X.useCallback(e=>({...e,hasOpenSubpage:f,subpageId:p}),[f,p]),b=X.useMemo(()=>typeof r==`function`?e=>r(y(e)):r,[r,y]),x=X.useMemo(()=>typeof i==`function`?(e,t)=>i(e,y(t)):i,[i,y]),S=X.useMemo(()=>({dataSurfaceContext:h,setDataSurfaceContext:g,resolvedNodes:_,setResolvedNodes:v}),[h,_]);return/* @__PURE__ */ Z(m.Provider,{value:s,children:/* @__PURE__ */ Z(o.Provider,{value:l,children:/* @__PURE__ */ Z(M.Provider,{value:S,children:/* @__PURE__ */ se(Q.Popup,{ref:t,className:b,render:x,"data-command-menu-popup":``,"data-navigating":u?``:void 0,"data-has-open-subpage":f?``:void 0,...a,children:[n,/* @__PURE__ */ Z(F,{})]})})})})}),de=Q.Portal;function fe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function pe(e){let t=e.key.toLowerCase();return t===` `?`space`:t}function $(e,t){let n=oe(),r=t.meta||n&&t.mod,i=t.ctrl||!n&&t.mod;return e.metaKey===r&&e.ctrlKey===i&&e.altKey===t.alt&&e.shiftKey===t.shift}function me(e,t){return t.key===pe(e)&&$(e,t)}function he(e,t,n){let r=X.useMemo(()=>ae(e),[e]),[i]=r.chords,a=r.chords.length===1&&i!==void 0?i:null,o=r.chords.length>1,s=n?.enabled!==!1,c=X.useRef(t),l=X.useRef(n);c.current=t,l.current=n,X.useEffect(()=>{o&&process.env.NODE_ENV!==`production`&&console.warn(`useHotkey only supports single-chord keybindings. Received "${e}", but sequences are not supported by useHotkey.`)},[o,e]),X.useEffect(()=>{if(!s||a===null||o||a.key===null)return;let e=e=>{let t=l.current;e.repeat||(t?.allowInInput||!fe(e.target))&&me(e,a)&&(t?.preventDefault!==!1&&e.preventDefault(),c.current(e))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[a,s,o])}function ge(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,hotkey:o,modal:s=!0,disabled:c,getResolvedId:l,idScope:u=`surface`,rangeSelection:d=!0,dragSelection:f=!1,getAriaSelectionText:p}=e,{store:m,focusOwnerStore:h,openChainStore:g,registerSurface:_,closeAll:y,handleOpenChange:b,disabled:x,menuTreeResolver:S}=v({onOpenChange:i,defaultOpen:r,disabled:c,closeOnOutsidePress:`pointerdown`,getResolvedId:l,idScope:u});m.useControlledProp(`openProp`,n);let w=m.useState(`open`);he(o??``,()=>b(!m.select(`open`),q),{enabled:!!o&&!x,allowInInput:!0});let T=X.useCallback((e,t)=>{b(e,t.reason,t.event)},[b]),E=X.useCallback(e=>{!e&&m.context.clearSearchOnClose===`after-exit`&&(m.clearSearch(),m.setInputActive(!1)),e||(m.clearHighlight(),m.context.onCloseComplete?.(),m.context.onPopupCloseComplete?.()),a?.(e)},[m,a]);return/* @__PURE__ */ Z(C,{menuTreeResolver:S,store:m,focusOwnerStore:h,openChainStore:g,disabled:x,depth:0,closeAll:y,explicitTabBehavior:!0,tabWithoutZones:`inert`,registerSurface:_,menuType:`dropdown`,closeOnOutsidePress:`pointerdown`,rangeSelection:d,dragSelection:f,getAriaSelectionText:p,componentName:`command-menu`,children:/* @__PURE__ */ Z(Q.Root,{open:w,onOpenChange:T,onOpenChangeComplete:E,modal:s,children:t})})}function _e(e){let{closeRootOnEsc:t=!0,children:n,...r}=e;return/* @__PURE__ */ Z(A,{closeRootOnEsc:t,...r,children:n})}const ve=X.forwardRef(function(e,t){let{disabled:n,...r}=e,i=c(),a=n||i?.disabled||!1;return/* @__PURE__ */ Z(Q.Trigger,{ref:t,...r,disabled:a,"data-command-menu-trigger":``})});var ye=/* @__PURE__ */ e({Backdrop:()=>ce,CheckboxGroup:()=>a,CheckboxGroupValue:()=>B,CheckboxItem:()=>y,CheckboxItemIndicator:()=>U,Empty:()=>b,FocusZone:()=>w,Footer:()=>O,Group:()=>k,GroupLabel:()=>x,Header:()=>L,Icon:()=>S,Input:()=>le,Item:()=>n,LinkItem:()=>_,List:()=>p,Loading:()=>j,Popup:()=>ue,Portal:()=>de,Root:()=>ge,Separator:()=>re,Shortcut:()=>te,Subpage:()=>_e,SubpageBack:()=>z,SubpageBackItem:()=>P,SubpageTrigger:()=>V,Surface:()=>i,Trigger:()=>ve});export{ye as CommandMenu,B as CommandMenuCheckboxGroupValue,E as CommandMenuRadioGroupValue,ee as DataListContext,H as DataSurfaceContext,r as defaultGetResolvedId,h as defineCheckboxGroup,s as defineRadioGroup,u as isDisplayCheckboxGroupNode,f as isDisplayGroupNode,g as isDisplayRadioGroupNode,K as isDisplayRowNode,t as isDisplaySeparatorNode,W as isPopupMenuNode,T as useAsyncMenuCoordinator,ne as useDataList,D as useDataSurfaceContext,I as useMaybeAsyncMenuCoordinator,R as useMaybeDataList,N as useMaybeDataSurfaceContext,Y as useMaybeSurfaceContext,J as useSurfaceContext};
2
2
  //# sourceMappingURL=index.js.map