@lobehub/ui 4.33.3 → 4.34.0

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 (596) hide show
  1. package/README.md +3 -3
  2. package/es/A/index.mjs.map +1 -1
  3. package/es/Accordion/Accordion.d.mts +2 -2
  4. package/es/Accordion/Accordion.mjs +3 -3
  5. package/es/Accordion/Accordion.mjs.map +1 -1
  6. package/es/Accordion/AccordionItem.d.mts +2 -2
  7. package/es/Accordion/AccordionItem.mjs +15 -15
  8. package/es/Accordion/AccordionItem.mjs.map +1 -1
  9. package/es/Accordion/context.mjs +2 -2
  10. package/es/Accordion/context.mjs.map +1 -1
  11. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  12. package/es/ActionIcon/ActionIcon.mjs +2 -2
  13. package/es/ActionIcon/ActionIcon.mjs.map +1 -1
  14. package/es/ActionIcon/style.mjs.map +1 -1
  15. package/es/ActionIconGroup/ActionIconGroup.mjs +3 -3
  16. package/es/ActionIconGroup/ActionIconGroup.mjs.map +1 -1
  17. package/es/ActionIconGroup/style.mjs.map +1 -1
  18. package/es/Alert/Alert.d.mts +2 -2
  19. package/es/Alert/Alert.mjs +6 -6
  20. package/es/Alert/Alert.mjs.map +1 -1
  21. package/es/Alert/style.mjs.map +1 -1
  22. package/es/AutoComplete/Select.d.mts +2 -2
  23. package/es/AutoComplete/Select.mjs +1 -1
  24. package/es/AutoComplete/Select.mjs.map +1 -1
  25. package/es/AutoComplete/style.mjs.map +1 -1
  26. package/es/Avatar/Avatar.mjs +4 -4
  27. package/es/Avatar/Avatar.mjs.map +1 -1
  28. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  29. package/es/Avatar/AvatarGroup/index.mjs +5 -5
  30. package/es/Avatar/AvatarGroup/index.mjs.map +1 -1
  31. package/es/Avatar/index.mjs.map +1 -1
  32. package/es/Avatar/style.mjs.map +1 -1
  33. package/es/Avatar/utils.mjs.map +1 -1
  34. package/es/Block/style.mjs.map +1 -1
  35. package/es/Burger/Burger.d.mts +2 -2
  36. package/es/Burger/Burger.mjs +2 -2
  37. package/es/Burger/Burger.mjs.map +1 -1
  38. package/es/Burger/type.d.mts +1 -1
  39. package/es/Button/Button.mjs +7 -7
  40. package/es/Button/Button.mjs.map +1 -1
  41. package/es/Button/style.mjs.map +1 -1
  42. package/es/Checkbox/Checkbox.mjs +8 -8
  43. package/es/Checkbox/Checkbox.mjs.map +1 -1
  44. package/es/Checkbox/CheckboxGroup.mjs +4 -4
  45. package/es/Checkbox/CheckboxGroup.mjs.map +1 -1
  46. package/es/Checkbox/index.mjs.map +1 -1
  47. package/es/CodeDiff/CodeDiff.d.mts +2 -2
  48. package/es/CodeDiff/CodeDiff.mjs +3 -3
  49. package/es/CodeDiff/CodeDiff.mjs.map +1 -1
  50. package/es/CodeDiff/PatchDiff.d.mts +2 -2
  51. package/es/CodeDiff/PatchDiff.mjs +3 -3
  52. package/es/CodeDiff/PatchDiff.mjs.map +1 -1
  53. package/es/CodeDiff/style.mjs.map +1 -1
  54. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  55. package/es/CodeEditor/CodeEditor.mjs +5 -5
  56. package/es/CodeEditor/CodeEditor.mjs.map +1 -1
  57. package/es/CodeEditor/style.mjs.map +1 -1
  58. package/es/Collapse/Collapse.d.mts +2 -2
  59. package/es/Collapse/Collapse.mjs +5 -5
  60. package/es/Collapse/Collapse.mjs.map +1 -1
  61. package/es/Collapse/style.mjs.map +1 -1
  62. package/es/ColorSwatches/ColorSwatches.mjs +11 -11
  63. package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
  64. package/es/ConfigProvider/index.d.mts +3 -3
  65. package/es/ConfigProvider/index.mjs.map +1 -1
  66. package/es/ContextMenu/ContextMenuHost.d.mts +3 -3
  67. package/es/ContextMenu/ContextMenuHost.mjs +10 -3
  68. package/es/ContextMenu/ContextMenuHost.mjs.map +1 -1
  69. package/es/ContextMenu/ContextMenuTrigger.mjs.map +1 -1
  70. package/es/ContextMenu/renderItems.d.mts +1 -1
  71. package/es/ContextMenu/renderItems.mjs +39 -14
  72. package/es/ContextMenu/renderItems.mjs.map +1 -1
  73. package/es/ContextMenu/store.d.mts +3 -1
  74. package/es/ContextMenu/store.mjs +1 -0
  75. package/es/ContextMenu/store.mjs.map +1 -1
  76. package/es/CopyButton/CopyButton.d.mts +2 -2
  77. package/es/DatePicker/DatePicker.d.mts +2 -2
  78. package/es/DatePicker/DatePicker.mjs +1 -1
  79. package/es/DatePicker/DatePicker.mjs.map +1 -1
  80. package/es/DatePicker/style.mjs.map +1 -1
  81. package/es/DraggablePanel/DraggablePanel.mjs +9 -9
  82. package/es/DraggablePanel/DraggablePanel.mjs.map +1 -1
  83. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  84. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  85. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  86. package/es/DraggablePanel/components/DraggablePanelFooter.mjs +1 -1
  87. package/es/DraggablePanel/components/DraggablePanelFooter.mjs.map +1 -1
  88. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  89. package/es/DraggablePanel/components/DraggablePanelHeader.mjs +7 -7
  90. package/es/DraggablePanel/components/DraggablePanelHeader.mjs.map +1 -1
  91. package/es/DraggablePanel/index.mjs +1 -1
  92. package/es/DraggablePanel/index.mjs.map +1 -1
  93. package/es/DraggablePanel/style.mjs.map +1 -1
  94. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  95. package/es/DraggableSideNav/DraggableSideNav.mjs +5 -5
  96. package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
  97. package/es/Drawer/Drawer.d.mts +2 -2
  98. package/es/Drawer/Drawer.mjs +5 -5
  99. package/es/Drawer/Drawer.mjs.map +1 -1
  100. package/es/Dropdown/Dropdown.d.mts +2 -2
  101. package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
  102. package/es/DropdownMenu/DropdownMenu.mjs +7 -3
  103. package/es/DropdownMenu/DropdownMenu.mjs.map +1 -1
  104. package/es/DropdownMenu/atoms.d.mts +33 -17
  105. package/es/DropdownMenu/atoms.mjs +20 -6
  106. package/es/DropdownMenu/atoms.mjs.map +1 -1
  107. package/es/DropdownMenu/index.d.mts +2 -2
  108. package/es/DropdownMenu/index.mjs +2 -2
  109. package/es/DropdownMenu/renderItems.d.mts +1 -1
  110. package/es/DropdownMenu/renderItems.mjs +36 -14
  111. package/es/DropdownMenu/renderItems.mjs.map +1 -1
  112. package/es/DropdownMenu/type.d.mts +8 -1
  113. package/es/EditableText/ControlInput.mjs +29 -29
  114. package/es/EditableText/ControlInput.mjs.map +1 -1
  115. package/es/EditableText/EditableText.d.mts +2 -2
  116. package/es/EditableText/EditableText.mjs +16 -16
  117. package/es/EditableText/EditableText.mjs.map +1 -1
  118. package/es/EditorSlashMenu/EditorSlashMenu.mjs +2 -2
  119. package/es/EditorSlashMenu/EditorSlashMenu.mjs.map +1 -1
  120. package/es/EditorSlashMenu/MenuItemRenderer.mjs +1 -1
  121. package/es/EditorSlashMenu/MenuItemRenderer.mjs.map +1 -1
  122. package/es/EditorSlashMenu/atoms.d.mts +22 -13
  123. package/es/EditorSlashMenu/atoms.mjs +3 -4
  124. package/es/EditorSlashMenu/atoms.mjs.map +1 -1
  125. package/es/EmojiPicker/AvatarUploader.mjs +5 -5
  126. package/es/EmojiPicker/AvatarUploader.mjs.map +1 -1
  127. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  128. package/es/EmojiPicker/EmojiPicker.mjs +23 -23
  129. package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
  130. package/es/Empty/Empty.mjs +2 -2
  131. package/es/Empty/Empty.mjs.map +1 -1
  132. package/es/FileTypeIcon/components/FileIcon.mjs.map +1 -1
  133. package/es/FileTypeIcon/components/FolderIcon.mjs.map +1 -1
  134. package/es/Flex/FlexBasic.d.mts +2 -2
  135. package/es/FluentEmoji/FluentEmoji.mjs +1 -1
  136. package/es/FluentEmoji/FluentEmoji.mjs.map +1 -1
  137. package/es/FontLoader/index.d.mts +2 -2
  138. package/es/Footer/Footer.d.mts +2 -2
  139. package/es/Footer/Footer.mjs +1 -1
  140. package/es/Footer/Footer.mjs.map +1 -1
  141. package/es/Form/Form.mjs +12 -12
  142. package/es/Form/Form.mjs.map +1 -1
  143. package/es/Form/components/FormGroup.d.mts +2 -2
  144. package/es/Form/components/FormGroup.mjs +5 -5
  145. package/es/Form/components/FormGroup.mjs.map +1 -1
  146. package/es/Form/components/FormItem.d.mts +2 -2
  147. package/es/Form/components/FormProvider.mjs.map +1 -1
  148. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  149. package/es/Form/components/FormSubmitFooter.mjs +5 -5
  150. package/es/Form/components/FormSubmitFooter.mjs.map +1 -1
  151. package/es/Form/components/FormTitle.mjs +1 -1
  152. package/es/Form/components/FormTitle.mjs.map +1 -1
  153. package/es/Form/components/merge.mjs.map +1 -1
  154. package/es/Form/index.mjs +1 -1
  155. package/es/Form/index.mjs.map +1 -1
  156. package/es/Form/style.mjs.map +1 -1
  157. package/es/Form/type.d.mts +1 -1
  158. package/es/FormModal/FormModal.d.mts +2 -2
  159. package/es/FormModal/FormModal.mjs +10 -10
  160. package/es/FormModal/FormModal.mjs.map +1 -1
  161. package/es/GroupAvatar/style.mjs.map +1 -1
  162. package/es/GroupAvatar/type.d.mts +1 -1
  163. package/es/GuideCard/GuideCard.d.mts +2 -2
  164. package/es/GuideCard/style.mjs.map +1 -1
  165. package/es/Header/Header.d.mts +2 -2
  166. package/es/Header/Header.mjs +5 -5
  167. package/es/Header/Header.mjs.map +1 -1
  168. package/es/Highlighter/FullFeatured.mjs +9 -9
  169. package/es/Highlighter/FullFeatured.mjs.map +1 -1
  170. package/es/Highlighter/Highlighter.d.mts +2 -2
  171. package/es/Highlighter/Highlighter.mjs +4 -4
  172. package/es/Highlighter/Highlighter.mjs.map +1 -1
  173. package/es/Highlighter/LangSelect.mjs +6 -6
  174. package/es/Highlighter/LangSelect.mjs.map +1 -1
  175. package/es/Highlighter/SyntaxHighlighter/StaticRenderer.mjs +2 -2
  176. package/es/Highlighter/SyntaxHighlighter/StaticRenderer.mjs.map +1 -1
  177. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  178. package/es/Highlighter/SyntaxHighlighter/style.mjs.map +1 -1
  179. package/es/Highlighter/style.mjs.map +1 -1
  180. package/es/Hotkey/Hotkey.d.mts +2 -2
  181. package/es/Hotkey/Hotkey.mjs +5 -5
  182. package/es/Hotkey/Hotkey.mjs.map +1 -1
  183. package/es/Hotkey/style.mjs.map +1 -1
  184. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  185. package/es/HotkeyInput/HotkeyInput.mjs +10 -10
  186. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  187. package/es/HotkeyInput/style.mjs.map +1 -1
  188. package/es/Icon/Icon.d.mts +2 -2
  189. package/es/Icon/Icon.mjs.map +1 -1
  190. package/es/Icon/components/IconProvider.d.mts +3 -3
  191. package/es/Icon/components/IconProvider.mjs.map +1 -1
  192. package/es/Icon/style.mjs.map +1 -1
  193. package/es/Image/Image.mjs +3 -3
  194. package/es/Image/Image.mjs.map +1 -1
  195. package/es/Image/PreviewGroup.d.mts +2 -2
  196. package/es/Image/PreviewGroup.mjs.map +1 -1
  197. package/es/Image/components/Preview.mjs.map +1 -1
  198. package/es/Image/components/Toolbar.mjs +1 -1
  199. package/es/Image/components/Toolbar.mjs.map +1 -1
  200. package/es/Image/components/usePreviewGroup.mjs.map +1 -1
  201. package/es/Image/style.mjs.map +1 -1
  202. package/es/ImageSelect/ImageSelect.d.mts +2 -2
  203. package/es/ImageSelect/ImageSelect.mjs +7 -7
  204. package/es/ImageSelect/ImageSelect.mjs.map +1 -1
  205. package/es/Img/index.mjs.map +1 -1
  206. package/es/Input/Input.d.mts +2 -2
  207. package/es/Input/Input.mjs +2 -2
  208. package/es/Input/Input.mjs.map +1 -1
  209. package/es/Input/InputNumber.d.mts +2 -2
  210. package/es/Input/InputNumber.mjs +2 -2
  211. package/es/Input/InputNumber.mjs.map +1 -1
  212. package/es/Input/InputOPT.mjs +2 -2
  213. package/es/Input/InputOPT.mjs.map +1 -1
  214. package/es/Input/InputPassword.d.mts +2 -2
  215. package/es/Input/InputPassword.mjs +2 -2
  216. package/es/Input/InputPassword.mjs.map +1 -1
  217. package/es/Input/TextArea.d.mts +2 -2
  218. package/es/Input/TextArea.mjs +2 -2
  219. package/es/Input/TextArea.mjs.map +1 -1
  220. package/es/Input/style.mjs.map +1 -1
  221. package/es/Layout/Layout.mjs +1 -1
  222. package/es/Layout/Layout.mjs.map +1 -1
  223. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  224. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  225. package/es/Layout/components/LayoutMain.d.mts +2 -2
  226. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  227. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  228. package/es/Layout/components/LayoutToc.d.mts +2 -2
  229. package/es/Layout/index.mjs.map +1 -1
  230. package/es/List/List.mjs +6 -6
  231. package/es/List/List.mjs.map +1 -1
  232. package/es/List/ListItem/index.d.mts +2 -2
  233. package/es/List/ListItem/index.mjs +11 -11
  234. package/es/List/ListItem/index.mjs.map +1 -1
  235. package/es/LobeSelect/LobeSelect.d.mts +2 -2
  236. package/es/LobeSelect/LobeSelect.mjs +16 -16
  237. package/es/LobeSelect/LobeSelect.mjs.map +1 -1
  238. package/es/LobeSelect/atoms.d.mts +19 -19
  239. package/es/LobeSelect/atoms.mjs +1 -1
  240. package/es/LobeSelect/atoms.mjs.map +1 -1
  241. package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
  242. package/es/LobeSwitch/LobeSwitch.mjs +2 -2
  243. package/es/LobeSwitch/LobeSwitch.mjs.map +1 -1
  244. package/es/LobeSwitch/atoms.d.mts +4 -4
  245. package/es/LobeSwitch/atoms.mjs +10 -10
  246. package/es/LobeSwitch/atoms.mjs.map +1 -1
  247. package/es/Markdown/Markdown.d.mts +2 -2
  248. package/es/Markdown/Markdown.mjs +3 -3
  249. package/es/Markdown/Markdown.mjs.map +1 -1
  250. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
  251. package/es/Markdown/Typography.d.mts +2 -2
  252. package/es/Markdown/components/CodeBlock.mjs.map +1 -1
  253. package/es/Markdown/components/Footnotes.mjs +3 -3
  254. package/es/Markdown/components/Footnotes.mjs.map +1 -1
  255. package/es/Markdown/components/MarkdownProvider.mjs.map +1 -1
  256. package/es/Markdown/components/SearchResultCards/SearchResultCard.mjs +3 -3
  257. package/es/Markdown/components/SearchResultCards/SearchResultCard.mjs.map +1 -1
  258. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  259. package/es/Markdown/components/SearchResultCards/index.mjs +1 -1
  260. package/es/Markdown/components/SearchResultCards/index.mjs.map +1 -1
  261. package/es/Markdown/plugins/rehypeCustomFootnotes.mjs.map +1 -1
  262. package/es/Markdown/plugins/rehypeKatexDir.mjs.map +1 -1
  263. package/es/Markdown/plugins/rehypeStreamAnimated.mjs.map +1 -1
  264. package/es/Markdown/plugins/remarkColor.mjs +1 -1
  265. package/es/Markdown/plugins/remarkColor.mjs.map +1 -1
  266. package/es/Markdown/plugins/remarkCustomFootnotes.mjs.map +1 -1
  267. package/es/Markdown/plugins/remarkVideo.mjs +3 -3
  268. package/es/Markdown/plugins/remarkVideo.mjs.map +1 -1
  269. package/es/Markdown/style.mjs.map +1 -1
  270. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  271. package/es/MaskShadow/style.mjs.map +1 -1
  272. package/es/Menu/Menu.d.mts +2 -2
  273. package/es/Menu/Menu.mjs.map +1 -1
  274. package/es/Menu/checkboxItem.d.mts +1 -0
  275. package/es/Menu/index.d.mts +2 -2
  276. package/es/Menu/renderUtils.d.mts +4 -1
  277. package/es/Menu/renderUtils.mjs.map +1 -1
  278. package/es/Menu/sharedStyle.d.mts +4 -0
  279. package/es/Menu/sharedStyle.mjs +24 -0
  280. package/es/Menu/sharedStyle.mjs.map +1 -1
  281. package/es/Menu/style.mjs.map +1 -1
  282. package/es/Menu/switchItem.d.mts +1 -0
  283. package/es/Menu/type.d.mts +3 -1
  284. package/es/Mermaid/FullFeatured.mjs +7 -7
  285. package/es/Mermaid/FullFeatured.mjs.map +1 -1
  286. package/es/Mermaid/Mermaid.d.mts +2 -2
  287. package/es/Mermaid/Mermaid.mjs +1 -1
  288. package/es/Mermaid/Mermaid.mjs.map +1 -1
  289. package/es/Mermaid/SyntaxMermaid/StaticMermaid.mjs +3 -3
  290. package/es/Mermaid/SyntaxMermaid/StaticMermaid.mjs.map +1 -1
  291. package/es/Mermaid/SyntaxMermaid/StreamMermaid.mjs +3 -3
  292. package/es/Mermaid/SyntaxMermaid/StreamMermaid.mjs.map +1 -1
  293. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  294. package/es/Mermaid/SyntaxMermaid/style.mjs.map +1 -1
  295. package/es/Modal/Modal.d.mts +2 -2
  296. package/es/Modal/Modal.mjs +25 -25
  297. package/es/Modal/Modal.mjs.map +1 -1
  298. package/es/Modal/ModalProvider.d.mts +2 -2
  299. package/es/Modal/ModalStackItem.mjs +1 -1
  300. package/es/Modal/ModalStackItem.mjs.map +1 -1
  301. package/es/Modal/imperative.d.mts +2 -2
  302. package/es/Modal/imperative.mjs +5 -5
  303. package/es/Modal/imperative.mjs.map +1 -1
  304. package/es/MotionProvider/index.d.mts +2 -2
  305. package/es/MotionProvider/index.mjs.map +1 -1
  306. package/es/Popover/ArrowIcon.d.mts +2 -2
  307. package/es/Popover/Popover.mjs +2 -2
  308. package/es/Popover/Popover.mjs.map +1 -1
  309. package/es/Popover/PopoverGroup.mjs +2 -2
  310. package/es/Popover/PopoverGroup.mjs.map +1 -1
  311. package/es/Popover/PopoverInGroup.mjs +2 -2
  312. package/es/Popover/PopoverInGroup.mjs.map +1 -1
  313. package/es/Popover/PopoverStandalone.mjs +1 -1
  314. package/es/Popover/PopoverStandalone.mjs.map +1 -1
  315. package/es/Popover/atoms.d.mts +9 -9
  316. package/es/Popover/atoms.mjs +1 -1
  317. package/es/Popover/atoms.mjs.map +1 -1
  318. package/es/Popover/context.d.mts +2 -2
  319. package/es/Popover/context.mjs.map +1 -1
  320. package/es/Popover/groupContext.mjs.map +1 -1
  321. package/es/ScrollArea/atoms.d.mts +7 -7
  322. package/es/ScrollArea/type.d.mts +1 -1
  323. package/es/ScrollShadow/style.mjs.map +1 -1
  324. package/es/ScrollShadow/useScrollOverflow.mjs.map +1 -1
  325. package/es/SearchBar/SearchBar.d.mts +2 -2
  326. package/es/SearchBar/SearchBar.mjs +14 -14
  327. package/es/SearchBar/SearchBar.mjs.map +1 -1
  328. package/es/Segmented/Segmented.d.mts +2 -2
  329. package/es/Segmented/style.mjs.map +1 -1
  330. package/es/Select/Select.d.mts +2 -2
  331. package/es/Select/Select.mjs +2 -2
  332. package/es/Select/Select.mjs.map +1 -1
  333. package/es/Select/style.mjs.map +1 -1
  334. package/es/SideNav/SideNav.d.mts +2 -2
  335. package/es/Skeleton/Skeleton.mjs +1 -1
  336. package/es/Skeleton/Skeleton.mjs.map +1 -1
  337. package/es/Skeleton/SkeletonBlock.mjs.map +1 -1
  338. package/es/Skeleton/SkeletonTags.mjs +3 -3
  339. package/es/Skeleton/SkeletonTags.mjs.map +1 -1
  340. package/es/Skeleton/SkeletonTitle.mjs +1 -1
  341. package/es/Skeleton/SkeletonTitle.mjs.map +1 -1
  342. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  343. package/es/SliderWithInput/SliderWithInput.mjs +3 -3
  344. package/es/SliderWithInput/SliderWithInput.mjs.map +1 -1
  345. package/es/Snippet/Snippet.mjs +1 -1
  346. package/es/Snippet/Snippet.mjs.map +1 -1
  347. package/es/Snippet/style.mjs.map +1 -1
  348. package/es/SortableList/SortableList.mjs +1 -1
  349. package/es/SortableList/SortableList.mjs.map +1 -1
  350. package/es/SortableList/components/DragHandle.d.mts +2 -2
  351. package/es/SortableList/components/DragHandle.mjs +3 -3
  352. package/es/SortableList/components/DragHandle.mjs.map +1 -1
  353. package/es/SortableList/components/SortableItem.d.mts +2 -2
  354. package/es/SortableList/components/SortableItem.mjs +1 -1
  355. package/es/SortableList/components/SortableItem.mjs.map +1 -1
  356. package/es/SortableList/components/SortableOverlay.mjs.map +1 -1
  357. package/es/SortableList/style.mjs.map +1 -1
  358. package/es/SortableList/type.d.mts +2 -2
  359. package/es/Tabs/style.mjs.map +1 -1
  360. package/es/Tag/Tag.mjs +2 -2
  361. package/es/Tag/Tag.mjs.map +1 -1
  362. package/es/Tag/styles.mjs.map +1 -1
  363. package/es/Text/Text.mjs +27 -14
  364. package/es/Text/Text.mjs.map +1 -1
  365. package/es/Text/type.d.mts +18 -1
  366. package/es/ThemeProvider/ConfigProvider.mjs.map +1 -1
  367. package/es/ThemeProvider/GlobalStyle/antdOverride.mjs.map +1 -1
  368. package/es/ThemeProvider/GlobalStyle/global.mjs.map +1 -1
  369. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  370. package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
  371. package/es/ThemeSwitch/ThemeSwitch.mjs +4 -4
  372. package/es/ThemeSwitch/ThemeSwitch.mjs.map +1 -1
  373. package/es/Toast/Toast.mjs +3 -3
  374. package/es/Toast/Toast.mjs.map +1 -1
  375. package/es/Toast/imperative.d.mts +3 -3
  376. package/es/Toast/imperative.mjs +1 -1
  377. package/es/Toast/imperative.mjs.map +1 -1
  378. package/es/Toc/Toc.d.mts +2 -2
  379. package/es/Toc/Toc.mjs.map +1 -1
  380. package/es/Toc/TocMobile.mjs +6 -6
  381. package/es/Toc/TocMobile.mjs.map +1 -1
  382. package/es/Toc/utils.mjs.map +1 -1
  383. package/es/Tooltip/Tooltip.mjs +2 -2
  384. package/es/Tooltip/Tooltip.mjs.map +1 -1
  385. package/es/Tooltip/TooltipContent.mjs.map +1 -1
  386. package/es/Tooltip/TooltipGroup.mjs +3 -3
  387. package/es/Tooltip/TooltipGroup.mjs.map +1 -1
  388. package/es/Tooltip/TooltipInGroup.mjs +3 -3
  389. package/es/Tooltip/TooltipInGroup.mjs.map +1 -1
  390. package/es/Tooltip/TooltipStandalone.mjs +2 -2
  391. package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
  392. package/es/Tooltip/groupContext.mjs.map +1 -1
  393. package/es/Tooltip/type.d.mts +1 -1
  394. package/es/Video/index.d.mts +2 -2
  395. package/es/Video/index.mjs +8 -8
  396. package/es/Video/index.mjs.map +1 -1
  397. package/es/Video/style.mjs.map +1 -1
  398. package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
  399. package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
  400. package/es/awesome/BottomGradientButton/BottomGradientButton.mjs +1 -1
  401. package/es/awesome/BottomGradientButton/BottomGradientButton.mjs.map +1 -1
  402. package/es/awesome/Features/FeatureItem.mjs +1 -1
  403. package/es/awesome/Features/FeatureItem.mjs.map +1 -1
  404. package/es/awesome/Features/Features.d.mts +2 -2
  405. package/es/awesome/Features/Features.mjs +4 -4
  406. package/es/awesome/Features/Features.mjs.map +1 -1
  407. package/es/awesome/Features/type.d.mts +1 -1
  408. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  409. package/es/awesome/GradientButton/GradientButton.mjs +2 -2
  410. package/es/awesome/GradientButton/GradientButton.mjs.map +1 -1
  411. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  412. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  413. package/es/awesome/GridBackground/GridShowcase.mjs +5 -5
  414. package/es/awesome/GridBackground/GridShowcase.mjs.map +1 -1
  415. package/es/awesome/GridBackground/components/Grid.mjs.map +1 -1
  416. package/es/awesome/Hero/Hero.d.mts +2 -2
  417. package/es/awesome/Hero/Hero.mjs +3 -3
  418. package/es/awesome/Hero/Hero.mjs.map +1 -1
  419. package/es/awesome/Hero/type.d.mts +1 -1
  420. package/es/awesome/Spline/ParentSize.mjs.map +1 -1
  421. package/es/awesome/Spline/Spine.mjs +2 -2
  422. package/es/awesome/Spline/Spine.mjs.map +1 -1
  423. package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
  424. package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
  425. package/es/brand/BrandLoading/index.mjs.map +1 -1
  426. package/es/brand/LobeChat/index.d.mts +2 -2
  427. package/es/brand/LobeChat/index.mjs +3 -3
  428. package/es/brand/LobeChat/index.mjs.map +1 -1
  429. package/es/brand/LobeChatText/index.mjs.map +1 -1
  430. package/es/brand/LobeHub/index.d.mts +2 -2
  431. package/es/brand/LobeHub/index.mjs +3 -3
  432. package/es/brand/LobeHub/index.mjs.map +1 -1
  433. package/es/brand/LobeHubText/index.mjs.map +1 -1
  434. package/es/brand/Logo3d/index.mjs.map +1 -1
  435. package/es/brand/LogoThree/Loading.mjs +2 -2
  436. package/es/brand/LogoThree/Loading.mjs.map +1 -1
  437. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  438. package/es/brand/LogoThree/LogoSpline.mjs +1 -1
  439. package/es/brand/LogoThree/LogoSpline.mjs.map +1 -1
  440. package/es/brand/LogoThree/index.d.mts +2 -2
  441. package/es/brand/LogoThree/index.mjs +4 -4
  442. package/es/brand/LogoThree/index.mjs.map +1 -1
  443. package/es/brand/components/Divider.mjs.map +1 -1
  444. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  445. package/es/chat/BackBottom/BackBottom.mjs +2 -2
  446. package/es/chat/BackBottom/BackBottom.mjs.map +1 -1
  447. package/es/chat/ChatHeader/ChatHeader.mjs +6 -6
  448. package/es/chat/ChatHeader/ChatHeader.mjs.map +1 -1
  449. package/es/chat/ChatHeader/ChatHeaderTitle.mjs +4 -4
  450. package/es/chat/ChatHeader/ChatHeaderTitle.mjs.map +1 -1
  451. package/es/chat/ChatInputArea/ChatInputArea.mjs +3 -3
  452. package/es/chat/ChatInputArea/ChatInputArea.mjs.map +1 -1
  453. package/es/chat/ChatInputArea/components/ChatInputActionBar.mjs +3 -3
  454. package/es/chat/ChatInputArea/components/ChatInputActionBar.mjs.map +1 -1
  455. package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
  456. package/es/chat/ChatInputArea/components/ChatInputAreaInner.mjs +3 -3
  457. package/es/chat/ChatInputArea/components/ChatInputAreaInner.mjs.map +1 -1
  458. package/es/chat/ChatInputArea/components/ChatSendButton.mjs +5 -5
  459. package/es/chat/ChatInputArea/components/ChatSendButton.mjs.map +1 -1
  460. package/es/chat/ChatItem/ChatItem.mjs +9 -9
  461. package/es/chat/ChatItem/ChatItem.mjs.map +1 -1
  462. package/es/chat/ChatItem/components/Actions.mjs.map +1 -1
  463. package/es/chat/ChatItem/components/Avatar.mjs +2 -2
  464. package/es/chat/ChatItem/components/Avatar.mjs.map +1 -1
  465. package/es/chat/ChatItem/components/ErrorContent.mjs +1 -1
  466. package/es/chat/ChatItem/components/ErrorContent.mjs.map +1 -1
  467. package/es/chat/ChatItem/components/Loading.mjs +2 -2
  468. package/es/chat/ChatItem/components/Loading.mjs.map +1 -1
  469. package/es/chat/ChatItem/components/MessageContent.mjs +4 -4
  470. package/es/chat/ChatItem/components/MessageContent.mjs.map +1 -1
  471. package/es/chat/ChatItem/components/Title.mjs.map +1 -1
  472. package/es/chat/ChatList/ChatList.d.mts +2 -2
  473. package/es/chat/ChatList/components/ChatListItem.mjs +14 -14
  474. package/es/chat/ChatList/components/ChatListItem.mjs.map +1 -1
  475. package/es/chat/ChatList/type.d.mts +1 -1
  476. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  477. package/es/chat/EditableMessage/EditableMessage.mjs +18 -18
  478. package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
  479. package/es/chat/EditableMessageList/EditableMessageList.mjs +17 -17
  480. package/es/chat/EditableMessageList/EditableMessageList.mjs.map +1 -1
  481. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  482. package/es/chat/MessageInput/MessageInput.mjs +8 -8
  483. package/es/chat/MessageInput/MessageInput.mjs.map +1 -1
  484. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  485. package/es/chat/MessageModal/MessageModal.mjs +15 -15
  486. package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
  487. package/es/chat/TokenTag/TokenTag.mjs +2 -2
  488. package/es/chat/TokenTag/TokenTag.mjs.map +1 -1
  489. package/es/chat/types/error.mjs.map +1 -1
  490. package/es/color/ColorScales/ScaleRow.mjs +3 -3
  491. package/es/color/ColorScales/ScaleRow.mjs.map +1 -1
  492. package/es/color/ColorScales/index.d.mts +2 -2
  493. package/es/color/ColorScales/index.mjs +4 -4
  494. package/es/color/ColorScales/index.mjs.map +1 -1
  495. package/es/color/CssVar/ScaleRow.mjs +4 -4
  496. package/es/color/CssVar/ScaleRow.mjs.map +1 -1
  497. package/es/color/CssVar/VarRow.mjs +2 -2
  498. package/es/color/CssVar/VarRow.mjs.map +1 -1
  499. package/es/color/CssVar/index.d.mts +2 -2
  500. package/es/color/CssVar/index.mjs +4 -4
  501. package/es/color/CssVar/index.mjs.map +1 -1
  502. package/es/color/colors/blue.mjs.map +1 -1
  503. package/es/color/colors/cyan.mjs.map +1 -1
  504. package/es/color/colors/geekblue.mjs.map +1 -1
  505. package/es/color/colors/gold.mjs.map +1 -1
  506. package/es/color/colors/gray.mjs.map +1 -1
  507. package/es/color/colors/green.mjs.map +1 -1
  508. package/es/color/colors/lime.mjs.map +1 -1
  509. package/es/color/colors/magenta.mjs.map +1 -1
  510. package/es/color/colors/orange.mjs.map +1 -1
  511. package/es/color/colors/primary.mjs.map +1 -1
  512. package/es/color/colors/purple.mjs.map +1 -1
  513. package/es/color/colors/red.mjs.map +1 -1
  514. package/es/color/colors/volcano.mjs.map +1 -1
  515. package/es/color/colors/yellow.mjs.map +1 -1
  516. package/es/color/neutrals/mauve.mjs.map +1 -1
  517. package/es/color/neutrals/olive.mjs.map +1 -1
  518. package/es/color/neutrals/sage.mjs.map +1 -1
  519. package/es/color/neutrals/sand.mjs.map +1 -1
  520. package/es/color/neutrals/slate.mjs.map +1 -1
  521. package/es/hooks/useFloatingLayer.mjs +2 -2
  522. package/es/hooks/useFloatingLayer.mjs.map +1 -1
  523. package/es/hooks/useHighlight.mjs.map +1 -1
  524. package/es/hooks/useMarkdown/latex.mjs +12 -12
  525. package/es/hooks/useMarkdown/latex.mjs.map +1 -1
  526. package/es/hooks/useMarkdown/useMarkdownComponents.mjs +1 -1
  527. package/es/hooks/useMarkdown/useMarkdownComponents.mjs.map +1 -1
  528. package/es/hooks/useMarkdown/utils.mjs +4 -4
  529. package/es/hooks/useMarkdown/utils.mjs.map +1 -1
  530. package/es/hooks/useNativeButton.mjs.map +1 -1
  531. package/es/hooks/useStreamHighlight.mjs.map +1 -1
  532. package/es/i18n/context.d.mts +3 -3
  533. package/es/i18n/context.mjs.map +1 -1
  534. package/es/icons/Authelia/components/Color.mjs.map +1 -1
  535. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  536. package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
  537. package/es/icons/lucideExtra/DiscordIcon.d.mts +2 -2
  538. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +3 -3
  539. package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
  540. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  541. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  542. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  543. package/es/icons/lucideExtra/McpIcon.d.mts +2 -2
  544. package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
  545. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  546. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  547. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
  548. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  549. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  550. package/es/mdx/Callout/index.mjs +1 -1
  551. package/es/mdx/Callout/index.mjs.map +1 -1
  552. package/es/mdx/Cards/Card.mjs +2 -2
  553. package/es/mdx/Cards/Card.mjs.map +1 -1
  554. package/es/mdx/FileTree/File.mjs +1 -1
  555. package/es/mdx/FileTree/File.mjs.map +1 -1
  556. package/es/mdx/FileTree/Folder.mjs +1 -1
  557. package/es/mdx/FileTree/Folder.mjs.map +1 -1
  558. package/es/mdx/FileTree/index.mjs.map +1 -1
  559. package/es/mdx/Mdx/index.d.mts +2 -2
  560. package/es/mdx/Mdx/index.mjs +3 -3
  561. package/es/mdx/Mdx/index.mjs.map +1 -1
  562. package/es/mdx/Steps/index.mjs.map +1 -1
  563. package/es/mdx/Tabs/Tab.mjs.map +1 -1
  564. package/es/mdx/Tabs/index.mjs +1 -1
  565. package/es/mdx/Tabs/index.mjs.map +1 -1
  566. package/es/mdx/mdxComponents/Citation/PopoverPanel.mjs +3 -3
  567. package/es/mdx/mdxComponents/Citation/PopoverPanel.mjs.map +1 -1
  568. package/es/mdx/mdxComponents/Citation/index.mjs.map +1 -1
  569. package/es/mdx/mdxComponents/Link.mjs +1 -1
  570. package/es/mdx/mdxComponents/Link.mjs.map +1 -1
  571. package/es/mobile/ChatHeader/ChatHeader.mjs +4 -4
  572. package/es/mobile/ChatHeader/ChatHeader.mjs.map +1 -1
  573. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  574. package/es/mobile/ChatHeader/ChatHeaderTitle.mjs +5 -5
  575. package/es/mobile/ChatHeader/ChatHeaderTitle.mjs.map +1 -1
  576. package/es/mobile/ChatInputArea/ChatInputArea.mjs +9 -9
  577. package/es/mobile/ChatInputArea/ChatInputArea.mjs.map +1 -1
  578. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  579. package/es/mobile/ChatInputArea/components/ChatSendButton.mjs +2 -2
  580. package/es/mobile/ChatInputArea/components/ChatSendButton.mjs.map +1 -1
  581. package/es/mobile/SafeArea/SafeArea.mjs.map +1 -1
  582. package/es/mobile/TabBar/TabBar.d.mts +2 -2
  583. package/es/mobile/TabBar/TabBar.mjs +3 -3
  584. package/es/mobile/TabBar/TabBar.mjs.map +1 -1
  585. package/es/storybook/StoryBook/index.d.mts +2 -2
  586. package/es/storybook/StoryBook/index.mjs.map +1 -1
  587. package/es/styles/theme/algorithms/darkAlgorithm.mjs.map +1 -1
  588. package/es/styles/theme/algorithms/lightAlgorithm.mjs.map +1 -1
  589. package/es/styles/theme/antdTheme.mjs.map +1 -1
  590. package/es/styles/theme/customStylish.mjs.map +1 -1
  591. package/es/styles/theme/customToken.mjs.map +1 -1
  592. package/es/styles/theme/generateColorPalette.mjs.map +1 -1
  593. package/es/styles/theme/token/base.mjs.map +1 -1
  594. package/es/styles/theme/token/dark.mjs.map +1 -1
  595. package/es/styles/theme/token/light.mjs.map +1 -1
  596. package/package.json +79 -1
