haze-ui 1.26.0 → 1.28.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 (479) hide show
  1. package/README.md +420 -36
  2. package/dist/components/Anchor/Anchor.js +78 -0
  3. package/dist/components/Anchor/index.js +3 -0
  4. package/dist/components/AppShell/AppShell.js +44 -0
  5. package/dist/components/AppShell/index.js +3 -0
  6. package/dist/components/AspectRatio/AspectRatio.js +0 -1
  7. package/dist/components/AspectRatio/index.js +0 -1
  8. package/dist/components/Badge/Badge.js +5 -17
  9. package/dist/components/Badge/badge-styles.js +15 -0
  10. package/dist/components/Badge/index.js +3 -3
  11. package/dist/components/BottomSheet/BottomSheet.js +133 -22
  12. package/dist/components/Button/index.js +4 -3
  13. package/dist/components/Calendar/Calendar.js +525 -78
  14. package/dist/components/Calendar/date.js +35 -2
  15. package/dist/components/Card/Card.js +0 -1
  16. package/dist/components/Card/index.js +0 -1
  17. package/dist/components/Carousel/Carousel.js +64 -41
  18. package/dist/components/Cascader/Cascader.js +222 -140
  19. package/dist/components/Chart/Chart.js +34 -0
  20. package/dist/components/Chart/chart-elements.js +164 -0
  21. package/dist/components/Chart/index.js +3 -0
  22. package/dist/components/ChatContainer/ChatContainer.js +36 -16
  23. package/dist/components/ChatInput/ChatInput.js +49 -29
  24. package/dist/components/ChatMessage/ChatMessage.js +76 -29
  25. package/dist/components/Checkbox/Checkbox.js +6 -5
  26. package/dist/components/Checkbox/CheckboxCore.js +6 -5
  27. package/dist/components/CodeBlock/CodeBlock.js +39 -10
  28. package/dist/components/CodeBlock/index.js +0 -1
  29. package/dist/components/Collapsible/Collapsible.js +23 -10
  30. package/dist/components/ColorPicker/ColorPicker.js +5 -4
  31. package/dist/components/ColorPicker/ColorPickerCore.js +5 -4
  32. package/dist/components/Combobox/Combobox.js +202 -75
  33. package/dist/components/Combobox/ComboboxGroup.js +23 -0
  34. package/dist/components/Combobox/ComboboxOption.js +7 -6
  35. package/dist/components/Combobox/index.js +4 -3
  36. package/dist/components/Command/Command.js +102 -59
  37. package/dist/components/Command/CommandDialog.js +48 -0
  38. package/dist/components/Command/command-filter.js +16 -0
  39. package/dist/components/Command/index.js +3 -2
  40. package/dist/components/ConfirmDialog/ConfirmDialog.js +3 -3
  41. package/dist/components/Container/Container.js +0 -1
  42. package/dist/components/Container/index.js +0 -1
  43. package/dist/components/ContextMenu/ContextMenuContent.js +4 -4
  44. package/dist/components/DataTable/CellEditor.js +38 -0
  45. package/dist/components/DataTable/DataTable.js +394 -143
  46. package/dist/components/DataTable/csv.js +29 -0
  47. package/dist/components/DataTable/features.js +25 -0
  48. package/dist/components/DataTable/index.js +3 -1
  49. package/dist/components/DataTable/summary.js +17 -0
  50. package/dist/components/DateRangePicker/DateRangePicker.js +31 -13
  51. package/dist/components/DateRangePicker/DateRangePickerCore.js +59 -27
  52. package/dist/components/DateRangePicker/presets.js +43 -0
  53. package/dist/components/Datepicker/Datepicker.js +17 -12
  54. package/dist/components/Datepicker/DatepickerCore.js +73 -39
  55. package/dist/components/Datepicker/datetime.js +23 -0
  56. package/dist/components/Descriptions/Descriptions.js +46 -0
  57. package/dist/components/Descriptions/index.js +3 -0
  58. package/dist/components/Dialog/Dialog.js +56 -32
  59. package/dist/components/DiffViewer/DiffViewer.js +31 -30
  60. package/dist/components/Divider/Divider.js +0 -1
  61. package/dist/components/Divider/index.js +0 -1
  62. package/dist/components/Drawer/Drawer.js +49 -29
  63. package/dist/components/DropdownMenu/DropdownMenu.js +38 -26
  64. package/dist/components/DropdownMenu/DropdownMenuSub.js +23 -0
  65. package/dist/components/DropdownMenu/DropdownMenuSubContent.js +24 -0
  66. package/dist/components/DropdownMenu/DropdownMenuSubTrigger.js +30 -0
  67. package/dist/components/DropdownMenu/index.js +4 -1
  68. package/dist/components/FilePreview/FilePreview.js +135 -0
  69. package/dist/components/FilePreview/file-preview-format.js +23 -0
  70. package/dist/components/FilePreview/index.js +3 -0
  71. package/dist/components/Flex/Flex.js +0 -1
  72. package/dist/components/Flex/index.js +0 -1
  73. package/dist/components/FloatButton/FloatButton.js +42 -0
  74. package/dist/components/FloatButton/FloatButtonGroup.js +58 -0
  75. package/dist/components/FloatButton/float-button-context.js +9 -0
  76. package/dist/components/FloatButton/float-button-glyphs.js +26 -0
  77. package/dist/components/FloatButton/float-button-styles.js +14 -0
  78. package/dist/components/FloatButton/index.js +4 -0
  79. package/dist/components/Fullscreen/Fullscreen.js +29 -0
  80. package/dist/components/Fullscreen/index.js +3 -0
  81. package/dist/components/Grid/Grid.js +0 -1
  82. package/dist/components/Grid/GridItem.js +0 -1
  83. package/dist/components/Grid/index.js +0 -1
  84. package/dist/components/Icon/Icon.js +0 -1
  85. package/dist/components/Icon/index.js +0 -1
  86. package/dist/components/Image/Image.js +37 -19
  87. package/dist/components/Image/ImagePreview.js +233 -0
  88. package/dist/components/InlineCompletion/InlineCompletion.js +81 -0
  89. package/dist/components/InlineCompletion/index.js +3 -0
  90. package/dist/components/Input/Input.js +6 -5
  91. package/dist/components/Input/InputCore.js +3 -2
  92. package/dist/components/JsonView/JsonView.js +209 -0
  93. package/dist/components/JsonView/index.js +3 -0
  94. package/dist/components/JsonView/json-view-utils.js +24 -0
  95. package/dist/components/Kbd/Kbd.js +0 -1
  96. package/dist/components/Kbd/index.js +0 -1
  97. package/dist/components/LocaleProvider/LocaleProvider.js +16 -13
  98. package/dist/components/LocaleProvider/index.js +5 -3
  99. package/dist/components/LocaleProvider/ja-jp.js +222 -0
  100. package/dist/components/LocaleProvider/locale.js +99 -5
  101. package/dist/components/LocaleProvider/strings.js +15 -0
  102. package/dist/components/LocaleProvider/useStrings.js +13 -11
  103. package/dist/components/LocaleProvider/zh-cn.js +99 -5
  104. package/dist/components/Masonry/Masonry.js +29 -0
  105. package/dist/components/Masonry/index.js +3 -0
  106. package/dist/components/Masonry/masonry-distribute.js +15 -0
  107. package/dist/components/Mentions/Mentions.js +6 -5
  108. package/dist/components/Mentions/MentionsCore.js +69 -68
  109. package/dist/components/Menu/Menu.js +5 -5
  110. package/dist/components/Menu/MenuSub.js +23 -0
  111. package/dist/components/Menu/MenuSubContent.js +24 -0
  112. package/dist/components/Menu/MenuSubTrigger.js +30 -0
  113. package/dist/components/Menu/index.js +4 -1
  114. package/dist/components/NumberInput/NumberInput.js +6 -5
  115. package/dist/components/NumberInput/NumberInputCore.js +9 -8
  116. package/dist/components/OTPInput/OTPInput.js +5 -4
  117. package/dist/components/OTPInput/OTPInputCore.js +34 -33
  118. package/dist/components/PasswordInput/PasswordInput.js +5 -4
  119. package/dist/components/PasswordInput/PasswordInputCore.js +8 -7
  120. package/dist/components/Popover/Popover.js +43 -31
  121. package/dist/components/PromptInput/PromptInput.js +213 -0
  122. package/dist/components/PromptInput/index.js +3 -0
  123. package/dist/components/Radio/Radio.js +7 -6
  124. package/dist/components/Radio/RadioGroup.js +5 -4
  125. package/dist/components/Radio/RadioGroupCore.js +23 -14
  126. package/dist/components/Rating/Rating.js +5 -4
  127. package/dist/components/Rating/RatingCore.js +62 -28
  128. package/dist/components/Resizable/index.js +1 -1
  129. package/dist/components/Segmented/Segmented.js +5 -4
  130. package/dist/components/Segmented/SegmentedCore.js +22 -18
  131. package/dist/components/Select/OptionGroup.js +12 -0
  132. package/dist/components/Select/Select.js +20 -9
  133. package/dist/components/Select/SelectCore.js +74 -13
  134. package/dist/components/Select/SelectFloating.js +256 -0
  135. package/dist/components/Select/index.js +5 -4
  136. package/dist/components/Select/select-options.js +57 -0
  137. package/dist/components/Sidebar/Sidebar.js +9 -9
  138. package/dist/components/Signature/Signature.js +165 -0
  139. package/dist/components/Signature/index.js +3 -0
  140. package/dist/components/Signature/signature-points.js +28 -0
  141. package/dist/components/Skeleton/Skeleton.js +0 -1
  142. package/dist/components/Skeleton/index.js +0 -1
  143. package/dist/components/Slider/Slider.js +16 -8
  144. package/dist/components/Slider/SliderCore.js +75 -12
  145. package/dist/components/Sources/Sources.js +109 -0
  146. package/dist/components/Sources/index.js +3 -0
  147. package/dist/components/Stat/Stat.js +0 -1
  148. package/dist/components/Stat/index.js +0 -1
  149. package/dist/components/Switch/Switch.js +6 -5
  150. package/dist/components/Switch/SwitchCore.js +3 -2
  151. package/dist/components/Tabs/Tab.js +7 -4
  152. package/dist/components/Tabs/TabList.js +38 -7
  153. package/dist/components/Tabs/TabPanel.js +4 -3
  154. package/dist/components/Tabs/Tabs.js +11 -6
  155. package/dist/components/TagGroup/SortableTagGroup.js +26 -0
  156. package/dist/components/TagGroup/TagGroup.js +4 -6
  157. package/dist/components/TagGroup/TagGroupItem.js +17 -11
  158. package/dist/components/TagGroup/index.js +2 -1
  159. package/dist/components/TagGroup/tag-group-styles.js +7 -0
  160. package/dist/components/TagInput/SortableTagInput.js +24 -0
  161. package/dist/components/TagInput/SortableTagInputCore.js +52 -0
  162. package/dist/components/TagInput/TagInput.js +5 -4
  163. package/dist/components/TagInput/TagInputCore.js +71 -57
  164. package/dist/components/TagInput/index.js +3 -1
  165. package/dist/components/TagInput/tag-input-styles.js +7 -0
  166. package/dist/components/Textarea/Textarea.js +6 -5
  167. package/dist/components/Textarea/TextareaCore.js +3 -2
  168. package/dist/components/TimePicker/TimePicker.js +6 -5
  169. package/dist/components/TimePicker/TimePickerCore.js +3 -2
  170. package/dist/components/Toast/Toast.js +44 -42
  171. package/dist/components/Toast/ToastContainer.js +67 -47
  172. package/dist/components/Toast/ToastContext.js +23 -4
  173. package/dist/components/Toast/toast2.js +63 -28
  174. package/dist/components/Toast/useToast.js +9 -7
  175. package/dist/components/Toggle/Toggle.js +20 -0
  176. package/dist/components/Toggle/ToggleCore.js +31 -0
  177. package/dist/components/Toggle/index.js +4 -0
  178. package/dist/components/Toolbar/Toolbar.js +33 -32
  179. package/dist/components/Toolbar/ToolbarToggle.js +31 -0
  180. package/dist/components/Toolbar/index.js +2 -1
  181. package/dist/components/Tooltip/Tooltip.js +1 -1
  182. package/dist/components/Tour/Tour.js +57 -53
  183. package/dist/components/Tree/Tree.js +265 -80
  184. package/dist/components/Tree/TreeItem.js +91 -55
  185. package/dist/components/Tree/utils.js +82 -10
  186. package/dist/components/Typography/Typography.js +0 -1
  187. package/dist/components/Typography/index.js +0 -1
  188. package/dist/components/Upload/Upload.js +24 -8
  189. package/dist/components/Upload/UploadCore.js +230 -37
  190. package/dist/components/Upload/UploadList.js +300 -0
  191. package/dist/components/Upload/xhr-upload.js +22 -0
  192. package/dist/components/VirtualList/VirtualList.js +84 -56
  193. package/dist/components/Watermark/Watermark.js +55 -0
  194. package/dist/components/Watermark/index.js +3 -0
  195. package/dist/css/anchor.css +2 -0
  196. package/dist/css/app-shell.css +2 -0
  197. package/dist/css/badge.css +1 -1
  198. package/dist/css/bottom-sheet.css +1 -1
  199. package/dist/css/button.css +1 -1
  200. package/dist/css/calendar.css +1 -1
  201. package/dist/css/cascader.css +1 -1
  202. package/dist/css/chart.css +2 -0
  203. package/dist/css/chat-container.css +1 -1
  204. package/dist/css/chat-message.css +1 -1
  205. package/dist/css/combobox.css +3 -2
  206. package/dist/css/command.css +2 -1
  207. package/dist/css/context-menu.css +1 -1
  208. package/dist/css/data-table.css +2 -1
  209. package/dist/css/date-range-picker.css +1 -1
  210. package/dist/css/datepicker.css +2 -2
  211. package/dist/css/descriptions.css +2 -0
  212. package/dist/css/dialog.css +1 -1
  213. package/dist/css/drawer.css +1 -1
  214. package/dist/css/dropdown-menu.css +4 -1
  215. package/dist/css/file-preview.css +2 -0
  216. package/dist/css/float-button.css +2 -0
  217. package/dist/css/image.css +2 -1
  218. package/dist/css/inline-completion.css +2 -0
  219. package/dist/css/json-view.css +2 -0
  220. package/dist/css/masonry.css +2 -0
  221. package/dist/css/menu.css +4 -1
  222. package/dist/css/popover.css +1 -1
  223. package/dist/css/prompt-input.css +2 -0
  224. package/dist/css/rating.css +1 -1
  225. package/dist/css/select.css +3 -1
  226. package/dist/css/signature.css +2 -0
  227. package/dist/css/slider.css +1 -1
  228. package/dist/css/sources.css +2 -0
  229. package/dist/css/tag-group.css +3 -1
  230. package/dist/css/tag-input.css +2 -1
  231. package/dist/css/toggle.css +2 -0
  232. package/dist/css/toolbar.css +1 -0
  233. package/dist/css/tooltip.css +1 -1
  234. package/dist/css/tree.css +2 -2
  235. package/dist/css/upload.css +2 -1
  236. package/dist/css/watermark.css +2 -0
  237. package/dist/css-manifest.json +75 -1
  238. package/dist/form/FormItem.js +55 -50
  239. package/dist/form/FormList.js +79 -0
  240. package/dist/form/index.js +5 -1
  241. package/dist/form/standard-schema.js +16 -0
  242. package/dist/haze-ui.css +61 -30
  243. package/dist/headless/index.js +19 -0
  244. package/dist/hooks/useClickOutside.js +24 -0
  245. package/dist/hooks/useDarkMode.js +27 -0
  246. package/dist/hooks/useFullscreen.js +42 -0
  247. package/dist/hooks/useHotkeys.js +77 -0
  248. package/dist/hooks/useInView.js +27 -0
  249. package/dist/hooks/useLocalStorage.js +8 -0
  250. package/dist/hooks/useMediaQuery.js +2 -1
  251. package/dist/hooks/usePrevious.js +11 -0
  252. package/dist/hooks/useSessionStorage.js +8 -0
  253. package/dist/hooks/useStorageState.js +80 -0
  254. package/dist/index.js +220 -171
  255. package/dist/registry.json +2435 -91
  256. package/dist/tokens/colors.js +0 -1
  257. package/dist/tokens/index.js +0 -1
  258. package/dist/tokens/motion.js +0 -1
  259. package/dist/tokens/oklch.js +0 -1
  260. package/dist/tokens/palette.js +0 -1
  261. package/dist/tokens/registry.js +17 -28
  262. package/dist/tokens/spacing.js +0 -1
  263. package/dist/tokens/typography.js +0 -1
  264. package/dist/types/components/Anchor/Anchor.d.ts +25 -0
  265. package/dist/types/components/Anchor/index.d.ts +2 -0
  266. package/dist/types/components/AppShell/AppShell.d.ts +17 -0
  267. package/dist/types/components/AppShell/index.d.ts +2 -0
  268. package/dist/types/components/Badge/badge-styles.d.ts +21 -0
  269. package/dist/types/components/Badge/index.d.ts +1 -0
  270. package/dist/types/components/BottomSheet/BottomSheet.d.ts +52 -3
  271. package/dist/types/components/BottomSheet/index.d.ts +1 -1
  272. package/dist/types/components/Button/Button.d.ts +7 -0
  273. package/dist/types/components/Button/ButtonLink.d.ts +3 -0
  274. package/dist/types/components/Button/index.d.ts +1 -0
  275. package/dist/types/components/Button/styles.d.ts +17 -0
  276. package/dist/types/components/Calendar/Calendar.d.ts +71 -7
  277. package/dist/types/components/Calendar/date.d.ts +52 -0
  278. package/dist/types/components/Calendar/index.d.ts +1 -1
  279. package/dist/types/components/Cascader/Cascader.d.ts +48 -3
  280. package/dist/types/components/Chart/Chart.d.ts +43 -0
  281. package/dist/types/components/Chart/chart-elements.d.ts +104 -0
  282. package/dist/types/components/Chart/index.d.ts +2 -0
  283. package/dist/types/components/ChatContainer/ChatContainer.d.ts +18 -3
  284. package/dist/types/components/ChatInput/ChatInput.d.ts +11 -1
  285. package/dist/types/components/ChatMessage/ChatMessage.d.ts +13 -1
  286. package/dist/types/components/Checkbox/Checkbox.d.ts +6 -2
  287. package/dist/types/components/Checkbox/CheckboxCore.d.ts +4 -2
  288. package/dist/types/components/CodeBlock/CodeBlock.d.ts +19 -2
  289. package/dist/types/components/CodeBlock/index.d.ts +1 -1
  290. package/dist/types/components/Collapsible/Collapsible.d.ts +24 -2
  291. package/dist/types/components/Collapsible/index.d.ts +1 -1
  292. package/dist/types/components/ColorPicker/ColorPicker.d.ts +7 -1
  293. package/dist/types/components/ColorPicker/ColorPickerCore.d.ts +7 -1
  294. package/dist/types/components/Combobox/Combobox.d.ts +111 -7
  295. package/dist/types/components/Combobox/ComboboxGroup.d.ts +22 -0
  296. package/dist/types/components/Combobox/ComboboxOption.d.ts +7 -2
  297. package/dist/types/components/Combobox/index.d.ts +3 -1
  298. package/dist/types/components/Command/Command.d.ts +70 -6
  299. package/dist/types/components/Command/CommandDialog.d.ts +36 -0
  300. package/dist/types/components/Command/command-filter.d.ts +34 -0
  301. package/dist/types/components/Command/index.d.ts +4 -2
  302. package/dist/types/components/DataTable/CellEditor.d.ts +24 -0
  303. package/dist/types/components/DataTable/DataTable.d.ts +184 -32
  304. package/dist/types/components/DataTable/csv.d.ts +36 -0
  305. package/dist/types/components/DataTable/features.d.ts +124 -0
  306. package/dist/types/components/DataTable/index.d.ts +4 -1
  307. package/dist/types/components/DataTable/summary.d.ts +19 -0
  308. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +28 -2
  309. package/dist/types/components/DateRangePicker/DateRangePickerCore.d.ts +26 -2
  310. package/dist/types/components/DateRangePicker/index.d.ts +2 -2
  311. package/dist/types/components/DateRangePicker/presets.d.ts +23 -0
  312. package/dist/types/components/Datepicker/Datepicker.d.ts +21 -1
  313. package/dist/types/components/Datepicker/DatepickerCore.d.ts +29 -2
  314. package/dist/types/components/Datepicker/datetime.d.ts +27 -0
  315. package/dist/types/components/Datepicker/index.d.ts +1 -1
  316. package/dist/types/components/Descriptions/Descriptions.d.ts +30 -0
  317. package/dist/types/components/Descriptions/index.d.ts +2 -0
  318. package/dist/types/components/Dialog/Dialog.d.ts +68 -3
  319. package/dist/types/components/Dialog/index.d.ts +1 -1
  320. package/dist/types/components/Drawer/Drawer.d.ts +33 -3
  321. package/dist/types/components/Drawer/index.d.ts +1 -1
  322. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +23 -3
  323. package/dist/types/components/DropdownMenu/DropdownMenuSub.d.ts +18 -0
  324. package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +13 -0
  325. package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +14 -0
  326. package/dist/types/components/DropdownMenu/index.d.ts +7 -1
  327. package/dist/types/components/FilePreview/FilePreview.d.ts +35 -0
  328. package/dist/types/components/FilePreview/file-preview-format.d.ts +20 -0
  329. package/dist/types/components/FilePreview/index.d.ts +2 -0
  330. package/dist/types/components/FloatButton/FloatButton.d.ts +43 -0
  331. package/dist/types/components/FloatButton/FloatButtonGroup.d.ts +33 -0
  332. package/dist/types/components/FloatButton/float-button-context.d.ts +11 -0
  333. package/dist/types/components/FloatButton/float-button-glyphs.d.ts +3 -0
  334. package/dist/types/components/FloatButton/float-button-styles.d.ts +58 -0
  335. package/dist/types/components/FloatButton/index.d.ts +4 -0
  336. package/dist/types/components/Fullscreen/Fullscreen.d.ts +34 -0
  337. package/dist/types/components/Fullscreen/index.d.ts +3 -0
  338. package/dist/types/components/Image/Image.d.ts +20 -5
  339. package/dist/types/components/Image/ImagePreview.d.ts +13 -0
  340. package/dist/types/components/Image/index.d.ts +1 -1
  341. package/dist/types/components/InlineCompletion/InlineCompletion.d.ts +29 -0
  342. package/dist/types/components/InlineCompletion/index.d.ts +2 -0
  343. package/dist/types/components/Input/Input.d.ts +5 -2
  344. package/dist/types/components/Input/InputCore.d.ts +4 -2
  345. package/dist/types/components/JsonView/JsonView.d.ts +26 -0
  346. package/dist/types/components/JsonView/index.d.ts +2 -0
  347. package/dist/types/components/JsonView/json-view-utils.d.ts +22 -0
  348. package/dist/types/components/LocaleProvider/LocaleContext.d.ts +9 -0
  349. package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +12 -1
  350. package/dist/types/components/LocaleProvider/index.d.ts +3 -0
  351. package/dist/types/components/LocaleProvider/ja-jp.d.ts +13 -0
  352. package/dist/types/components/LocaleProvider/locale.d.ts +100 -0
  353. package/dist/types/components/LocaleProvider/strings.d.ts +28 -0
  354. package/dist/types/components/Masonry/Masonry.d.ts +34 -0
  355. package/dist/types/components/Masonry/index.d.ts +2 -0
  356. package/dist/types/components/Masonry/masonry-distribute.d.ts +16 -0
  357. package/dist/types/components/Mentions/Mentions.d.ts +5 -2
  358. package/dist/types/components/Mentions/MentionsCore.d.ts +4 -2
  359. package/dist/types/components/Menu/MenuSub.d.ts +18 -0
  360. package/dist/types/components/Menu/MenuSubContent.d.ts +12 -0
  361. package/dist/types/components/Menu/MenuSubTrigger.d.ts +14 -0
  362. package/dist/types/components/Menu/index.d.ts +6 -0
  363. package/dist/types/components/NumberInput/NumberInput.d.ts +5 -2
  364. package/dist/types/components/NumberInput/NumberInputCore.d.ts +4 -2
  365. package/dist/types/components/OTPInput/OTPInput.d.ts +5 -1
  366. package/dist/types/components/OTPInput/OTPInputCore.d.ts +4 -1
  367. package/dist/types/components/PasswordInput/PasswordInput.d.ts +5 -1
  368. package/dist/types/components/PasswordInput/PasswordInputCore.d.ts +4 -1
  369. package/dist/types/components/Popover/Popover.d.ts +41 -3
  370. package/dist/types/components/Popover/index.d.ts +1 -1
  371. package/dist/types/components/PromptInput/PromptInput.d.ts +46 -0
  372. package/dist/types/components/PromptInput/index.d.ts +2 -0
  373. package/dist/types/components/Radio/Radio.d.ts +5 -2
  374. package/dist/types/components/Radio/RadioGroup.d.ts +8 -2
  375. package/dist/types/components/Radio/RadioGroupCore.d.ts +7 -2
  376. package/dist/types/components/Rating/Rating.d.ts +8 -1
  377. package/dist/types/components/Rating/RatingCore.d.ts +7 -1
  378. package/dist/types/components/Resizable/index.d.ts +2 -0
  379. package/dist/types/components/Segmented/Segmented.d.ts +8 -1
  380. package/dist/types/components/Segmented/SegmentedCore.d.ts +7 -2
  381. package/dist/types/components/Select/OptionGroup.d.ts +16 -0
  382. package/dist/types/components/Select/Select.d.ts +78 -4
  383. package/dist/types/components/Select/SelectCore.d.ts +79 -6
  384. package/dist/types/components/Select/SelectFloating.d.ts +94 -0
  385. package/dist/types/components/Select/index.d.ts +2 -0
  386. package/dist/types/components/Select/select-options.d.ts +53 -0
  387. package/dist/types/components/Signature/Signature.d.ts +51 -0
  388. package/dist/types/components/Signature/index.d.ts +2 -0
  389. package/dist/types/components/Signature/signature-points.d.ts +31 -0
  390. package/dist/types/components/Slider/Slider.d.ts +29 -4
  391. package/dist/types/components/Slider/SliderCore.d.ts +35 -6
  392. package/dist/types/components/Sources/Sources.d.ts +37 -0
  393. package/dist/types/components/Sources/index.d.ts +2 -0
  394. package/dist/types/components/Switch/Switch.d.ts +5 -2
  395. package/dist/types/components/Switch/SwitchCore.d.ts +4 -2
  396. package/dist/types/components/Tabs/TabList.d.ts +7 -0
  397. package/dist/types/components/Tabs/Tabs.d.ts +8 -1
  398. package/dist/types/components/Tabs/TabsContext.d.ts +20 -0
  399. package/dist/types/components/Tabs/index.d.ts +1 -0
  400. package/dist/types/components/TagGroup/SortableTagGroup.d.ts +20 -0
  401. package/dist/types/components/TagGroup/TagGroup.d.ts +3 -0
  402. package/dist/types/components/TagGroup/index.d.ts +2 -0
  403. package/dist/types/components/TagGroup/tag-group-styles.d.ts +7 -0
  404. package/dist/types/components/TagInput/SortableTagInput.d.ts +34 -0
  405. package/dist/types/components/TagInput/SortableTagInputCore.d.ts +18 -0
  406. package/dist/types/components/TagInput/TagInput.d.ts +5 -1
  407. package/dist/types/components/TagInput/TagInputCore.d.ts +6 -2
  408. package/dist/types/components/TagInput/index.d.ts +4 -0
  409. package/dist/types/components/TagInput/tag-input-styles.d.ts +12 -0
  410. package/dist/types/components/Textarea/Textarea.d.ts +5 -2
  411. package/dist/types/components/Textarea/TextareaCore.d.ts +4 -2
  412. package/dist/types/components/TimePicker/TimePicker.d.ts +5 -2
  413. package/dist/types/components/TimePicker/TimePickerCore.d.ts +4 -2
  414. package/dist/types/components/Toast/Toast.d.ts +31 -2
  415. package/dist/types/components/Toast/ToastContainer.d.ts +11 -1
  416. package/dist/types/components/Toast/ToastContext.d.ts +44 -3
  417. package/dist/types/components/Toast/index.d.ts +1 -1
  418. package/dist/types/components/Toast/toast.d.ts +35 -4
  419. package/dist/types/components/Toast/useToast.d.ts +16 -4
  420. package/dist/types/components/Toggle/Toggle.d.ts +19 -0
  421. package/dist/types/components/Toggle/ToggleCore.d.ts +23 -0
  422. package/dist/types/components/Toggle/index.d.ts +4 -0
  423. package/dist/types/components/Toolbar/ToolbarToggle.d.ts +19 -0
  424. package/dist/types/components/Toolbar/index.d.ts +2 -0
  425. package/dist/types/components/Tour/Tour.d.ts +3 -3
  426. package/dist/types/components/Tree/Tree.d.ts +3 -3
  427. package/dist/types/components/Tree/TreeItem.d.ts +16 -1
  428. package/dist/types/components/Tree/types.d.ts +51 -0
  429. package/dist/types/components/Tree/utils.d.ts +73 -0
  430. package/dist/types/components/Upload/Upload.d.ts +47 -3
  431. package/dist/types/components/Upload/UploadCore.d.ts +95 -4
  432. package/dist/types/components/Upload/UploadList.d.ts +18 -0
  433. package/dist/types/components/Upload/index.d.ts +1 -0
  434. package/dist/types/components/Upload/types.d.ts +60 -0
  435. package/dist/types/components/Upload/xhr-upload.d.ts +20 -0
  436. package/dist/types/components/VirtualList/VirtualList.d.ts +16 -1
  437. package/dist/types/components/Watermark/Watermark.d.ts +32 -0
  438. package/dist/types/components/Watermark/index.d.ts +2 -0
  439. package/dist/types/form/FormItem.d.ts +33 -8
  440. package/dist/types/form/FormList.d.ts +113 -0
  441. package/dist/types/form/index.d.ts +26 -0
  442. package/dist/types/form/standard-schema.d.ts +30 -0
  443. package/dist/types/headless/index.d.ts +399 -0
  444. package/dist/types/hooks/index.d.ts +13 -0
  445. package/dist/types/hooks/useClickOutside.d.ts +46 -0
  446. package/dist/types/hooks/useDarkMode.d.ts +40 -0
  447. package/dist/types/hooks/useFullscreen.d.ts +33 -0
  448. package/dist/types/hooks/useHotkeys.d.ts +53 -0
  449. package/dist/types/hooks/useInView.d.ts +32 -0
  450. package/dist/types/hooks/useLocalStorage.d.ts +33 -0
  451. package/dist/types/hooks/useMediaQuery.d.ts +3 -0
  452. package/dist/types/hooks/usePrevious.d.ts +18 -0
  453. package/dist/types/hooks/useSessionStorage.d.ts +26 -0
  454. package/dist/types/hooks/useStorageState.d.ts +12 -0
  455. package/dist/types/index.d.ts +79 -37
  456. package/dist/types/utils/collision.d.ts +39 -1
  457. package/dist/types/utils/direction.d.ts +22 -0
  458. package/dist/types/utils/floating.d.ts +32 -4
  459. package/dist/types/utils/focus-scope.d.ts +2 -1
  460. package/dist/types/utils/focus.d.ts +2 -1
  461. package/dist/types/utils/menuKeyboard.d.ts +19 -4
  462. package/dist/types/utils/refs.d.ts +16 -0
  463. package/dist/types/utils/sortable-handle.d.ts +25 -0
  464. package/dist/types/utils/sortable-shared.d.ts +30 -0
  465. package/dist/types/utils/sortable.d.ts +36 -0
  466. package/dist/types/utils/submenu.d.ts +63 -0
  467. package/dist/types/utils/view-transition.d.ts +28 -0
  468. package/dist/utils/classnames.js +0 -1
  469. package/dist/utils/collision.js +37 -26
  470. package/dist/utils/direction.js +34 -0
  471. package/dist/utils/floating.js +163 -143
  472. package/dist/utils/menuKeyboard.js +59 -46
  473. package/dist/utils/refs.js +9 -0
  474. package/dist/utils/sortable-handle.js +12 -0
  475. package/dist/utils/sortable-shared.js +16 -0
  476. package/dist/utils/sortable.js +47 -0
  477. package/dist/utils/submenu.js +106 -0
  478. package/dist/utils/view-transition.js +26 -0
  479. package/package.json +169 -16
