@deepseek-ai/dsh-client-ui-primitives 0.2.3-alpha.1 → 0.2.3-alpha.3

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 (897) hide show
  1. package/README.i18n.yaml +14 -14
  2. package/README.md +20 -19
  3. package/README.zh.md +20 -19
  4. package/lib/assets/vendor/katex/dist/fonts/KaTeX_AMS-Regular-34494743736f.woff2 +0 -0
  5. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold-5bfa49cac46c.woff2 +0 -0
  6. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular-9f8077e0b38a.woff2 +0 -0
  7. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold-f98f89272eca.woff2 +0 -0
  8. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular-a5764c6e2784.woff2 +0 -0
  9. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Main-Bold-31050a1b1b12.woff2 +0 -0
  10. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic-a4a4905b8b12.woff2 +0 -0
  11. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Main-Italic-c9b2b5ffd2f2.woff2 +0 -0
  12. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Main-Regular-c884086c25ce.woff2 +0 -0
  13. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic-8fcb9d2de65a.woff2 +0 -0
  14. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Math-Italic-db4883d0cff9.woff2 +0 -0
  15. package/lib/assets/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold-886e61797a52.woff2 +0 -0
  16. package/lib/assets/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic-3d5fa3cb309f.woff2 +0 -0
  17. package/lib/assets/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular-e45d5f4f4a7f.woff2 +0 -0
  18. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Script-Regular-63b80959f1fc.woff2 +0 -0
  19. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Size1-Regular-57fa599974a1.woff2 +0 -0
  20. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Size2-Regular-ee18713634a3.woff2 +0 -0
  21. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Size3-Regular-19a7caadfb66.woff2 +0 -0
  22. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Size4-Regular-9bed17fb92f2.woff2 +0 -0
  23. package/lib/assets/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular-7a08883fffc6.woff2 +0 -0
  24. package/lib/client.asciidoc.js +3 -0
  25. package/lib/client.asciidoc.js.map +1 -0
  26. package/lib/client.bat.js +3 -0
  27. package/lib/client.bat.js.map +1 -0
  28. package/lib/client.bibtex.js +3 -0
  29. package/lib/client.bibtex.js.map +1 -0
  30. package/lib/client.c.js +3 -0
  31. package/lib/client.c.js.map +1 -0
  32. package/lib/client.clojure.js +3 -0
  33. package/lib/client.clojure.js.map +1 -0
  34. package/lib/client.cmake.js +3 -0
  35. package/lib/client.cmake.js.map +1 -0
  36. package/lib/client.cpp.js +3 -0
  37. package/lib/client.cpp.js.map +1 -0
  38. package/lib/client.csharp.js +3 -0
  39. package/lib/client.csharp.js.map +1 -0
  40. package/lib/client.css.js +3 -0
  41. package/lib/client.css.js.map +1 -0
  42. package/lib/client.csv.js +3 -0
  43. package/lib/client.csv.js.map +1 -0
  44. package/lib/client.dart.js +3 -0
  45. package/lib/client.dart.js.map +1 -0
  46. package/lib/client.diff.js +3 -0
  47. package/lib/client.diff.js.map +1 -0
  48. package/lib/client.dotenv.js +3 -0
  49. package/lib/client.dotenv.js.map +1 -0
  50. package/lib/client.elixir.js +3 -0
  51. package/lib/client.elixir.js.map +1 -0
  52. package/lib/client.erlang.js +3 -0
  53. package/lib/client.erlang.js.map +1 -0
  54. package/lib/client.fish.js +3 -0
  55. package/lib/client.fish.js.map +1 -0
  56. package/lib/client.fsharp.js +3 -0
  57. package/lib/client.fsharp.js.map +1 -0
  58. package/lib/client.go.js +3 -0
  59. package/lib/client.go.js.map +1 -0
  60. package/lib/client.graphql.js +3 -0
  61. package/lib/client.graphql.js.map +1 -0
  62. package/lib/client.groovy.js +3 -0
  63. package/lib/client.groovy.js.map +1 -0
  64. package/lib/client.haskell.js +3 -0
  65. package/lib/client.haskell.js.map +1 -0
  66. package/lib/client.hcl.js +3 -0
  67. package/lib/client.hcl.js.map +1 -0
  68. package/lib/client.html-derivative.js +3 -0
  69. package/lib/client.html-derivative.js.map +1 -0
  70. package/lib/client.html.js +3 -0
  71. package/lib/client.html.js.map +1 -0
  72. package/lib/client.http.js +3 -0
  73. package/lib/client.http.js.map +1 -0
  74. package/lib/client.ini.js +3 -0
  75. package/lib/client.ini.js.map +1 -0
  76. package/lib/client.java.js +3 -0
  77. package/lib/client.java.js.map +1 -0
  78. package/lib/client.javascript.js +3 -0
  79. package/lib/client.javascript.js.map +1 -0
  80. package/lib/client.js +489 -0
  81. package/lib/client.js.map +1 -0
  82. package/lib/client.julia.js +3 -0
  83. package/lib/client.julia.js.map +1 -0
  84. package/lib/client.kotlin.js +3 -0
  85. package/lib/client.kotlin.js.map +1 -0
  86. package/lib/client.latex.js +3 -0
  87. package/lib/client.latex.js.map +1 -0
  88. package/lib/client.less.js +3 -0
  89. package/lib/client.less.js.map +1 -0
  90. package/lib/client.log.js +3 -0
  91. package/lib/client.log.js.map +1 -0
  92. package/lib/client.lua.js +3 -0
  93. package/lib/client.lua.js.map +1 -0
  94. package/lib/client.make.js +3 -0
  95. package/lib/client.make.js.map +1 -0
  96. package/lib/client.markdown.js +3 -0
  97. package/lib/client.markdown.js.map +1 -0
  98. package/lib/client.mdx.js +3 -0
  99. package/lib/client.mdx.js.map +1 -0
  100. package/lib/client.nix.js +3 -0
  101. package/lib/client.nix.js.map +1 -0
  102. package/lib/client.perl.js +3 -0
  103. package/lib/client.perl.js.map +1 -0
  104. package/lib/client.php.js +3 -0
  105. package/lib/client.php.js.map +1 -0
  106. package/lib/client.powershell.js +3 -0
  107. package/lib/client.powershell.js.map +1 -0
  108. package/lib/client.proto.js +3 -0
  109. package/lib/client.proto.js.map +1 -0
  110. package/lib/client.python.js +3 -0
  111. package/lib/client.python.js.map +1 -0
  112. package/lib/client.r.js +3 -0
  113. package/lib/client.r.js.map +1 -0
  114. package/lib/client.rst.js +3 -0
  115. package/lib/client.rst.js.map +1 -0
  116. package/lib/client.ruby.js +3 -0
  117. package/lib/client.ruby.js.map +1 -0
  118. package/lib/client.rust.js +3 -0
  119. package/lib/client.rust.js.map +1 -0
  120. package/lib/client.scala.js +3 -0
  121. package/lib/client.scala.js.map +1 -0
  122. package/lib/client.scss.js +3 -0
  123. package/lib/client.scss.js.map +1 -0
  124. package/lib/client.sql.js +3 -0
  125. package/lib/client.sql.js.map +1 -0
  126. package/lib/client.svelte.js +3 -0
  127. package/lib/client.svelte.js.map +1 -0
  128. package/lib/client.swift.js +3 -0
  129. package/lib/client.swift.js.map +1 -0
  130. package/lib/client.system-verilog.js +3 -0
  131. package/lib/client.system-verilog.js.map +1 -0
  132. package/lib/client.toml.js +3 -0
  133. package/lib/client.toml.js.map +1 -0
  134. package/lib/client.vb.js +3 -0
  135. package/lib/client.vb.js.map +1 -0
  136. package/lib/client.verilog.js +3 -0
  137. package/lib/client.verilog.js.map +1 -0
  138. package/lib/client.vue.js +3 -0
  139. package/lib/client.vue.js.map +1 -0
  140. package/lib/client.xml.js +3 -0
  141. package/lib/client.xml.js.map +1 -0
  142. package/lib/client.yaml.js +3 -0
  143. package/lib/client.yaml.js.map +1 -0
  144. package/lib/index.js +10 -14594
  145. package/lib/types/client/AnimatedRows.d.ts.map +1 -0
  146. package/lib/types/client/AnimatedRows.js.map +1 -0
  147. package/lib/types/client/BrandWordmark.d.ts.map +1 -0
  148. package/lib/types/client/BrandWordmark.js.map +1 -0
  149. package/lib/types/client/Button.d.ts.map +1 -0
  150. package/lib/types/client/Button.js.map +1 -0
  151. package/lib/types/client/Checkbox.d.ts.map +1 -0
  152. package/lib/types/client/Checkbox.js.map +1 -0
  153. package/lib/types/client/CodeFileIcon.d.ts.map +1 -0
  154. package/lib/types/client/CodeFileIcon.js.map +1 -0
  155. package/lib/types/client/CodeToolbar.d.ts.map +1 -0
  156. package/lib/types/client/CodeToolbar.js.map +1 -0
  157. package/lib/types/client/CommandText.d.ts.map +1 -0
  158. package/lib/types/client/CommandText.js.map +1 -0
  159. package/lib/types/client/ConfigField.d.ts.map +1 -0
  160. package/lib/types/client/ConfigField.js.map +1 -0
  161. package/lib/types/client/ConnectionIndicator.d.ts.map +1 -0
  162. package/lib/types/client/ConnectionIndicator.js.map +1 -0
  163. package/lib/types/client/DetailDocument.d.ts.map +1 -0
  164. package/lib/types/client/DetailDocument.js.map +1 -0
  165. package/lib/types/client/DiffBlock.d.ts.map +1 -0
  166. package/lib/types/client/DiffBlock.js.map +1 -0
  167. package/lib/types/client/DisclosureRow.d.ts.map +1 -0
  168. package/lib/types/client/DisclosureRow.js.map +1 -0
  169. package/lib/types/client/DraggableImage.d.ts.map +1 -0
  170. package/lib/types/client/DraggableImage.js.map +1 -0
  171. package/lib/types/client/FileTypeIcon.d.ts.map +1 -0
  172. package/lib/types/client/FileTypeIcon.js.map +1 -0
  173. package/lib/types/client/FishLogo.d.ts.map +1 -0
  174. package/lib/types/client/FishLogo.js.map +1 -0
  175. package/lib/types/client/FoldToggle.d.ts.map +1 -0
  176. package/lib/types/client/FoldToggle.js.map +1 -0
  177. package/lib/types/client/HoverCard.d.ts.map +1 -0
  178. package/lib/types/client/HoverCard.js.map +1 -0
  179. package/lib/types/client/HoverCardGroup.d.ts.map +1 -0
  180. package/lib/types/client/HoverCardGroup.js.map +1 -0
  181. package/lib/types/client/ImageLightbox.d.ts.map +1 -0
  182. package/lib/types/client/ImageLightbox.js.map +1 -0
  183. package/lib/types/client/ImagePreview.d.ts.map +1 -0
  184. package/lib/types/client/ImagePreview.js.map +1 -0
  185. package/lib/types/client/InlineEditor.d.ts.map +1 -0
  186. package/lib/types/client/InlineEditor.js.map +1 -0
  187. package/lib/types/client/Input.d.ts.map +1 -0
  188. package/lib/types/client/Input.js.map +1 -0
  189. package/lib/types/client/InspectButton.d.ts +18 -0
  190. package/lib/types/client/InspectButton.d.ts.map +1 -0
  191. package/lib/types/client/InspectButton.js.map +1 -0
  192. package/lib/types/client/JsonTree.d.ts.map +1 -0
  193. package/lib/types/client/JsonTree.js.map +1 -0
  194. package/lib/types/client/LinkIcon.d.ts.map +1 -0
  195. package/lib/types/client/LinkIcon.js.map +1 -0
  196. package/lib/types/client/Marquee.d.ts.map +1 -0
  197. package/lib/types/client/Marquee.js.map +1 -0
  198. package/lib/types/client/Menu.d.ts.map +1 -0
  199. package/lib/types/client/Menu.js.map +1 -0
  200. package/lib/types/client/MenuGroup.d.ts.map +1 -0
  201. package/lib/types/client/MenuGroup.js.map +1 -0
  202. package/lib/types/client/MenuRow.d.ts.map +1 -0
  203. package/lib/types/client/MenuRow.js.map +1 -0
  204. package/lib/types/client/MenuSurface.d.ts.map +1 -0
  205. package/lib/types/client/MenuSurface.js.map +1 -0
  206. package/lib/types/client/Modal.d.ts.map +1 -0
  207. package/lib/types/client/Modal.js.map +1 -0
  208. package/lib/types/client/PathLabel.d.ts.map +1 -0
  209. package/lib/types/client/PathLabel.js.map +1 -0
  210. package/lib/types/client/PermissionIcon.d.ts.map +1 -0
  211. package/lib/types/client/PermissionIcon.js.map +1 -0
  212. package/lib/types/client/Pill.d.ts.map +1 -0
  213. package/lib/types/client/Pill.js.map +1 -0
  214. package/lib/types/client/QuotePreview.d.ts +38 -0
  215. package/lib/types/client/QuotePreview.d.ts.map +1 -0
  216. package/lib/types/client/QuotePreview.js.map +1 -0
  217. package/lib/types/client/ReadBlock.d.ts.map +1 -0
  218. package/lib/types/client/ReadBlock.js.map +1 -0
  219. package/lib/types/client/ReferenceIcon.d.ts.map +1 -0
  220. package/lib/types/client/ReferenceIcon.js.map +1 -0
  221. package/lib/types/client/RiskConfirmation.d.ts.map +1 -0
  222. package/lib/types/client/RiskConfirmation.js.map +1 -0
  223. package/lib/types/client/SearchBlock.d.ts.map +1 -0
  224. package/lib/types/client/SearchBlock.js.map +1 -0
  225. package/lib/types/client/SearchField.d.ts.map +1 -0
  226. package/lib/types/client/SearchField.js.map +1 -0
  227. package/lib/types/client/SegmentedControl.d.ts.map +1 -0
  228. package/lib/types/client/SegmentedControl.js.map +1 -0
  229. package/lib/types/client/SegmentedTabs.d.ts.map +1 -0
  230. package/lib/types/client/SegmentedTabs.js.map +1 -0
  231. package/lib/types/client/ShortcutKeys.d.ts.map +1 -0
  232. package/lib/types/client/ShortcutKeys.js.map +1 -0
  233. package/lib/types/client/SiteGlyph.d.ts.map +1 -0
  234. package/lib/types/client/SiteGlyph.js.map +1 -0
  235. package/lib/types/client/StateDot.d.ts.map +1 -0
  236. package/lib/types/client/StateDot.js.map +1 -0
  237. package/lib/types/client/SubmenuPanel.d.ts.map +1 -0
  238. package/lib/types/client/SubmenuPanel.js.map +1 -0
  239. package/lib/types/client/Switch.d.ts.map +1 -0
  240. package/lib/types/client/Switch.js.map +1 -0
  241. package/lib/types/client/Tag.d.ts.map +1 -0
  242. package/lib/types/client/Tag.js.map +1 -0
  243. package/lib/types/client/TerminalBlock.d.ts.map +1 -0
  244. package/lib/types/client/TerminalBlock.js.map +1 -0
  245. package/lib/types/client/TextShimmer.d.ts.map +1 -0
  246. package/lib/types/client/TextShimmer.js.map +1 -0
  247. package/lib/types/client/Toast.d.ts.map +1 -0
  248. package/lib/types/client/Toast.js.map +1 -0
  249. package/lib/types/client/Tooltip.d.ts.map +1 -0
  250. package/lib/types/client/Tooltip.js.map +1 -0
  251. package/lib/types/client/UserMessageBubble.d.ts.map +1 -0
  252. package/lib/types/client/UserMessageBubble.js.map +1 -0
  253. package/lib/types/client/WebBlock.d.ts.map +1 -0
  254. package/lib/types/client/WebBlock.js.map +1 -0
  255. package/lib/types/client/ZoomControls.d.ts.map +1 -0
  256. package/lib/types/client/ZoomControls.js.map +1 -0
  257. package/lib/types/client/ansi.d.ts.map +1 -0
  258. package/lib/types/client/ansi.js.map +1 -0
  259. package/lib/types/client/clipboard.d.ts.map +1 -0
  260. package/lib/types/client/clipboard.js.map +1 -0
  261. package/lib/types/client/code-file-icon-artwork.d.ts.map +1 -0
  262. package/lib/types/client/code-file-icon-artwork.js.map +1 -0
  263. package/lib/types/client/code-file-types.d.ts.map +1 -0
  264. package/lib/types/client/code-file-types.js.map +1 -0
  265. package/lib/types/client/code-highlighting.d.ts.map +1 -0
  266. package/lib/types/client/code-highlighting.js.map +1 -0
  267. package/lib/types/client/darwin-desktop.d.ts.map +1 -0
  268. package/lib/types/client/darwin-desktop.js.map +1 -0
  269. package/lib/types/client/document-zoom.d.ts.map +1 -0
  270. package/lib/types/client/document-zoom.js.map +1 -0
  271. package/lib/types/client/file-drag-actions.d.ts.map +1 -0
  272. package/lib/types/client/file-drag-actions.js.map +1 -0
  273. package/lib/types/client/file-size.d.ts.map +1 -0
  274. package/lib/types/client/file-size.js.map +1 -0
  275. package/lib/types/client/focus.d.ts.map +1 -0
  276. package/lib/types/client/focus.js.map +1 -0
  277. package/lib/types/client/guide-artwork.d.ts.map +1 -0
  278. package/lib/types/client/guide-artwork.js.map +1 -0
  279. package/lib/types/client/head-tail-cap.d.ts.map +1 -0
  280. package/lib/types/client/head-tail-cap.js.map +1 -0
  281. package/lib/types/client/icons/artwork.d.ts +475 -0
  282. package/lib/types/client/icons/artwork.d.ts.map +1 -0
  283. package/lib/types/client/icons/artwork.js.map +1 -0
  284. package/lib/types/client/icons/index.d.ts +450 -0
  285. package/lib/types/client/icons/index.d.ts.map +1 -0
  286. package/lib/types/client/icons/index.js.map +1 -0
  287. package/lib/types/client/icons/props.d.ts.map +1 -0
  288. package/lib/types/client/icons/props.js.map +1 -0
  289. package/lib/types/client/icons/shared-artwork.d.ts.map +1 -0
  290. package/lib/types/client/icons/shared-artwork.js.map +1 -0
  291. package/lib/types/client/image-drag.d.ts.map +1 -0
  292. package/lib/types/client/image-drag.js.map +1 -0
  293. package/lib/types/client/index.d.ts +128 -0
  294. package/lib/types/client/index.d.ts.map +1 -0
  295. package/lib/types/client/index.js.map +1 -0
  296. package/lib/types/client/input-modality.d.ts.map +1 -0
  297. package/lib/types/client/input-modality.js.map +1 -0
  298. package/lib/types/client/keyboard-composition.d.ts.map +1 -0
  299. package/lib/types/client/keyboard-composition.js.map +1 -0
  300. package/lib/types/client/markdown/CodeBlock.d.ts.map +1 -0
  301. package/lib/types/client/markdown/CodeBlock.js.map +1 -0
  302. package/lib/types/client/markdown/FenceBlocks.d.ts.map +1 -0
  303. package/lib/types/client/markdown/FenceBlocks.js.map +1 -0
  304. package/lib/types/client/markdown/JsonBlock.d.ts.map +1 -0
  305. package/lib/types/client/markdown/JsonBlock.js.map +1 -0
  306. package/lib/types/client/markdown/MarkdownDelegate.d.ts.map +1 -0
  307. package/lib/types/client/markdown/MarkdownDelegate.js.map +1 -0
  308. package/lib/types/client/markdown/MarkdownText.d.ts.map +1 -0
  309. package/lib/types/client/markdown/MarkdownText.js.map +1 -0
  310. package/lib/types/client/markdown/cjkFriendlyStrong.d.ts.map +1 -0
  311. package/lib/types/client/markdown/cjkFriendlyStrong.js.map +1 -0
  312. package/lib/types/client/markdown/copy-tex.d.ts.map +1 -0
  313. package/lib/types/client/markdown/copy-tex.js.map +1 -0
  314. package/lib/types/client/markdown/diff-fence.d.ts.map +1 -0
  315. package/lib/types/client/markdown/diff-fence.js.map +1 -0
  316. package/lib/types/client/markdown/file-link.d.ts.map +1 -0
  317. package/lib/types/client/markdown/file-link.js.map +1 -0
  318. package/lib/types/client/markdown/highlight.d.ts.map +1 -0
  319. package/lib/types/client/markdown/highlight.js.map +1 -0
  320. package/lib/types/client/markdown/incremental.d.ts.map +1 -0
  321. package/lib/types/client/markdown/incremental.js.map +1 -0
  322. package/lib/types/client/markdown/katex.d.ts.map +1 -0
  323. package/lib/types/client/markdown/katex.js.map +1 -0
  324. package/lib/types/client/markdown/local-image-syntax.d.ts.map +1 -0
  325. package/lib/types/client/markdown/local-image-syntax.js.map +1 -0
  326. package/lib/types/client/markdown/mathCompatibility.d.ts.map +1 -0
  327. package/lib/types/client/markdown/mathCompatibility.js.map +1 -0
  328. package/lib/types/client/markdown/parse.d.ts.map +1 -0
  329. package/lib/types/client/markdown/parse.js.map +1 -0
  330. package/lib/types/client/markdown/plain-text.d.ts.map +1 -0
  331. package/lib/types/client/markdown/plain-text.js.map +1 -0
  332. package/lib/types/client/markdown/quote-text.d.ts.map +1 -0
  333. package/lib/types/client/markdown/quote-text.js.map +1 -0
  334. package/lib/types/client/markdown/render.d.ts.map +1 -0
  335. package/lib/types/client/markdown/render.js.map +1 -0
  336. package/lib/types/client/markdown/useViewportHighlighting.d.ts +11 -0
  337. package/lib/types/client/markdown/useViewportHighlighting.d.ts.map +1 -0
  338. package/lib/types/client/markdown/useViewportHighlighting.js.map +1 -0
  339. package/lib/types/client/markdown/windows-path-destinations.d.ts.map +1 -0
  340. package/lib/types/client/markdown/windows-path-destinations.js.map +1 -0
  341. package/lib/types/client/menu-submenu-position.d.ts.map +1 -0
  342. package/lib/types/client/menu-submenu-position.js.map +1 -0
  343. package/lib/types/client/overlay-top-margin.d.ts.map +1 -0
  344. package/lib/types/client/overlay-top-margin.js.map +1 -0
  345. package/lib/types/client/plugin-artwork.d.ts.map +1 -0
  346. package/lib/types/client/plugin-artwork.js.map +1 -0
  347. package/lib/types/client/pointer-grace.d.ts.map +1 -0
  348. package/lib/types/client/pointer-grace.js.map +1 -0
  349. package/lib/types/client/relative-time.d.ts.map +1 -0
  350. package/lib/types/client/relative-time.js.map +1 -0
  351. package/lib/types/client/settings-form/SettingsForm.d.ts.map +1 -0
  352. package/lib/types/client/settings-form/SettingsForm.js.map +1 -0
  353. package/lib/types/client/settings-form/fields.d.ts.map +1 -0
  354. package/lib/types/client/settings-form/fields.js.map +1 -0
  355. package/lib/types/client/settings-form/form-model.d.ts.map +1 -0
  356. package/lib/types/client/settings-form/form-model.js.map +1 -0
  357. package/lib/types/client/tooltip-placement.d.ts.map +1 -0
  358. package/lib/types/client/tooltip-placement.js.map +1 -0
  359. package/lib/types/client/use-clipboard-copy.d.ts.map +1 -0
  360. package/lib/types/client/use-clipboard-copy.js.map +1 -0
  361. package/lib/types/client/useAnchoredMaxHeight.d.ts +14 -0
  362. package/lib/types/client/useAnchoredMaxHeight.d.ts.map +1 -0
  363. package/lib/types/client/useAnchoredMaxHeight.js.map +1 -0
  364. package/lib/types/client/useDismissOnOutsidePointer.d.ts.map +1 -0
  365. package/lib/types/client/useDismissOnOutsidePointer.js.map +1 -0
  366. package/lib/types/client/useMenuSubmenu.d.ts +44 -0
  367. package/lib/types/client/useMenuSubmenu.d.ts.map +1 -0
  368. package/lib/types/client/useMenuSubmenu.js.map +1 -0
  369. package/lib/types/client/useModalLayer.d.ts.map +1 -0
  370. package/lib/types/client/useModalLayer.js.map +1 -0
  371. package/lib/types/client/useRowDragPreview.d.ts.map +1 -0
  372. package/lib/types/client/useRowDragPreview.js.map +1 -0
  373. package/lib/types/client/user-text.d.ts.map +1 -0
  374. package/lib/types/client/user-text.js.map +1 -0
  375. package/locale/de.json +6 -0
  376. package/locale/en.json +5 -0
  377. package/locale/es.json +6 -0
  378. package/locale/fr.json +6 -0
  379. package/locale/ja.json +6 -0
  380. package/locale/pt.json +6 -0
  381. package/locale/ru.json +6 -0
  382. package/locale/zh.json +6 -0
  383. package/package.json +28 -12
  384. package/src/client/CodeFileIcon.tsx +28 -0
  385. package/src/client/HoverCard.tsx +360 -0
  386. package/src/client/InspectButton.module.css +47 -0
  387. package/src/client/InspectButton.tsx +29 -0
  388. package/src/client/JsonTree.tsx +850 -0
  389. package/src/client/Menu.module.css +491 -0
  390. package/src/client/Menu.tsx +656 -0
  391. package/src/client/MenuSurface.tsx +54 -0
  392. package/src/client/QuotePreview.tsx +116 -0
  393. package/src/client/RiskConfirmation.module.css +54 -0
  394. package/src/client/TextShimmer.tsx +64 -0
  395. package/src/client/Tooltip.tsx +282 -0
  396. package/src/client/icons/artwork.ts +169 -0
  397. package/src/client/icons/index.tsx +694 -0
  398. package/src/client/image-drag.ts +84 -0
  399. package/src/client/index.ts +148 -0
  400. package/src/client/markdown/MarkdownText.module.css +612 -0
  401. package/src/client/markdown/useViewportHighlighting.ts +72 -0
  402. package/src/client/plugin-artwork.tsx +110 -0
  403. package/src/client/useAnchoredMaxHeight.ts +45 -0
  404. package/src/client/useMenuSubmenu.ts +185 -0
  405. package/src/index.js +12 -0
  406. package/lib/index.js.map +0 -1
  407. package/lib/types/AnimatedRows.d.ts.map +0 -1
  408. package/lib/types/AnimatedRows.js.map +0 -1
  409. package/lib/types/BrandWordmark.d.ts.map +0 -1
  410. package/lib/types/BrandWordmark.js.map +0 -1
  411. package/lib/types/Button.d.ts.map +0 -1
  412. package/lib/types/Button.js.map +0 -1
  413. package/lib/types/Checkbox.d.ts.map +0 -1
  414. package/lib/types/Checkbox.js.map +0 -1
  415. package/lib/types/CodeFileIcon.d.ts.map +0 -1
  416. package/lib/types/CodeFileIcon.js.map +0 -1
  417. package/lib/types/CodeToolbar.d.ts.map +0 -1
  418. package/lib/types/CodeToolbar.js.map +0 -1
  419. package/lib/types/CommandText.d.ts.map +0 -1
  420. package/lib/types/CommandText.js.map +0 -1
  421. package/lib/types/ConfigField.d.ts.map +0 -1
  422. package/lib/types/ConfigField.js.map +0 -1
  423. package/lib/types/ConnectionIndicator.d.ts.map +0 -1
  424. package/lib/types/ConnectionIndicator.js.map +0 -1
  425. package/lib/types/DetailDocument.d.ts.map +0 -1
  426. package/lib/types/DetailDocument.js.map +0 -1
  427. package/lib/types/DiffBlock.d.ts.map +0 -1
  428. package/lib/types/DiffBlock.js.map +0 -1
  429. package/lib/types/DisclosureRow.d.ts.map +0 -1
  430. package/lib/types/DisclosureRow.js.map +0 -1
  431. package/lib/types/DraggableImage.d.ts.map +0 -1
  432. package/lib/types/DraggableImage.js.map +0 -1
  433. package/lib/types/FileTypeIcon.d.ts.map +0 -1
  434. package/lib/types/FileTypeIcon.js.map +0 -1
  435. package/lib/types/FishLogo.d.ts.map +0 -1
  436. package/lib/types/FishLogo.js.map +0 -1
  437. package/lib/types/FoldToggle.d.ts.map +0 -1
  438. package/lib/types/FoldToggle.js.map +0 -1
  439. package/lib/types/HoverCard.d.ts.map +0 -1
  440. package/lib/types/HoverCard.js.map +0 -1
  441. package/lib/types/HoverCardGroup.d.ts.map +0 -1
  442. package/lib/types/HoverCardGroup.js.map +0 -1
  443. package/lib/types/ImageLightbox.d.ts.map +0 -1
  444. package/lib/types/ImageLightbox.js.map +0 -1
  445. package/lib/types/ImagePreview.d.ts.map +0 -1
  446. package/lib/types/ImagePreview.js.map +0 -1
  447. package/lib/types/InlineEditor.d.ts.map +0 -1
  448. package/lib/types/InlineEditor.js.map +0 -1
  449. package/lib/types/Input.d.ts.map +0 -1
  450. package/lib/types/Input.js.map +0 -1
  451. package/lib/types/JsonTree.d.ts.map +0 -1
  452. package/lib/types/JsonTree.js.map +0 -1
  453. package/lib/types/LinkIcon.d.ts.map +0 -1
  454. package/lib/types/LinkIcon.js.map +0 -1
  455. package/lib/types/Marquee.d.ts.map +0 -1
  456. package/lib/types/Marquee.js.map +0 -1
  457. package/lib/types/Menu.d.ts.map +0 -1
  458. package/lib/types/Menu.js.map +0 -1
  459. package/lib/types/MenuGroup.d.ts.map +0 -1
  460. package/lib/types/MenuGroup.js.map +0 -1
  461. package/lib/types/MenuRow.d.ts.map +0 -1
  462. package/lib/types/MenuRow.js.map +0 -1
  463. package/lib/types/MenuSurface.d.ts.map +0 -1
  464. package/lib/types/MenuSurface.js.map +0 -1
  465. package/lib/types/Modal.d.ts.map +0 -1
  466. package/lib/types/Modal.js.map +0 -1
  467. package/lib/types/PathLabel.d.ts.map +0 -1
  468. package/lib/types/PathLabel.js.map +0 -1
  469. package/lib/types/PermissionIcon.d.ts.map +0 -1
  470. package/lib/types/PermissionIcon.js.map +0 -1
  471. package/lib/types/Pill.d.ts.map +0 -1
  472. package/lib/types/Pill.js.map +0 -1
  473. package/lib/types/QuotePreview.d.ts +0 -37
  474. package/lib/types/QuotePreview.d.ts.map +0 -1
  475. package/lib/types/QuotePreview.js.map +0 -1
  476. package/lib/types/ReadBlock.d.ts.map +0 -1
  477. package/lib/types/ReadBlock.js.map +0 -1
  478. package/lib/types/ReferenceIcon.d.ts.map +0 -1
  479. package/lib/types/ReferenceIcon.js.map +0 -1
  480. package/lib/types/RiskConfirmation.d.ts.map +0 -1
  481. package/lib/types/RiskConfirmation.js.map +0 -1
  482. package/lib/types/SearchBlock.d.ts.map +0 -1
  483. package/lib/types/SearchBlock.js.map +0 -1
  484. package/lib/types/SearchField.d.ts.map +0 -1
  485. package/lib/types/SearchField.js.map +0 -1
  486. package/lib/types/SegmentedControl.d.ts.map +0 -1
  487. package/lib/types/SegmentedControl.js.map +0 -1
  488. package/lib/types/SegmentedTabs.d.ts.map +0 -1
  489. package/lib/types/SegmentedTabs.js.map +0 -1
  490. package/lib/types/ShortcutKeys.d.ts.map +0 -1
  491. package/lib/types/ShortcutKeys.js.map +0 -1
  492. package/lib/types/SiteGlyph.d.ts.map +0 -1
  493. package/lib/types/SiteGlyph.js.map +0 -1
  494. package/lib/types/StateDot.d.ts.map +0 -1
  495. package/lib/types/StateDot.js.map +0 -1
  496. package/lib/types/SubmenuPanel.d.ts.map +0 -1
  497. package/lib/types/SubmenuPanel.js.map +0 -1
  498. package/lib/types/Switch.d.ts.map +0 -1
  499. package/lib/types/Switch.js.map +0 -1
  500. package/lib/types/Tag.d.ts.map +0 -1
  501. package/lib/types/Tag.js.map +0 -1
  502. package/lib/types/TerminalBlock.d.ts.map +0 -1
  503. package/lib/types/TerminalBlock.js.map +0 -1
  504. package/lib/types/TextShimmer.d.ts.map +0 -1
  505. package/lib/types/TextShimmer.js.map +0 -1
  506. package/lib/types/Toast.d.ts.map +0 -1
  507. package/lib/types/Toast.js.map +0 -1
  508. package/lib/types/Tooltip.d.ts.map +0 -1
  509. package/lib/types/Tooltip.js.map +0 -1
  510. package/lib/types/UserMessageBubble.d.ts.map +0 -1
  511. package/lib/types/UserMessageBubble.js.map +0 -1
  512. package/lib/types/WebBlock.d.ts.map +0 -1
  513. package/lib/types/WebBlock.js.map +0 -1
  514. package/lib/types/ZoomControls.d.ts.map +0 -1
  515. package/lib/types/ZoomControls.js.map +0 -1
  516. package/lib/types/ansi.d.ts.map +0 -1
  517. package/lib/types/ansi.js.map +0 -1
  518. package/lib/types/clipboard.d.ts.map +0 -1
  519. package/lib/types/clipboard.js.map +0 -1
  520. package/lib/types/code-file-icon-artwork.d.ts.map +0 -1
  521. package/lib/types/code-file-icon-artwork.js.map +0 -1
  522. package/lib/types/code-file-types.d.ts.map +0 -1
  523. package/lib/types/code-file-types.js.map +0 -1
  524. package/lib/types/code-highlighting.d.ts.map +0 -1
  525. package/lib/types/code-highlighting.js.map +0 -1
  526. package/lib/types/darwin-desktop.d.ts.map +0 -1
  527. package/lib/types/darwin-desktop.js.map +0 -1
  528. package/lib/types/document-zoom.d.ts.map +0 -1
  529. package/lib/types/document-zoom.js.map +0 -1
  530. package/lib/types/file-drag-actions.d.ts.map +0 -1
  531. package/lib/types/file-drag-actions.js.map +0 -1
  532. package/lib/types/file-size.d.ts.map +0 -1
  533. package/lib/types/file-size.js.map +0 -1
  534. package/lib/types/focus.d.ts.map +0 -1
  535. package/lib/types/focus.js.map +0 -1
  536. package/lib/types/guide-artwork.d.ts.map +0 -1
  537. package/lib/types/guide-artwork.js.map +0 -1
  538. package/lib/types/head-tail-cap.d.ts.map +0 -1
  539. package/lib/types/head-tail-cap.js.map +0 -1
  540. package/lib/types/icons/artwork.d.ts +0 -454
  541. package/lib/types/icons/artwork.d.ts.map +0 -1
  542. package/lib/types/icons/artwork.js.map +0 -1
  543. package/lib/types/icons/index.d.ts +0 -430
  544. package/lib/types/icons/index.d.ts.map +0 -1
  545. package/lib/types/icons/index.js.map +0 -1
  546. package/lib/types/icons/props.d.ts.map +0 -1
  547. package/lib/types/icons/props.js.map +0 -1
  548. package/lib/types/icons/shared-artwork.d.ts.map +0 -1
  549. package/lib/types/icons/shared-artwork.js.map +0 -1
  550. package/lib/types/image-drag.d.ts.map +0 -1
  551. package/lib/types/image-drag.js.map +0 -1
  552. package/lib/types/index.d.ts +0 -124
  553. package/lib/types/index.d.ts.map +0 -1
  554. package/lib/types/index.js.map +0 -1
  555. package/lib/types/input-modality.d.ts.map +0 -1
  556. package/lib/types/input-modality.js.map +0 -1
  557. package/lib/types/keyboard-composition.d.ts.map +0 -1
  558. package/lib/types/keyboard-composition.js.map +0 -1
  559. package/lib/types/markdown/CodeBlock.d.ts.map +0 -1
  560. package/lib/types/markdown/CodeBlock.js.map +0 -1
  561. package/lib/types/markdown/FenceBlocks.d.ts.map +0 -1
  562. package/lib/types/markdown/FenceBlocks.js.map +0 -1
  563. package/lib/types/markdown/JsonBlock.d.ts.map +0 -1
  564. package/lib/types/markdown/JsonBlock.js.map +0 -1
  565. package/lib/types/markdown/MarkdownDelegate.d.ts.map +0 -1
  566. package/lib/types/markdown/MarkdownDelegate.js.map +0 -1
  567. package/lib/types/markdown/MarkdownText.d.ts.map +0 -1
  568. package/lib/types/markdown/MarkdownText.js.map +0 -1
  569. package/lib/types/markdown/cjkFriendlyStrong.d.ts.map +0 -1
  570. package/lib/types/markdown/cjkFriendlyStrong.js.map +0 -1
  571. package/lib/types/markdown/copy-tex.d.ts.map +0 -1
  572. package/lib/types/markdown/copy-tex.js.map +0 -1
  573. package/lib/types/markdown/diff-fence.d.ts.map +0 -1
  574. package/lib/types/markdown/diff-fence.js.map +0 -1
  575. package/lib/types/markdown/file-link.d.ts.map +0 -1
  576. package/lib/types/markdown/file-link.js.map +0 -1
  577. package/lib/types/markdown/highlight.d.ts.map +0 -1
  578. package/lib/types/markdown/highlight.js.map +0 -1
  579. package/lib/types/markdown/incremental.d.ts.map +0 -1
  580. package/lib/types/markdown/incremental.js.map +0 -1
  581. package/lib/types/markdown/katex.d.ts.map +0 -1
  582. package/lib/types/markdown/katex.js.map +0 -1
  583. package/lib/types/markdown/local-image-syntax.d.ts.map +0 -1
  584. package/lib/types/markdown/local-image-syntax.js.map +0 -1
  585. package/lib/types/markdown/mathCompatibility.d.ts.map +0 -1
  586. package/lib/types/markdown/mathCompatibility.js.map +0 -1
  587. package/lib/types/markdown/parse.d.ts.map +0 -1
  588. package/lib/types/markdown/parse.js.map +0 -1
  589. package/lib/types/markdown/plain-text.d.ts.map +0 -1
  590. package/lib/types/markdown/plain-text.js.map +0 -1
  591. package/lib/types/markdown/quote-text.d.ts.map +0 -1
  592. package/lib/types/markdown/quote-text.js.map +0 -1
  593. package/lib/types/markdown/render.d.ts.map +0 -1
  594. package/lib/types/markdown/render.js.map +0 -1
  595. package/lib/types/markdown/useViewportHighlighting.d.ts +0 -11
  596. package/lib/types/markdown/useViewportHighlighting.d.ts.map +0 -1
  597. package/lib/types/markdown/useViewportHighlighting.js.map +0 -1
  598. package/lib/types/markdown/windows-path-destinations.d.ts.map +0 -1
  599. package/lib/types/markdown/windows-path-destinations.js.map +0 -1
  600. package/lib/types/menu-submenu-position.d.ts.map +0 -1
  601. package/lib/types/menu-submenu-position.js.map +0 -1
  602. package/lib/types/overlay-top-margin.d.ts.map +0 -1
  603. package/lib/types/overlay-top-margin.js.map +0 -1
  604. package/lib/types/plugin-artwork.d.ts.map +0 -1
  605. package/lib/types/plugin-artwork.js.map +0 -1
  606. package/lib/types/pointer-grace.d.ts.map +0 -1
  607. package/lib/types/pointer-grace.js.map +0 -1
  608. package/lib/types/relative-time.d.ts.map +0 -1
  609. package/lib/types/relative-time.js.map +0 -1
  610. package/lib/types/settings-form/SettingsForm.d.ts.map +0 -1
  611. package/lib/types/settings-form/SettingsForm.js.map +0 -1
  612. package/lib/types/settings-form/fields.d.ts.map +0 -1
  613. package/lib/types/settings-form/fields.js.map +0 -1
  614. package/lib/types/settings-form/form-model.d.ts.map +0 -1
  615. package/lib/types/settings-form/form-model.js.map +0 -1
  616. package/lib/types/tooltip-placement.d.ts.map +0 -1
  617. package/lib/types/tooltip-placement.js.map +0 -1
  618. package/lib/types/use-clipboard-copy.d.ts.map +0 -1
  619. package/lib/types/use-clipboard-copy.js.map +0 -1
  620. package/lib/types/useAnchoredMaxHeight.d.ts +0 -14
  621. package/lib/types/useAnchoredMaxHeight.d.ts.map +0 -1
  622. package/lib/types/useAnchoredMaxHeight.js.map +0 -1
  623. package/lib/types/useDismissOnOutsidePointer.d.ts.map +0 -1
  624. package/lib/types/useDismissOnOutsidePointer.js.map +0 -1
  625. package/lib/types/useMenuSubmenu.d.ts +0 -44
  626. package/lib/types/useMenuSubmenu.d.ts.map +0 -1
  627. package/lib/types/useMenuSubmenu.js.map +0 -1
  628. package/lib/types/useModalLayer.d.ts.map +0 -1
  629. package/lib/types/useModalLayer.js.map +0 -1
  630. package/lib/types/useRowDragPreview.d.ts.map +0 -1
  631. package/lib/types/useRowDragPreview.js.map +0 -1
  632. package/lib/types/user-text.d.ts.map +0 -1
  633. package/lib/types/user-text.js.map +0 -1
  634. package/src/CodeFileIcon.tsx +0 -28
  635. package/src/HoverCard.tsx +0 -360
  636. package/src/JsonTree.tsx +0 -850
  637. package/src/Menu.module.css +0 -473
  638. package/src/Menu.tsx +0 -656
  639. package/src/MenuSurface.tsx +0 -54
  640. package/src/QuotePreview.tsx +0 -133
  641. package/src/RiskConfirmation.module.css +0 -52
  642. package/src/TextShimmer.tsx +0 -58
  643. package/src/Tooltip.tsx +0 -273
  644. package/src/icons/artwork.ts +0 -161
  645. package/src/icons/index.tsx +0 -664
  646. package/src/image-drag.ts +0 -84
  647. package/src/index.ts +0 -143
  648. package/src/markdown/MarkdownText.module.css +0 -522
  649. package/src/markdown/useViewportHighlighting.ts +0 -72
  650. package/src/plugin-artwork.tsx +0 -110
  651. package/src/useAnchoredMaxHeight.ts +0 -45
  652. package/src/useMenuSubmenu.ts +0 -185
  653. /package/lib/types/{AnimatedRows.d.ts → client/AnimatedRows.d.ts} +0 -0
  654. /package/lib/types/{BrandWordmark.d.ts → client/BrandWordmark.d.ts} +0 -0
  655. /package/lib/types/{Button.d.ts → client/Button.d.ts} +0 -0
  656. /package/lib/types/{Checkbox.d.ts → client/Checkbox.d.ts} +0 -0
  657. /package/lib/types/{CodeFileIcon.d.ts → client/CodeFileIcon.d.ts} +0 -0
  658. /package/lib/types/{CodeToolbar.d.ts → client/CodeToolbar.d.ts} +0 -0
  659. /package/lib/types/{CommandText.d.ts → client/CommandText.d.ts} +0 -0
  660. /package/lib/types/{ConfigField.d.ts → client/ConfigField.d.ts} +0 -0
  661. /package/lib/types/{ConnectionIndicator.d.ts → client/ConnectionIndicator.d.ts} +0 -0
  662. /package/lib/types/{DetailDocument.d.ts → client/DetailDocument.d.ts} +0 -0
  663. /package/lib/types/{DiffBlock.d.ts → client/DiffBlock.d.ts} +0 -0
  664. /package/lib/types/{DisclosureRow.d.ts → client/DisclosureRow.d.ts} +0 -0
  665. /package/lib/types/{DraggableImage.d.ts → client/DraggableImage.d.ts} +0 -0
  666. /package/lib/types/{FileTypeIcon.d.ts → client/FileTypeIcon.d.ts} +0 -0
  667. /package/lib/types/{FishLogo.d.ts → client/FishLogo.d.ts} +0 -0
  668. /package/lib/types/{FoldToggle.d.ts → client/FoldToggle.d.ts} +0 -0
  669. /package/lib/types/{HoverCard.d.ts → client/HoverCard.d.ts} +0 -0
  670. /package/lib/types/{HoverCardGroup.d.ts → client/HoverCardGroup.d.ts} +0 -0
  671. /package/lib/types/{ImageLightbox.d.ts → client/ImageLightbox.d.ts} +0 -0
  672. /package/lib/types/{ImagePreview.d.ts → client/ImagePreview.d.ts} +0 -0
  673. /package/lib/types/{InlineEditor.d.ts → client/InlineEditor.d.ts} +0 -0
  674. /package/lib/types/{Input.d.ts → client/Input.d.ts} +0 -0
  675. /package/lib/types/{JsonTree.d.ts → client/JsonTree.d.ts} +0 -0
  676. /package/lib/types/{LinkIcon.d.ts → client/LinkIcon.d.ts} +0 -0
  677. /package/lib/types/{Marquee.d.ts → client/Marquee.d.ts} +0 -0
  678. /package/lib/types/{Menu.d.ts → client/Menu.d.ts} +0 -0
  679. /package/lib/types/{MenuGroup.d.ts → client/MenuGroup.d.ts} +0 -0
  680. /package/lib/types/{MenuRow.d.ts → client/MenuRow.d.ts} +0 -0
  681. /package/lib/types/{MenuSurface.d.ts → client/MenuSurface.d.ts} +0 -0
  682. /package/lib/types/{Modal.d.ts → client/Modal.d.ts} +0 -0
  683. /package/lib/types/{PathLabel.d.ts → client/PathLabel.d.ts} +0 -0
  684. /package/lib/types/{PermissionIcon.d.ts → client/PermissionIcon.d.ts} +0 -0
  685. /package/lib/types/{Pill.d.ts → client/Pill.d.ts} +0 -0
  686. /package/lib/types/{ReadBlock.d.ts → client/ReadBlock.d.ts} +0 -0
  687. /package/lib/types/{ReferenceIcon.d.ts → client/ReferenceIcon.d.ts} +0 -0
  688. /package/lib/types/{RiskConfirmation.d.ts → client/RiskConfirmation.d.ts} +0 -0
  689. /package/lib/types/{SearchBlock.d.ts → client/SearchBlock.d.ts} +0 -0
  690. /package/lib/types/{SearchField.d.ts → client/SearchField.d.ts} +0 -0
  691. /package/lib/types/{SegmentedControl.d.ts → client/SegmentedControl.d.ts} +0 -0
  692. /package/lib/types/{SegmentedTabs.d.ts → client/SegmentedTabs.d.ts} +0 -0
  693. /package/lib/types/{ShortcutKeys.d.ts → client/ShortcutKeys.d.ts} +0 -0
  694. /package/lib/types/{SiteGlyph.d.ts → client/SiteGlyph.d.ts} +0 -0
  695. /package/lib/types/{StateDot.d.ts → client/StateDot.d.ts} +0 -0
  696. /package/lib/types/{SubmenuPanel.d.ts → client/SubmenuPanel.d.ts} +0 -0
  697. /package/lib/types/{Switch.d.ts → client/Switch.d.ts} +0 -0
  698. /package/lib/types/{Tag.d.ts → client/Tag.d.ts} +0 -0
  699. /package/lib/types/{TerminalBlock.d.ts → client/TerminalBlock.d.ts} +0 -0
  700. /package/lib/types/{TextShimmer.d.ts → client/TextShimmer.d.ts} +0 -0
  701. /package/lib/types/{Toast.d.ts → client/Toast.d.ts} +0 -0
  702. /package/lib/types/{Tooltip.d.ts → client/Tooltip.d.ts} +0 -0
  703. /package/lib/types/{UserMessageBubble.d.ts → client/UserMessageBubble.d.ts} +0 -0
  704. /package/lib/types/{WebBlock.d.ts → client/WebBlock.d.ts} +0 -0
  705. /package/lib/types/{ZoomControls.d.ts → client/ZoomControls.d.ts} +0 -0
  706. /package/lib/types/{ansi.d.ts → client/ansi.d.ts} +0 -0
  707. /package/lib/types/{clipboard.d.ts → client/clipboard.d.ts} +0 -0
  708. /package/lib/types/{code-file-icon-artwork.d.ts → client/code-file-icon-artwork.d.ts} +0 -0
  709. /package/lib/types/{code-file-types.d.ts → client/code-file-types.d.ts} +0 -0
  710. /package/lib/types/{code-highlighting.d.ts → client/code-highlighting.d.ts} +0 -0
  711. /package/lib/types/{darwin-desktop.d.ts → client/darwin-desktop.d.ts} +0 -0
  712. /package/lib/types/{document-zoom.d.ts → client/document-zoom.d.ts} +0 -0
  713. /package/lib/types/{file-drag-actions.d.ts → client/file-drag-actions.d.ts} +0 -0
  714. /package/lib/types/{file-size.d.ts → client/file-size.d.ts} +0 -0
  715. /package/lib/types/{focus.d.ts → client/focus.d.ts} +0 -0
  716. /package/lib/types/{guide-artwork.d.ts → client/guide-artwork.d.ts} +0 -0
  717. /package/lib/types/{head-tail-cap.d.ts → client/head-tail-cap.d.ts} +0 -0
  718. /package/lib/types/{icons → client/icons}/props.d.ts +0 -0
  719. /package/lib/types/{icons → client/icons}/shared-artwork.d.ts +0 -0
  720. /package/lib/types/{image-drag.d.ts → client/image-drag.d.ts} +0 -0
  721. /package/lib/types/{input-modality.d.ts → client/input-modality.d.ts} +0 -0
  722. /package/lib/types/{keyboard-composition.d.ts → client/keyboard-composition.d.ts} +0 -0
  723. /package/lib/types/{markdown → client/markdown}/CodeBlock.d.ts +0 -0
  724. /package/lib/types/{markdown → client/markdown}/FenceBlocks.d.ts +0 -0
  725. /package/lib/types/{markdown → client/markdown}/JsonBlock.d.ts +0 -0
  726. /package/lib/types/{markdown → client/markdown}/MarkdownDelegate.d.ts +0 -0
  727. /package/lib/types/{markdown → client/markdown}/MarkdownText.d.ts +0 -0
  728. /package/lib/types/{markdown → client/markdown}/cjkFriendlyStrong.d.ts +0 -0
  729. /package/lib/types/{markdown → client/markdown}/copy-tex.d.ts +0 -0
  730. /package/lib/types/{markdown → client/markdown}/diff-fence.d.ts +0 -0
  731. /package/lib/types/{markdown → client/markdown}/file-link.d.ts +0 -0
  732. /package/lib/types/{markdown → client/markdown}/highlight.d.ts +0 -0
  733. /package/lib/types/{markdown → client/markdown}/incremental.d.ts +0 -0
  734. /package/lib/types/{markdown → client/markdown}/katex.d.ts +0 -0
  735. /package/lib/types/{markdown → client/markdown}/local-image-syntax.d.ts +0 -0
  736. /package/lib/types/{markdown → client/markdown}/mathCompatibility.d.ts +0 -0
  737. /package/lib/types/{markdown → client/markdown}/parse.d.ts +0 -0
  738. /package/lib/types/{markdown → client/markdown}/plain-text.d.ts +0 -0
  739. /package/lib/types/{markdown → client/markdown}/quote-text.d.ts +0 -0
  740. /package/lib/types/{markdown → client/markdown}/render.d.ts +0 -0
  741. /package/lib/types/{markdown → client/markdown}/windows-path-destinations.d.ts +0 -0
  742. /package/lib/types/{menu-submenu-position.d.ts → client/menu-submenu-position.d.ts} +0 -0
  743. /package/lib/types/{overlay-top-margin.d.ts → client/overlay-top-margin.d.ts} +0 -0
  744. /package/lib/types/{plugin-artwork.d.ts → client/plugin-artwork.d.ts} +0 -0
  745. /package/lib/types/{pointer-grace.d.ts → client/pointer-grace.d.ts} +0 -0
  746. /package/lib/types/{relative-time.d.ts → client/relative-time.d.ts} +0 -0
  747. /package/lib/types/{settings-form → client/settings-form}/SettingsForm.d.ts +0 -0
  748. /package/lib/types/{settings-form → client/settings-form}/fields.d.ts +0 -0
  749. /package/lib/types/{settings-form → client/settings-form}/form-model.d.ts +0 -0
  750. /package/lib/types/{tooltip-placement.d.ts → client/tooltip-placement.d.ts} +0 -0
  751. /package/lib/types/{use-clipboard-copy.d.ts → client/use-clipboard-copy.d.ts} +0 -0
  752. /package/lib/types/{useDismissOnOutsidePointer.d.ts → client/useDismissOnOutsidePointer.d.ts} +0 -0
  753. /package/lib/types/{useModalLayer.d.ts → client/useModalLayer.d.ts} +0 -0
  754. /package/lib/types/{useRowDragPreview.d.ts → client/useRowDragPreview.d.ts} +0 -0
  755. /package/lib/types/{user-text.d.ts → client/user-text.d.ts} +0 -0
  756. /package/src/{AnimatedRows.module.css → client/AnimatedRows.module.css} +0 -0
  757. /package/src/{AnimatedRows.tsx → client/AnimatedRows.tsx} +0 -0
  758. /package/src/{BrandWordmark.tsx → client/BrandWordmark.tsx} +0 -0
  759. /package/src/{Button.module.css → client/Button.module.css} +0 -0
  760. /package/src/{Button.tsx → client/Button.tsx} +0 -0
  761. /package/src/{Checkbox.module.css → client/Checkbox.module.css} +0 -0
  762. /package/src/{Checkbox.tsx → client/Checkbox.tsx} +0 -0
  763. /package/src/{CodeCard.module.css → client/CodeCard.module.css} +0 -0
  764. /package/src/{CodeToolbar.tsx → client/CodeToolbar.tsx} +0 -0
  765. /package/src/{CommandText.module.css → client/CommandText.module.css} +0 -0
  766. /package/src/{CommandText.tsx → client/CommandText.tsx} +0 -0
  767. /package/src/{ConfigField.module.css → client/ConfigField.module.css} +0 -0
  768. /package/src/{ConfigField.tsx → client/ConfigField.tsx} +0 -0
  769. /package/src/{ConnectionIndicator.module.css → client/ConnectionIndicator.module.css} +0 -0
  770. /package/src/{ConnectionIndicator.tsx → client/ConnectionIndicator.tsx} +0 -0
  771. /package/src/{DetailDocument.module.css → client/DetailDocument.module.css} +0 -0
  772. /package/src/{DetailDocument.tsx → client/DetailDocument.tsx} +0 -0
  773. /package/src/{DiffBlock.module.css → client/DiffBlock.module.css} +0 -0
  774. /package/src/{DiffBlock.tsx → client/DiffBlock.tsx} +0 -0
  775. /package/src/{DisclosureRow.module.css → client/DisclosureRow.module.css} +0 -0
  776. /package/src/{DisclosureRow.tsx → client/DisclosureRow.tsx} +0 -0
  777. /package/src/{DraggableImage.tsx → client/DraggableImage.tsx} +0 -0
  778. /package/src/{FileTypeIcon.module.css → client/FileTypeIcon.module.css} +0 -0
  779. /package/src/{FileTypeIcon.tsx → client/FileTypeIcon.tsx} +0 -0
  780. /package/src/{FishLogo.tsx → client/FishLogo.tsx} +0 -0
  781. /package/src/{FoldToggle.tsx → client/FoldToggle.tsx} +0 -0
  782. /package/src/{HoverCard.module.css → client/HoverCard.module.css} +0 -0
  783. /package/src/{HoverCardGroup.tsx → client/HoverCardGroup.tsx} +0 -0
  784. /package/src/{ImageLightbox.module.css → client/ImageLightbox.module.css} +0 -0
  785. /package/src/{ImageLightbox.tsx → client/ImageLightbox.tsx} +0 -0
  786. /package/src/{ImagePreview.module.css → client/ImagePreview.module.css} +0 -0
  787. /package/src/{ImagePreview.tsx → client/ImagePreview.tsx} +0 -0
  788. /package/src/{InlineEditor.module.css → client/InlineEditor.module.css} +0 -0
  789. /package/src/{InlineEditor.tsx → client/InlineEditor.tsx} +0 -0
  790. /package/src/{Input.module.css → client/Input.module.css} +0 -0
  791. /package/src/{Input.tsx → client/Input.tsx} +0 -0
  792. /package/src/{JsonTree.module.css → client/JsonTree.module.css} +0 -0
  793. /package/src/{LinkIcon.tsx → client/LinkIcon.tsx} +0 -0
  794. /package/src/{Marquee.module.css → client/Marquee.module.css} +0 -0
  795. /package/src/{Marquee.tsx → client/Marquee.tsx} +0 -0
  796. /package/src/{MenuGroup.module.css → client/MenuGroup.module.css} +0 -0
  797. /package/src/{MenuGroup.tsx → client/MenuGroup.tsx} +0 -0
  798. /package/src/{MenuRow.tsx → client/MenuRow.tsx} +0 -0
  799. /package/src/{MenuSurface.module.css → client/MenuSurface.module.css} +0 -0
  800. /package/src/{Modal.module.css → client/Modal.module.css} +0 -0
  801. /package/src/{Modal.tsx → client/Modal.tsx} +0 -0
  802. /package/src/{PathLabel.module.css → client/PathLabel.module.css} +0 -0
  803. /package/src/{PathLabel.tsx → client/PathLabel.tsx} +0 -0
  804. /package/src/{PermissionIcon.tsx → client/PermissionIcon.tsx} +0 -0
  805. /package/src/{Pill.module.css → client/Pill.module.css} +0 -0
  806. /package/src/{Pill.tsx → client/Pill.tsx} +0 -0
  807. /package/src/{QuotePreview.module.css → client/QuotePreview.module.css} +0 -0
  808. /package/src/{ReadBlock.module.css → client/ReadBlock.module.css} +0 -0
  809. /package/src/{ReadBlock.tsx → client/ReadBlock.tsx} +0 -0
  810. /package/src/{ReferenceIcon.tsx → client/ReferenceIcon.tsx} +0 -0
  811. /package/src/{RiskConfirmation.tsx → client/RiskConfirmation.tsx} +0 -0
  812. /package/src/{RowDragPreview.module.css → client/RowDragPreview.module.css} +0 -0
  813. /package/src/{SearchBlock.module.css → client/SearchBlock.module.css} +0 -0
  814. /package/src/{SearchBlock.tsx → client/SearchBlock.tsx} +0 -0
  815. /package/src/{SearchField.module.css → client/SearchField.module.css} +0 -0
  816. /package/src/{SearchField.tsx → client/SearchField.tsx} +0 -0
  817. /package/src/{SegmentedControl.module.css → client/SegmentedControl.module.css} +0 -0
  818. /package/src/{SegmentedControl.tsx → client/SegmentedControl.tsx} +0 -0
  819. /package/src/{SegmentedTabs.module.css → client/SegmentedTabs.module.css} +0 -0
  820. /package/src/{SegmentedTabs.tsx → client/SegmentedTabs.tsx} +0 -0
  821. /package/src/{ShortcutKeys.module.css → client/ShortcutKeys.module.css} +0 -0
  822. /package/src/{ShortcutKeys.tsx → client/ShortcutKeys.tsx} +0 -0
  823. /package/src/{SiteGlyph.tsx → client/SiteGlyph.tsx} +0 -0
  824. /package/src/{StateDot.module.css → client/StateDot.module.css} +0 -0
  825. /package/src/{StateDot.tsx → client/StateDot.tsx} +0 -0
  826. /package/src/{SubmenuPanel.tsx → client/SubmenuPanel.tsx} +0 -0
  827. /package/src/{Switch.module.css → client/Switch.module.css} +0 -0
  828. /package/src/{Switch.tsx → client/Switch.tsx} +0 -0
  829. /package/src/{Tag.module.css → client/Tag.module.css} +0 -0
  830. /package/src/{Tag.tsx → client/Tag.tsx} +0 -0
  831. /package/src/{TerminalBlock.module.css → client/TerminalBlock.module.css} +0 -0
  832. /package/src/{TerminalBlock.tsx → client/TerminalBlock.tsx} +0 -0
  833. /package/src/{TextShimmer.module.css → client/TextShimmer.module.css} +0 -0
  834. /package/src/{Toast.module.css → client/Toast.module.css} +0 -0
  835. /package/src/{Toast.tsx → client/Toast.tsx} +0 -0
  836. /package/src/{Tooltip.module.css → client/Tooltip.module.css} +0 -0
  837. /package/src/{UserMessageBubble.module.css → client/UserMessageBubble.module.css} +0 -0
  838. /package/src/{UserMessageBubble.tsx → client/UserMessageBubble.tsx} +0 -0
  839. /package/src/{WebBlock.module.css → client/WebBlock.module.css} +0 -0
  840. /package/src/{WebBlock.tsx → client/WebBlock.tsx} +0 -0
  841. /package/src/{ZoomControls.module.css → client/ZoomControls.module.css} +0 -0
  842. /package/src/{ZoomControls.tsx → client/ZoomControls.tsx} +0 -0
  843. /package/src/{ansi.ts → client/ansi.ts} +0 -0
  844. /package/src/{clipboard.ts → client/clipboard.ts} +0 -0
  845. /package/src/{code-file-icon-artwork.manifest.json → client/code-file-icon-artwork.manifest.json} +0 -0
  846. /package/src/{code-file-icon-artwork.ts → client/code-file-icon-artwork.ts} +0 -0
  847. /package/src/{code-file-types.ts → client/code-file-types.ts} +0 -0
  848. /package/src/{code-highlighting.ts → client/code-highlighting.ts} +0 -0
  849. /package/src/{css-modules.d.ts → client/css-modules.d.ts} +0 -0
  850. /package/src/{darwin-desktop.ts → client/darwin-desktop.ts} +0 -0
  851. /package/src/{document-zoom.ts → client/document-zoom.ts} +0 -0
  852. /package/src/{file-drag-actions.ts → client/file-drag-actions.ts} +0 -0
  853. /package/src/{file-size.ts → client/file-size.ts} +0 -0
  854. /package/src/{focus.ts → client/focus.ts} +0 -0
  855. /package/src/{guide-artwork.tsx → client/guide-artwork.tsx} +0 -0
  856. /package/src/{head-tail-cap.ts → client/head-tail-cap.ts} +0 -0
  857. /package/src/{icons → client/icons}/props.ts +0 -0
  858. /package/src/{icons → client/icons}/shared-artwork.tsx +0 -0
  859. /package/src/{input-modality.ts → client/input-modality.ts} +0 -0
  860. /package/src/{keyboard-composition.ts → client/keyboard-composition.ts} +0 -0
  861. /package/src/{markdown → client/markdown}/CodeBlock.module.css +0 -0
  862. /package/src/{markdown → client/markdown}/CodeBlock.tsx +0 -0
  863. /package/src/{markdown → client/markdown}/FenceBlocks.tsx +0 -0
  864. /package/src/{markdown → client/markdown}/JsonBlock.module.css +0 -0
  865. /package/src/{markdown → client/markdown}/JsonBlock.tsx +0 -0
  866. /package/src/{markdown → client/markdown}/MarkdownDelegate.tsx +0 -0
  867. /package/src/{markdown → client/markdown}/MarkdownText.tsx +0 -0
  868. /package/src/{markdown → client/markdown}/cjkFriendlyStrong.ts +0 -0
  869. /package/src/{markdown → client/markdown}/copy-tex.ts +0 -0
  870. /package/src/{markdown → client/markdown}/diff-fence.ts +0 -0
  871. /package/src/{markdown → client/markdown}/file-link.ts +0 -0
  872. /package/src/{markdown → client/markdown}/highlight.ts +0 -0
  873. /package/src/{markdown → client/markdown}/incremental.ts +0 -0
  874. /package/src/{markdown → client/markdown}/katex.tsx +0 -0
  875. /package/src/{markdown → client/markdown}/local-image-syntax.ts +0 -0
  876. /package/src/{markdown → client/markdown}/mathCompatibility.ts +0 -0
  877. /package/src/{markdown → client/markdown}/parse.ts +0 -0
  878. /package/src/{markdown → client/markdown}/plain-text.ts +0 -0
  879. /package/src/{markdown → client/markdown}/quote-text.ts +0 -0
  880. /package/src/{markdown → client/markdown}/render.tsx +0 -0
  881. /package/src/{markdown → client/markdown}/windows-path-destinations.ts +0 -0
  882. /package/src/{menu-submenu-position.ts → client/menu-submenu-position.ts} +0 -0
  883. /package/src/{overlay-top-margin.ts → client/overlay-top-margin.ts} +0 -0
  884. /package/src/{pointer-grace.ts → client/pointer-grace.ts} +0 -0
  885. /package/src/{relative-time.ts → client/relative-time.ts} +0 -0
  886. /package/src/{settings-form → client/settings-form}/SettingsForm.module.css +0 -0
  887. /package/src/{settings-form → client/settings-form}/SettingsForm.tsx +0 -0
  888. /package/src/{settings-form → client/settings-form}/fields.module.css +0 -0
  889. /package/src/{settings-form → client/settings-form}/fields.tsx +0 -0
  890. /package/src/{settings-form → client/settings-form}/form-model.ts +0 -0
  891. /package/src/{tooltip-placement.ts → client/tooltip-placement.ts} +0 -0
  892. /package/src/{use-clipboard-copy.ts → client/use-clipboard-copy.ts} +0 -0
  893. /package/src/{useDismissOnOutsidePointer.ts → client/useDismissOnOutsidePointer.ts} +0 -0
  894. /package/src/{useModalLayer.ts → client/useModalLayer.ts} +0 -0
  895. /package/src/{useRowDragPreview.ts → client/useRowDragPreview.ts} +0 -0
  896. /package/src/{user-text.module.css → client/user-text.module.css} +0 -0
  897. /package/src/{user-text.tsx → client/user-text.tsx} +0 -0
