haze-ui 1.26.0 → 1.27.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 (392) 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 +454 -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 +185 -137
  19. package/dist/components/Chart/Chart.js +31 -0
  20. package/dist/components/Chart/chart-elements.js +88 -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 +0 -1
  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 +195 -76
  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 +390 -142
  46. package/dist/components/DataTable/features.js +25 -0
  47. package/dist/components/DataTable/index.js +2 -1
  48. package/dist/components/DataTable/summary.js +17 -0
  49. package/dist/components/DateRangePicker/DateRangePicker.js +10 -7
  50. package/dist/components/DateRangePicker/DateRangePickerCore.js +59 -27
  51. package/dist/components/Datepicker/Datepicker.js +16 -12
  52. package/dist/components/Datepicker/DatepickerCore.js +50 -37
  53. package/dist/components/Dialog/Dialog.js +56 -32
  54. package/dist/components/Divider/Divider.js +0 -1
  55. package/dist/components/Divider/index.js +0 -1
  56. package/dist/components/Drawer/Drawer.js +49 -29
  57. package/dist/components/DropdownMenu/DropdownMenu.js +38 -26
  58. package/dist/components/DropdownMenu/DropdownMenuSub.js +23 -0
  59. package/dist/components/DropdownMenu/DropdownMenuSubContent.js +24 -0
  60. package/dist/components/DropdownMenu/DropdownMenuSubTrigger.js +30 -0
  61. package/dist/components/DropdownMenu/index.js +4 -1
  62. package/dist/components/Flex/Flex.js +0 -1
  63. package/dist/components/Flex/index.js +0 -1
  64. package/dist/components/Fullscreen/Fullscreen.js +29 -0
  65. package/dist/components/Fullscreen/index.js +3 -0
  66. package/dist/components/Grid/Grid.js +0 -1
  67. package/dist/components/Grid/GridItem.js +0 -1
  68. package/dist/components/Grid/index.js +0 -1
  69. package/dist/components/Icon/Icon.js +0 -1
  70. package/dist/components/Icon/index.js +0 -1
  71. package/dist/components/Image/Image.js +37 -19
  72. package/dist/components/Image/ImagePreview.js +233 -0
  73. package/dist/components/Input/Input.js +6 -5
  74. package/dist/components/Input/InputCore.js +3 -2
  75. package/dist/components/Kbd/Kbd.js +0 -1
  76. package/dist/components/Kbd/index.js +0 -1
  77. package/dist/components/LocaleProvider/LocaleProvider.js +16 -13
  78. package/dist/components/LocaleProvider/index.js +2 -1
  79. package/dist/components/LocaleProvider/locale.js +58 -2
  80. package/dist/components/LocaleProvider/strings.js +15 -0
  81. package/dist/components/LocaleProvider/zh-cn.js +58 -2
  82. package/dist/components/Mentions/Mentions.js +6 -5
  83. package/dist/components/Mentions/MentionsCore.js +69 -68
  84. package/dist/components/Menu/Menu.js +5 -5
  85. package/dist/components/Menu/MenuSub.js +23 -0
  86. package/dist/components/Menu/MenuSubContent.js +24 -0
  87. package/dist/components/Menu/MenuSubTrigger.js +30 -0
  88. package/dist/components/Menu/index.js +4 -1
  89. package/dist/components/NumberInput/NumberInput.js +6 -5
  90. package/dist/components/NumberInput/NumberInputCore.js +9 -8
  91. package/dist/components/OTPInput/OTPInput.js +5 -4
  92. package/dist/components/OTPInput/OTPInputCore.js +34 -33
  93. package/dist/components/PasswordInput/PasswordInput.js +5 -4
  94. package/dist/components/PasswordInput/PasswordInputCore.js +8 -7
  95. package/dist/components/Popover/Popover.js +43 -31
  96. package/dist/components/PromptInput/PromptInput.js +213 -0
  97. package/dist/components/PromptInput/index.js +3 -0
  98. package/dist/components/Radio/Radio.js +7 -6
  99. package/dist/components/Radio/RadioGroup.js +5 -4
  100. package/dist/components/Radio/RadioGroupCore.js +23 -14
  101. package/dist/components/Rating/Rating.js +5 -4
  102. package/dist/components/Rating/RatingCore.js +62 -28
  103. package/dist/components/Resizable/index.js +1 -1
  104. package/dist/components/Segmented/Segmented.js +5 -4
  105. package/dist/components/Segmented/SegmentedCore.js +22 -18
  106. package/dist/components/Select/OptionGroup.js +12 -0
  107. package/dist/components/Select/Select.js +19 -9
  108. package/dist/components/Select/SelectCore.js +73 -13
  109. package/dist/components/Select/SelectFloating.js +248 -0
  110. package/dist/components/Select/index.js +5 -4
  111. package/dist/components/Select/select-options.js +57 -0
  112. package/dist/components/Sidebar/Sidebar.js +9 -9
  113. package/dist/components/Skeleton/Skeleton.js +0 -1
  114. package/dist/components/Skeleton/index.js +0 -1
  115. package/dist/components/Slider/Slider.js +16 -8
  116. package/dist/components/Slider/SliderCore.js +75 -12
  117. package/dist/components/Stat/Stat.js +0 -1
  118. package/dist/components/Stat/index.js +0 -1
  119. package/dist/components/Switch/Switch.js +6 -5
  120. package/dist/components/Switch/SwitchCore.js +3 -2
  121. package/dist/components/Tabs/Tab.js +7 -4
  122. package/dist/components/Tabs/TabList.js +38 -7
  123. package/dist/components/Tabs/TabPanel.js +4 -3
  124. package/dist/components/Tabs/Tabs.js +11 -6
  125. package/dist/components/TagGroup/TagGroup.js +19 -7
  126. package/dist/components/TagGroup/TagGroupItem.js +17 -11
  127. package/dist/components/TagInput/TagInput.js +10 -8
  128. package/dist/components/TagInput/TagInputCore.js +94 -57
  129. package/dist/components/Textarea/Textarea.js +6 -5
  130. package/dist/components/Textarea/TextareaCore.js +3 -2
  131. package/dist/components/TimePicker/TimePicker.js +6 -5
  132. package/dist/components/TimePicker/TimePickerCore.js +3 -2
  133. package/dist/components/Toast/Toast.js +23 -22
  134. package/dist/components/Toast/ToastContainer.js +67 -47
  135. package/dist/components/Toast/ToastContext.js +23 -4
  136. package/dist/components/Toast/toast2.js +63 -28
  137. package/dist/components/Toast/useToast.js +9 -7
  138. package/dist/components/Toggle/Toggle.js +20 -0
  139. package/dist/components/Toggle/ToggleCore.js +31 -0
  140. package/dist/components/Toggle/index.js +4 -0
  141. package/dist/components/Toolbar/Toolbar.js +33 -32
  142. package/dist/components/Toolbar/ToolbarToggle.js +31 -0
  143. package/dist/components/Toolbar/index.js +2 -1
  144. package/dist/components/Tooltip/Tooltip.js +1 -1
  145. package/dist/components/Tour/Tour.js +57 -53
  146. package/dist/components/Tree/Tree.js +199 -77
  147. package/dist/components/Tree/TreeItem.js +17 -15
  148. package/dist/components/Tree/utils.js +26 -10
  149. package/dist/components/Typography/Typography.js +0 -1
  150. package/dist/components/Typography/index.js +0 -1
  151. package/dist/components/Upload/Upload.js +21 -8
  152. package/dist/components/Upload/UploadCore.js +224 -37
  153. package/dist/components/Upload/UploadList.js +172 -0
  154. package/dist/components/Upload/xhr-upload.js +22 -0
  155. package/dist/components/VirtualList/VirtualList.js +84 -56
  156. package/dist/components/Watermark/Watermark.js +55 -0
  157. package/dist/components/Watermark/index.js +3 -0
  158. package/dist/css/anchor.css +2 -0
  159. package/dist/css/app-shell.css +2 -0
  160. package/dist/css/badge.css +1 -1
  161. package/dist/css/bottom-sheet.css +1 -1
  162. package/dist/css/button.css +1 -1
  163. package/dist/css/calendar.css +1 -1
  164. package/dist/css/cascader.css +1 -1
  165. package/dist/css/chart.css +2 -0
  166. package/dist/css/chat-container.css +1 -1
  167. package/dist/css/chat-message.css +1 -1
  168. package/dist/css/combobox.css +3 -2
  169. package/dist/css/command.css +2 -1
  170. package/dist/css/context-menu.css +1 -1
  171. package/dist/css/data-table.css +2 -1
  172. package/dist/css/date-range-picker.css +1 -1
  173. package/dist/css/datepicker.css +2 -2
  174. package/dist/css/dialog.css +1 -1
  175. package/dist/css/dropdown-menu.css +4 -1
  176. package/dist/css/image.css +2 -1
  177. package/dist/css/menu.css +4 -1
  178. package/dist/css/popover.css +1 -1
  179. package/dist/css/prompt-input.css +2 -0
  180. package/dist/css/rating.css +1 -1
  181. package/dist/css/select.css +3 -1
  182. package/dist/css/slider.css +1 -1
  183. package/dist/css/tag-group.css +2 -0
  184. package/dist/css/tag-input.css +3 -1
  185. package/dist/css/toggle.css +2 -0
  186. package/dist/css/toolbar.css +1 -0
  187. package/dist/css/tooltip.css +1 -1
  188. package/dist/css/tree.css +1 -1
  189. package/dist/css/upload.css +2 -1
  190. package/dist/css/watermark.css +2 -0
  191. package/dist/css-manifest.json +60 -1
  192. package/dist/form/FormItem.js +55 -50
  193. package/dist/form/FormList.js +79 -0
  194. package/dist/form/index.js +5 -1
  195. package/dist/form/standard-schema.js +16 -0
  196. package/dist/haze-ui.css +51 -27
  197. package/dist/headless/index.js +7 -0
  198. package/dist/hooks/useClickOutside.js +24 -0
  199. package/dist/hooks/useFullscreen.js +42 -0
  200. package/dist/hooks/useHotkeys.js +77 -0
  201. package/dist/hooks/useInView.js +27 -0
  202. package/dist/hooks/useLocalStorage.js +8 -0
  203. package/dist/hooks/useMediaQuery.js +2 -1
  204. package/dist/hooks/usePrevious.js +11 -0
  205. package/dist/hooks/useSessionStorage.js +8 -0
  206. package/dist/hooks/useStorageState.js +80 -0
  207. package/dist/index.js +205 -171
  208. package/dist/registry.json +2259 -91
  209. package/dist/tokens/colors.js +0 -1
  210. package/dist/tokens/index.js +0 -1
  211. package/dist/tokens/motion.js +0 -1
  212. package/dist/tokens/oklch.js +0 -1
  213. package/dist/tokens/palette.js +0 -1
  214. package/dist/tokens/registry.js +17 -28
  215. package/dist/tokens/spacing.js +0 -1
  216. package/dist/tokens/typography.js +0 -1
  217. package/dist/types/components/Anchor/Anchor.d.ts +25 -0
  218. package/dist/types/components/Anchor/index.d.ts +2 -0
  219. package/dist/types/components/AppShell/AppShell.d.ts +17 -0
  220. package/dist/types/components/AppShell/index.d.ts +2 -0
  221. package/dist/types/components/Badge/badge-styles.d.ts +21 -0
  222. package/dist/types/components/Badge/index.d.ts +1 -0
  223. package/dist/types/components/BottomSheet/BottomSheet.d.ts +52 -3
  224. package/dist/types/components/BottomSheet/index.d.ts +1 -1
  225. package/dist/types/components/Button/Button.d.ts +7 -0
  226. package/dist/types/components/Button/ButtonLink.d.ts +3 -0
  227. package/dist/types/components/Button/index.d.ts +1 -0
  228. package/dist/types/components/Button/styles.d.ts +17 -0
  229. package/dist/types/components/Calendar/Calendar.d.ts +71 -7
  230. package/dist/types/components/Calendar/date.d.ts +52 -0
  231. package/dist/types/components/Calendar/index.d.ts +1 -1
  232. package/dist/types/components/Cascader/Cascader.d.ts +29 -3
  233. package/dist/types/components/Chart/Chart.d.ts +29 -0
  234. package/dist/types/components/Chart/chart-elements.d.ts +52 -0
  235. package/dist/types/components/Chart/index.d.ts +2 -0
  236. package/dist/types/components/ChatContainer/ChatContainer.d.ts +18 -3
  237. package/dist/types/components/ChatInput/ChatInput.d.ts +11 -1
  238. package/dist/types/components/ChatMessage/ChatMessage.d.ts +13 -1
  239. package/dist/types/components/Checkbox/Checkbox.d.ts +6 -2
  240. package/dist/types/components/Checkbox/CheckboxCore.d.ts +4 -2
  241. package/dist/types/components/Collapsible/Collapsible.d.ts +24 -2
  242. package/dist/types/components/Collapsible/index.d.ts +1 -1
  243. package/dist/types/components/ColorPicker/ColorPicker.d.ts +7 -1
  244. package/dist/types/components/ColorPicker/ColorPickerCore.d.ts +7 -1
  245. package/dist/types/components/Combobox/Combobox.d.ts +101 -7
  246. package/dist/types/components/Combobox/ComboboxGroup.d.ts +22 -0
  247. package/dist/types/components/Combobox/ComboboxOption.d.ts +7 -2
  248. package/dist/types/components/Combobox/index.d.ts +3 -1
  249. package/dist/types/components/Command/Command.d.ts +70 -6
  250. package/dist/types/components/Command/CommandDialog.d.ts +36 -0
  251. package/dist/types/components/Command/command-filter.d.ts +34 -0
  252. package/dist/types/components/Command/index.d.ts +4 -2
  253. package/dist/types/components/DataTable/CellEditor.d.ts +24 -0
  254. package/dist/types/components/DataTable/DataTable.d.ts +149 -32
  255. package/dist/types/components/DataTable/features.d.ts +118 -0
  256. package/dist/types/components/DataTable/index.d.ts +2 -1
  257. package/dist/types/components/DataTable/summary.d.ts +19 -0
  258. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +15 -1
  259. package/dist/types/components/DateRangePicker/DateRangePickerCore.d.ts +26 -2
  260. package/dist/types/components/DateRangePicker/index.d.ts +1 -1
  261. package/dist/types/components/Datepicker/Datepicker.d.ts +17 -1
  262. package/dist/types/components/Datepicker/DatepickerCore.d.ts +24 -2
  263. package/dist/types/components/Datepicker/index.d.ts +1 -1
  264. package/dist/types/components/Dialog/Dialog.d.ts +68 -3
  265. package/dist/types/components/Dialog/index.d.ts +1 -1
  266. package/dist/types/components/Drawer/Drawer.d.ts +33 -3
  267. package/dist/types/components/Drawer/index.d.ts +1 -1
  268. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +23 -3
  269. package/dist/types/components/DropdownMenu/DropdownMenuSub.d.ts +18 -0
  270. package/dist/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +13 -0
  271. package/dist/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +14 -0
  272. package/dist/types/components/DropdownMenu/index.d.ts +7 -1
  273. package/dist/types/components/Fullscreen/Fullscreen.d.ts +34 -0
  274. package/dist/types/components/Fullscreen/index.d.ts +3 -0
  275. package/dist/types/components/Image/Image.d.ts +20 -5
  276. package/dist/types/components/Image/ImagePreview.d.ts +13 -0
  277. package/dist/types/components/Image/index.d.ts +1 -1
  278. package/dist/types/components/Input/Input.d.ts +5 -2
  279. package/dist/types/components/Input/InputCore.d.ts +4 -2
  280. package/dist/types/components/LocaleProvider/LocaleContext.d.ts +9 -0
  281. package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +12 -1
  282. package/dist/types/components/LocaleProvider/index.d.ts +2 -0
  283. package/dist/types/components/LocaleProvider/locale.d.ts +56 -0
  284. package/dist/types/components/LocaleProvider/strings.d.ts +28 -0
  285. package/dist/types/components/Mentions/Mentions.d.ts +5 -2
  286. package/dist/types/components/Mentions/MentionsCore.d.ts +4 -2
  287. package/dist/types/components/Menu/MenuSub.d.ts +18 -0
  288. package/dist/types/components/Menu/MenuSubContent.d.ts +12 -0
  289. package/dist/types/components/Menu/MenuSubTrigger.d.ts +14 -0
  290. package/dist/types/components/Menu/index.d.ts +6 -0
  291. package/dist/types/components/NumberInput/NumberInput.d.ts +5 -2
  292. package/dist/types/components/NumberInput/NumberInputCore.d.ts +4 -2
  293. package/dist/types/components/OTPInput/OTPInput.d.ts +5 -1
  294. package/dist/types/components/OTPInput/OTPInputCore.d.ts +4 -1
  295. package/dist/types/components/PasswordInput/PasswordInput.d.ts +5 -1
  296. package/dist/types/components/PasswordInput/PasswordInputCore.d.ts +4 -1
  297. package/dist/types/components/Popover/Popover.d.ts +41 -3
  298. package/dist/types/components/Popover/index.d.ts +1 -1
  299. package/dist/types/components/PromptInput/PromptInput.d.ts +46 -0
  300. package/dist/types/components/PromptInput/index.d.ts +2 -0
  301. package/dist/types/components/Radio/Radio.d.ts +5 -2
  302. package/dist/types/components/Radio/RadioGroup.d.ts +8 -2
  303. package/dist/types/components/Radio/RadioGroupCore.d.ts +7 -2
  304. package/dist/types/components/Rating/Rating.d.ts +8 -1
  305. package/dist/types/components/Rating/RatingCore.d.ts +7 -1
  306. package/dist/types/components/Resizable/index.d.ts +2 -0
  307. package/dist/types/components/Segmented/Segmented.d.ts +8 -1
  308. package/dist/types/components/Segmented/SegmentedCore.d.ts +7 -2
  309. package/dist/types/components/Select/OptionGroup.d.ts +16 -0
  310. package/dist/types/components/Select/Select.d.ts +66 -4
  311. package/dist/types/components/Select/SelectCore.d.ts +70 -6
  312. package/dist/types/components/Select/SelectFloating.d.ts +83 -0
  313. package/dist/types/components/Select/index.d.ts +2 -0
  314. package/dist/types/components/Select/select-options.d.ts +53 -0
  315. package/dist/types/components/Slider/Slider.d.ts +29 -4
  316. package/dist/types/components/Slider/SliderCore.d.ts +35 -6
  317. package/dist/types/components/Switch/Switch.d.ts +5 -2
  318. package/dist/types/components/Switch/SwitchCore.d.ts +4 -2
  319. package/dist/types/components/Tabs/TabList.d.ts +7 -0
  320. package/dist/types/components/Tabs/Tabs.d.ts +8 -1
  321. package/dist/types/components/Tabs/TabsContext.d.ts +20 -0
  322. package/dist/types/components/Tabs/index.d.ts +1 -0
  323. package/dist/types/components/TagGroup/TagGroup.d.ts +13 -1
  324. package/dist/types/components/TagInput/TagInput.d.ts +12 -1
  325. package/dist/types/components/TagInput/TagInputCore.d.ts +11 -1
  326. package/dist/types/components/Textarea/Textarea.d.ts +5 -2
  327. package/dist/types/components/Textarea/TextareaCore.d.ts +4 -2
  328. package/dist/types/components/TimePicker/TimePicker.d.ts +5 -2
  329. package/dist/types/components/TimePicker/TimePickerCore.d.ts +4 -2
  330. package/dist/types/components/Toast/Toast.d.ts +31 -2
  331. package/dist/types/components/Toast/ToastContainer.d.ts +11 -1
  332. package/dist/types/components/Toast/ToastContext.d.ts +44 -3
  333. package/dist/types/components/Toast/index.d.ts +1 -1
  334. package/dist/types/components/Toast/toast.d.ts +35 -4
  335. package/dist/types/components/Toast/useToast.d.ts +16 -4
  336. package/dist/types/components/Toggle/Toggle.d.ts +19 -0
  337. package/dist/types/components/Toggle/ToggleCore.d.ts +23 -0
  338. package/dist/types/components/Toggle/index.d.ts +4 -0
  339. package/dist/types/components/Toolbar/ToolbarToggle.d.ts +19 -0
  340. package/dist/types/components/Toolbar/index.d.ts +2 -0
  341. package/dist/types/components/Tour/Tour.d.ts +3 -3
  342. package/dist/types/components/Tree/Tree.d.ts +3 -3
  343. package/dist/types/components/Tree/TreeItem.d.ts +6 -1
  344. package/dist/types/components/Tree/types.d.ts +26 -0
  345. package/dist/types/components/Tree/utils.d.ts +32 -0
  346. package/dist/types/components/Upload/Upload.d.ts +38 -3
  347. package/dist/types/components/Upload/UploadCore.d.ts +75 -4
  348. package/dist/types/components/Upload/UploadList.d.ts +12 -0
  349. package/dist/types/components/Upload/index.d.ts +1 -0
  350. package/dist/types/components/Upload/types.d.ts +60 -0
  351. package/dist/types/components/Upload/xhr-upload.d.ts +20 -0
  352. package/dist/types/components/VirtualList/VirtualList.d.ts +16 -1
  353. package/dist/types/components/Watermark/Watermark.d.ts +32 -0
  354. package/dist/types/components/Watermark/index.d.ts +2 -0
  355. package/dist/types/form/FormItem.d.ts +33 -8
  356. package/dist/types/form/FormList.d.ts +113 -0
  357. package/dist/types/form/index.d.ts +26 -0
  358. package/dist/types/form/standard-schema.d.ts +30 -0
  359. package/dist/types/headless/index.d.ts +182 -0
  360. package/dist/types/hooks/index.d.ts +11 -0
  361. package/dist/types/hooks/useClickOutside.d.ts +46 -0
  362. package/dist/types/hooks/useFullscreen.d.ts +33 -0
  363. package/dist/types/hooks/useHotkeys.d.ts +53 -0
  364. package/dist/types/hooks/useInView.d.ts +32 -0
  365. package/dist/types/hooks/useLocalStorage.d.ts +33 -0
  366. package/dist/types/hooks/useMediaQuery.d.ts +3 -0
  367. package/dist/types/hooks/usePrevious.d.ts +18 -0
  368. package/dist/types/hooks/useSessionStorage.d.ts +26 -0
  369. package/dist/types/hooks/useStorageState.d.ts +12 -0
  370. package/dist/types/index.d.ts +57 -32
  371. package/dist/types/utils/collision.d.ts +39 -1
  372. package/dist/types/utils/direction.d.ts +22 -0
  373. package/dist/types/utils/floating.d.ts +32 -4
  374. package/dist/types/utils/focus-scope.d.ts +2 -1
  375. package/dist/types/utils/focus.d.ts +2 -1
  376. package/dist/types/utils/menuKeyboard.d.ts +19 -4
  377. package/dist/types/utils/refs.d.ts +16 -0
  378. package/dist/types/utils/sortable-shared.d.ts +42 -0
  379. package/dist/types/utils/sortable.d.ts +36 -0
  380. package/dist/types/utils/submenu.d.ts +63 -0
  381. package/dist/types/utils/view-transition.d.ts +28 -0
  382. package/dist/utils/classnames.js +0 -1
  383. package/dist/utils/collision.js +37 -26
  384. package/dist/utils/direction.js +34 -0
  385. package/dist/utils/floating.js +163 -143
  386. package/dist/utils/menuKeyboard.js +59 -46
  387. package/dist/utils/refs.js +9 -0
  388. package/dist/utils/sortable-shared.js +24 -0
  389. package/dist/utils/sortable.js +46 -0
  390. package/dist/utils/submenu.js +104 -0
  391. package/dist/utils/view-transition.js +26 -0
  392. package/package.json +109 -16