@@ -1,13 +1,33 @@
1
+ import type { Ref } from 'react';
1
2
  import type { ControlOrValue } from 'react-use-control';
3
+ import type { CalendarPickerMode } from '../Calendar/Calendar';
4
+ import type { DatepickerPreset } from './DatepickerCore';
2
5
  type DatepickerProps = {
3
6
  value?: ControlOrValue<string>;
4
7
  open?: ControlOrValue<boolean>;
8
+ /** Calendar granularity — 'date' (default), 'month', 'quarter' or
9
+ * 'year'. `value` serializes per mode: "YYYY-MM-DD", "YYYY-MM",
10
+ * "YYYY-Qn" or "YYYY". */
11
+ picker?: CalendarPickerMode;
5
12
  min?: string;
6
13
  max?: string;
14
+ /** Disables individual dates on the calendar panel (see Calendar's
15
+ * `disabledDate`). */
16
+ disabledDate?: (date: Date) => boolean;
17
+ /** Shortcut rows at the top of the panel; clicking applies the
18
+ * preset's value and closes the panel. */
19
+ presets?: DatepickerPreset[];
20
+ /** Adds a time input (hour/minute) below the calendar; `value`
21
+ * serializes as `"YYYY-MM-DD HH:mm"` instead of `"YYYY-MM-DD"`
22
+ * (plain-date values stay accepted). Date granularity only. */
23
+ showTime?: boolean;
7
24
  locale?: string;
8
25
  weekStartsOn?: 0 | 1;
9
26
  placeholder?: string;
10
27
  className?: string;
28
+ /** Forwarded to the trigger `<input>` (not the wrapper div) — the
29
+ * element form bridges and `ref.current.focus()` reach. */
30
+ ref?: Ref<HTMLInputElement>;
11
31
  };