@@ -1,6 +1,6 @@
1
1
  import { DropdownMenuPlacement } from "./type.mjs";
2
2
  import React from "react";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime30 from "react/jsx-runtime";
4
4
  import * as _base_ui_react_menu0 from "@base-ui/react/menu";
5
5
  import { Menu } from "@base-ui/react/menu";
6
6
 
@@ -19,7 +19,7 @@ declare const DropdownMenuTrigger: {
19
19
  nativeButton,
20
20
  ref: refProp,
21
21
  ...rest
22
- }: DropdownMenuTriggerProps): react_jsx_runtime0.JSX.Element;
22
+ }: DropdownMenuTriggerProps): react_jsx_runtime30.JSX.Element;
23
23
  displayName: string;
24
24
  };
25
25
  type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {
@@ -32,7 +32,7 @@ declare const DropdownMenuPortal: {
32
32
  ({
33
33
  container,
34
34
  ...rest
35
- }: DropdownMenuPortalProps): react_jsx_runtime0.JSX.Element;
35
+ }: DropdownMenuPortalProps): react_jsx_runtime30.JSX.Element;
36
36
  displayName: string;
37
37
  };
38
38
  type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {
@@ -49,7 +49,7 @@ declare const DropdownMenuPositioner: {
49
49
  sideOffset,
50
50
  children,
51
51
  ...rest
52
- }: DropdownMenuPositionerProps): react_jsx_runtime0.JSX.Element;
52
+ }: DropdownMenuPositionerProps): react_jsx_runtime30.JSX.Element;
53
53
  displayName: string;