@@ -1,11 +1,40 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  type SliderCoreProps = {
3
- value: number;
4
- onChange: (value: number) => void;
3
+ /** `number` in single mode, `[low, high]` when `range` is set. An
4
+ * inverted tuple renders normalized (low ≤ high). */
5
+ value: number | [number, number];
6
+ /** Notifies the next value: `number` in single mode, `[low, high]` in
7
+ * range mode — a thumb driven past the other snaps against it, so the
8
+ * pair stays ordered. */
9
+ onChange: (value: number | [number, number]) => void;
5
10
  /** Native change event passthrough — invoked with the DOM event after
6
- * `onChange`, so a spread can never override the controlled callback. */
11
+ * `onChange`, so a spread can never override the controlled callback.
12
+ * In range mode the event is the changing input's. */
7
13
  onNativeChange?: ComponentPropsWithoutRef<'input'>['onChange'];
14
+ /**
15
+ * Range mode: the single input becomes two stacked native inputs
16
+ * (low thumb first in DOM and tab order) over a shared rail with a
17
+ * primary-colored fill between the thumbs. Each thumb steps
18
+ * independently, clamps to the shared min/max, and snaps against the
19
+ * other thumb instead of crossing it. The stacked inputs' tracks are
20
+ * transparent and pointer-transparent — only their thumbs take
21
+ * pointer input.
22
+ */
23
+ range?: boolean;
8
24
  className?: string;
9
- } & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'onChange'>;
10
- export default function SliderCore({ value, onChange, onNativeChange, className, ...rest }: SliderCoreProps): import("react").JSX.Element;
25
+ /**
26
+ * Single mode: forwarded to the input untouched. Range mode: a
27
+ * `[lowLabel, highLabel]` tuple labels each thumb; a bare string
28
+ * labels both thumbs (two identically named sliders are ambiguous —
29
+ * prefer the tuple). All other forwarded native props (min, max,
30
+ * step, disabled, …) apply to both inputs.
31
+ */
32
+ 'aria-label'?: string | [string, string];
33
+ /**
34
+ * Forwarded to the `<input type='range'>` — the only input in single
35
+ * mode, the low thumb (first tab stop) in range mode.
36
+ */
37
+ ref?: Ref<HTMLInputElement>;
38
+ } & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'onChange' | 'aria-label'>;
39
+ export default function SliderCore({ value, onChange, onNativeChange, range, className, onKeyDown, 'aria-label': ariaLabel, ref, ...rest }: SliderCoreProps): import("react").JSX.Element;
11
40
  export type { SliderCoreProps };