12
- export default function Datepicker({ value: valueControl, open: openControl, min, max, locale, weekStartsOn, placeholder, className, }: DatepickerProps): import("react").JSX.Element;
32
+ export default function Datepicker({ value: valueControl, open: openControl, picker, min, max, disabledDate, presets, showTime, locale, weekStartsOn, placeholder, className, ref, }: DatepickerProps): import("react").JSX.Element;
13
33
  export type { DatepickerProps };
@@ -1,14 +1,41 @@
1
+ import type { Ref } from 'react';
2
+ import type { CalendarPickerMode } from '../Calendar/Calendar';
3
+ /** One shortcut row at the top of the dropdown panel: clicking applies
4
+ * `value` (serialized per `picker`) and closes the panel. */
5
+ type DatepickerPreset = {
6
+ /** Visible row copy. */
7
+ label: string;
8
+ /** Applied value — "YYYY-MM-DD" (date), "YYYY-MM" (month), "YYYY-Qn"
9
+ * (quarter) or "YYYY" (year), matching `picker`. */
10
+ value: string;
11
+ };
1
12
  type DatepickerCoreProps = {
2
13
  value: string;
3
14
  onChange: (value: string) => void;
4
15
  open: boolean;
5
16
  onOpenChange: (open: boolean) => void;
17
+ /** Calendar granularity; forwarded to the panel's Calendar and
18
+ * followed by `value`/`onChange` serialization. */
19
+ picker?: CalendarPickerMode;
6
20
  min?: string;
7
21
  max?: string;
22
+ /** Disables individual dates on the panel's Calendar (see Calendar's
23
+ * `disabledDate`). */
24
+ disabledDate?: (date: Date) => boolean;
25
+ /** Shortcut rows rendered above the calendar; clicking applies the
26
+ * preset and closes the panel. */
27
+ presets?: DatepickerPreset[];
28
+ /** Renders a time input (hour/minute) below the calendar; `value`
29
+ * serializes as `"YYYY-MM-DD HH:mm"`. Applies to the default date
30
+ * granularity only; without it the value keeps the plain
31
+ * `"YYYY-MM-DD"` format. */
32
+ showTime?: boolean;
8
33
  locale?: string;
9
34
  weekStartsOn?: 0 | 1;
10
35
  placeholder?: string;
11
36
  className?: string;
37
+ /** Forwarded to the trigger `<input>` (not the wrapper div). */
38
+ ref?: Ref<HTMLInputElement>;
12
39
  };