54
54
  };
55
55
  type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;
@@ -57,7 +57,7 @@ declare const DropdownMenuPopup: {
57
57
  ({
58
58
  className,
59
59
  ...rest
60
- }: DropdownMenuPopupProps): react_jsx_runtime0.JSX.Element;
60
+ }: DropdownMenuPopupProps): react_jsx_runtime30.JSX.Element;
61
61
  displayName: string;
62
62
  };
63
63
  type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & {
@@ -68,7 +68,7 @@ declare const DropdownMenuItem: {
68
68
  className,
69
69
  danger,
70
70
  ...rest
71
- }: DropdownMenuItemProps): react_jsx_runtime0.JSX.Element;
71
+ }: DropdownMenuItemProps): react_jsx_runtime30.JSX.Element;
72
72
  displayName: string;
73
73
  };
74
74
  type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {
@@ -79,7 +79,7 @@ declare const DropdownMenuCheckboxItemPrimitive: {
79
79
  className,
80
80
  danger,
81
81
  ...rest
82
- }: DropdownMenuCheckboxItemProps): react_jsx_runtime0.JSX.Element;
82
+ }: DropdownMenuCheckboxItemProps): react_jsx_runtime30.JSX.Element;
83
83
  displayName: string;
84
84
  };
85
85
  type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;