@@ -1,8 +1,11 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
3
  type SwitchProps = {
4
4
  checked?: ControlOrValue<boolean>;
5
5
  size?: 'sm' | 'md' | 'lg';
6
+ /** Forwarded to the underlying switch `<button>` — form bridges and
7
+ * `ref.current.focus()` reach. */
8
+ ref?: Ref<HTMLButtonElement>;
6
9
  } & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'checked' | 'onChange'>;
7
- export default function Switch({ checked: checkedControl, size, className, onClick, ...rest }: SwitchProps): import("react").JSX.Element;
10
+ export default function Switch({ checked: checkedControl, size, className, onClick, ref, ...rest }: SwitchProps): import("react").JSX.Element;
8
11
  export type { SwitchProps };
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  type SwitchCoreProps = {
3
3
  checked: boolean;
4
4
  onChange: (checked: boolean) => void;
@@ -7,6 +7,8 @@ type SwitchCoreProps = {
7
7
  onNativeClick?: ComponentPropsWithoutRef<'button'>['onClick'];
8
8
  size?: 'sm' | 'md' | 'lg';
9
9
  className?: string;
10
+ /** Forwarded to the switch `<button>` element. */
11
+ ref?: Ref<HTMLButtonElement>;
10
12
  } & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'checked' | 'onChange'>;
11
- export default function SwitchCore({ checked, onChange, onNativeClick, size, className, ...rest }: SwitchCoreProps): import("react").JSX.Element;
13
+ export default function SwitchCore({ checked, onChange, onNativeClick, size, className, ref, ...rest }: SwitchCoreProps): import("react").JSX.Element;
12
14
  export type { SwitchCoreProps };
@@ -3,5 +3,12 @@ type TabListProps = {
3
3
  className?: string;
4
4
  children: ReactNode;
5
5
  };
6
+ /**
7
+ * The tab strip: a roving-tabindex list per the WAI-ARIA tabs pattern —
8
+ * ←/→ move between tabs with wrapping and automatic activation
9
+ * (selection follows focus), Home/End jump to the ends. Under
10
+ * `dir="rtl"` the horizontal arrows mirror (← advances), read from the
11
+ * DOM at event time so the keys follow the mirrored strip.
12
+ */
6
13
  export default function TabList({ className, children }: TabListProps): import("react").JSX.Element;
7
14
  export type { TabListProps };
@@ -1,9 +1,16 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
+ import type { TabsClassNames } from './TabsContext';
3
4
  type TabsProps = {
4
5
  value?: ControlOrValue<string>;
6
+ /**
7
+ * Semantic slot classes (AntD v6 `classNames` shape): declared once
8
+ * here and distributed to every part through context — see
9
+ * {@link TabsClassNames}. Omitting it changes nothing.
10
+ */
11
+ classNames?: TabsClassNames;
5
12
  className?: string;
6
13
  children: ReactNode;
7
14
  };
8
- export default function Tabs({ value: valueControl, className, children, }: TabsProps): import("react").JSX.Element;
15
+ export default function Tabs({ value: valueControl, classNames, className, children, }: TabsProps): import("react").JSX.Element;
9
16
  export type { TabsProps };
@@ -1,7 +1,27 @@
1
1
  import type { Dispatch, SetStateAction } from 'react';
2
+ /**
3
+ * Semantic slot classes (AntD v6 `classNames` shape) for the Tabs
4
+ * family: declared once on the `<Tabs>` root and distributed to every
5
+ * part through context — the sub-components stay prop-light while one
6
+ * record themes the whole strip. Consumer classes are appended at the
7
+ * end of each part's class list (able to override component defaults);
8
+ * per-part `className` props remain for one-off tweaks and still land
9
+ * after the slot class.
10
+ */
11
+ export type TabsClassNames = {
12
+ /** The wrapper `<div>` `<Tabs>` renders. */
13
+ root?: string;
14
+ /** The `<TabList>` strip (`role="tablist"`). */
15
+ list?: string;
16
+ /** Every `<Tab>` button (`role="tab"`). */
17
+ tab?: string;
18
+ /** Every `<TabPanel>` (`role="tabpanel"`). */
19
+ panel?: string;
20
+ };
2
21
  type TabsContextValue = {
3
22
  value: string;
4
23
  setValue: Dispatch<SetStateAction<string>>;
24
+ classNames: TabsClassNames | undefined;
5
25
  };
6
26
  export declare const TabsProvider: import("react").Provider<TabsContextValue | undefined>;
7
27
  export declare function useTabsContext(): TabsContextValue;
@@ -1,5 +1,6 @@
1
1
  export { default as Tabs } from './Tabs';
2
2
  export type { TabsProps } from './Tabs';
3
+ export type { TabsClassNames } from './TabsContext';
3
4
  export { default as TabList } from './TabList';
4
5
  export type { TabListProps } from './TabList';
5
6
  export { default as Tab } from './Tab';
@@ -2,6 +2,18 @@ import type { ReactNode } from 'react';
2
2
  type TagGroupProps = {
3
3
  children: ReactNode;
4
4
  className?: string;
5
+ /**
6
+ * Opt-in drag-and-drop reordering (@dnd-kit optional peers). Each chip
7
+ * becomes draggable; keyboard: focus a chip, Space lifts, arrows move,
8
+ * Space drops, Escape cancels.
9
+ */
10
+ sortable?: boolean;
11
+ /**
12
+ * Receives `nextOrder` — the new sequence of original child indices —
13
+ * after a completed drag. Reorder the children you pass accordingly;
14
+ * without a handler a drop only animates back to the source position.
15
+ */
16
+ onReorder?: (nextOrder: number[]) => void;
5
17
  };
6
- export default function TagGroup({ children, className }: TagGroupProps): import("react").JSX.Element;
18
+ export default function TagGroup({ children, className, sortable, onReorder, }: TagGroupProps): import("react").JSX.Element;
7
19
  export type { TagGroupProps };
@@ -1,3 +1,4 @@
1
+ import type { Ref } from 'react';
1
2
  import type { ControlOrValue } from 'react-use-control';
2
3
  type TagInputProps = {
3
4
  value?: ControlOrValue<string[]>;
@@ -5,6 +6,13 @@ type TagInputProps = {
5
6
  placeholder?: string;
6
7
  maxTags?: number;
7
8
  disabled?: boolean;
9
+ /**
10
+ * Opt-in drag-and-drop tag reordering (@dnd-kit optional peers). Order
11
+ * changes leave through `onChange` with the new array — the same single
12
+ * exit as add/remove. Keyboard: focus a tag's label, Space lifts,
13
+ * arrows move, Space drops, Escape cancels.
14
+ */
15
+ sortable?: boolean;
8
16
  className?: string;
9
17
  /**
10
18
  * 字段 id(FormItem 桥生成):必须挂到内部可聚焦的 input 上而非根
@@ -16,6 +24,9 @@ type TagInputProps = {
16
24
  'aria-invalid'?: boolean;
17
25
  /** 指向 FormItem 渲染的错误 span(id={errorId}),透传给内部 input。 */
18
26
  'aria-describedby'?: string;
27
+ /** Forwarded to the inner text `<input>` (not the root div) — the
28
+ * element form bridges and `ref.current.focus()` reach. */
29
+ ref?: Ref<HTMLInputElement>;
19
30
  };
20
- export default function TagInput({ value: valueControl, onChange, placeholder, maxTags, disabled, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, }: TagInputProps): import("react").JSX.Element;
31
+ export default function TagInput({ value: valueControl, onChange, placeholder, maxTags, disabled, sortable, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, ref, }: TagInputProps): import("react").JSX.Element;
21
32
  export type { TagInputProps };
@@ -1,9 +1,17 @@
1
+ import type { Ref } from 'react';
1
2
  type TagInputCoreProps = {
2
3
  value: string[];
3
4
  onChange: (value: string[]) => void;
4
5
  placeholder?: string;
5
6
  maxTags?: number;
6
7
  disabled?: boolean;
8
+ /**
9
+ * Opt-in drag-and-drop tag reordering (@dnd-kit optional peers). Order
10
+ * changes leave through `onChange` with the new array — the same single
11
+ * exit as add/remove. Keyboard: focus a tag's label, Space lifts,
12
+ * arrows move, Space drops, Escape cancels.
13
+ */
14
+ sortable?: boolean;
7
15
  className?: string;
8
16
  /**
9
17
  * 字段 id(FormItem 桥生成):必须挂到内部可聚焦的 input 上而非根
@@ -15,6 +23,8 @@ type TagInputCoreProps = {
15
23
  'aria-invalid'?: boolean;
16
24
  /** 指向 FormItem 渲染的错误 span(id={errorId}),透传给内部 input。 */
17
25
  'aria-describedby'?: string;
26
+ /** Forwarded to the inner text `<input>` (not the root div). */
27
+ ref?: Ref<HTMLInputElement>;
18
28
  };
19
- export default function TagInputCore({ value: tags, onChange, placeholder, maxTags, disabled, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, }: TagInputCoreProps): import("react").JSX.Element;
29
+ export default function TagInputCore({ value: tags, onChange, placeholder, maxTags, disabled, sortable, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, ref, }: TagInputCoreProps): import("react").JSX.Element;
20
30
  export type { TagInputCoreProps };
@@ -1,8 +1,11 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
3
  type TextareaProps = {
4
4
  value?: ControlOrValue<string>;
5
5
  size?: 'sm' | 'md' | 'lg';
6
+ /** Forwarded to the underlying `<textarea>` — the element form bridges
7
+ * (react-f0rm `focusRef`), tests and `ref.current.focus()` reach. */
8
+ ref?: Ref<HTMLTextAreaElement>;
6
9
  } & Omit<ComponentPropsWithoutRef<'textarea'>, 'value'>;
7
- export default function Textarea({ value: valueControl, size, className, onChange, ...rest }: TextareaProps): import("react").JSX.Element;
10
+ export default function Textarea({ value: valueControl, size, className, onChange, ref, ...rest }: TextareaProps): import("react").JSX.Element;
8
11
  export type { TextareaProps };
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  type TextareaCoreProps = {
3
3
  value: string;
4
4
  onChange: (value: string) => void;
@@ -7,6 +7,8 @@ type TextareaCoreProps = {
7
7
  onNativeChange?: ComponentPropsWithoutRef<'textarea'>['onChange'];
8
8
  size?: 'sm' | 'md' | 'lg';
9
9
  className?: string;
10
+ /** Forwarded to the `<textarea>` element. */
11
+ ref?: Ref<HTMLTextAreaElement>;
10
12
  } & Omit<ComponentPropsWithoutRef<'textarea'>, 'value' | 'onChange' | 'size'>;
11
- export default function TextareaCore({ value, onChange, onNativeChange, size, className, ...rest }: TextareaCoreProps): import("react").JSX.Element;
13
+ export default function TextareaCore({ value, onChange, onNativeChange, size, className, ref, ...rest }: TextareaCoreProps): import("react").JSX.Element;
12
14
  export type { TextareaCoreProps };
@@ -1,10 +1,13 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
3
  type TimePickerProps = {
4
4
  value?: ControlOrValue<string>;
5
5
  onChange?: (value: string) => void;
6
6
  placeholder?: string;
7
7
  className?: string;
8
+ /** Forwarded to the underlying `<input>` — the element form bridges
9
+ * and `ref.current.focus()` reach. */
10
+ ref?: Ref<HTMLInputElement>;
8
11
  } & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'type' | 'placeholder'>;
9
- export default function TimePicker({ value: valueControl, onChange, placeholder, className, ...rest }: TimePickerProps): import("react").JSX.Element;
12
+ export default function TimePicker({ value: valueControl, onChange, placeholder, className, ref, ...rest }: TimePickerProps): import("react").JSX.Element;
10
13
  export type { TimePickerProps };
@@ -1,9 +1,11 @@
1
- import type { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
2
  type TimePickerCoreProps = {
3
3
  value: string;
4
4
  onChange: (value: string) => void;
5
5
  placeholder?: string;
6
6
  className?: string;
7
+ /** Forwarded to the `<input>` element. */
8
+ ref?: Ref<HTMLInputElement>;
7
9
  } & Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'type' | 'placeholder'>;
8
- export default function TimePickerCore({ value, onChange, placeholder, className, ...rest }: TimePickerCoreProps): import("react").JSX.Element;
10
+ export default function TimePickerCore({ value, onChange, placeholder, className, ref, ...rest }: TimePickerCoreProps): import("react").JSX.Element;
9
11
  export type { TimePickerCoreProps };
@@ -1,9 +1,38 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from 'react';
2
+ /**
3
+ * Semantic slot classes (AntD v6 `classNames` shape) for the toast
4
+ * family. Toasts are usually fired imperatively (`useToast()` /
5
+ * `toast()`), so the record is accepted by `ToastContainer` and flows
6
+ * to every toast it renders; a directly rendered `<Toast>` accepts the
7
+ * same record and reads the item slots. Consumer classes are appended
8
+ * at the end of each part's class list (able to override component
9
+ * defaults).
10
+ */
11
+ type ToastClassNames = {
12
+ /**
13
+ * The fixed-position toast stack. Only `ToastContainer` renders this
14
+ * part — a directly rendered `<Toast>` ignores the key.
15
+ */
16
+ viewport?: string;
17
+ /** One toast: the `role="status"`/`"alert"` card. */
18
+ item?: string;
19
+ /** The body wrapper around the toast content. */
20
+ content?: string;
21
+ /** The dismiss × button. */
22
+ close?: string;
23
+ };
2
24
  type ToastProps = {
3
25
  variant?: 'info' | 'success' | 'warning' | 'danger';
4
26
  onClose: () => void;
5
27
  duration: number;
6
28
  children: ReactNode;
29
+ /**
30
+ * Semantic slot classes (AntD v6 `classNames` shape) — see
31
+ * {@link ToastClassNames}. Only `item`/`content`/`close` apply to a
32
+ * directly rendered toast; `viewport` is a `ToastContainer` part.
33
+ * Omitting it changes nothing.
34
+ */
35
+ classNames?: ToastClassNames;
7
36
  } & Omit<ComponentPropsWithRef<'div'>, 'children' | 'onClose'>;
8
- export default function Toast({ variant, onClose, duration, children, className, ...rest }: ToastProps): import("react").JSX.Element;
9
- export type { ToastProps };
37
+ export default function Toast({ variant, onClose, duration, children, classNames, className, ...rest }: ToastProps): import("react").JSX.Element;
38
+ export type { ToastProps, ToastClassNames };
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { ToastClassNames } from './Toast';
2
3
  type ToastPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
3
4
  type ToastContainerProps = {
4
5
  children: ReactNode;
@@ -6,6 +7,15 @@ type ToastContainerProps = {
6
7
  maxCount?: number;
7
8
  /** Viewport edge the stack is pinned to. */
8
9
  placement?: ToastPlacement;
10
+ /**
11
+ * Semantic slot classes (AntD v6 `classNames` shape) for the whole
12
+ * toast family — `viewport` lands on the fixed stack this container
13
+ * renders, `item`/`content`/`close` flow to every toast (see
14
+ * {@link ToastClassNames}). Toasts are fired imperatively through
15
+ * `useToast()`/`toast()`, so this prop is the one place to theme
16
+ * them. Omitting it changes nothing.
17
+ */
18
+ classNames?: ToastClassNames;
9
19
  };
10
20
  export declare const toastPlacements: {
11
21
  readonly 'top-left': import("@linaria/core").LinariaClassName;
@@ -13,5 +23,5 @@ export declare const toastPlacements: {
13
23
  readonly 'bottom-left': import("@linaria/core").LinariaClassName;
14
24
  readonly 'bottom-right': import("@linaria/core").LinariaClassName;
15
25
  };
16
- export default function ToastContainer({ children, maxCount, placement, }: ToastContainerProps): import("react").JSX.Element;
26
+ export default function ToastContainer({ children, maxCount, placement, classNames, }: ToastContainerProps): import("react").JSX.Element;
17
27
  export type { ToastContainerProps, ToastPlacement };
@@ -1,15 +1,56 @@
1
1
  import type { ReactNode } from 'react';
2
+ type ToastVariant = 'info' | 'success' | 'warning' | 'danger';
2
3
  type ToastItem = {
3
4
  id: number;
4
- variant: 'info' | 'success' | 'warning' | 'danger';
5
+ variant: ToastVariant;
5
6
  content: ReactNode;
6
7
  duration: number;
7
8
  };
9
+ /**
10
+ * Patch accepted by `toast.update(id, patch)` and `useToast().update(id,
11
+ * patch)`. Only fields present in the patch change; an omitted (or
12
+ * undefined) field keeps the toast's current value.
13
+ */
14
+ type ToastUpdateOptions = {
15
+ /** Replacement message content. */
16
+ content?: ReactNode;
17
+ /** Replacement color variant. */
18
+ variant?: ToastVariant;
19
+ /** New auto-dismiss budget in ms. Changing it re-arms the countdown
20
+ * from the full value; leaving it out keeps the running countdown. */
21
+ duration?: number;
22
+ };
23
+ /** The `toast.promise` phases whose default copy lives in the locale pack. */
24
+ type ToastDeferredCopyKey = 'loading' | 'success' | 'error';
25
+ /**
26
+ * Sentinel ReactNode standing in for promise-phase copy that resolves
27
+ * against the locale pack at render time: `toast.promise` may fire from
28
+ * outside any React tree, so it cannot read `useStrings` itself — the
29
+ * container resolves the marker when it renders the toast. The sentinel
30
+ * rides the `content` channel as an opaque marker (cast once at the
31
+ * factory below); only the container ever interprets it.
32
+ */
33
+ type ToastDeferredCopy = {
34
+ readonly deferredCopy: ToastDeferredCopyKey;
35
+ };
36
+ /** Creates the locale-deferred sentinel for one promise phase. */
37
+ declare function deferredToastCopy(key: ToastDeferredCopyKey): ReactNode;
38
+ declare function deferredCopyKey(node: ReactNode): ToastDeferredCopyKey | null;
39
+ /**
40
+ * Pure merge of an update patch onto a toast item: keys absent (or
41
+ * undefined) in the patch keep the item's current value, so an update
42
+ * never clobbers fields it did not name.
43
+ */
44
+ declare function applyToastPatch(item: ToastItem, patch: ToastUpdateOptions): ToastItem;
8
45
  type ToastContextValue = {
9
46
  toasts: ToastItem[];
10
- addToast: (toast: Omit<ToastItem, 'id'>) => void;
47
+ addToast: (toast: Omit<ToastItem, 'id'>) => number;
11
48
  removeToast: (id: number) => void;
49
+ /** Patches a live toast in place — the same id and React key, so the
50
+ * enter/exit animations never replay (see `toast.update`). */
51
+ updateToast: (id: number, patch: ToastUpdateOptions) => void;
12
52
  };
13
53
  export declare const ToastProvider: import("react").Provider<ToastContextValue | undefined>;
14
54
  export declare function useToastContext(): ToastContextValue;
15
- export type { ToastItem, ToastContextValue };
55
+ export { applyToastPatch, deferredCopyKey, deferredToastCopy, };
56
+ export type { ToastDeferredCopy, ToastDeferredCopyKey, ToastItem, ToastContextValue, ToastUpdateOptions, ToastVariant, };
@@ -1,5 +1,5 @@
1
1
  export { default as Toast } from './Toast';
2
- export type { ToastProps } from './Toast';
2
+ export type { ToastProps, ToastClassNames } from './Toast';
3
3
  export { default as ToastContainer } from './ToastContainer';
4
4
  export type { ToastContainerProps } from './ToastContainer';
5
5
  export { default as useToast } from './useToast';
@@ -1,6 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { ToastItem } from './ToastContext';
3
- type ToastVariant = ToastItem['variant'];
2
+ import type { ToastDeferredCopyKey, ToastItem, ToastUpdateOptions, ToastVariant } from './ToastContext';
4
3
  /** Options accepted by `toast()` — the same call shape `useToast()` takes. */
5
4
  type ToastOptions = {
6
5
  variant?: ToastVariant;
@@ -8,10 +7,29 @@ type ToastOptions = {
8
7
  };
9
8
  /** Options accepted by the variant sugar methods (`toast.success()` …). */
10
9
  type ToastVariantOptions = Omit<ToastOptions, 'variant'>;
10
+ /** Copy for one `toast.promise` phase: a literal, or derived from the
11
+ * settled value / rejection when the promise settles. */
12
+ type ToastPhaseContent<T> = ReactNode | ((data: T) => ReactNode);
13
+ /** Options accepted by `toast.promise(promise, options)`. */
14
+ type ToastPromiseOptions<T> = {
15
+ /** Copy shown while the promise is pending. Defaults to the locale
16
+ * pack's `toast.loading`. The loading toast never auto-dismisses. */
17
+ loading?: ReactNode;
18
+ /** Copy shown once the promise resolves; a function receives the
19
+ * resolved value. Defaults to the locale pack's `toast.success`. */
20
+ success?: ToastPhaseContent<T>;
21
+ /** Copy shown once the promise rejects; a function receives the
22
+ * rejection value. Defaults to the locale pack's `toast.error`. */
23
+ error?: ToastPhaseContent<unknown>;
24
+ /** Auto-dismiss delay in ms applied once the promise settles — the
25
+ * loading toast stays until then. Defaults to 3000. */
26
+ duration?: number;
27
+ };
11
28
  /** Sink a mounted `ToastContainer` registers to receive imperative calls. */
12
29
  type ToastChannel = {
13
30
  onToast: (item: ToastItem) => void;
14
31
  onDismiss: (id?: number) => void;
32
+ onUpdate: (id: number, patch: ToastUpdateOptions) => void;
15
33
  };
16
34
  /**
17
35
  * The single id sequence, shared by this module and the container's
@@ -21,7 +39,8 @@ export declare function nextToastId(): number;
21
39
  /**
22
40
  * Fires a toast without `useToast` — module-level, callable from anywhere
23
41
  * (outside React, in event callbacks, before a container has mounted).
24
- * Returns the toast id, usable with `toast.dismiss(id)`.
42
+ * Returns the toast id, usable with `toast.dismiss(id)` and
43
+ * `toast.update(id, patch)`.
25
44
  *
26
45
  * Mirrors the `useToast()` call shape (content + `{variant, duration}`,
27
46
  * defaulting to `info` / 3000ms). With no container mounted the toast is
@@ -35,7 +54,19 @@ declare namespace toast {
35
54
  var warning: (content: ReactNode, options?: ToastVariantOptions) => number;
36
55
  var danger: (content: ReactNode, options?: ToastVariantOptions) => number;
37
56
  var dismiss: (id?: number) => void;
57
+ var update: (id: number, patch: ToastUpdateOptions) => void;
58
+ var promise: <T>(p: Promise<T>, options?: ToastPromiseOptions<T>) => Promise<T>;
38
59
  }
60
+ /**
61
+ * Shared engine behind `toast.promise` and `useToast().promise`: fires the
62
+ * loading toast through `show` (persistent — duration 0), then patches it
63
+ * in place when the promise settles, so the toast never remounts and its
64
+ * animations never replay. Returns the original promise untouched:
65
+ * rejections keep propagating to the caller's `await`/`catch`, and a
66
+ * loading toast dismissed before settling is simply not found by the
67
+ * update — it never resurrects.
68
+ */
69
+ export declare function driveToastPromise<T>(show: (content: ReactNode, options?: ToastOptions) => number, updateById: (id: number, patch: ToastUpdateOptions) => void, promise: Promise<T>, options?: ToastPromiseOptions<T>): Promise<T>;
39
70
  /**
40
71
  * Called from `ToastContainer`'s mount effect. The first subscriber also
41
72
  * replays everything queued before any container existed, in call order;
@@ -43,4 +74,4 @@ declare namespace toast {
43
74
  */
44
75
  export declare function subscribeToastChannel(channel: ToastChannel): () => void;
45
76
  export { toast };
46
- export type { ToastOptions, ToastVariant, ToastVariantOptions };
77
+ export type { ToastDeferredCopyKey, ToastOptions, ToastPhaseContent, ToastPromiseOptions, ToastUpdateOptions, ToastVariant, ToastVariantOptions, };
@@ -1,5 +1,17 @@
1
1
  import type { ReactNode } from 'react';
2
- export default function useToast(): (content: ReactNode, options?: {
3
- variant?: "info" | "success" | "warning" | "danger";
4
- duration?: number;
5
- }) => void;
2
+ import type { ToastOptions, ToastPromiseOptions, ToastUpdateOptions } from './toast';
3
+ /**
4
+ * The `useToast()` return value: the toast trigger itself (returns the id,
5
+ * usable with `update`) plus `update` and `promise` — one-to-one with the
6
+ * module-level `toast` API, but routed through the enclosing container's
7
+ * context instead of the first-mounted channel subscriber.
8
+ */
9
+ type ShowToast = {
10
+ (content: ReactNode, options?: ToastOptions): number;
11
+ /** Patches a toast in place — see `toast.update`. */
12
+ update: (id: number, patch: ToastUpdateOptions) => void;
13
+ /** Loading → success/danger lifecycle — see `toast.promise`. */
14
+ promise: <T>(promise: Promise<T>, options?: ToastPromiseOptions<T>) => Promise<T>;
15
+ };
16
+ export default function useToast(): ShowToast;
17
+ export type { ShowToast };
@@ -0,0 +1,19 @@
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ type ToggleProps = {
4
+ /** Whether the toggle is pressed; a control for full external ownership. */
5
+ pressed?: ControlOrValue<boolean>;
6
+ size?: 'sm' | 'md' | 'lg';
7
+ /** Equal padding on all sides — for icon-only square toggles. */
8
+ square?: boolean;
9
+ /** Forwarded to the underlying `<button>` — form bridges and
10
+ * `ref.current.focus()` reach. */
11
+ ref?: Ref<HTMLButtonElement>;
12
+ } & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'aria-pressed'>;
13
+ /**
14
+ * A momentary pressed-state button (aria-pressed) for one-shot modes —
15
+ * bold, mute, grid/list view. `pressed` is one prop, two modes: a plain
16
+ * boolean leaves state internal, a control hands ownership to the caller.
17
+ */
18
+ export default function Toggle({ pressed: pressedControl, size, square, className, onClick, ref, ...rest }: ToggleProps): import("react").JSX.Element;
19
+ export type { ToggleProps };
@@ -0,0 +1,23 @@
1
+ import type { ComponentPropsWithoutRef, Ref } from 'react';
2
+ type ToggleCoreProps = {
3
+ pressed: boolean;
4
+ onPressedChange: (pressed: boolean) => void;
5
+ /** Native click event passthrough — invoked with the DOM event after
6
+ * `onPressedChange`, so a spread can never override the controlled callback. */
7
+ onNativeClick?: ComponentPropsWithoutRef<'button'>['onClick'];
8
+ size?: 'sm' | 'md' | 'lg';
9
+ /** Equal padding on all sides — for icon-only square toggles. */
10
+ square?: boolean;
11
+ className?: string;
12
+ /** Forwarded to the `<button>` element. */
13
+ ref?: Ref<HTMLButtonElement>;
14
+ } & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'aria-pressed'>;
15
+ /**
16
+ * The controlled half of Toggle: a momentary pressed-state button
17
+ * (`<button aria-pressed>`) — one-shot commands like bold/mute, not the
18
+ * on/off *setting* that Switch's `role="switch"` carries. State never
19
+ * lives here: it renders `pressed` and reports clicks through
20
+ * `onPressedChange`, so the sugar (or any owner) owns the truth.
21
+ */
22
+ export default function ToggleCore({ pressed, onPressedChange, onNativeClick, size, square, className, ref, ...rest }: ToggleCoreProps): import("react").JSX.Element;
23
+ export type { ToggleCoreProps };
@@ -0,0 +1,4 @@
1
+ export { default as Toggle } from './Toggle';
2
+ export type { ToggleProps } from './Toggle';
3
+ export { default as ToggleCore } from './ToggleCore';
4
+ export type { ToggleCoreProps } from './ToggleCore';
@@ -0,0 +1,19 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ /**
4
+ * A toolbar item that toggles: ToolbarButton's skin and roving behavior
5
+ * with a pressed state of its own. `pressed` is self-contained by
6
+ * default (no external wiring needed) and switches to external ownership
7
+ * when passed a control. The pressed look is keyed off `aria-pressed`,
8
+ * so the visual state can never drift from what assistive tech announces.
9
+ */
10
+ type ToolbarToggleProps = {
11
+ /** Whether the item is pressed; a control for full external ownership. */
12
+ pressed?: ControlOrValue<boolean>;
13
+ variant?: 'solid' | 'outline' | 'ghost';
14
+ size?: 'sm' | 'md' | 'lg';
15
+ /** Equal padding on all sides — for icon-only square items. */
16
+ square?: boolean;
17
+ } & Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'aria-pressed'>;
18
+ export default function ToolbarToggle({ pressed: pressedControl, variant, size, square, className, onClick, ...rest }: ToolbarToggleProps): import("react").JSX.Element;
19
+ export type { ToolbarToggleProps };
@@ -4,3 +4,5 @@ export { default as ToolbarButton } from './ToolbarButton';
4
4
  export type { ToolbarButtonProps } from './ToolbarButton';
5
5
  export { default as ToolbarSeparator } from './ToolbarSeparator';
6
6
  export type { ToolbarSeparatorProps } from './ToolbarSeparator';
7
+ export { default as ToolbarToggle } from './ToolbarToggle';
8
+ export type { ToolbarToggleProps } from './ToolbarToggle';
@@ -4,9 +4,9 @@ import type { FloatingPlacement } from '../../utils/floating';
4
4
  /** Why the tour closed: the last step's Done button vs. an early exit. */
5
5
  type TourCloseReason = 'done' | 'skip';
6
6
  /**
7
- * Step-card placement relative to the spotlighted target — physical
8
- * semantics, the anchorable subset of FloatingPlacement ('point' has no
9
- * meaning without a floating trigger pair).
7
+ * Step-card placement relative to the spotlighted target — logical
8
+ * semantics (mirrors under RTL, like FloatingPlacement), the anchorable
9
+ * subset ('point' has no meaning without a floating trigger pair).
10
10
  */
11
11
  type TourPlacement = Exclude<FloatingPlacement, 'point'>;
12
12
  type TourStep = {
@@ -1,3 +1,3 @@
1
- import type { TreeProps } from './types';
2
- export default function Tree({ treeData, multiple, checkable, checkStrictly, selectable, disabled, blockNode, showLine, showIcon, switcherIcon, loadingIcon, titleRender, iconRender, expandedKeys: expandedKeysControl, selectedKeys: selectedKeysControl, checkedKeys: checkedKeysControl, className, onExpand, onSelect, onCheck, }: TreeProps): import("react").JSX.Element;
3
- export type { TreeProps };
1
+ import type { TreeProps, TreeVirtualizedConfig } from './types';
2
+ export default function Tree({ treeData, multiple, checkable, checkStrictly, selectable, disabled, blockNode, showLine, showIcon, switcherIcon, loadingIcon, titleRender, iconRender, virtualized, expandedKeys: expandedKeysControl, selectedKeys: selectedKeysControl, checkedKeys: checkedKeysControl, className, onExpand, onSelect, onCheck, }: TreeProps): import("react").JSX.Element;
3
+ export type { TreeProps, TreeVirtualizedConfig };