package/src/Menu.tsx DELETED
@@ -1,656 +0,0 @@
1
- import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react'
2
- import type { CSSProperties, ReactNode, RefObject } from 'react'
3
- import { createPortal } from 'react-dom'
4
- import clsx from 'clsx'
5
- import { useMenuSubmenu, menuHoverAllowed } from './useMenuSubmenu.ts'
6
- import { MenuRow, menuIconColumns, renderMenuDecoration } from './MenuRow.tsx'
7
- import { SubmenuPanel } from './SubmenuPanel.tsx'
8
- import { usePointerGrace } from './pointer-grace.ts'
9
- import { isBehindModal } from './useModalLayer.ts'
10
- import { observeComposition } from './keyboard-composition.ts'
11
- import { focusWithoutRing } from './focus.ts'
12
- import { touchModality } from './input-modality.ts'
13
- import { MenuSurface } from './MenuSurface.tsx'
14
- import { SearchField } from './SearchField.tsx'
15
- import css from './Menu.module.css'
16
-
17
- /** Selectable row (optionally with a nested submenu). */
18
- export interface MenuItem {
19
- id: string
20
- label: ReactNode
21
- disabled?: boolean
22
- /** Effective binding supplied by the command owner; omitted for unbound actions. */
23
- shortcut?: { keys: readonly string[]; aria?: string | undefined }
24
- /** Leading icon (figma .Menu_cell gap 8). */
25
- icon?: ReactNode
26
- /** Destructive row: error-colored text/icon and danger hover fill. */
27
- danger?: boolean
28
- /** Child choices opened by hover, focus, click, or ArrowRight; placement follows available space. */
29
- submenu?: readonly MenuEntry[]
30
- }
31
-
32
- /** Hairline between item groups (not selectable). */
33
- export interface MenuSeparator {
34
- type: 'separator'
35
- id: string
36
- }
37
-
38
- /** Non-interactive heading row above a group of items. */
39
- export interface MenuLabel {
40
- type: 'label'
41
- id: string
42
- text: string
43
- }
44
-
45
- /** One primary-menu entry: a row, a separator, or a heading label. */
46
- export type MenuEntry = MenuItem | MenuSeparator | MenuLabel
47
-
48
- /** Props for one component-rendered menu row. */
49
- export interface MenuItemButtonProps {
50
- /** Visible row label. */
51
- children: ReactNode
52
- /** Effective binding supplied by the command owner; omitted for unbound actions. */
53
- shortcut?: MenuItem['shortcut']
54
- /** Leading icon (figma .Menu_cell gap 8). */
55
- icon?: ReactNode
56
- /** Whether this row identifies the currently displayed page or view. */
57
- current?: boolean
58
- /** Whether the row cannot be activated. */
59
- disabled?: boolean
60
- /**
61
- * Why the disabled row cannot be activated. The row then stays hoverable and
62
- * focusable, shows the reason in a tooltip, and exposes it as the row's
63
- * description; an enabled row ignores it.
64
- */
65
- disabledReason?: string | undefined
66
- /** Destructive row: error-colored text/icon and danger hover fill. */
67
- danger?: boolean
68
- /**
69
- * Start a new group: a hairline above this row, the same one a
70
- * `{ type: 'separator' }` data entry draws. It comes and goes with the row,
71
- * so a row that renders nothing leaves no stray line; a data separator
72
- * directly before it draws no second line, and the list's first row draws none.
73
- */
74
- separatorBefore?: boolean
75
- /** Row activation (click, Enter, or Tab on the focused row). */
76
- onSelect: () => void
77
- }
78
-
79
- /**
80
- * Render one `role="menuitem"` row for a {@link Menu} whose rows are
81
- * components rather than `items` data: the same markup and styling as a data
82
- * row, so it joins the list's keyboard walk and post-selection focus return
83
- * without any shared state. Closing the menu stays the owner's decision, as
84
- * it is for data rows.
85
- * @param props.children - visible row label.
86
- * @param props.shortcut - effective key labels and accessible combination.
87
- * @param props.icon - optional leading icon.
88
- * @param props.current - whether the row identifies the currently displayed page or view.
89
- * @param props.disabled - whether the row cannot be activated.
90
- * @param props.disabledReason - why a disabled row cannot be activated, shown in a tooltip and read as its description.
91
- * @param props.danger - whether to use the destructive row colors.
92
- * @param props.separatorBefore - whether this row starts a new group (hairline above it).
93
- * @param props.onSelect - row activation callback.
94
- * @returns one menu-item row.
95
- */
96
- export function MenuItemButton({ onSelect, ...props }: MenuItemButtonProps) {
97
- return <MenuRow {...props} decorativeIcon={false} onClick={onSelect} />
98
- }
99
-
100
- /** Buttons reachable by keyboard within a menu row group. */
101
- function menuButtons(container: HTMLElement | null): HTMLButtonElement[] {
102
- return Array.from(container?.querySelectorAll<HTMLButtonElement>('button:not(:disabled)') ?? [])
103
- }
104
-
105
- /**
106
- * Render an anchored dropdown menu. While the list is open its keys mirror the
107
- * composer's: Tab settles the focused row — from the trigger, Tab enters the
108
- * list instead — and Escape or Shift+Tab close it and return focus to the
109
- * anchor's first button, and selecting a row does the same — the rows unmount
110
- * with the list. Only a keyboard on the trigger or inside the list is
111
- * intercepted; Tab presses elsewhere on the page stay the browser's. Escape
112
- * first returns from a visible child, while ArrowRight enters and ArrowLeft returns.
113
- * When neither side fits, click or ArrowRight opens a single-panel child page;
114
- * focus alone retains the parent page.
115
- * @param props.contextual - cursor positioning, context dismissal, and per-divider icon alignment.
116
- * @param props.exiting - retain an inert popup during dismissal or replacement fade.
117
- * @param props.returnFocus - original control captured before asynchronous menu preparation.
118
- * @param props.isExternalTrigger - recognizes external controls whose pointer presses should not dismiss;
119
- * omitted, every press outside the anchor and menu panels dismisses.
120
- * @param props.autoFocus - focus the first focusable row on open when `search` is omitted.
121
- * With `search`, the search settings determine initial focus. Arrow keys navigate either way.
122
- * @param props.open - whether the list is showing (owner-controlled).
123
- * @param props.anchor - the trigger element (rendered in place).
124
- * @param props.items - selectable data rows and optional separators (default none; with no `children` either, the list is empty).
125
- * @param props.submenuBackLabel - localized single-panel return label; omitted uses the caller's
126
- * parent-row label beside a back arrow, without selecting that row.
127
- * @param props.selectedId - row shown as selected.
128
- * @param props.selectedIds - rows shown as selected when a menu contains independent option groups.
129
- * @param props.onSelect - data-row activation callback (not called for disabled rows or submenu parents that only open children).
130
- * @param props.onClose - invoked on outside click, on activating another popup
131
- * trigger (an `aria-haspopup` control outside this menu that
132
- * `isExternalTrigger` does not claim) even when that trigger stops its
133
- * pointer presses, on Escape, or on a window blur that moved focus into an
134
- * iframe (the only signal a pointerdown inside a cross-origin iframe leaves).
135
- * @param props.align - list alignment against the anchor (default 'start').
136
- * @param props.side - open below (`bottom`, default) or above (`top`) the anchor.
137
- * @param props.portal - render the list into document.body, fixed-positioned
138
- * with CSS anchor positioning; it follows browser zoom and may exceed the
139
- * visual viewport. Use when an ancestor's overflow clipping would crop the
140
- * in-place list; default false keeps the pure-CSS in-place behavior.
141
- * @param props.closeOnPointerLeave - close the list once the pointer has left
142
- * both trigger and list for the pointer grace (default false keeps it open
143
- * until outside click/Escape/selection). The grace makes the 4px trigger->list
144
- * gap and a brief overshoot survivable; coming back cancels the close.
145
- * @param props.dense - reduce vertical row spacing without changing the standard typography or card width.
146
- * @param props.compact - use reduced menu typography and spacing.
147
- * @param props.anchorRef - external element used as the CSS anchor in portal mode.
148
- * @param props.anchorPoint - client viewport coordinates captured when a context menu opens.
149
- * @param props.minWidthFromAnchor - in portal mode, keep the menu at least as wide as its anchor, bounded by viewport margins.
150
- * @param props.footer - rows pinned below the scrolling items area, separated
151
- * by a hairline; contextual menus reuse an explicit leading separator. These rows stay visible while the items above scroll.
152
- * @param props.search - controlled field above the rows. It focuses on open unless
153
- * `skipAutoFocusOnTouch` is set and opened by touch. Enter activates the first available
154
- * result in the scrolling rows. `clearLabel` enables a clear button that restores input focus.
155
- * The owner filters `items` and provides the labels and empty message.
156
- * @param props.maxVisibleRows - cap the scrolling viewport at this many row heights.
157
- * @param props.children - component rows rendered after `items` in the same
158
- * list, each a `role="menuitem"` button such as {@link MenuItemButton}; they
159
- * share the keyboard walk, the submenu exclusivity, and the post-selection
160
- * focus return.
161
- * @param props.selection - how a selected row is marked: a trailing check
162
- * (`'check'`, default — figma .Menu_cell) or the hover fill held on the row
163
- * with no check (`'fill'`, for icon-labelled rows where a trailing glyph
164
- * crowds the cell).
165
- * @param props.className - extra class on the anchor wrapper span.
166
- * @param props.listClassName - extra class on the dropdown card itself; the
167
- * only style hook that reaches a portaled list, which renders under
168
- * document.body outside the owner's DOM subtree.
169
- * @returns anchor wrapper with the conditional list.
170
- */
171
- export function Menu({ open, anchor, items = [], children, submenuBackLabel, selectedId, selectedIds, onSelect, onClose, align = 'start', side = 'bottom', portal = false, closeOnPointerLeave = false, dense = false, compact = false, autoFocus = false, selection = 'check', anchorRef, anchorPoint, minWidthFromAnchor = false, footer, search, maxVisibleRows, className, listClassName, contextual = false, exiting, returnFocus, isExternalTrigger }: {
172
- open: boolean
173
- /** Pointer-positioned popup: cursor clearance, grouped icons, and context gestures. */
174
- contextual?: boolean
175
- /** Recognizes external triggers exempt from outside dismissal; omitted exempts no external nodes. */
176
- isExternalTrigger?: (node: Node) => boolean
177
- /** Resolve the original control for focus restoration and inert/hidden dismissal. */
178
- returnFocus?: (() => HTMLElement | null) | undefined
179
- /** Retain a dismissed context popup during its short fade. */
180
- exiting?: 'dismiss' | 'replace' | undefined
181
- autoFocus?: boolean
182
- anchor: ReactNode
183
- items?: readonly MenuEntry[]
184
- /** Localized return action; omitted uses the caller's parent label with a back arrow. */
185
- submenuBackLabel?: string | undefined
186
- children?: ReactNode
187
- footer?: readonly MenuEntry[]
188
- search?: {
189
- label: string
190
- /** Localized label for the optional clear button. */
191
- clearLabel?: string | undefined
192
- value: string
193
- onChange: (value: string) => void
194
- emptyMessage?: string | undefined
195
- /** Leave the search field unfocused when touch opens the menu. */
196
- skipAutoFocusOnTouch?: boolean
197
- } | undefined
198
- maxVisibleRows?: number | undefined
199
- selectedId?: string | undefined
200
- selectedIds?: readonly string[] | undefined
201
- onSelect?: (id: string) => void
202
- onClose: () => void
203
- align?: 'start' | 'end'
204
- side?: 'bottom' | 'top' | 'right'
205
- portal?: boolean
206
- closeOnPointerLeave?: boolean
207
- dense?: boolean
208
- compact?: boolean
209
- selection?: 'check' | 'fill'
210
- anchorRef?: RefObject<HTMLElement | null> | undefined
211
- /** Client coordinates captured for this opening; Safari offsets are applied once. */
212
- anchorPoint?: { readonly x: number; readonly y: number } | undefined
213
- minWidthFromAnchor?: boolean
214
- className?: string | undefined
215
- listClassName?: string | undefined
216
- }) {
217
- const rootRef = useRef<HTMLSpanElement>(null)
218
- const listRef = useRef<HTMLDivElement>(null)
219
- const searchRowsRef = useRef<HTMLDivElement>(null)
220
- const viewportRef = useRef<HTMLDivElement>(null)
221
- const searchFieldRef = useRef<HTMLDivElement>(null)
222
- const searchRef = useRef<HTMLInputElement>(null)
223
- const hasSearch = search !== undefined
224
- const hasSearchClear = search?.clearLabel !== undefined
225
- const skipAutoFocusOnTouch = search?.skipAutoFocusOnTouch === true
226
- const openedByTouch = useRef(false)
227
- const menuId = useId()
228
- const pointX = anchorPoint?.x
229
- const pointY = anchorPoint?.y
230
- const point = useMemo(() => {
231
- if (pointX === undefined || pointY === undefined) return undefined
232
- // WebKit reports client coordinates from the visual origin; fixed CSS uses
233
- // the layout origin. Subsequent panning must not move this captured point.
234
- const visualOrigin = open && typeof window.CSS !== 'undefined'
235
- && window.CSS.supports('-webkit-backdrop-filter', 'none')
236
- const viewport = visualOrigin ? window.visualViewport : undefined
237
- return { x: pointX + (viewport?.offsetLeft ?? 0), y: pointY + (viewport?.offsetTop ?? 0) }
238
- }, [open, pointX, pointY])
239
- useLayoutEffect(() => {
240
- const trigger = returnFocus?.()
241
- if (!open || !contextual || trigger == null) return
242
- const previous = trigger.getAttribute('aria-controls')
243
- trigger.setAttribute('aria-controls', [previous, menuId].filter(Boolean).join(' '))
244
- return () => {
245
- if (previous === null) trigger.removeAttribute('aria-controls')
246
- else trigger.setAttribute('aria-controls', previous)
247
- }
248
- }, [open, contextual, returnFocus, menuId])
249
- /** Index the arrow walk last focused, the resume point when focus left the rows. */
250
- const walkIndex = useRef<number | null>(null)
251
- /**
252
- * The control that had the keyboard when this menu opened — its own trigger,
253
- * which an anchor that wraps several controls (a split button) would not be
254
- * able to name by position.
255
- */
256
- const triggerRef = useRef<HTMLElement | null>(null)
257
- const selectingWithTab = useRef(false)
258
-
259
- /**
260
- * Hand the keyboard back to the trigger that opened the menu — or, when the
261
- * anchor never held it, to the anchor's first button. Focus left on a removed
262
- * row otherwise falls to the page body, where the next Tab restarts from the
263
- * top of the page.
264
- * @param navigation - whether explicit keyboard traversal should retain its focus indicator.
265
- */
266
- const refocusAnchor = (navigation = false): void => {
267
- const remembered = triggerRef.current
268
- const trigger = returnFocus?.() ?? (remembered?.isConnected ? remembered : anchorRef?.current) ?? null
269
- const target = trigger !== null && document.contains(trigger) && !(trigger as HTMLButtonElement).disabled
270
- ? trigger : rootRef.current?.querySelector<HTMLButtonElement>('button:not(:disabled)')
271
- if (target == null) return
272
- if (navigation) target.focus()
273
- else focusWithoutRing(target)
274
- }
275
-
276
- /**
277
- * Post-selection focus, for the paths where the rows unmount with the list.
278
- * A selection whose owner keeps the menu open is left alone, and so is an
279
- * owner that moved focus itself (a presented file card hands it to its
280
- * preview button): only a keyboard left on the closing list (or on the body
281
- * its removal produced) comes back to the trigger.
282
- */
283
- const refocusAfterSelection = (): void => {
284
- const navigation = selectingWithTab.current
285
- queueMicrotask(() => {
286
- if (openRef.current && exitingRef.current === undefined) return
287
- const active = document.activeElement
288
- if (active === null || active === document.body || listRef.current?.contains(active) === true
289
- || submenu.contains(active)) refocusAnchor(navigation)
290
- })
291
- }
292
- const exitingRef = useRef(exiting)
293
- exitingRef.current = exiting
294
- const openRef = useRef(open)
295
- openRef.current = open
296
- const submenu = useMenuSubmenu({ open: open && exiting === undefined, items, footer, listRef, searchRowsRef, refocusAnchor })
297
- const submenuEvents = useRef<Pick<typeof submenu, 'contains' | 'activeList' | 'returnToParent'>>(submenu)
298
- submenuEvents.current = submenu
299
- const close = useRef(onClose)
300
- close.current = onClose
301
- const anchorName = `--dsh-menu-trigger-${menuId.replaceAll(':', '')}`
302
- const [externalAnchor, setExternalAnchor] = useState<HTMLElement | null>(null)
303
- const positioned = !portal || anchorRef === undefined || externalAnchor !== null
304
- // External refs can attach after this component or replace their element
305
- // without changing ref identity. Publish the anchor after all refs commit.
306
- useEffect(() => {
307
- if (!open || !portal || anchorRef === undefined) {
308
- setExternalAnchor(null)
309
- return
310
- }
311
- const element = anchorRef.current
312
- setExternalAnchor(element)
313
- if (element === null) return
314
- const previous = element.style.getPropertyValue('anchor-name')
315
- const priority = element.style.getPropertyPriority('anchor-name')
316
- element.style.setProperty('anchor-name', anchorName)
317
- return () => { element.style.setProperty('anchor-name', previous, priority) }
318
- })
319
- useEffect(() => {
320
- if (!open || !portal || exiting !== undefined) return
321
- const currentAnchor = (): HTMLElement | null => returnFocus?.() ?? (anchorRef === undefined ? rootRef.current : anchorRef.current)
322
- const element = currentAnchor()
323
- if (element === null) return
324
- let dismissed = false
325
- const check = (): void => {
326
- const current = currentAnchor()
327
- if (dismissed || (current !== null && current.isConnected && current.closest('[inert], [hidden]') === null)) return
328
- dismissed = true
329
- close.current()
330
- }
331
- const observer = new MutationObserver(check)
332
- observer.observe(element.ownerDocument.documentElement, {
333
- subtree: true, childList: true, attributes: true, attributeFilter: ['inert', 'hidden'],
334
- })
335
- check()
336
- return () => { observer.disconnect() }
337
- }, [open, portal, exiting, anchorRef, externalAnchor, returnFocus])
338
- const { arm: armClose, cancel: cancelClose } = usePointerGrace(onClose)
339
-
340
- // Opening remembers where the keyboard was, so closing can hand it back to
341
- // that control — an anchor wrapping several (a split button) cannot be asked
342
- // for it by position. Declared before the autoFocus effect so the capture
343
- // sees the trigger, not the row autoFocus is about to focus.
344
- useEffect(() => {
345
- if (!open) return
346
- openedByTouch.current = touchModality()
347
- const active = document.activeElement
348
- triggerRef.current = active instanceof HTMLElement && active !== document.body
349
- && (anchorRef !== undefined || anchorPoint !== undefined || rootRef.current?.contains(active) === true)
350
- ? active : null
351
- }, [open])
352
-
353
- useEffect(() => {
354
- if (open && positioned && exiting === undefined && hasSearch
355
- && !(skipAutoFocusOnTouch && openedByTouch.current)
356
- && !isBehindModal(triggerRef.current ?? rootRef.current)) {
357
- searchRef.current?.focus({ preventScroll: true })
358
- }
359
- }, [open, positioned, exiting, hasSearch, skipAutoFocusOnTouch])
360
-
361
- useEffect(() => {
362
- if (!open || !positioned || exiting !== undefined || !autoFocus || hasSearch
363
- || listRef.current?.contains(document.activeElement) || submenu.contains(document.activeElement)) return
364
- const first = menuButtons(listRef.current)[0]
365
- walkIndex.current = first === undefined ? null : 0
366
- if (first !== undefined) focusWithoutRing(first)
367
- }, [open, autoFocus, hasSearch, items.length, footer?.length, positioned, exiting])
368
-
369
- useEffect(() => {
370
- if (!open || exiting !== undefined) {
371
- walkIndex.current = null
372
- return
373
- }
374
- const composition = observeComposition(document)
375
- const onPointerDown = (e: PointerEvent) => {
376
- if (!(e.target instanceof Node) || (contextual && e.button === 2)) return
377
- // The portaled list is outside the anchor subtree; check both.
378
- if (rootRef.current?.contains(e.target) === true || anchorRef?.current?.contains(e.target) === true) return
379
- if (isExternalTrigger?.(e.target) === true) return
380
- if (listRef.current?.contains(e.target) === true || submenuEvents.current.contains(e.target)) return
381
- onClose()
382
- }
383
- // Activating another popup trigger closes this menu even when that trigger
384
- // isolates its presses from its owners, as the shared context-menu button
385
- // does: its pointerdown never reaches the listener above, so the
386
- // activating click is caught in the capture phase instead.
387
- const onOtherTrigger = (e: MouseEvent) => {
388
- const trigger = e.target instanceof Element ? e.target.closest('[aria-haspopup]') : null
389
- if (trigger === null || rootRef.current?.contains(trigger) === true || anchorRef?.current?.contains(trigger) === true) return
390
- if (isExternalTrigger?.(trigger) === true) return
391
- if (listRef.current?.contains(trigger) === true || submenuEvents.current.contains(trigger)) return
392
- onClose()
393
- }
394
- const onKeyDown = (e: KeyboardEvent) => {
395
- if (composition.guards(e) || isBehindModal(triggerRef.current ?? rootRef.current)
396
- || e.defaultPrevented || e.ctrlKey || e.altKey || e.metaKey) return
397
- // Where the keyboard is, computed once: the menu owns it when it holds a
398
- // row or sits on its anchor region.
399
- const focused = document.activeElement
400
- const inSearch = focused !== null && focused === searchRef.current
401
- const onClearSearch = !inSearch && searchFieldRef.current?.contains(focused) === true
402
- const insideList = listRef.current?.contains(focused) === true || submenuEvents.current.contains(focused)
403
- const anchored = focused === returnFocus?.() || anchorRef?.current?.contains(focused) === true
404
- || rootRef.current?.contains(focused) === true || insideList || (hasSearch && focused === triggerRef.current)
405
- if (inSearch && e.key === 'Enter' && !e.shiftKey) {
406
- e.preventDefault()
407
- if (!e.repeat) menuButtons(viewportRef.current).find(button =>
408
- button.getAttribute('role') === 'menuitem' && button.getAttribute('aria-disabled') !== 'true')?.click()
409
- return
410
- }
411
- if (e.key === 'Escape' && !e.shiftKey) {
412
- e.preventDefault()
413
- if (e.repeat) return
414
- if (submenuEvents.current.returnToParent()) return
415
- // Closing hands the keyboard back when the menu had it — and, as this
416
- // primitive always did for autoFocus menus, when it held the keyboard
417
- // and lost it again (a row that unmounted under it).
418
- onClose()
419
- if (anchored || autoFocus) refocusAnchor()
420
- }
421
- if (e.key === 'ArrowLeft' && anchored && submenuEvents.current.returnToParent()) {
422
- e.preventDefault()
423
- return
424
- }
425
- if (e.key === 'ArrowRight' && insideList && focused instanceof HTMLButtonElement
426
- && focused.getAttribute('aria-haspopup') === 'menu') {
427
- e.preventDefault()
428
- focused.click()
429
- return
430
- }
431
- // Tab settles like Enter and Shift+Tab leaves like Escape, so a menu's
432
- // keys mean what they mean in the composer. Only a keyboard already on
433
- // the trigger or inside the list is intercepted: Tab elsewhere on the
434
- // page keeps the browser's traversal even while a menu is open.
435
- if (e.key === 'Tab') {
436
- const list = submenuEvents.current.activeList(focused)
437
- if (list === null || !anchored) return
438
- if ((!e.shiftKey && inSearch && hasSearchClear) || (e.shiftKey && onClearSearch)) return
439
- if (e.shiftKey) {
440
- e.preventDefault()
441
- onClose()
442
- refocusAnchor(true)
443
- return
444
- }
445
- // Tab settles a focused row. Other controls inside the list keep
446
- // native traversal unless they belong to the search field.
447
- if (insideList && !inSearch && !onClearSearch) {
448
- if (focused instanceof Element && focused.getAttribute('role') === 'menuitem') {
449
- e.preventDefault()
450
- if (focused.getAttribute('aria-disabled') === 'true') {
451
- onClose()
452
- refocusAnchor(true)
453
- return
454
- }
455
- selectingWithTab.current = true
456
- try { (focused as HTMLElement).click() }
457
- finally { selectingWithTab.current = false }
458
- }
459
- return
460
- }
461
- const row = menuButtons(list)[0]
462
- if (row === undefined) {
463
- if (inSearch || onClearSearch) {
464
- e.preventDefault()
465
- searchRef.current?.focus()
466
- }
467
- return
468
- }
469
- e.preventDefault()
470
- row.focus()
471
- walkIndex.current = 0
472
- return
473
- }
474
- // Arrows walk the list whether or not the menu focused its first item on
475
- // open, so `autoFocus` chooses only that entry behavior. A keyboard still
476
- // on the anchor enters at the end the step comes from — unless it already
477
- // walked, in which case the walk resumes where it left off. The walk resumes
478
- // from where it last put focus, not from `document.activeElement`: a row
479
- // that refused focus (a hidden portal frame, a detached node) would
480
- // otherwise re-enter at the near end on every press and the walk would
481
- // alternate between two rows.
482
- if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(e.key)) return
483
- if (inSearch && (e.key === 'Home' || e.key === 'End')) return
484
- const list = submenuEvents.current.activeList(focused)
485
- if (list === null || !anchored) return
486
- const buttons = menuButtons(list)
487
- if (buttons.length === 0) return
488
- const index = buttons.indexOf(focused as HTMLButtonElement)
489
- const from = index >= 0 ? index : inSearch || onClearSearch ? null : walkIndex.current
490
- const next = e.key === 'Home' ? 0 : e.key === 'End' ? buttons.length - 1
491
- : from === null
492
- ? (e.key === 'ArrowDown' ? 0 : buttons.length - 1)
493
- : (from + (e.key === 'ArrowDown' ? 1 : -1) + buttons.length) % buttons.length
494
- e.preventDefault()
495
- walkIndex.current = next
496
- buttons[next]?.focus()
497
- }
498
- // A pointerdown inside a cross-origin iframe (a sandboxed HTML preview)
499
- // never reaches this document; the focus move it causes blurs the window
500
- // instead. Only that case closes: an app or tab switch leaves the
501
- // document's focus where it was, so activeElement is not an iframe.
502
- const onWindowBlur = () => {
503
- if (document.activeElement instanceof HTMLIFrameElement) onClose()
504
- }
505
- document.addEventListener('pointerdown', onPointerDown)
506
- document.addEventListener('click', onOtherTrigger, true)
507
- const onEscape = (event: KeyboardEvent): void => { if (event.key === 'Escape') onKeyDown(event) }
508
- const onOtherKey = (event: KeyboardEvent): void => { if (event.key !== 'Escape') onKeyDown(event) }
509
- document.addEventListener('keydown', onOtherKey)
510
- document.addEventListener('keydown', onEscape, true)
511
- window.addEventListener('blur', onWindowBlur)
512
- return () => {
513
- composition.dispose()
514
- document.removeEventListener('pointerdown', onPointerDown)
515
- document.removeEventListener('click', onOtherTrigger, true)
516
- document.removeEventListener('keydown', onOtherKey)
517
- document.removeEventListener('keydown', onEscape, true)
518
- window.removeEventListener('blur', onWindowBlur)
519
- }
520
- }, [open, onClose, autoFocus, hasSearch, hasSearchClear, contextual, exiting, anchorRef, returnFocus, isExternalTrigger])
521
-
522
- useLayoutEffect(() => {
523
- if (exiting === 'dismiss' && listRef.current?.contains(document.activeElement)) refocusAnchor()
524
- }, [exiting])
525
-
526
- // A close from selection/Escape/outside click outruns a pending grace close;
527
- // left armed it would shut a list reopened inside the grace window. Its own
528
- // effect, not the listener effect above: that one re-runs on every `onClose`
529
- // identity change and would cancel the grace mid-transit.
530
- useEffect(() => {
531
- if (!open) cancelClose()
532
- }, [open, cancelClose])
533
-
534
- const itemColumns = menuIconColumns(items, contextual)
535
- const footerColumns = menuIconColumns(footer ?? [], contextual)
536
- const renderEntry = (entry: MenuEntry, columns: ReadonlySet<MenuEntry>) => {
537
- if ('type' in entry) return renderMenuDecoration(entry)
538
- const hasSub = entry.submenu !== undefined && entry.submenu.length > 0
539
- return <MenuRow key={entry.id} icon={entry.icon} reserveIcon={columns.has(entry)}
540
- disabled={entry.disabled} danger={entry.danger} shortcut={entry.shortcut}
541
- selected={entry.id === selectedId || selectedIds?.includes(entry.id) === true} selection={selection}
542
- aria-haspopup={hasSub ? 'menu' : undefined}
543
- aria-expanded={hasSub ? submenu.entry?.id === entry.id && !submenu.hidden : undefined}
544
- wrapperProps={hasSub ? {
545
- onPointerEnter: (event) => {
546
- if (!menuHoverAllowed(event) || entry.disabled) return
547
- const trigger = event.currentTarget.querySelector<HTMLButtonElement>('button')
548
- if (trigger !== null) submenu.openChild(entry.id, trigger)
549
- },
550
- onPointerLeave: (event) => { if (menuHoverAllowed(event)) submenu.leave() },
551
- } : undefined}
552
- onFocus={hasSub ? (event) => { submenu.focusParent(entry.id, event.currentTarget) } : undefined}
553
- onClick={(event) => {
554
- if (hasSub) submenu.openChild(entry.id, event.currentTarget, true)
555
- else onSelect?.(entry.id)
556
- }}>{entry.label}</MenuRow>
557
- }
558
-
559
- const rows = <>
560
- <div ref={viewportRef} className={css.viewport} role="presentation">
561
- {items.map(entry => renderEntry(entry, itemColumns))}
562
- {children}
563
- </div>
564
- {footer !== undefined && footer.length > 0 && (
565
- <div className={css.footer} role="presentation">
566
- {footer.map(entry => renderEntry(entry, footerColumns))}
567
- </div>
568
- )}
569
- </>
570
- const visible = exiting === undefined && !submenu.page
571
- const cardStyle: CSSProperties & { '--dsh-menu-visible-rows'?: number } = {
572
- positionAnchor: portal ? anchorName : undefined,
573
- ...(maxVisibleRows === undefined ? {} : { '--dsh-menu-visible-rows': maxVisibleRows }),
574
- }
575
- const updateSearch = (value: string): void => {
576
- if (viewportRef.current !== null) viewportRef.current.scrollTop = 0
577
- search?.onChange(value)
578
- }
579
-
580
- const list = open && positioned && (
581
- <MenuSurface compact={compact} id={contextual ? menuId : undefined}
582
- ref={listRef}
583
- className={clsx(css.list, listClassName, dense && css.denseList, compact && css.compactList, css.scrollable, submenu.page && css.parentPage, portal && css.portal, side === 'top' && !portal && css.sideTop, align === 'end' && !portal && css.alignEnd)}
584
- style={cardStyle}
585
- data-anchor-side={portal ? side : undefined}
586
- data-anchor-align={portal ? align : undefined}
587
- data-match-anchor-width={portal && minWidthFromAnchor ? '' : undefined}
588
- data-menu-popup={visible && hasSearch ? '' : undefined}
589
- role={visible && !hasSearch ? 'menu' : undefined}
590
- aria-hidden={visible ? undefined : true}
591
- data-context-menu={contextual ? '' : undefined}
592
- phase={contextual ? exiting ?? 'enter' : undefined}
593
- // React portals bubble synthetic events through the REACT tree: without
594
- // this stop, an item click re-fires the anchor row's own onClick
595
- // (open/toggle) after onSelect. The same bubble is where every row's
596
- // activation lands — data rows and component rows alike — so the
597
- // post-selection focus return is decided once here, after the row's
598
- // own handler ran; a submenu parent only opened its card.
599
- onClick={(e) => {
600
- e.stopPropagation()
601
- const row = e.target instanceof Element ? e.target.closest('button[role="menuitem"]') : null
602
- if (row !== null && row.getAttribute('aria-haspopup') !== 'menu') refocusAfterSelection()
603
- }}
604
- onContextMenu={contextual ? (event) => {
605
- event.preventDefault(); event.stopPropagation(); onClose()
606
- } : undefined}
607
- onPointerOver={(event) => { if (menuHoverAllowed(event)) submenu.collapseFrom(event) }}
608
- onFocus={submenu.collapseFrom}
609
- >
610
- {/* Child cards anchor to this unscrolled box, which matches the card itself. */}
611
- {submenu.entry !== undefined && <span aria-hidden="true" className={css.submenuAnchor} style={{ anchorName: submenu.parentAnchor }} />}
612
- {search === undefined ? rows : <>
613
- <SearchField
614
- inputRef={searchRef}
615
- rootRef={searchFieldRef}
616
- className={css.search}
617
- role="searchbox"
618
- aria-label={search.label}
619
- placeholder={search.label}
620
- value={search.value}
621
- onChange={updateSearch}
622
- clearLabel={search.clearLabel}
623
- onClear={() => {
624
- updateSearch('')
625
- searchRef.current?.focus({ preventScroll: true })
626
- }}
627
- />
628
- {search.emptyMessage !== undefined && items.length === 0 && <div role="status" className={css.searchStatus}>{search.emptyMessage}</div>}
629
- <div ref={searchRowsRef} className={css.searchRows}
630
- role={visible && (items.length > 0 || children != null || !!footer?.length) ? 'menu' : undefined}>{rows}</div>
631
- </>}
632
- </MenuSurface>
633
- )
634
-
635
- // Pointer-leave dismissal watches the WRAPPER, not the list: React's
636
- // enter/leave traversal runs over the React tree, so trigger and portaled
637
- // list are one region here. Aiming back at the trigger, or crossing the 4px
638
- // gap between them, therefore never counts as leaving.
639
- return (
640
- <span
641
- ref={rootRef}
642
- className={clsx(css.root, className)}
643
- style={{ anchorName: anchorRef === undefined ? anchorName : undefined, ...(point === undefined ? {} : {
644
- position: 'fixed', left: point.x, top: point.y, width: 0, height: 0,
645
- }) }}
646
- onPointerEnter={closeOnPointerLeave ? cancelClose : undefined}
647
- onPointerLeave={closeOnPointerLeave ? (event) => { if (open && menuHoverAllowed(event)) armClose() } : undefined}
648
- >
649
- {anchor}
650
- {portal ? (list !== false && createPortal(list, document.body)) : list}
651
- {open && exiting === undefined && submenu.entry !== undefined && <SubmenuPanel key={submenu.entry.id}
652
- entry={submenu.entry} submenu={submenu} compact={compact} dense={dense} contextual={contextual}
653
- backLabel={submenuBackLabel ?? submenu.entry.label} onSelect={onSelect} onClose={onClose} afterSelection={refocusAfterSelection} />}
654
- </span>
655
- )
656
- }