@@ -87,7 +87,7 @@ declare const DropdownMenuSeparator: {
87
87
  ({
88
88
  className,
89
89
  ...rest
90
- }: DropdownMenuSeparatorProps): react_jsx_runtime0.JSX.Element;
90
+ }: DropdownMenuSeparatorProps): react_jsx_runtime30.JSX.Element;
91
91
  displayName: string;
92
92
  };
93
93
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<_base_ui_react_menu0.MenuGroupProps & React.RefAttributes<Element>>;
@@ -96,7 +96,7 @@ declare const DropdownMenuGroupLabel: {
96
96
  ({
97
97
  className,
98
98
  ...rest
99
- }: DropdownMenuGroupLabelProps): react_jsx_runtime0.JSX.Element;
99
+ }: DropdownMenuGroupLabelProps): react_jsx_runtime30.JSX.Element;
100
100
  displayName: string;
101
101
  };
102
102
  type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {
@@ -107,7 +107,7 @@ declare const DropdownMenuSubmenuTrigger: {
107
107
  className,
108
108
  danger,
109
109
  ...rest
110
- }: DropdownMenuSubmenuTriggerProps): react_jsx_runtime0.JSX.Element;
110
+ }: DropdownMenuSubmenuTriggerProps): react_jsx_runtime30.JSX.Element;
111
111
  displayName: string;
112
112
  };
113
113
  type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;
@@ -115,7 +115,7 @@ declare const DropdownMenuItemContent: {
115
115
  ({
116
116
  className,
117
117
  ...rest
118
- }: DropdownMenuItemContentProps): react_jsx_runtime0.JSX.Element;
118
+ }: DropdownMenuItemContentProps): react_jsx_runtime30.JSX.Element;
119
119
  displayName: string;
120
120
  };
121
121
  type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;
@@ -123,7 +123,15 @@ declare const DropdownMenuItemIcon: {
123
123
  ({
124
124
  className,
125
125
  ...rest
126
- }: DropdownMenuItemIconProps): react_jsx_runtime0.JSX.Element;
126
+ }: DropdownMenuItemIconProps): react_jsx_runtime30.JSX.Element;
127
+ displayName: string;
128
+ };
129
+ type DropdownMenuItemLabelGroupProps = React.HTMLAttributes<HTMLDivElement>;
130
+ declare const DropdownMenuItemLabelGroup: {
131
+ ({
132
+ className,
133
+ ...rest
134
+ }: DropdownMenuItemLabelGroupProps): react_jsx_runtime30.JSX.Element;
127
135
  displayName: string;
128
136
  };
129
137
  type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;
@@ -131,7 +139,15 @@ declare const DropdownMenuItemLabel: {
131
139
  ({
132
140
  className,
133
141
  ...rest
134
- }: DropdownMenuItemLabelProps): react_jsx_runtime0.JSX.Element;
142
+ }: DropdownMenuItemLabelProps): react_jsx_runtime30.JSX.Element;
143
+ displayName: string;
144
+ };
145
+ type DropdownMenuItemDescProps = React.HTMLAttributes<HTMLSpanElement>;
146
+ declare const DropdownMenuItemDesc: {
147
+ ({
148
+ className,
149
+ ...rest
150
+ }: DropdownMenuItemDescProps): react_jsx_runtime30.JSX.Element;
135
151
  displayName: string;
136
152
  };
137
153
  type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;
@@ -139,7 +155,7 @@ declare const DropdownMenuItemExtra: {
139
155
  ({
140
156
  className,
141
157
  ...rest
142
- }: DropdownMenuItemExtraProps): react_jsx_runtime0.JSX.Element;
158
+ }: DropdownMenuItemExtraProps): react_jsx_runtime30.JSX.Element;
143
159
  displayName: string;
144
160
  };
145
161
  type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;
@@ -147,7 +163,7 @@ declare const DropdownMenuSubmenuArrow: {
147
163
  ({
148
164
  className,
149
165
  ...rest
150
- }: DropdownMenuSubmenuArrowProps): react_jsx_runtime0.JSX.Element;
166
+ }: DropdownMenuSubmenuArrowProps): react_jsx_runtime30.JSX.Element;
151
167
  displayName: string;
152
168
  };
153
169
  type DropdownMenuSwitchItemProps = Omit<React.ComponentProps<typeof Menu.Item>, 'onClick'> & {
@@ -168,9 +184,9 @@ declare const DropdownMenuSwitchItem: {
168
184
  onCheckedChange,
169
185
  children,
170
186
  ...rest
171
- }: DropdownMenuSwitchItemProps): react_jsx_runtime0.JSX.Element;
187
+ }: DropdownMenuSwitchItemProps): react_jsx_runtime30.JSX.Element;
172
188
  displayName: string;
173
189
  };
174
190
  //#endregion
175
- export { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemContentProps, DropdownMenuItemExtra, DropdownMenuItemExtraProps, DropdownMenuItemIcon, DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelProps, DropdownMenuItemProps, DropdownMenuPopup, DropdownMenuPopupProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuPositioner, DropdownMenuPositionerProps, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, DropdownMenuSwitchItemProps, DropdownMenuTrigger, DropdownMenuTriggerProps };
191
+ export { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemContentProps, DropdownMenuItemDesc, DropdownMenuItemDescProps, DropdownMenuItemExtra, DropdownMenuItemExtraProps, DropdownMenuItemIcon, DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuItemLabelGroupProps, DropdownMenuItemLabelProps, DropdownMenuItemProps, DropdownMenuPopup, DropdownMenuPopupProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuPositioner, DropdownMenuPositionerProps, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, DropdownMenuSwitchItemProps, DropdownMenuTrigger, DropdownMenuTriggerProps };
176
192
  //# sourceMappingURL=atoms.d.mts.map
@@ -4,8 +4,8 @@ import { useNativeButton } from "../hooks/useNativeButton.mjs";
4
4
  import { FloatingLayerProvider } from "../hooks/useFloatingLayer.mjs";
5
5
  import { placementMap } from "../utils/placement.mjs";
6
6
  import { CLASSNAMES } from "../styles/classNames.mjs";
7
- import { styles } from "../Menu/sharedStyle.mjs";
8
7
  import { usePortalContainer } from "../hooks/usePortalContainer.mjs";
8
+ import { styles } from "../Menu/sharedStyle.mjs";
9
9
  import { cloneElement, isValidElement, useCallback, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { Switch } from "antd";
@@ -147,6 +147,13 @@ const DropdownMenuItemIcon = ({ className, ...rest }) => {
147
147
  });
148
148
  };
149
149
  DropdownMenuItemIcon.displayName = "DropdownMenuItemIcon";