13
- export default function DatepickerCore({ value, onChange, open, onOpenChange, min, max, locale, weekStartsOn, placeholder, className, }: DatepickerCoreProps): import("react").JSX.Element;
14
- export type { DatepickerCoreProps };
40
+ export default function DatepickerCore({ value, onChange, open, onOpenChange, picker, min, max, disabledDate, presets, showTime, locale, weekStartsOn, placeholder, className, ref, }: DatepickerCoreProps): import("react").JSX.Element;
41
+ export type { DatepickerCoreProps, DatepickerPreset };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Serialization helpers for Datepicker's `showTime` mode.
3
+ *
4
+ * The combined value is the day-grid `"YYYY-MM-DD"` value (see
5
+ * Calendar/date.ts — a local civil date, never a UTC timestamp) plus a
6
+ * space and a 24-hour `"HH:mm"` time: `"2026-03-01 09:30"`. Without
7
+ * `showTime` the value keeps the plain date format, and a plain date
8
+ * stays a valid input with `showTime` on (the time then reads as
9
+ * unset, defaulting to `00:00` on the next pick).
10
+ */
11
+ /**
12
+ * Split a value into its date and time parts. Accepts the combined
13
+ * `"YYYY-MM-DD HH:mm"` form (returning both parts) and the bare
14
+ * `"YYYY-MM-DD"` form (returning `time: null` — the backward-compatible
15
+ * pure-date value). Returns `null` for anything that is not a real
16
+ * calendar date, leaving the caller free to fall back to empty.
17
+ */
18
+ export declare function splitDateTimeValue(value: string): {
19
+ date: string;
20
+ time: string | null;
21
+ } | null;
22
+ /**
23
+ * Combine a `"YYYY-MM-DD"` date and an `"HH:mm"` time into the
24
+ * `"YYYY-MM-DD HH:mm"` value. Pure string join — both inputs are
25
+ * expected in their already-serialized forms.
26
+ */
27
+ export declare function formatDateTimeValue(date: string, time: string): string;
@@ -1,4 +1,4 @@
1
1
  export { default as Datepicker } from './Datepicker';