150
+ const DropdownMenuItemLabelGroup = ({ className, ...rest }) => {
151
+ return /* @__PURE__ */ jsx("div", {
152
+ ...rest,
153
+ className: cx(styles.labelGroup, className)
154
+ });
155
+ };
156
+ DropdownMenuItemLabelGroup.displayName = "DropdownMenuItemLabelGroup";
150
157
  const DropdownMenuItemLabel = ({ className, ...rest }) => {
151
158
  return /* @__PURE__ */ jsx("span", {
152
159
  ...rest,
@@ -154,6 +161,13 @@ const DropdownMenuItemLabel = ({ className, ...rest }) => {
154
161
  });
155
162
  };
156
163
  DropdownMenuItemLabel.displayName = "DropdownMenuItemLabel";
164
+ const DropdownMenuItemDesc = ({ className, ...rest }) => {
165
+ return /* @__PURE__ */ jsx("span", {
166
+ ...rest,
167
+ className: cx(styles.desc, className)
168
+ });
169
+ };
170
+ DropdownMenuItemDesc.displayName = "DropdownMenuItemDesc";
157
171
  const DropdownMenuItemExtra = ({ className, ...rest }) => {
158
172
  return /* @__PURE__ */ jsx("span", {
159
173
  ...rest,
@@ -178,9 +192,9 @@ const DropdownMenuSwitchItem = ({ checked: checkedProp, className, closeOnClick
178
192
  }, [isControlled, onCheckedChange]);
179
193
  return /* @__PURE__ */ jsxs(Menu$1.Item, {
180
194
  ...rest,
181
- className: (state) => cx(styles.item, danger && styles.danger, typeof className === "function" ? className(state) : className),
182
195
  closeOnClick,
183
196
  disabled,
197
+ className: (state) => cx(styles.item, danger && styles.danger, typeof className === "function" ? className(state) : className),
184
198
  onClick: (e) => {
185
199
  e.preventDefault();
186
200
  if (!disabled) handleCheckedChange(!checked);
@@ -188,15 +202,15 @@ const DropdownMenuSwitchItem = ({ checked: checkedProp, className, closeOnClick
188
202
  children: [children, /* @__PURE__ */ jsx(Switch, {
189
203
  checked,
190
204
  disabled,
191
- onChange: handleCheckedChange,
192
- onClick: (_, e) => e.stopPropagation(),
193
205
  size: "small",
194
- style: { marginInlineStart: 16 }
206
+ style: { marginInlineStart: 16 },
207
+ onChange: handleCheckedChange,
208
+ onClick: (_, e) => e.stopPropagation()
195
209
  })]
196
210
  });
197
211
  };
198
212
  DropdownMenuSwitchItem.displayName = "DropdownMenuSwitchItem";
199
213
 
200
214
  //#endregion
201
- export { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger };
215
+ export { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger };
202
216
  //# sourceMappingURL=atoms.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"atoms.mjs","names":["DropdownMenuRoot: typeof Menu.Root","Menu"],"sources":["../../src/DropdownMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Menu } from '@base-ui/react/menu';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Switch } from 'antd';\nimport { cx } from 'antd-style';\nimport clsx from 'clsx';\nimport type React from 'react';\nimport { cloneElement, isValidElement, useCallback, useState } from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { styles } from '@/Menu/sharedStyle';\nimport { FloatingLayerProvider } from '@/hooks/useFloatingLayer';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { usePortalContainer } from '@/hooks/usePortalContainer';\nimport { CLASSNAMES } from '@/styles/classNames';\nimport { placementMap } from '@/utils/placement';\n\nimport type { DropdownMenuPlacement } from './type';\n\nexport const DROPDOWN_MENU_CONTAINER_ATTR = 'data-lobe-ui-dropdown-menu-container';\n\nexport const DropdownMenuRoot: typeof Menu.Root = (props) => <Menu.Root modal={false} {...props} />;\nexport const DropdownMenuSubmenuRoot = Menu.SubmenuRoot;\nexport const DropdownMenuCheckboxItemIndicator = Menu.CheckboxItemIndicator;\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => cx(base, className(state));\n return cx(base, className);\n};\n\nexport type DropdownMenuTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Menu.Trigger>,\n 'children' | 'render'\n> & {\n children: React.ReactNode;\n};\n\nexport const DropdownMenuTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DropdownMenuTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\n const { type, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: clsx(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return <Menu.Trigger {...rest} nativeButton={resolvedNativeButton} render={renderer as any} />;\n }\n\n return (\n <Menu.Trigger\n {...rest}\n className={clsx(CLASSNAMES.DropdownMenuTrigger, className)}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Menu.Trigger>\n );\n};\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const DropdownMenuPortal = ({ container, ...rest }: DropdownMenuPortalProps) => {\n const defaultContainer = usePortalContainer(DROPDOWN_MENU_CONTAINER_ATTR);\n return <Menu.Portal container={container ?? defaultContainer} {...rest} />;\n};\n\nDropdownMenuPortal.displayName = 'DropdownMenuPortal';\n\nexport type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {\n hoverTrigger?: boolean;\n placement?: DropdownMenuPlacement;\n};\n\nexport const DropdownMenuPositioner = ({\n className,\n placement,\n hoverTrigger,\n align,\n side,\n sideOffset,\n children,\n ...rest\n}: DropdownMenuPositionerProps) => {\n const placementConfig = placement ? placementMap[placement] : undefined;\n const [positionerNode, setPositionerNode] = useState<HTMLDivElement | null>(null);\n\n return (\n <Menu.Positioner\n {...rest}\n align={align ?? placementConfig?.align}\n className={mergeStateClassName(styles.positioner, className as any) as any}\n data-hover-trigger={hoverTrigger || undefined}\n data-placement={placement}\n ref={setPositionerNode}\n side={side ?? placementConfig?.side}\n sideOffset={sideOffset ?? (placementConfig ? 6 : undefined)}\n >\n <FloatingLayerProvider value={positionerNode}>{children}</FloatingLayerProvider>\n </Menu.Positioner>\n );\n};\n\nDropdownMenuPositioner.displayName = 'DropdownMenuPositioner';\n\nexport type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;\n\nexport const DropdownMenuPopup = ({ className, ...rest }: DropdownMenuPopupProps) => {\n return (\n <Menu.Popup {...rest} className={mergeStateClassName(styles.popup, className as any) as any} />\n );\n};\n\nDropdownMenuPopup.displayName = 'DropdownMenuPopup';\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & { danger?: boolean };\n\nexport const DropdownMenuItem = ({ className, danger, ...rest }: DropdownMenuItemProps) => {\n return (\n <Menu.Item\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuCheckboxItemPrimitive = ({\n className,\n danger,\n ...rest\n}: DropdownMenuCheckboxItemProps) => {\n return (\n <Menu.CheckboxItem\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuCheckboxItemPrimitive.displayName = 'DropdownMenuCheckboxItemPrimitive';\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...rest }: DropdownMenuSeparatorProps) => {\n return (\n <Menu.Separator\n {...rest}\n className={(state) =>\n cx(styles.separator, typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\nexport const DropdownMenuGroup = Menu.Group;\n\nexport type DropdownMenuGroupLabelProps = React.ComponentProps<typeof Menu.GroupLabel>;\n\nexport const DropdownMenuGroupLabel = ({ className, ...rest }: DropdownMenuGroupLabelProps) => {\n return (\n <Menu.GroupLabel\n {...rest}\n className={(state) =>\n cx(styles.groupLabel, typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuGroupLabel.displayName = 'DropdownMenuGroupLabel';\n\nexport type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuSubmenuTrigger = ({\n className,\n danger,\n ...rest\n}: DropdownMenuSubmenuTriggerProps) => {\n return (\n <Menu.SubmenuTrigger\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuSubmenuTrigger.displayName = 'DropdownMenuSubmenuTrigger';\n\nexport type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemContent = ({ className, ...rest }: DropdownMenuItemContentProps) => {\n return <div {...rest} className={cx(styles.itemContent, className)} />;\n};\n\nDropdownMenuItemContent.displayName = 'DropdownMenuItemContent';\n\nexport type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemIcon = ({ className, ...rest }: DropdownMenuItemIconProps) => {\n return <span {...rest} className={cx(styles.icon, className)} />;\n};\n\nDropdownMenuItemIcon.displayName = 'DropdownMenuItemIcon';\n\nexport type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemLabel = ({ className, ...rest }: DropdownMenuItemLabelProps) => {\n return <span {...rest} className={cx(styles.label, className)} />;\n};\n\nDropdownMenuItemLabel.displayName = 'DropdownMenuItemLabel';\n\nexport type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemExtra = ({ className, ...rest }: DropdownMenuItemExtraProps) => {\n return <span {...rest} className={cx(styles.extra, className)} />;\n};\n\nDropdownMenuItemExtra.displayName = 'DropdownMenuItemExtra';\n\nexport type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuSubmenuArrow = ({ className, ...rest }: DropdownMenuSubmenuArrowProps) => {\n return <span {...rest} className={cx(styles.submenuArrow, className)} />;\n};\n\nDropdownMenuSubmenuArrow.displayName = 'DropdownMenuSubmenuArrow';\n\nexport type DropdownMenuSwitchItemProps = Omit<\n React.ComponentProps<typeof Menu.Item>,\n 'onClick'\n> & {\n checked?: boolean;\n closeOnClick?: boolean;\n danger?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n};\n\nexport const DropdownMenuSwitchItem = ({\n checked: checkedProp,\n className,\n closeOnClick = false,\n danger,\n defaultChecked,\n disabled,\n onCheckedChange,\n children,\n ...rest\n}: DropdownMenuSwitchItemProps) => {\n const [internalChecked, setInternalChecked] = useState(defaultChecked ?? false);\n const isControlled = checkedProp !== undefined;\n const checked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n return (\n <Menu.Item\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n closeOnClick={closeOnClick}\n disabled={disabled}\n onClick={(e) => {\n e.preventDefault();\n if (!disabled) {\n handleCheckedChange(!checked);\n }\n }}\n >\n {children}\n <Switch\n checked={checked}\n disabled={disabled}\n onChange={handleCheckedChange}\n onClick={(_, e) => e.stopPropagation()}\n size=\"small\"\n style={{ marginInlineStart: 16 }}\n />\n </Menu.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,iBAAiB,sBAAsB,SAAS,kBAAkB,MAAM;CAC/E,MAAM,eAAe,gBAAgB;CACrC,MAAM,UAAU,eAAe,cAAc;CAE7C,MAAM,sBAAsB,aACzB,eAAwB;AACvB,MAAI,CAAC,aACH,oBAAmB,WAAW;AAEhC,oBAAkB,WAAW;IAE/B,CAAC,cAAc,gBAAgB,CAChC;AAED,QACE,qBAACA,OAAK;EACJ,GAAI;EACJ,YAAY,UACV,GACE,OAAO,MACP,UAAU,OAAO,QACjB,OAAO,cAAc,aAAa,UAAU,MAAM,GAAG,UACtD;EAEW;EACJ;EACV,UAAU,MAAM;AACd,KAAE,gBAAgB;AAClB,OAAI,CAAC,SACH,qBAAoB,CAAC,QAAQ;;aAIhC,UACD,oBAAC;GACU;GACC;GACV,UAAU;GACV,UAAU,GAAG,MAAM,EAAE,iBAAiB;GACtC,MAAK;GACL,OAAO,EAAE,mBAAmB,IAAI;IAChC;GACQ;;AAIhB,uBAAuB,cAAc"}
1
+ {"version":3,"file":"atoms.mjs","names":["DropdownMenuRoot: typeof Menu.Root","Menu"],"sources":["../../src/DropdownMenu/atoms.tsx"],"sourcesContent":["'use client';\n\nimport { Menu } from '@base-ui/react/menu';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Switch } from 'antd';\nimport { cx } from 'antd-style';\nimport clsx from 'clsx';\nimport type React from 'react';\nimport { cloneElement, isValidElement, useCallback, useState } from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { FloatingLayerProvider } from '@/hooks/useFloatingLayer';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { usePortalContainer } from '@/hooks/usePortalContainer';\nimport { styles } from '@/Menu/sharedStyle';\nimport { CLASSNAMES } from '@/styles/classNames';\nimport { placementMap } from '@/utils/placement';\n\nimport { type DropdownMenuPlacement } from './type';\n\nexport const DROPDOWN_MENU_CONTAINER_ATTR = 'data-lobe-ui-dropdown-menu-container';\n\nexport const DropdownMenuRoot: typeof Menu.Root = (props) => <Menu.Root modal={false} {...props} />;\nexport const DropdownMenuSubmenuRoot = Menu.SubmenuRoot;\nexport const DropdownMenuCheckboxItemIndicator = Menu.CheckboxItemIndicator;\n\nconst mergeStateClassName = <TState,>(\n base: string,\n className: string | ((state: TState) => string | undefined) | undefined,\n) => {\n if (typeof className === 'function') return (state: TState) => cx(base, className(state));\n return cx(base, className);\n};\n\nexport type DropdownMenuTriggerProps = Omit<\n React.ComponentPropsWithRef<typeof Menu.Trigger>,\n 'children' | 'render'\n> & {\n children: React.ReactNode;\n};\n\nexport const DropdownMenuTrigger = ({\n children,\n className,\n nativeButton,\n ref: refProp,\n ...rest\n}: DropdownMenuTriggerProps) => {\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const renderer = (props: any) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars\n const { type, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: clsx(CLASSNAMES.DropdownMenuTrigger, className, mergedProps.className),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n };\n\n if (isValidElement(children)) {\n return <Menu.Trigger {...rest} nativeButton={resolvedNativeButton} render={renderer as any} />;\n }\n\n return (\n <Menu.Trigger\n {...rest}\n className={clsx(CLASSNAMES.DropdownMenuTrigger, className)}\n nativeButton={resolvedNativeButton}\n ref={refProp as any}\n >\n {children}\n </Menu.Trigger>\n );\n};\n\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {\n /**\n * When `container` is not provided, it uses a shared container created by `usePortalContainer`.\n */\n container?: HTMLElement | null;\n};\n\nexport const DropdownMenuPortal = ({ container, ...rest }: DropdownMenuPortalProps) => {\n const defaultContainer = usePortalContainer(DROPDOWN_MENU_CONTAINER_ATTR);\n return <Menu.Portal container={container ?? defaultContainer} {...rest} />;\n};\n\nDropdownMenuPortal.displayName = 'DropdownMenuPortal';\n\nexport type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {\n hoverTrigger?: boolean;\n placement?: DropdownMenuPlacement;\n};\n\nexport const DropdownMenuPositioner = ({\n className,\n placement,\n hoverTrigger,\n align,\n side,\n sideOffset,\n children,\n ...rest\n}: DropdownMenuPositionerProps) => {\n const placementConfig = placement ? placementMap[placement] : undefined;\n const [positionerNode, setPositionerNode] = useState<HTMLDivElement | null>(null);\n\n return (\n <Menu.Positioner\n {...rest}\n align={align ?? placementConfig?.align}\n className={mergeStateClassName(styles.positioner, className as any) as any}\n data-hover-trigger={hoverTrigger || undefined}\n data-placement={placement}\n ref={setPositionerNode}\n side={side ?? placementConfig?.side}\n sideOffset={sideOffset ?? (placementConfig ? 6 : undefined)}\n >\n <FloatingLayerProvider value={positionerNode}>{children}</FloatingLayerProvider>\n </Menu.Positioner>\n );\n};\n\nDropdownMenuPositioner.displayName = 'DropdownMenuPositioner';\n\nexport type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;\n\nexport const DropdownMenuPopup = ({ className, ...rest }: DropdownMenuPopupProps) => {\n return (\n <Menu.Popup {...rest} className={mergeStateClassName(styles.popup, className as any) as any} />\n );\n};\n\nDropdownMenuPopup.displayName = 'DropdownMenuPopup';\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & { danger?: boolean };\n\nexport const DropdownMenuItem = ({ className, danger, ...rest }: DropdownMenuItemProps) => {\n return (\n <Menu.Item\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuCheckboxItemPrimitive = ({\n className,\n danger,\n ...rest\n}: DropdownMenuCheckboxItemProps) => {\n return (\n <Menu.CheckboxItem\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuCheckboxItemPrimitive.displayName = 'DropdownMenuCheckboxItemPrimitive';\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...rest }: DropdownMenuSeparatorProps) => {\n return (\n <Menu.Separator\n {...rest}\n className={(state) =>\n cx(styles.separator, typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\nexport const DropdownMenuGroup = Menu.Group;\n\nexport type DropdownMenuGroupLabelProps = React.ComponentProps<typeof Menu.GroupLabel>;\n\nexport const DropdownMenuGroupLabel = ({ className, ...rest }: DropdownMenuGroupLabelProps) => {\n return (\n <Menu.GroupLabel\n {...rest}\n className={(state) =>\n cx(styles.groupLabel, typeof className === 'function' ? className(state) : className)\n }\n />\n );\n};\n\nDropdownMenuGroupLabel.displayName = 'DropdownMenuGroupLabel';\n\nexport type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {\n danger?: boolean;\n};\n\nexport const DropdownMenuSubmenuTrigger = ({\n className,\n danger,\n ...rest\n}: DropdownMenuSubmenuTriggerProps) => {\n return (\n <Menu.SubmenuTrigger\n {...rest}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n />\n );\n};\n\nDropdownMenuSubmenuTrigger.displayName = 'DropdownMenuSubmenuTrigger';\n\nexport type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemContent = ({ className, ...rest }: DropdownMenuItemContentProps) => {\n return <div {...rest} className={cx(styles.itemContent, className)} />;\n};\n\nDropdownMenuItemContent.displayName = 'DropdownMenuItemContent';\n\nexport type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemIcon = ({ className, ...rest }: DropdownMenuItemIconProps) => {\n return <span {...rest} className={cx(styles.icon, className)} />;\n};\n\nDropdownMenuItemIcon.displayName = 'DropdownMenuItemIcon';\n\nexport type DropdownMenuItemLabelGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const DropdownMenuItemLabelGroup = ({\n className,\n ...rest\n}: DropdownMenuItemLabelGroupProps) => {\n return <div {...rest} className={cx(styles.labelGroup, className)} />;\n};\n\nDropdownMenuItemLabelGroup.displayName = 'DropdownMenuItemLabelGroup';\n\nexport type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemLabel = ({ className, ...rest }: DropdownMenuItemLabelProps) => {\n return <span {...rest} className={cx(styles.label, className)} />;\n};\n\nDropdownMenuItemLabel.displayName = 'DropdownMenuItemLabel';\n\nexport type DropdownMenuItemDescProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemDesc = ({ className, ...rest }: DropdownMenuItemDescProps) => {\n return <span {...rest} className={cx(styles.desc, className)} />;\n};\n\nDropdownMenuItemDesc.displayName = 'DropdownMenuItemDesc';\n\nexport type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuItemExtra = ({ className, ...rest }: DropdownMenuItemExtraProps) => {\n return <span {...rest} className={cx(styles.extra, className)} />;\n};\n\nDropdownMenuItemExtra.displayName = 'DropdownMenuItemExtra';\n\nexport type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const DropdownMenuSubmenuArrow = ({ className, ...rest }: DropdownMenuSubmenuArrowProps) => {\n return <span {...rest} className={cx(styles.submenuArrow, className)} />;\n};\n\nDropdownMenuSubmenuArrow.displayName = 'DropdownMenuSubmenuArrow';\n\nexport type DropdownMenuSwitchItemProps = Omit<\n React.ComponentProps<typeof Menu.Item>,\n 'onClick'\n> & {\n checked?: boolean;\n closeOnClick?: boolean;\n danger?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n};\n\nexport const DropdownMenuSwitchItem = ({\n checked: checkedProp,\n className,\n closeOnClick = false,\n danger,\n defaultChecked,\n disabled,\n onCheckedChange,\n children,\n ...rest\n}: DropdownMenuSwitchItemProps) => {\n const [internalChecked, setInternalChecked] = useState(defaultChecked ?? false);\n const isControlled = checkedProp !== undefined;\n const checked = isControlled ? checkedProp : internalChecked;\n\n const handleCheckedChange = useCallback(\n (newChecked: boolean) => {\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n onCheckedChange?.(newChecked);\n },\n [isControlled, onCheckedChange],\n );\n\n return (\n <Menu.Item\n {...rest}\n closeOnClick={closeOnClick}\n disabled={disabled}\n className={(state) =>\n cx(\n styles.item,\n danger && styles.danger,\n typeof className === 'function' ? className(state) : className,\n )\n }\n onClick={(e) => {\n e.preventDefault();\n if (!disabled) {\n handleCheckedChange(!checked);\n }\n }}\n >\n {children}\n <Switch\n checked={checked}\n disabled={disabled}\n size=\"small\"\n style={{ marginInlineStart: 16 }}\n onChange={handleCheckedChange}\n onClick={(_, e) => e.stopPropagation()}\n />\n </Menu.Item>\n );\n};\n\nDropdownMenuSwitchItem.displayName = 'DropdownMenuSwitchItem';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,MAAa,+BAA+B;AAE5C,MAAaA,oBAAsC,UAAU,oBAACC,OAAK;CAAK,OAAO;CAAO,GAAI;EAAS;AACnG,MAAa,0BAA0BA,OAAK;AAC5C,MAAa,oCAAoCA,OAAK;AAEtD,MAAM,uBACJ,MACA,cACG;AACH,KAAI,OAAO,cAAc,WAAY,SAAQ,UAAkB,GAAG,MAAM,UAAU,MAAM,CAAC;AACzF,QAAO,GAAG,MAAM,UAAU;;AAU5B,MAAa,uB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AM,sBAAsB,aACzB,eAAwB;AACvB,MAAI,CAAC,aACH,oBAAmB,WAAW;AAEhC,oBAAkB,WAAW;IAE/B,CAAC,cAAc,gBAAgB,CAChC;AAED,QACE,qBAACA,OAAK;EACJ,GAAI;EACU;EACJ;EACV,YAAY,UACV,GACE,OAAO,MACP,UAAU,OAAO,QACjB,OAAO,cAAc,aAAa,UAAU,MAAM,GAAG,UACtD;EAEH,UAAU,MAAM;AACd,KAAE,gBAAgB;AAClB,OAAI,CAAC,SACH,qBAAoB,CAAC,QAAQ;;aAIhC,UACD,oBAAC;GACU;GACC;GACV,MAAK;GACL,OAAO,EAAE,mBAAmB,IAAI;GAChC,UAAU;GACV,UAAU,GAAG,MAAM,EAAE,iBAAiB;IACtC;GACQ;;AAIhB,uBAAuB,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { IconSpaceMode } from "../Menu/renderUtils.mjs";
2
2
  import { renderDropdownMenuItems } from "./renderItems.mjs";
3
3
  import { DropdownItem, DropdownMenuCheckboxItem, DropdownMenuPlacement, DropdownMenuProps, DropdownMenuSwitchItem as DropdownMenuSwitchItem$1 } from "./type.mjs";
4
- import { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemContentProps, DropdownMenuItemExtra, DropdownMenuItemExtraProps, DropdownMenuItemIcon, DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelProps, DropdownMenuItemProps, DropdownMenuPopup, DropdownMenuPopupProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuPositioner, DropdownMenuPositionerProps, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, DropdownMenuSwitchItemProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from "./atoms.mjs";
4
+ import { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemContentProps, DropdownMenuItemDesc, DropdownMenuItemDescProps, DropdownMenuItemExtra, DropdownMenuItemExtraProps, DropdownMenuItemIcon, DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuItemLabelGroupProps, DropdownMenuItemLabelProps, DropdownMenuItemProps, DropdownMenuPopup, DropdownMenuPopupProps, DropdownMenuPortal, DropdownMenuPortalProps, DropdownMenuPositioner, DropdownMenuPositionerProps, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, DropdownMenuSwitchItemProps, DropdownMenuTrigger, DropdownMenuTriggerProps } from "./atoms.mjs";
5
5
  import { DropdownMenu } from "./DropdownMenu.mjs";
6
- export { DROPDOWN_MENU_CONTAINER_ATTR, type DropdownItem, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, type IconSpaceMode, DropdownMenu as default, renderDropdownMenuItems };
6
+ export { DROPDOWN_MENU_CONTAINER_ATTR, type DropdownItem, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, type IconSpaceMode, DropdownMenu as default, renderDropdownMenuItems };
@@ -1,5 +1,5 @@
1
- import { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger } from "./atoms.mjs";
1
+ import { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger } from "./atoms.mjs";
2
2
  import { renderDropdownMenuItems } from "./renderItems.mjs";
3
3
  import DropdownMenu_default from "./DropdownMenu.mjs";
4
4
 
5
- export { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, DropdownMenu_default as default, renderDropdownMenuItems };
5
+ export { DROPDOWN_MENU_CONTAINER_ATTR, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, DropdownMenu_default as default, renderDropdownMenuItems };
@@ -1,4 +1,4 @@
1
- import { IconSpaceMode, RenderOptions } from "../Menu/renderUtils.mjs";
1
+ import { IconAlign, IconSpaceMode, RenderOptions } from "../Menu/renderUtils.mjs";
2
2
  import "../Menu/index.mjs";
3
3
  import { DropdownItem } from "./type.mjs";
4
4
  import { ReactNode } from "react";
@@ -1,4 +1,5 @@
1
- import { DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem } from "./atoms.mjs";
1
+ import { styles } from "../Menu/sharedStyle.mjs";
2
+ import { DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem } from "./atoms.mjs";
2
3
  import { getItemKey, getItemLabel, hasAnyIcon, hasCheckboxAndIcon, renderIcon } from "../Menu/renderUtils.mjs";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { Check, ChevronRight } from "lucide-react";
@@ -6,20 +7,28 @@ import { Check, ChevronRight } from "lucide-react";
6
7
  //#region src/DropdownMenu/renderItems.tsx
7
8
  const renderItemContent = (item, options, iconNode) => {
8
9
  const label = getItemLabel(item);
10
+ const desc = "desc" in item ? item.desc : void 0;
9
11
  const extra = "extra" in item ? item.extra : void 0;
10
12
  const indicatorOnRight = options?.indicatorOnRight;
13
+ const alignStart = Boolean(desc) && options?.iconAlign === "start";
11
14
  const hasCustomIcon = iconNode !== void 0 && !indicatorOnRight;
12
15
  const hasIcon = hasCustomIcon ? Boolean(iconNode) : Boolean(item.icon);
13
- return /* @__PURE__ */ jsxs(DropdownMenuItemContent, { children: [
14
- (hasCustomIcon ? Boolean(options?.reserveIconSpace || iconNode) : Boolean(hasIcon || options?.reserveIconSpace)) ? /* @__PURE__ */ jsx(DropdownMenuItemIcon, {
15
- "aria-hidden": !hasIcon,
16
- children: hasCustomIcon ? iconNode : hasIcon ? renderIcon(item.icon) : null
17
- }) : null,
18
- /* @__PURE__ */ jsx(DropdownMenuItemLabel, { children: label }),
19
- extra ? /* @__PURE__ */ jsx(DropdownMenuItemExtra, { children: extra }) : null,
20
- indicatorOnRight && iconNode ? iconNode : null,
21
- options?.submenu ? /* @__PURE__ */ jsx(DropdownMenuSubmenuArrow, { children: /* @__PURE__ */ jsx(ChevronRight, { size: 16 }) }) : null
22
- ] });
16
+ const shouldRenderIcon = hasCustomIcon ? Boolean(options?.reserveIconSpace || iconNode) : Boolean(hasIcon || options?.reserveIconSpace);
17
+ const labelNode = desc ? /* @__PURE__ */ jsxs(DropdownMenuItemLabelGroup, { children: [/* @__PURE__ */ jsx(DropdownMenuItemLabel, { children: label }), /* @__PURE__ */ jsx(DropdownMenuItemDesc, { children: desc })] }) : /* @__PURE__ */ jsx(DropdownMenuItemLabel, { children: label });
18
+ return /* @__PURE__ */ jsxs(DropdownMenuItemContent, {
19
+ className: alignStart ? styles.itemContentAlignStart : void 0,
20
+ children: [
21
+ shouldRenderIcon ? /* @__PURE__ */ jsx(DropdownMenuItemIcon, {
22
+ "aria-hidden": !hasIcon,
23
+ className: alignStart ? styles.iconAlignStart : void 0,
24
+ children: hasCustomIcon ? iconNode : hasIcon ? renderIcon(item.icon) : null
25
+ }) : null,
26
+ labelNode,
27
+ extra ? /* @__PURE__ */ jsx(DropdownMenuItemExtra, { children: extra }) : null,
28
+ indicatorOnRight && iconNode ? iconNode : null,
29
+ options?.submenu ? /* @__PURE__ */ jsx(DropdownMenuSubmenuArrow, { children: /* @__PURE__ */ jsx(ChevronRight, { size: 16 }) }) : null
30
+ ]
31
+ });
23
32
  };
24
33
  const invokeItemClick = (item, keyPath, event) => {
25
34
  if (!item.onClick) return;
@@ -33,6 +42,7 @@ const invokeItemClick = (item, keyPath, event) => {
33
42
  item.onClick(info);
34
43
  };
35
44
  const renderDropdownMenuItems = (items, keyPath = [], options) => {
45
+ const iconAlign = options?.iconAlign;
36
46
  const iconSpaceMode = options?.iconSpaceMode ?? "global";
37
47
  const reserveIconSpace = options?.reserveIconSpace ?? hasAnyIcon(items, iconSpaceMode === "global");
38
48
  const indicatorOnRight = options?.indicatorOnRight ?? hasCheckboxAndIcon(items);
@@ -55,6 +65,7 @@ const renderDropdownMenuItems = (items, keyPath = [], options) => {
55
65
  label: labelText$1,
56
66
  onCheckedChange: (checked) => checkboxItem.onCheckedChange?.(checked),
57
67
  children: renderItemContent(checkboxItem, {
68
+ iconAlign,
58
69
  indicatorOnRight,
59
70
  reserveIconSpace
60
71
  }, indicator)
@@ -73,7 +84,10 @@ const renderDropdownMenuItems = (items, keyPath = [], options) => {
73
84
  disabled: switchItem.disabled,
74
85
  label: labelText$1,
75
86
  onCheckedChange: (checked) => switchItem.onCheckedChange?.(checked),
76
- children: renderItemContent(switchItem, { reserveIconSpace })
87
+ children: renderItemContent(switchItem, {
88
+ iconAlign,
89
+ reserveIconSpace
90
+ })
77
91
  }, itemKey);
78
92
  }
79
93
  if (item.type === "divider") return /* @__PURE__ */ jsx(DropdownMenuSeparator, {}, itemKey);
@@ -82,6 +96,7 @@ const renderDropdownMenuItems = (items, keyPath = [], options) => {
82
96
  const groupReserveIconSpace = iconSpaceMode === "group" ? group.children ? hasAnyIcon(group.children) : false : reserveIconSpace;
83
97
  const groupIndicatorOnRight = group.children ? hasCheckboxAndIcon(group.children) : false;
84
98
  return /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [group.label ? /* @__PURE__ */ jsx(DropdownMenuGroupLabel, { children: group.label }) : null, group.children ? renderDropdownMenuItems(group.children, nextKeyPath, {
99
+ iconAlign,
85
100
  iconSpaceMode,
86
101
  indicatorOnRight: groupIndicatorOnRight,
87
102
  reserveIconSpace: groupReserveIconSpace
@@ -96,6 +111,7 @@ const renderDropdownMenuItems = (items, keyPath = [], options) => {
96
111
  disabled: submenu.disabled,
97
112
  label: labelText$1,
98
113
  children: renderItemContent(submenu, {
114
+ iconAlign,
99
115
  reserveIconSpace,
100
116
  submenu: true
101
117
  })
@@ -103,7 +119,10 @@ const renderDropdownMenuItems = (items, keyPath = [], options) => {
103
119
  alignOffset: -4,
104
120
  "data-submenu": "",
105
121
  sideOffset: -1,
106
- children: /* @__PURE__ */ jsx(DropdownMenuPopup, { children: submenu.children ? renderDropdownMenuItems(submenu.children, nextKeyPath, { iconSpaceMode }) : null })
122
+ children: /* @__PURE__ */ jsx(DropdownMenuPopup, { children: submenu.children ? renderDropdownMenuItems(submenu.children, nextKeyPath, {
123
+ iconAlign,
124
+ iconSpaceMode
125
+ }) : null })
107
126
  }) })] }, itemKey);
108
127
  }
109
128
  const menuItem = item;
@@ -116,7 +135,10 @@ const renderDropdownMenuItems = (items, keyPath = [], options) => {
116
135
  disabled: menuItem.disabled,
117
136
  label: labelText,
118
137
  onClick: (event) => invokeItemClick(menuItem, nextKeyPath, event),
119
- children: renderItemContent(menuItem, { reserveIconSpace })
138
+ children: renderItemContent(menuItem, {
139
+ iconAlign,
140
+ reserveIconSpace
141
+ })
120
142
  }, itemKey);
121
143
  });
122
144
  };
@@ -1 +1 @@
1
- {"version":3,"file":"renderItems.mjs","names":["info: MenuInfo","label","labelText","isDanger"],"sources":["../../src/DropdownMenu/renderItems.tsx"],"sourcesContent":["import { Check, ChevronRight } from 'lucide-react';\nimport type { MenuInfo } from 'rc-menu/es/interface';\nimport type {\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent as ReactMouseEvent,\n ReactNode,\n} from 'react';\n\nimport {\n type MenuDividerType,\n type MenuItemGroupType,\n type MenuItemType,\n type RenderItemContentOptions,\n type RenderOptions,\n type SubMenuType,\n getItemKey,\n getItemLabel,\n hasAnyIcon,\n hasCheckboxAndIcon,\n renderIcon,\n} from '@/Menu';\n\nimport {\n DropdownMenuCheckboxItemIndicator,\n DropdownMenuCheckboxItemPrimitive,\n DropdownMenuGroup,\n DropdownMenuGroupLabel,\n DropdownMenuItem,\n DropdownMenuItemContent,\n DropdownMenuItemExtra,\n DropdownMenuItemIcon,\n DropdownMenuItemLabel,\n DropdownMenuPopup,\n DropdownMenuPortal,\n DropdownMenuPositioner,\n DropdownMenuSeparator,\n DropdownMenuSubmenuArrow,\n DropdownMenuSubmenuRoot,\n DropdownMenuSubmenuTrigger,\n DropdownMenuSwitchItem,\n} from './atoms';\nimport type {\n DropdownItem,\n DropdownMenuCheckboxItem as DropdownMenuCheckboxItemType,\n DropdownMenuSwitchItem as DropdownMenuSwitchItemType,\n} from './type';\n\nexport type { IconSpaceMode } from '@/Menu';\n\nconst renderItemContent = (\n item: MenuItemType | SubMenuType | DropdownMenuCheckboxItemType | DropdownMenuSwitchItemType,\n options?: RenderItemContentOptions,\n iconNode?: ReactNode,\n) => {\n const label = getItemLabel(item);\n const extra = 'extra' in item ? item.extra : undefined;\n const indicatorOnRight = options?.indicatorOnRight;\n const hasCustomIcon = iconNode !== undefined && !indicatorOnRight;\n const hasIcon = hasCustomIcon ? Boolean(iconNode) : Boolean(item.icon);\n const shouldRenderIcon = hasCustomIcon\n ? Boolean(options?.reserveIconSpace || iconNode)\n : Boolean(hasIcon || options?.reserveIconSpace);\n\n return (\n <DropdownMenuItemContent>\n {shouldRenderIcon ? (\n <DropdownMenuItemIcon aria-hidden={!hasIcon}>\n {hasCustomIcon ? iconNode : hasIcon ? renderIcon(item.icon) : null}\n </DropdownMenuItemIcon>\n ) : null}\n <DropdownMenuItemLabel>{label}</DropdownMenuItemLabel>\n {extra ? <DropdownMenuItemExtra>{extra}</DropdownMenuItemExtra> : null}\n {indicatorOnRight && iconNode ? iconNode : null}\n {options?.submenu ? (\n <DropdownMenuSubmenuArrow>\n <ChevronRight size={16} />\n </DropdownMenuSubmenuArrow>\n ) : null}\n </DropdownMenuItemContent>\n );\n};\n\nconst invokeItemClick = (\n item: MenuItemType,\n keyPath: string[],\n event: ReactMouseEvent<HTMLElement> | ReactKeyboardEvent<HTMLElement>,\n) => {\n if (!item.onClick) return;\n const key = item.key ?? keyPath.at(-1) ?? '';\n const info: MenuInfo = {\n domEvent: event,\n item: event.currentTarget as MenuInfo['item'],\n key: String(key),\n keyPath,\n };\n item.onClick(info);\n};\n\nexport const renderDropdownMenuItems = (\n items: DropdownItem[],\n keyPath: string[] = [],\n options?: RenderOptions,\n): ReactNode[] => {\n const iconSpaceMode = options?.iconSpaceMode ?? 'global';\n const reserveIconSpace =\n options?.reserveIconSpace ?? hasAnyIcon(items, iconSpaceMode === 'global');\n const indicatorOnRight = options?.indicatorOnRight ?? hasCheckboxAndIcon(items);\n\n return items.map((item, index) => {\n if (!item) return null;\n\n const fallbackKey = `${keyPath.join('-') || 'root'}-${index}`;\n const itemKey = getItemKey(item, fallbackKey);\n const nextKeyPath = [...keyPath, String(itemKey)];\n\n if ((item as DropdownMenuCheckboxItemType).type === 'checkbox') {\n const checkboxItem = item as DropdownMenuCheckboxItemType;\n const label = getItemLabel(checkboxItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = Boolean(checkboxItem.danger);\n const indicator = (\n <DropdownMenuCheckboxItemIndicator>{renderIcon(Check)}</DropdownMenuCheckboxItemIndicator>\n );\n\n return (\n <DropdownMenuCheckboxItemPrimitive\n checked={checkboxItem.checked}\n closeOnClick={checkboxItem.closeOnClick}\n danger={isDanger}\n defaultChecked={checkboxItem.defaultChecked}\n disabled={checkboxItem.disabled}\n key={itemKey}\n label={labelText}\n onCheckedChange={(checked) => checkboxItem.onCheckedChange?.(checked)}\n >\n {renderItemContent(checkboxItem, { indicatorOnRight, reserveIconSpace }, indicator)}\n </DropdownMenuCheckboxItemPrimitive>\n );\n }\n\n if ((item as DropdownMenuSwitchItemType).type === 'switch') {\n const switchItem = item as DropdownMenuSwitchItemType;\n const label = getItemLabel(switchItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = Boolean(switchItem.danger);\n\n return (\n <DropdownMenuSwitchItem\n checked={switchItem.checked}\n closeOnClick={switchItem.closeOnClick}\n danger={isDanger}\n defaultChecked={switchItem.defaultChecked}\n disabled={switchItem.disabled}\n key={itemKey}\n label={labelText}\n onCheckedChange={(checked) => switchItem.onCheckedChange?.(checked)}\n >\n {renderItemContent(switchItem, { reserveIconSpace })}\n </DropdownMenuSwitchItem>\n );\n }\n\n if ((item as MenuDividerType).type === 'divider') {\n return <DropdownMenuSeparator key={itemKey} />;\n }\n\n if ((item as MenuItemGroupType).type === 'group') {\n const group = item as MenuItemGroupType;\n const groupReserveIconSpace =\n iconSpaceMode === 'group'\n ? group.children\n ? hasAnyIcon(group.children)\n : false\n : reserveIconSpace;\n const groupIndicatorOnRight = group.children ? hasCheckboxAndIcon(group.children) : false;\n return (\n <DropdownMenuGroup key={itemKey}>\n {group.label ? <DropdownMenuGroupLabel>{group.label}</DropdownMenuGroupLabel> : null}\n {group.children\n ? renderDropdownMenuItems(group.children, nextKeyPath, {\n iconSpaceMode,\n indicatorOnRight: groupIndicatorOnRight,\n reserveIconSpace: groupReserveIconSpace,\n })\n : null}\n </DropdownMenuGroup>\n );\n }\n\n if ((item as SubMenuType).type === 'submenu' || 'children' in item) {\n const submenu = item as SubMenuType;\n const label = getItemLabel(submenu);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = 'danger' in submenu && Boolean(submenu.danger);\n\n return (\n <DropdownMenuSubmenuRoot key={itemKey}>\n <DropdownMenuSubmenuTrigger\n danger={isDanger}\n disabled={submenu.disabled}\n label={labelText}\n >\n {renderItemContent(submenu, {\n reserveIconSpace,\n submenu: true,\n })}\n </DropdownMenuSubmenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuPositioner alignOffset={-4} data-submenu=\"\" sideOffset={-1}>\n <DropdownMenuPopup>\n {submenu.children\n ? renderDropdownMenuItems(submenu.children, nextKeyPath, { iconSpaceMode })\n : null}\n </DropdownMenuPopup>\n </DropdownMenuPositioner>\n </DropdownMenuPortal>\n </DropdownMenuSubmenuRoot>\n );\n }\n\n const menuItem = item as MenuItemType;\n const label = getItemLabel(menuItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = 'danger' in menuItem && Boolean(menuItem.danger);\n\n return (\n <DropdownMenuItem\n closeOnClick={menuItem.closeOnClick}\n danger={isDanger}\n disabled={menuItem.disabled}\n key={itemKey}\n label={labelText}\n onClick={(event) => invokeItemClick(menuItem, nextKeyPath, event)}\n >\n {renderItemContent(menuItem, { reserveIconSpace })}\n </DropdownMenuItem>\n );\n });\n};\n"],"mappings":";;;;;;AAiDA,MAAM,qBACJ,MACA,SACA,aACG;CACH,MAAM,QAAQ,aAAa,KAAK;CAChC,MAAM,QAAQ,WAAW,OAAO,KAAK,QAAQ;CAC7C,MAAM,mBAAmB,SAAS;CAClC,MAAM,gBAAgB,aAAa,UAAa,CAAC;CACjD,MAAM,UAAU,gBAAgB,QAAQ,SAAS,GAAG,QAAQ,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W,QAAQ,QAAQ,OAAO;IAMzD,UAAU,QAAQ;IAClB,OAAOC;cAEN,kBAAkB,SAAS;KAC1B;KACA,SAAS;KACV,CAAC;KACyB,EAC7B,oBAAC,gCACC,oBAAC;IAAuB,aAAa;IAAI,gBAAa;IAAG,YAAY;cACnE,oBAAC,+BACE,QAAQ,WACL,wBAAwB,QAAQ,UAAU,aAAa,EAAE,eAAe,CAAC,GACzE,OACc;KACG,GACN,KAnBO,QAoBJ;;EAI9B,MAAM,WAAW;EACjB,MAAM,QAAQ,aAAa,SAAS;EACpC,MAAM,YAAY,OAAO,UAAU,WAAW,QAAQ;EACtD,MAAM,WAAW,YAAY,YAAY,QAAQ,SAAS,OAAO;AAEjE,SACE,oBAAC;GACC,cAAc,SAAS;GACvB,QAAQ;GACR,UAAU,SAAS;GAEnB,OAAO;GACP,UAAU,UAAU,gBAAgB,UAAU,aAAa,MAAM;aAEhE,kBAAkB,UAAU,EAAE,kBAAkB,CAAC;KAJ7C,QAKY;GAErB"}
1
+ {"version":3,"file":"renderItems.mjs","names":["info: MenuInfo","label","labelText","isDanger"],"sources":["../../src/DropdownMenu/renderItems.tsx"],"sourcesContent":["import { Check, ChevronRight } from 'lucide-react';\nimport { type MenuInfo } from 'rc-menu/es/interface';\nimport {\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from 'react';\n\nimport {\n getItemKey,\n getItemLabel,\n hasAnyIcon,\n hasCheckboxAndIcon,\n type MenuDividerType,\n type MenuItemGroupType,\n type MenuItemType,\n renderIcon,\n type RenderItemContentOptions,\n type RenderOptions,\n type SubMenuType,\n} from '@/Menu';\nimport { styles } from '@/Menu/sharedStyle';\n\nimport {\n DropdownMenuCheckboxItemIndicator,\n DropdownMenuCheckboxItemPrimitive,\n DropdownMenuGroup,\n DropdownMenuGroupLabel,\n DropdownMenuItem,\n DropdownMenuItemContent,\n DropdownMenuItemDesc,\n DropdownMenuItemExtra,\n DropdownMenuItemIcon,\n DropdownMenuItemLabel,\n DropdownMenuItemLabelGroup,\n DropdownMenuPopup,\n DropdownMenuPortal,\n DropdownMenuPositioner,\n DropdownMenuSeparator,\n DropdownMenuSubmenuArrow,\n DropdownMenuSubmenuRoot,\n DropdownMenuSubmenuTrigger,\n DropdownMenuSwitchItem,\n} from './atoms';\nimport {\n type DropdownItem,\n type DropdownMenuCheckboxItem as DropdownMenuCheckboxItemType,\n type DropdownMenuSwitchItem as DropdownMenuSwitchItemType,\n} from './type';\n\nexport type { IconAlign, IconSpaceMode } from '@/Menu';\n\nconst renderItemContent = (\n item: MenuItemType | SubMenuType | DropdownMenuCheckboxItemType | DropdownMenuSwitchItemType,\n options?: RenderItemContentOptions,\n iconNode?: ReactNode,\n) => {\n const label = getItemLabel(item);\n const desc = 'desc' in item ? item.desc : undefined;\n const extra = 'extra' in item ? item.extra : undefined;\n const indicatorOnRight = options?.indicatorOnRight;\n const alignStart = Boolean(desc) && options?.iconAlign === 'start';\n\n const hasCustomIcon = iconNode !== undefined && !indicatorOnRight;\n const hasIcon = hasCustomIcon ? Boolean(iconNode) : Boolean(item.icon);\n const shouldRenderIcon = hasCustomIcon\n ? Boolean(options?.reserveIconSpace || iconNode)\n : Boolean(hasIcon || options?.reserveIconSpace);\n\n const labelNode = desc ? (\n <DropdownMenuItemLabelGroup>\n <DropdownMenuItemLabel>{label}</DropdownMenuItemLabel>\n <DropdownMenuItemDesc>{desc}</DropdownMenuItemDesc>\n </DropdownMenuItemLabelGroup>\n ) : (\n <DropdownMenuItemLabel>{label}</DropdownMenuItemLabel>\n );\n\n return (\n <DropdownMenuItemContent className={alignStart ? styles.itemContentAlignStart : undefined}>\n {shouldRenderIcon ? (\n <DropdownMenuItemIcon\n aria-hidden={!hasIcon}\n className={alignStart ? styles.iconAlignStart : undefined}\n >\n {hasCustomIcon ? iconNode : hasIcon ? renderIcon(item.icon) : null}\n </DropdownMenuItemIcon>\n ) : null}\n {labelNode}\n {extra ? <DropdownMenuItemExtra>{extra}</DropdownMenuItemExtra> : null}\n {indicatorOnRight && iconNode ? iconNode : null}\n {options?.submenu ? (\n <DropdownMenuSubmenuArrow>\n <ChevronRight size={16} />\n </DropdownMenuSubmenuArrow>\n ) : null}\n </DropdownMenuItemContent>\n );\n};\n\nconst invokeItemClick = (\n item: MenuItemType,\n keyPath: string[],\n event: ReactMouseEvent<HTMLElement> | ReactKeyboardEvent<HTMLElement>,\n) => {\n if (!item.onClick) return;\n const key = item.key ?? keyPath.at(-1) ?? '';\n const info: MenuInfo = {\n domEvent: event,\n item: event.currentTarget as MenuInfo['item'],\n key: String(key),\n keyPath,\n };\n item.onClick(info);\n};\n\nexport const renderDropdownMenuItems = (\n items: DropdownItem[],\n keyPath: string[] = [],\n options?: RenderOptions,\n): ReactNode[] => {\n const iconAlign = options?.iconAlign;\n const iconSpaceMode = options?.iconSpaceMode ?? 'global';\n const reserveIconSpace =\n options?.reserveIconSpace ?? hasAnyIcon(items, iconSpaceMode === 'global');\n const indicatorOnRight = options?.indicatorOnRight ?? hasCheckboxAndIcon(items);\n\n return items.map((item, index) => {\n if (!item) return null;\n\n const fallbackKey = `${keyPath.join('-') || 'root'}-${index}`;\n const itemKey = getItemKey(item, fallbackKey);\n const nextKeyPath = [...keyPath, String(itemKey)];\n\n if ((item as DropdownMenuCheckboxItemType).type === 'checkbox') {\n const checkboxItem = item as DropdownMenuCheckboxItemType;\n const label = getItemLabel(checkboxItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = Boolean(checkboxItem.danger);\n const indicator = (\n <DropdownMenuCheckboxItemIndicator>{renderIcon(Check)}</DropdownMenuCheckboxItemIndicator>\n );\n\n return (\n <DropdownMenuCheckboxItemPrimitive\n checked={checkboxItem.checked}\n closeOnClick={checkboxItem.closeOnClick}\n danger={isDanger}\n defaultChecked={checkboxItem.defaultChecked}\n disabled={checkboxItem.disabled}\n key={itemKey}\n label={labelText}\n onCheckedChange={(checked) => checkboxItem.onCheckedChange?.(checked)}\n >\n {renderItemContent(\n checkboxItem,\n { iconAlign, indicatorOnRight, reserveIconSpace },\n indicator,\n )}\n </DropdownMenuCheckboxItemPrimitive>\n );\n }\n\n if ((item as DropdownMenuSwitchItemType).type === 'switch') {\n const switchItem = item as DropdownMenuSwitchItemType;\n const label = getItemLabel(switchItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = Boolean(switchItem.danger);\n\n return (\n <DropdownMenuSwitchItem\n checked={switchItem.checked}\n closeOnClick={switchItem.closeOnClick}\n danger={isDanger}\n defaultChecked={switchItem.defaultChecked}\n disabled={switchItem.disabled}\n key={itemKey}\n label={labelText}\n onCheckedChange={(checked) => switchItem.onCheckedChange?.(checked)}\n >\n {renderItemContent(switchItem, { iconAlign, reserveIconSpace })}\n </DropdownMenuSwitchItem>\n );\n }\n\n if ((item as MenuDividerType).type === 'divider') {\n return <DropdownMenuSeparator key={itemKey} />;\n }\n\n if ((item as MenuItemGroupType).type === 'group') {\n const group = item as MenuItemGroupType;\n const groupReserveIconSpace =\n iconSpaceMode === 'group'\n ? group.children\n ? hasAnyIcon(group.children)\n : false\n : reserveIconSpace;\n const groupIndicatorOnRight = group.children ? hasCheckboxAndIcon(group.children) : false;\n return (\n <DropdownMenuGroup key={itemKey}>\n {group.label ? <DropdownMenuGroupLabel>{group.label}</DropdownMenuGroupLabel> : null}\n {group.children\n ? renderDropdownMenuItems(group.children, nextKeyPath, {\n iconAlign,\n iconSpaceMode,\n indicatorOnRight: groupIndicatorOnRight,\n reserveIconSpace: groupReserveIconSpace,\n })\n : null}\n </DropdownMenuGroup>\n );\n }\n\n if ((item as SubMenuType).type === 'submenu' || 'children' in item) {\n const submenu = item as SubMenuType;\n const label = getItemLabel(submenu);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = 'danger' in submenu && Boolean(submenu.danger);\n\n return (\n <DropdownMenuSubmenuRoot key={itemKey}>\n <DropdownMenuSubmenuTrigger\n danger={isDanger}\n disabled={submenu.disabled}\n label={labelText}\n >\n {renderItemContent(submenu, {\n iconAlign,\n reserveIconSpace,\n submenu: true,\n })}\n </DropdownMenuSubmenuTrigger>\n <DropdownMenuPortal>\n <DropdownMenuPositioner alignOffset={-4} data-submenu=\"\" sideOffset={-1}>\n <DropdownMenuPopup>\n {submenu.children\n ? renderDropdownMenuItems(submenu.children, nextKeyPath, {\n iconAlign,\n iconSpaceMode,\n })\n : null}\n </DropdownMenuPopup>\n </DropdownMenuPositioner>\n </DropdownMenuPortal>\n </DropdownMenuSubmenuRoot>\n );\n }\n\n const menuItem = item as MenuItemType;\n const label = getItemLabel(menuItem);\n const labelText = typeof label === 'string' ? label : undefined;\n const isDanger = 'danger' in menuItem && Boolean(menuItem.danger);\n\n return (\n <DropdownMenuItem\n closeOnClick={menuItem.closeOnClick}\n danger={isDanger}\n disabled={menuItem.disabled}\n key={itemKey}\n label={labelText}\n onClick={(event) => invokeItemClick(menuItem, nextKeyPath, event)}\n >\n {renderItemContent(menuItem, { iconAlign, reserveIconSpace })}\n </DropdownMenuItem>\n );\n });\n};\n"],"mappings":";;;;;;;AAoDA,MAAM,qBACJ,MACA,SACA,aACG;CACH,MAAM,QAAQ,aAAa,KAAK;CAChC,MAAM,OAAO,UAAU,OAAO,KAAK,OAAO;CAC1C,MAAM,QAAQ,WAAW,OAAO,KAAK,QAAQ;CAC7C,MAAM,mBAAmB,SAAS;CAClC,MAAM,aAAa,QAAQ,KAAK,IAAI,SAAS,cAAc;CAE3D,MAAM,gBAAgB,aAAa,UAAa,CAAC;CACjD,MAAM,UAAU,gBAAgB,QAAQ,SAAS,GAAG,QAAQ,KAAK,KAAK;CACtE,MAAM,mBAAmB,gBACrB,QAAQ,SAAS,oBAAoB,SAAS,GAC9C,QAAQ,WAAW,SAAS,iBAAiB;CAEjD,MAAM,YAAY,OAChB,qBAAC,yCACC,oBAAC,mCAAuB,QAA8B,EACtD,oBAAC,kCAAsB,OAA4B,IACxB,GAE7B,oBAAC,mCAAuB,QAA8B;AAGxD,QACE,qBAAC;EAAwB,WAA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AAQ;IAClB,OAAOC;cAEN,kBAAkB,SAAS;KAC1B;KACA;KACA,SAAS;KACV,CAAC;KACyB,EAC7B,oBAAC,gCACC,oBAAC;IAAuB,aAAa;IAAI,gBAAa;IAAG,YAAY;cACnE,oBAAC,+BACE,QAAQ,WACL,wBAAwB,QAAQ,UAAU,aAAa;KACrD;KACA;KACD,CAAC,GACF,OACc;KACG,GACN,KAvBO,QAwBJ;;EAI9B,MAAM,WAAW;EACjB,MAAM,QAAQ,aAAa,SAAS;EACpC,MAAM,YAAY,OAAO,UAAU,WAAW,QAAQ;EACtD,MAAM,WAAW,YAAY,YAAY,QAAQ,SAAS,OAAO;AAEjE,SACE,oBAAC;GACC,cAAc,SAAS;GACvB,QAAQ;GACR,UAAU,SAAS;GAEnB,OAAO;GACP,UAAU,UAAU,gBAAgB,UAAU,aAAa,MAAM;aAEhE,kBAAkB,UAAU;IAAE;IAAW;IAAkB,CAAC;KAJxD,QAKY;GAErB"}
@@ -4,7 +4,7 @@ import { Placement } from "../utils/placement.mjs";
4
4
  import { MenuCheckboxItemType } from "../Menu/checkboxItem.mjs";
5
5
  import { MenuSwitchItemType } from "../Menu/switchItem.mjs";
6
6
  import { BaseMenuItemType } from "../Menu/baseItem.mjs";
7
- import { IconSpaceMode } from "../Menu/renderUtils.mjs";
7
+ import { IconAlign, IconSpaceMode } from "../Menu/renderUtils.mjs";
8
8
  import "../Menu/index.mjs";
9
9
  import "./renderItems.mjs";
10
10
  import { ReactNode } from "react";
@@ -17,6 +17,13 @@ type DropdownMenuSwitchItem = MenuSwitchItemType;
17
17
  type DropdownItem = BaseMenuItemType;
18
18
  interface DropdownMenuProps<Payload = unknown> extends Omit<MenuRootProps<Payload>, 'children'> {
19
19
  children: ReactNode;
20
+ /**
21
+ * 图标与 label+desc 的垂直对齐方式
22
+ * - 'center': 图标垂直居中(默认)
23
+ * - 'start': 图标与第一行文本顶部对齐,仅在 item 有 desc 时生效
24
+ * @default 'center'
25
+ */
26
+ iconAlign?: IconAlign;
20
27
  /**
21
28
  * 图标空间保留模式
22
29
  * - 'global': 当任何一个选项有图标时,所有 item 都保留图标位
@@ -22,58 +22,58 @@ const ControlInput = memo(({ value, onChange, onValueChanging, onChangeEnd, onCo
22
22
  };
23
23
  return /* @__PURE__ */ jsx(Input_default, {
24
24
  autoFocus: true,
25
- onChange: (e) => {
26
- setInput(e.target.value);
27
- onValueChanging?.(e.target.value);
28
- },
29
- onCompositionEnd: (e) => {
30
- isChineseInput.current = false;
31
- onCompositionEnd?.(e);
32
- },
33
- onCompositionStart: (e) => {
34
- isChineseInput.current = true;
35
- onCompositionStart?.(e);
36
- },
37
- onFocus,
38
- onPressEnter: (e) => {
39
- if (!e.shiftKey && !isChineseInput.current) {
40
- e.preventDefault();
41
- handleUpload();
42
- onPressEnter?.(e);
43
- }
44
- },
45
25
  ref,
26
+ value: input,
46
27
  style: {
47
28
  width: "100%",
48
29
  ...style
49
30
  },
50
31
  suffix: value === input ? /* @__PURE__ */ jsx("span", {}) : /* @__PURE__ */ jsxs(FlexBasic_default, {
51
- gap: 2,
52
32
  horizontal: true,
33
+ gap: 2,
53
34
  style: {
54
35
  marginRight: -4,
55
36
  zIndex: 1
56
37
  },
57
38
  children: [/* @__PURE__ */ jsx(ActionIcon_default, {
58
39
  icon: RotateCcw,
40
+ size: "small",
41
+ title: texts?.reset || "Reset",
59
42
  onClick: (e) => {
60
43
  e.preventDefault();
61
44
  setInput(value || "");
62
- },
63
- size: "small",
64
- title: texts?.reset || "Reset"
45
+ }
65
46
  }), /* @__PURE__ */ jsx(ActionIcon_default, {
66
47
  icon: submitIcon || Save,
48
+ size: "small",
49
+ title: texts?.submit || "Submit",
50
+ variant: "filled",
67
51
  onClick: (e) => {
68
52
  e.preventDefault();
69
53
  handleUpload();
70
- },
71
- size: "small",
72
- title: texts?.submit || "Submit",
73
- variant: "filled"
54
+ }
74
55
  })]
75
56
  }),
76
- value: input,
57
+ onFocus,
58
+ onChange: (e) => {
59
+ setInput(e.target.value);
60
+ onValueChanging?.(e.target.value);
61
+ },
62
+ onCompositionEnd: (e) => {
63
+ isChineseInput.current = false;
64
+ onCompositionEnd?.(e);
65
+ },
66
+ onCompositionStart: (e) => {
67
+ isChineseInput.current = true;
68
+ onCompositionStart?.(e);
69
+ },
70
+ onPressEnter: (e) => {
71
+ if (!e.shiftKey && !isChineseInput.current) {
72
+ e.preventDefault();
73
+ handleUpload();
74
+ onPressEnter?.(e);
75
+ }
76
+ },
77
77
  ...rest
78
78
  });
79
79
  });