2
2
  export type { DatepickerProps } from './Datepicker';
3
3
  export { default as DatepickerCore } from './DatepickerCore';
4
- export type { DatepickerCoreProps } from './DatepickerCore';
4
+ export type { DatepickerCoreProps, DatepickerPreset } from './DatepickerCore';
@@ -0,0 +1,30 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ /**
3
+ * One key→value pair. `span` is measured in description columns
4
+ * (label+value pairs per row), matching AntD: `span: 2` stretches the
5
+ * value across a second column pair on the same row.
6
+ */
7
+ type DescriptionsItem = {
8
+ /** Stable identity for the pair within `items`. */
9
+ key: string;
10
+ /** The term (`<dt>`). */
11
+ label: ReactNode;
12
+ /** The description (`<dd>`). */
13
+ children: ReactNode;
14
+ /** Columns the item occupies; clamped to `columns`. Default 1. */
15
+ span?: number;
16
+ };
17
+ type DescriptionsProps = {
18
+ /** Ordered pairs to display — the list is data-driven (no children). */
19
+ items: DescriptionsItem[];
20
+ /** Description columns (label+value pairs per row). Default 3. */
21
+ columns?: number;
22
+ /** Bordered variant: full grid lines plus a shaded label column. */
23
+ bordered?: boolean;
24
+ /** Cell padding density. Default 'md'. */
25
+ size?: 'sm' | 'md';
26
+ /** Heading rendered above the list (outside the `<dl>`). */
27
+ title?: ReactNode;
28
+ } & Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'title'>;
29
+ export default function Descriptions({ items, columns, bordered, size, title, className, style, ...rest }: DescriptionsProps): import("react").JSX.Element;
30
+ export type { DescriptionsProps, DescriptionsItem };
@@ -0,0 +1,2 @@
1
+ export { default as Descriptions } from './Descriptions';
2
+ export type { DescriptionsProps, DescriptionsItem } from './Descriptions';
@@ -1,5 +1,50 @@
1
- import type { ReactNode } from 'react';
1
+ import type { ReactNode, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
+ /**
4
+ * Imperative handle exposed through the React 19 `ref` prop (same API
5
+ * choice as VirtualList). `open`/`close` are state writes going through
6
+ * the same control path as every other open transition, so the animated
7
+ * exit → native `close` event remains the single `onClose` exit — a
8
+ * handle close never double-fires the callback.
9
+ */
10
+ type DialogHandle = {
11
+ /** Show the dialog (`showModal` + initial focus, as if `open` flipped true). */
12
+ open: () => void;
13
+ /**
14
+ * Close the dialog through the animated exit; `onClose` fires exactly
15
+ * once, via the native close event — never synchronously here.
16
+ */
17
+ close: () => void;
18
+ /** Focus the element that held focus when the dialog last opened. */
19
+ focusTrigger: () => void;
20
+ };
21
+ /**
22
+ * Semantic slot classes (AntD v6 `classNames` 形态):键名对应 Dialog 的
23
+ * 结构部位,消费者类名追加在部位节点 x-class 数组末尾(可覆盖组件
24
+ * 默认样式)。Dialog 的面板就是 `<dialog>` 元素本身、遮罩是它的
25
+ * `::backdrop` 伪元素(无法挂类),因此只有这两个真实部位:
26
+ *
27
+ * - `root` — `<dialog>` 面板元素
28
+ * - `header` — `title` prop 渲染出的 `<h2>` 标题(不传 title 时不存在)
29
+ */
30
+ type DialogClassNames = {
31
+ /** `<dialog>` 面板元素(含内边距/圆角/阴影的盒子)。 */
32
+ root?: string;
33
+ /** 标题 `<h2>`;仅在传 `title` prop 时渲染。 */
34
+ header?: string;
35
+ };
36
+ /**
37
+ * Component-level tokens: Dialog can be rethemed per-component by setting
38
+ * `--haze-dialog-*` custom properties on `:root` or any ancestor. The
39
+ * library never defines them — the stylesheet only carries fallback
40
+ * chains, so unset variables keep the shipped look:
41
+ *
42
+ * - `--haze-dialog-width` — panel max-width (fallback `480px`)
43
+ * - `--haze-dialog-radius` — panel corner radius (fallback `--haze-radius-xl`)
44
+ * - `--haze-dialog-padding` — panel body padding (fallback `--haze-space-6`)
45
+ * - `--haze-dialog-title-gap` — gap between title and body (fallback `--haze-space-4`)
46
+ * - `--haze-dialog-title-font-size` — title text size (fallback `--haze-text-lg`)
47
+ */
3
48
  type DialogProps = {
4
49
  open?: ControlOrValue<boolean>;
5
50
  onClose?: () => void;
@@ -9,8 +54,28 @@ type DialogProps = {
9
54
  * 可访问名默认为空)。不传时不生成空关联。
10
55
  */
11
56
  title?: ReactNode;
57
+ /**
58
+ * 开/关状态翻转是否包进 View Transitions API(默认 `false`,行为与
59
+ * 不传完全一致)。开启后每次显隐翻转都运行在
60
+ * `document.startViewTransition(() => flushSync(...))` 里(React 官方
61
+ * 要求的同步 DOM 更新模式),页面获得原生过渡;命令式 handle、
62
+ * Esc、背景点击等路径共用同一出口。引擎不支持
63
+ * `startViewTransition` 或用户偏好 `prefers-reduced-motion: reduce`
64
+ * 时自动退化为直接翻转。过渡外观由消费方的 `::view-transition-*`
65
+ * 样式定义,组件自身的进退场动画照常运行在新快照内。
66
+ */
67
+ viewTransition?: boolean;
68
+ /**
69
+ * 语义槽位类名(AntD v6 `classNames` 形态):按键把消费者类落到
70
+ * Dialog 的结构部位(见 {@link DialogClassNames})。槽位类追加在
71
+ * 部位节点类列表末尾,可与根节点 `className` 并用(`className`
72
+ * 同样落在 `<dialog>` 上,`classNames.root` 在其后)。不传时渲染
73
+ * 输出零变化。
74
+ */
75
+ classNames?: DialogClassNames;
12
76
  className?: string;
13
77
  children: ReactNode;
78
+ ref?: Ref<DialogHandle>;
14
79
  };
15
- export default function Dialog({ open: openControl, onClose, title, className, children, }: DialogProps): import("react").JSX.Element;
16
- export type { DialogProps };
80
+ export default function Dialog({ open: openControl, onClose, title, viewTransition, classNames, className, children, ref, }: DialogProps): import("react").JSX.Element;
81
+ export type { DialogProps, DialogHandle, DialogClassNames };
@@ -1,2 +1,2 @@
1
1
  export { default as Dialog } from './Dialog';
2
- export type { DialogProps } from './Dialog';
2
+ export type { DialogProps, DialogHandle, DialogClassNames } from './Dialog';
@@ -1,11 +1,41 @@
1
- import type { ReactNode } from 'react';
1
+ import type { ReactNode, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
+ /**
4
+ * Imperative handle exposed through the React 19 `ref` prop (same API
5
+ * choice as VirtualList). `open`/`close` are state writes going through
6
+ * the same control path as every other open transition, so the animated
7
+ * exit → native `close` event remains the single `onClose` exit — a
8
+ * handle close never double-fires the callback.
9
+ */
10
+ type DrawerHandle = {
11
+ /** Show the drawer (`showModal` + initial focus, as if `open` flipped true). */
12
+ open: () => void;
13
+ /**
14
+ * Close the drawer through the animated exit; `onClose` fires exactly
15
+ * once, via the native close event — never synchronously here.
16
+ */
17
+ close: () => void;
18
+ /** Focus the element that held focus when the drawer last opened. */
19
+ focusTrigger: () => void;
20
+ };
3
21
  type DrawerProps = {
4
22
  open?: ControlOrValue<boolean>;
5
23
  placement?: 'left' | 'right' | 'top' | 'bottom';
6
24
  onClose?: () => void;
25
+ /**
26
+ * 开/关状态翻转是否包进 View Transitions API(默认 `false`,行为与
27
+ * 不传完全一致)。开启后每次显隐翻转都运行在
28
+ * `document.startViewTransition(() => flushSync(...))` 里(React 官方
29
+ * 要求的同步 DOM 更新模式),页面获得原生过渡;命令式 handle、
30
+ * Esc、背景点击等路径共用同一出口。引擎不支持
31
+ * `startViewTransition` 或用户偏好 `prefers-reduced-motion: reduce`
32
+ * 时自动退化为直接翻转。过渡外观由消费方的 `::view-transition-*`
33
+ * 样式定义,组件自身的进退场动画照常运行在新快照内。
34
+ */
35
+ viewTransition?: boolean;
7
36
  className?: string;
8
37
  children: ReactNode;
38
+ ref?: Ref<DrawerHandle>;
9
39
  };
10
- export default function Drawer({ open: openControl, placement, onClose, className, children, }: DrawerProps): import("react").JSX.Element;
11
- export type { DrawerProps };
40
+ export default function Drawer({ open: openControl, placement, onClose, viewTransition, className, children, ref, }: DrawerProps): import("react").JSX.Element;
41
+ export type { DrawerProps, DrawerHandle };
@@ -1,2 +1,2 @@
1
1
  export { default as Drawer } from './Drawer';
2
- export type { DrawerProps } from './Drawer';
2
+ export type { DrawerProps, DrawerHandle } from './Drawer';
@@ -1,6 +1,25 @@
1
- import type { ReactNode } from 'react';
1
+ import type { ReactNode, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
3
  import type { CollisionPadding } from '../../utils/collision';
4
+ /**
5
+ * Imperative handle exposed through the React 19 `ref` prop (same API
6
+ * choice as VirtualList). `open`/`close` run through the same
7
+ * `handleSetOpen` the trigger and items use — `onOpenChange` fires, and
8
+ * the floating engine's popover visibility, animated exit and
9
+ * toggle-echo reconciliation stay in charge; the handle never calls
10
+ * `showPopover`/`hidePopover` directly.
11
+ */
12
+ type DropdownMenuHandle = {
13
+ /** Show the menu, as if the trigger toggled it open (`onOpenChange(true)`). */
14
+ open: () => void;
15
+ /**
16
+ * Close the menu through the animated exit path
17
+ * (`onOpenChange(false)`).
18
+ */
19
+ close: () => void;
20
+ /** Focus the trigger element. */
21
+ focusTrigger: () => void;
22
+ };
4
23
  type DropdownMenuProps = {
5
24
  open?: ControlOrValue<boolean>;
6
25
  onOpenChange?: (open: boolean) => void;
@@ -11,6 +30,7 @@ type DropdownMenuProps = {
11
30
  collisionPadding?: CollisionPadding;
12
31
  children: ReactNode;
13
32
  className?: string;
33
+ ref?: Ref<DropdownMenuHandle>;
14
34
  };
15
- export default function DropdownMenu({ open: openControl, onOpenChange, collisionPadding, children, className, }: DropdownMenuProps): import("react").JSX.Element;
16
- export type { DropdownMenuProps };
35
+ export default function DropdownMenu({ open: openControl, onOpenChange, collisionPadding, children, className, ref, }: DropdownMenuProps): import("react").JSX.Element;
36
+ export type { DropdownMenuProps, DropdownMenuHandle };
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ type DropdownMenuSubProps = {
4
+ /** Whether the submenu is open — controlled control or uncontrolled initial value. */
5
+ open?: ControlOrValue<boolean>;
6
+ /** Fires on every open transition, whatever drove it (keyboard, hover, click, light dismiss). */
7
+ onOpenChange?: (open: boolean) => void;
8
+ className?: string;
9
+ /** `<DropdownMenuSubTrigger>` followed by `<DropdownMenuSubContent>`. */
10
+ children: ReactNode;
11
+ };
12
+ /**
13
+ * State container for a nested submenu inside a DropdownMenu. Wraps a
14
+ * DropdownMenuSubTrigger + DropdownMenuSubContent pair; the open state is
15
+ * controllable through the standard `ControlOrValue` prop.
16
+ */
17
+ export default function DropdownMenuSub({ open, onOpenChange, className, children, }: DropdownMenuSubProps): import("react").JSX.Element;
18
+ export type { DropdownMenuSubProps };
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ type DropdownMenuSubContentProps = {
3
+ className?: string;
4
+ children: ReactNode;
5
+ };
6
+ /**
7
+ * The panel of a DropdownMenuSub submenu. Unmounts once closed, like
8
+ * DropdownMenuContent (the animated exit keeps it mounted through the
9
+ * fade); keyboard focus is contained to this level — Escape closes only
10
+ * this submenu.
11
+ */
12
+ export default function DropdownMenuSubContent({ className, children, }: DropdownMenuSubContentProps): import("react").JSX.Element | null;
13
+ export type { DropdownMenuSubContentProps };
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ type DropdownMenuSubTriggerProps = {
3
+ disabled?: boolean;
4
+ className?: string;
5
+ children: ReactNode;
6
+ };
7
+ /**
8
+ * The menuitem that opens a DropdownMenuSub submenu: hover opens it after
9
+ * a short intent delay, click toggles, and the inline-end arrow
10
+ * (ArrowRight in LTR, ArrowLeft under `dir="rtl"`) opens it with focus on
11
+ * its first item.
12
+ */
13
+ export default function DropdownMenuSubTrigger({ disabled, className, children, }: DropdownMenuSubTriggerProps): import("react").JSX.Element;
14
+ export type { DropdownMenuSubTriggerProps };
@@ -3,8 +3,14 @@ export { default as DropdownMenuTrigger } from './DropdownMenuTrigger';
3
3
  export { default as DropdownMenuContent } from './DropdownMenuContent';
4
4
  export { default as DropdownMenuItem } from './DropdownMenuItem';
5
5
  export { default as DropdownMenuSeparator } from './DropdownMenuSeparator';
6
- export type { DropdownMenuProps } from './DropdownMenu';
6
+ export { default as DropdownMenuSub } from './DropdownMenuSub';
7
+ export { default as DropdownMenuSubTrigger } from './DropdownMenuSubTrigger';
8
+ export { default as DropdownMenuSubContent } from './DropdownMenuSubContent';
9
+ export type { DropdownMenuProps, DropdownMenuHandle } from './DropdownMenu';
7
10
  export type { DropdownMenuTriggerProps } from './DropdownMenuTrigger';
8
11
  export type { DropdownMenuContentProps } from './DropdownMenuContent';
9
12
  export type { DropdownMenuItemProps } from './DropdownMenuItem';
10
13
  export type { DropdownMenuSeparatorProps } from './DropdownMenuSeparator';
14
+ export type { DropdownMenuSubProps } from './DropdownMenuSub';
15
+ export type { DropdownMenuSubTriggerProps } from './DropdownMenuSubTrigger';
16
+ export type { DropdownMenuSubContentProps } from './DropdownMenuSubContent';
@@ -0,0 +1,35 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ /** The attached file's descriptor — name plus optional metadata. */
3
+ type FilePreviewFile = {
4
+ name: string;
5
+ /** Size in bytes; formatted via KB/MB when present. */
6
+ size?: number;
7
+ /** MIME type; `image/*` with a `url` renders a thumbnail. */
8
+ type?: string;
9
+ url?: string;
10
+ };
11
+ type FilePreviewStatus = 'uploading' | 'uploaded' | 'error';
12
+ type FilePreviewProps = {
13
+ file: FilePreviewFile;
14
+ /** Lifecycle of the attachment; drives progress, status text, retry. */
15
+ status?: FilePreviewStatus;
16
+ /** 0–100 upload progress, clamped; shown while `status` is `uploading`. */
17
+ progress?: number;
18
+ /** Rendering the remove action; only shown when provided. */
19
+ onRemove?: () => void;
20
+ /** Rendering the retry action; only shown in the `error` status. */
21
+ onRetry?: () => void;
22
+ /** Remove button label. Default from `filePreview.remove`. */
23
+ removeLabel?: string;
24
+ /** Retry button label. Default from `filePreview.retry`. */
25
+ retryLabel?: string;
26
+ /** Status text while `status` is `uploading`. Default from `filePreview.uploading`. */
27
+ uploadingLabel?: string;
28
+ /** Status text once `status` is `uploaded`. Default from `filePreview.uploaded`. */
29
+ uploadedLabel?: string;
30
+ /** Status text when `status` is `error`. Default from `filePreview.error`. */
31
+ errorLabel?: string;
32
+ className?: string;
33
+ } & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
34
+ export default function FilePreview({ file, status, progress, onRemove, onRetry, removeLabel, retryLabel, uploadingLabel, uploadedLabel, errorLabel, className, ...rest }: FilePreviewProps): import("react").JSX.Element;
35
+ export type { FilePreviewProps, FilePreviewFile, FilePreviewStatus };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Pure formatting helpers for FilePreview. Component-prefixed basename
3
+ * (`file-preview-*`): Linaria slug collisions are a non-issue in a
4
+ * class-free module, but the naming rule keeps sibling files greppable
5
+ * and future-proofs a later style split.
6
+ */
7
+ /**
8
+ * Human-readable byte size: `B` below 1 KiB, then the largest fitting
9
+ * binary unit (`KB`/`MB`/`GB`/`TB`) with 2 significant decimals
10
+ * (`512 B`, `1.00 KB`, `1.50 MB`). Non-finite or negative input (and
11
+ * `undefined`) yields an empty string so callers can skip the meta chip.
12
+ */
13
+ declare function formatFileSize(bytes?: number): string;
14
+ /**
15
+ * Uppercase extension of a file name for the type badge (`report.pdf` →
16
+ * `PDF`). Leading-dot files (` .vimrc`), extension-less names and a
17
+ * trailing dot return an empty string (no badge).
18
+ */
19
+ declare function getFileExtension(name: string): string;
20
+ export { formatFileSize, getFileExtension };
@@ -0,0 +1,2 @@
1
+ export { default as FilePreview } from './FilePreview';
2
+ export type { FilePreviewProps, FilePreviewFile, FilePreviewStatus } from './FilePreview';
@@ -0,0 +1,43 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ /**
3
+ * A floating action button pinned to the inline-end / block-end screen
4
+ * corner — the "primary action" affordance material design popularized.
5
+ * General-purpose: any global action (create, chat, share…). For the
6
+ * specific "scroll back up" action keep `BackToTop`, which owns its own
7
+ * scroll-watching logic.
8
+ *
9
+ * Pass `href` to render a real anchor (navigation keeps ⌘/middle-click
10
+ * and crawlability — the ButtonLink rationale); without it a
11
+ * `<button type='button'>` is rendered and the rest of the native
12
+ * attributes spread through.
13
+ *
14
+ * `variant` follows Button's `solid | outline | ghost` semantics over
15
+ * the same color tokens; only the elevation (FAB shadow) is
16
+ * FloatButton-specific. The default icon is a plus glyph — `icon`
17
+ * replaces it (give a custom `svg` explicit width/height, or wrap it in
18
+ * `Icon`).
19
+ *
20
+ * Standalone use fixes the button to the corner via logical insets
21
+ * (RTL-safe; `--haze-float-button-offset` re-themes the gap). Inside a
22
+ * `FloatButtonGroup` the button drops its own anchor and joins the
23
+ * group's expandable menu.
24
+ *
25
+ * An icon-only FloatButton has no accessible name — pass `aria-label`
26
+ * (it spreads through like any native attribute) or a `description`.
27
+ */
28
+ type FloatButtonProps = {
29
+ /** Icon slot; defaults to a plus glyph. Purely decorative (hidden
30
+ * from AT) — the accessible name comes from `description` or
31
+ * `aria-label`. */
32
+ icon?: ReactNode;
33
+ /** Text beside the icon (pill-shaped button); doubles as the
34
+ * accessible name. */
35
+ description?: ReactNode;
36
+ shape?: 'circle' | 'square';
37
+ /** Button-aligned color variant over the same tokens. */
38
+ variant?: 'solid' | 'outline' | 'ghost';
39
+ /** Render an anchor navigating to this URL instead of a button. */
40
+ href?: string;
41
+ } & Omit<ComponentPropsWithoutRef<'button'>, 'type'> & Omit<ComponentPropsWithoutRef<'a'>, 'children' | 'type'>;
42
+ export default function FloatButton({ icon, description, shape, variant, href, className, onClick, ...rest }: FloatButtonProps): import("react").JSX.Element;
43
+ export type { FloatButtonProps };
@@ -0,0 +1,33 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ /**
4
+ * A `FloatButton` whose trigger expands a stack of `FloatButton`
5
+ * children — the classic FAB menu. The trigger owns the fixed anchor
6
+ * (`--haze-float-button-offset`), rotates its plus into an × as the menu
7
+ * opens, and reports the state through `aria-expanded` /
8
+ * `aria-controls`. Activating a child button dismisses the menu (the
9
+ * child's own `onClick` runs first); Escape closes it too.
10
+ *
11
+ * `open` follows the controllable-state contract: a control drives it
12
+ * live, a plain boolean is the uncontrolled initial value.
13
+ */
14
+ type FloatButtonGroupProps = {
15
+ /** Expanded state; a Control drives it live, a plain boolean is the
16
+ * uncontrolled initial value. */
17
+ open?: ControlOrValue<boolean>;
18
+ /** Fires whenever the expanded state changes through user
19
+ * interaction — trigger toggle, child activation or Escape. */
20
+ onOpenChange?: (open: boolean) => void;
21
+ /** Icon of the trigger button; defaults to a plus glyph (rotates 45°
22
+ * into an × while open). */
23
+ icon?: ReactNode;
24
+ /** Text beside the trigger icon; doubles as its accessible name. */
25
+ description?: ReactNode;
26
+ shape?: 'circle' | 'square';
27
+ /** Button-aligned color variant over the same tokens. */
28
+ variant?: 'solid' | 'outline' | 'ghost';
29
+ /** `FloatButton` items revealed by the trigger. */
30
+ children: ReactNode;
31
+ } & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
32
+ export default function FloatButtonGroup({ open: openControl, onOpenChange, icon, description, shape, variant, children, className, onKeyDown, ...rest }: FloatButtonGroupProps): import("react").JSX.Element;
33
+ export type { FloatButtonGroupProps };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Provided by `FloatButtonGroup`. A `FloatButton` inside a group drops
3
+ * its own fixed anchor (the group owns the anchor) and closes the menu
4
+ * after its action runs (AntD behavior).
5
+ */
6
+ export type FloatButtonGroupContextValue = {
7
+ /** Request the group menu to close. */
8
+ closeMenu: () => void;
9
+ };
10
+ export declare const FloatButtonGroupContext: import("react").Context<FloatButtonGroupContextValue | undefined>;
11
+ export declare function useFloatButtonGroup(): FloatButtonGroupContextValue | undefined;
@@ -0,0 +1,3 @@
1
+ /** Default FloatButton glyph — a plus that reads as an × once the group
2
+ * trigger rotates it 45° (see `iconOpen` in ./float-button-styles). */
3
+ export declare function PlusGlyph(): import("react").JSX.Element;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Shared FloatButton skin — the button face both `FloatButton` and the
3
+ * `FloatButtonGroup` trigger wear, plus the fixed anchor and the
4
+ * expand/collapse menu mechanics. Split into its own module (with the
5
+ * `float-button-` basename Linaria hashes class names from) so component
6
+ * files stay free of style internals and no two siblings ever collide on
7
+ * the `haze-styles__*` slug.
8
+ *
9
+ * ## Component-level tokens
10
+ *
11
+ * The skin exposes component-scoped custom properties for per-component
12
+ * theming. The library never *defines* them — every usage below is a
13
+ * fallback chain, so the shipped look is the fallback until a consumer
14
+ * sets the variable on `:root` or any ancestor (plain CSS inheritance):
15
+ *
16
+ * - `--haze-float-button-size` — button size (fallback `2.5rem`)
17
+ * - `--haze-float-button-offset` — screen-edge gap of the fixed anchor
18
+ * (fallback `--haze-space-6`); the safe-area inset is always added on
19
+ * top for the block-end edge
20
+ * - `--haze-float-button-radius` — `square` shape radius
21
+ * (fallback `--haze-radius-lg`)
22
+ *
23
+ * ## Button semantics
24
+ *
25
+ * `variant` mirrors Button's `solid | outline | ghost` family and reads
26
+ * the same color tokens, so a FloatButton re-themes together with
27
+ * Buttons — only the elevation (FAB shadow) is FloatButton-specific.
28
+ */
29
+ export declare const fab: import("@linaria/core").LinariaClassName;
30
+ export declare const shapes: {
31
+ readonly circle: import("@linaria/core").LinariaClassName;
32
+ readonly square: import("@linaria/core").LinariaClassName;
33
+ };
34
+ export declare const variants: {
35
+ readonly solid: import("@linaria/core").LinariaClassName;
36
+ readonly outline: import("@linaria/core").LinariaClassName;
37
+ readonly ghost: import("@linaria/core").LinariaClassName;
38
+ };
39
+ /**
40
+ * Fixed screen anchor — logical insets keep the placement RTL-safe
41
+ * (inline-end flips with direction). Only the block-end edge carries the
42
+ * physical safe-area env, which has no logical counterpart but matches
43
+ * block-end in every horizontal writing mode.
44
+ */
45
+ export declare const anchored: import("@linaria/core").LinariaClassName;
46
+ export declare const groupAnchor: import("@linaria/core").LinariaClassName;
47
+ /**
48
+ * Expand/collapse list of grouped buttons. The outer grid animates its
49
+ * single row track 1fr↔0fr (no content-height knowledge needed); the
50
+ * structural inner wrapper clips while shrinking. `visibility` keeps
51
+ * collapsed items out of the tab order, delayed on close so the collapse
52
+ * animation finishes first and immediate on open.
53
+ */
54
+ export declare const menuList: import("@linaria/core").LinariaClassName;
55
+ export declare const iconBox: import("@linaria/core").LinariaClassName;
56
+ /** Plus rotates into an × as the group opens (AntD behavior). */
57
+ export declare const iconOpen: import("@linaria/core").LinariaClassName;
58
+ export declare const descBox: import("@linaria/core").LinariaClassName;
@@ -0,0 +1,4 @@
1
+ export { default as FloatButton } from './FloatButton';
2
+ export type { FloatButtonProps } from './FloatButton';
3
+ export { default as FloatButtonGroup } from './FloatButtonGroup';
4
+ export type { FloatButtonGroupProps } from './FloatButtonGroup';