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
@@ -0,0 +1,53 @@
1
+ import type { ReactNode } from 'react';
2
+ /** One selectable entry extracted from the Select's JSX children. */
3
+ export type SelectOptionData = {
4
+ value: string;
5
+ label: ReactNode;
6
+ };
7
+ /**
8
+ * One rendering slot of the Select's children: a top-level option, or a
9
+ * labelled group of options (from `<OptionGroup>` / plain `<optgroup>`).
10
+ * The flat keyboard-navigation order is the depth-first traversal of
11
+ * this structure, so highlighting runs continuously across groups.
12
+ */
13
+ export type SelectEntryData = {
14
+ kind: 'option';
15
+ option: SelectOptionData;
16
+ } | {
17
+ kind: 'group';
18
+ label: string;
19
+ options: SelectOptionData[];
20
+ };
21
+ /**
22
+ * Flattens the Select's children — <Option> and plain <option> elements
23
+ * are both accepted — into the {value, label} list. <OptionGroup> /
24
+ * <optgroup> wrappers contribute their nested options in document
25
+ * order. Children without a resolvable value are ignored, the same way
26
+ * a native select treats stray non-option nodes.
27
+ */
28
+ export declare function extractSelectOptions(children: ReactNode): SelectOptionData[];
29
+ /**
30
+ * Extracts the Select's children preserving the grouping structure:
31
+ * top-level options stay single entries, <OptionGroup>/<optgroup>
32
+ * wrappers become group entries with their nested options. Group
33
+ * nesting is not recursive — a native <optgroup> cannot contain another
34
+ * group — and groups left without any resolvable option are dropped.
35
+ */
36
+ export declare function extractSelectEntries(children: ReactNode): SelectEntryData[];
37
+ /** Depth-first flattening of the entry structure (groups in document
38
+ * order) — the order keyboard navigation walks. */
39
+ export declare function flattenSelectEntries(entries: SelectEntryData[]): SelectOptionData[];
40
+ /**
41
+ * Textual form of an option's label for string-only contexts: the
42
+ * search filter and the `+N` overflow tooltip. String/number labels
43
+ * pass through; element labels contribute their concatenated text
44
+ * content (nested arrays and elements are walked).
45
+ */
46
+ export declare function selectOptionText(label: ReactNode): string;
47
+ /**
48
+ * Case-insensitive substring filter over the entry structure. An empty
49
+ * (or whitespace-only) query returns the entries unchanged; groups
50
+ * whose options all miss the query are dropped entirely, keeping the
51
+ * rendered list free of orphaned headers.
52
+ */
53
+ export declare function filterSelectEntries(entries: SelectEntryData[], query: string): SelectEntryData[];
@@ -0,0 +1,51 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ /**
4
+ * Handwriting signature pad on a `<canvas>`.
5
+ *
6
+ * `value` is the committed signature as a PNG `data:` URL (empty string
7
+ * when the pad is blank) — it is an *output*: committed on every stroke
8
+ * end, `Undo` and `Clear` follow the same path. Painting an initial
9
+ * `data:` URL back onto the canvas is not supported (the canvas is the
10
+ * input device; persist the committed string, e.g. into a form field).
11
+ * `onChange` fires with the new string on every commit.
12
+ *
13
+ * Pointer Events drive the drawing (`setPointerCapture` keeps the
14
+ * stroke alive outside the canvas bounds); the drawing scales for
15
+ * high-DPI screens via `devicePixelRatio`. When the canvas 2d context
16
+ * is unavailable (jsdom, ancient engines) the pad degrades to a notice
17
+ * instead of a broken input — the Watermark precedent.
18
+ *
19
+ * Visible copy is localized through the LocaleProvider packs
20
+ * (`signature` section): `clearLabel`, `undoLabel` and
21
+ * `unsupportedLabel` override the pack per instance.
22
+ */
23
+ type SignatureProps = {
24
+ /** Committed signature as a PNG data URL; a Control receives every
25
+ * commit live, a plain string seeds the committed state. */
26
+ value?: ControlOrValue<string>;
27
+ /** Fires with the committed data URL (or `''` when blank) on stroke
28
+ * end, undo and clear. */
29
+ onChange?: (value: string) => void;
30
+ /** Label of the clear button. Default from `signature.clear`. */
31
+ clearLabel?: string;
32
+ /** Label of the undo button. Default from `signature.undo`. */
33
+ undoLabel?: string;
34
+ /** Notice rendered instead of the pad when the canvas 2d context
35
+ * is unavailable. Default from `signature.unsupported`. */
36
+ unsupportedLabel?: string;
37
+ /** Canvas CSS width in px. */
38
+ width?: number;
39
+ /** Canvas CSS height in px. */
40
+ height?: number;
41
+ /** Locks drawing and the toolbar. */
42
+ disabled?: boolean;
43
+ /** Pen stroke color; any CSS color. Defaults to the theme's
44
+ * `--haze-color-text` (resolved from the canvas element at stroke
45
+ * time — a canvas cannot consume `var()` directly). */
46
+ penColor?: string;
47
+ /** Pen stroke width in px. */
48
+ penWidth?: number;
49
+ } & Omit<ComponentPropsWithoutRef<'div'>, 'onChange'>;
50
+ export default function Signature({ value: valueControl, onChange, clearLabel, undoLabel, unsupportedLabel, width, height, disabled, penColor, penWidth, className, ...rest }: SignatureProps): import("react").JSX.Element;
51
+ export type { SignatureProps };
@@ -0,0 +1,2 @@
1
+ export { default as Signature } from './Signature';
2
+ export type { SignatureProps } from './Signature';
@@ -0,0 +1,31 @@
1
+ /** Canvas-space point of a signature stroke. */
2
+ export type SignaturePoint = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ /** Euclidean distance between two points. */
7
+ export declare function pointDistance(a: SignaturePoint, b: SignaturePoint): number;
8
+ /**
9
+ * Map pointer client coordinates onto the canvas coordinate space
10
+ * (CSS pixels after the high-DPI `ctx.scale` — device pixels never leak
11
+ * into stroke data). `rect` is the canvas's `getBoundingClientRect()`.
12
+ */
13
+ export declare function getCanvasPoint(clientX: number, clientY: number, rect: {
14
+ left: number;
15
+ top: number;
16
+ }): SignaturePoint;
17
+ /**
18
+ * Drop points that move less than `minDistance` from their predecessor
19
+ * (pointer-event streams over-sample stationary contact). The first and
20
+ * last points of the stroke are always kept — the last one carries the
21
+ * stroke's true endpoint. An input of fewer than two points returns a
22
+ * copy unchanged.
23
+ */
24
+ export declare function normalizeStroke(stroke: SignaturePoint[], minDistance: number): SignaturePoint[];
25
+ /**
26
+ * Compact deterministic serialization of a stroke set —
27
+ * `"x,y x,y|x,y"` — used to detect whether a commit (stroke end, undo,
28
+ * clear) actually changed the drawing, so redundant events are not
29
+ * fired.
30
+ */
31
+ export declare function serializeStrokes(strokes: SignaturePoint[][]): string;
@@ -1,7 +1,32 @@
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 SliderProps = {
4
- value?: ControlOrValue<number>;
5
- } & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value'>;
6
- export default function Slider({ value: valueControl, className, onChange, ...rest }: SliderProps): import("react").JSX.Element;
4
+ /** `number` in single mode, `[low, high]` when `range` is set. */
5
+ value?: ControlOrValue<number | [number, number]>;
6
+ /**
7
+ * Range mode (two thumbs; see SliderCoreProps.range). The uncontrolled
8
+ * default is `[min ?? 0, max ?? 100]` in this mode, `50` otherwise.
9
+ */
10
+ range?: boolean;
11
+ /**
12
+ * Value callback for both modes: `number` in single mode,
13
+ * `[low, high]` when `range` is set — fired after the value updates.
14
+ * The native input `change` event stays available through `onChange`
15
+ * (the historical contract; in range mode it fires for the input
16
+ * currently changing).
17
+ */
18
+ onValuesChange?: (value: number | [number, number]) => void;
19
+ /**
20
+ * Forwarded to the input. In range mode a `[lowLabel, highLabel]`
21
+ * tuple labels each thumb; a bare string labels both thumbs (two
22
+ * identically named sliders are ambiguous — prefer the tuple).
23
+ */
24
+ 'aria-label'?: string | [string, string];
25
+ /**
26
+ * Forwarded to the `<input type='range'>` — the only input in single
27
+ * mode, the low thumb (first tab stop) in range mode.
28
+ */
29
+ ref?: Ref<HTMLInputElement>;
30
+ } & Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'value' | 'aria-label'>;
31
+ export default function Slider({ value: valueControl, range, className, onChange, onValuesChange, ref, ...rest }: SliderProps): import("react").JSX.Element;
7
32
  export type { SliderProps };
@@ -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 };
@@ -0,0 +1,37 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ /** One cited source: a numbered entry whose title optionally links out. */
4
+ type SourceItem = {
5
+ /** Stable identity — the list key and the unit of `expanded`. */
6
+ id: string;
7
+ title: ReactNode;
8
+ /** When present the title becomes an external link (safe rel, new tab). */
9
+ url?: string;
10
+ /** Excerpt quoted from the source; revealed on hover/focus or `expanded`. */
11
+ snippet?: ReactNode;
12
+ };
13
+ type SourcesProps = {
14
+ items: SourceItem[];
15
+ /**
16
+ * Compact footnote form: an inline `nav` of `[1] [2] [3]` badges
17
+ * (each linking out when `url` is set) instead of the full list.
18
+ */
19
+ compact?: boolean;
20
+ /**
21
+ * Ids of the items whose snippet stays expanded regardless of
22
+ * hover/focus. Controllable: pass a control to own the toggle state.
23
+ */
24
+ expanded?: ControlOrValue<readonly string[]>;
25
+ /** Accessible name for the list (`compact`: the nav landmark).
26
+ * Default from `sources.label` in the locale packs. */
27
+ label?: string;
28
+ /** `aria-label` of a collapsed item's excerpt toggle button.
29
+ * Default from `sources.expand`. */
30
+ expandLabel?: string;
31
+ /** `aria-label` of an expanded item's excerpt toggle button.
32
+ * Default from `sources.collapse`. */
33
+ collapseLabel?: string;
34
+ className?: string;
35
+ } & Omit<ComponentPropsWithoutRef<'ol'>, 'children'>;
36
+ export default function Sources({ items, compact, expanded: expandedControl, label, expandLabel, collapseLabel, className, ...rest }: SourcesProps): import("react").JSX.Element;
37
+ export type { SourcesProps, SourceItem };
@@ -0,0 +1,2 @@
1
+ export { default as Sources } from './Sources';
2
+ export type { SourcesProps, SourceItem } from './Sources';
@@ -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';
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Drag-and-drop reorderable variant of TagGroup — built on @dnd-kit
4
+ * (optional peers), so this module statically imports the dnd runtime;
5
+ * the plain TagGroup stays free of it. Each chip becomes draggable;
6
+ * keyboard: focus a chip, Space lifts, arrows move, Space drops, Escape
7
+ * cancels.
8
+ */
9
+ type SortableTagGroupProps = {
10
+ children: ReactNode;
11
+ className?: string;
12
+ /**
13
+ * Receives `nextOrder` — the new sequence of original child indices —
14
+ * after a completed drag. Reorder the children you pass accordingly;
15
+ * without a handler a drop only animates back to the source position.
16
+ */
17
+ onReorder?: (nextOrder: number[]) => void;
18
+ };
19
+ export default function SortableTagGroup({ children, className, onReorder, }: SortableTagGroupProps): import("react").JSX.Element;
20
+ export type { SortableTagGroupProps };
@@ -3,5 +3,8 @@ type TagGroupProps = {
3
3
  children: ReactNode;
4
4
  className?: string;
5
5
  };
6
+ /** Plain non-draggable tag row. For drag-and-drop reordering use
7
+ * SortableTagGroup (which statically imports the dnd-kit optional peers);
8
+ * this base component stays free of the dnd runtime. */
6
9
  export default function TagGroup({ children, className }: TagGroupProps): import("react").JSX.Element;
7
10
  export type { TagGroupProps };
@@ -1,4 +1,6 @@
1
1
  export { default as TagGroup } from './TagGroup';
2
2
  export { default as TagGroupItem } from './TagGroupItem';
3
+ export { default as SortableTagGroup } from './SortableTagGroup';
3
4
  export type { TagGroupProps } from './TagGroup';
4
5
  export type { TagGroupItemProps } from './TagGroupItem';
6
+ export type { SortableTagGroupProps } from './SortableTagGroup';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared skin of the TagGroup family: the plain passthrough (TagGroup) and
3
+ * the dnd-backed variant (SortableTagGroup) render the same wrapper, so
4
+ * the class lives in one prefixed sibling file (Linaria slugs derive from
5
+ * the file basename — bare `styles.ts` siblings collide across families).
6
+ */
7
+ export declare const group: import("@linaria/core").LinariaClassName;
@@ -0,0 +1,34 @@
1
+ import type { Ref } from 'react';
2
+ import type { ControlOrValue } from 'react-use-control';
3
+ type SortableTagInputProps = {
4
+ value?: ControlOrValue<string[]>;
5
+ onChange?: (value: string[]) => void;
6
+ placeholder?: string;
7
+ maxTags?: number;
8
+ disabled?: boolean;
9
+ className?: string;
10
+ /**
11
+ * 字段 id(FormItem 桥生成):必须挂到内部可聚焦的 input 上而非根
12
+ * div,<label htmlFor> 与错误 span 的 aria 链路才能接到焦点元素——
13
+ * 根 div 不聚焦,挂那里等于断链。
14
+ */
15
+ id?: string;
16
+ /** 由 FormItem 桥传入,随字段错误态变化,透传给内部 input。 */
17
+ 'aria-invalid'?: boolean;
18
+ /** 指向 FormItem 渲染的错误 span(id={errorId}),透传给内部 input。 */
19
+ 'aria-describedby'?: string;
20
+ /** Forwarded to the inner text `<input>` (not the root div) — the
21
+ * element form bridges and `ref.current.focus()` reach. */
22
+ ref?: Ref<HTMLInputElement>;
23
+ };
24
+ /**
25
+ * Controllable-state sugar over `SortableTagInputCore`: drag-and-drop tag
26
+ * reordering built on the @dnd-kit optional peers — install
27
+ * `@dnd-kit/core`, `@dnd-kit/sortable` and `@dnd-kit/utilities` to use
28
+ * it (the plain `TagInput` never touches them). Reorders leave through
29
+ * `onChange` with the new array — the same single exit as add/remove.
30
+ * Keyboard: focus a tag's label, Space lifts, arrows move, Space drops,
31
+ * Escape cancels.
32
+ */
33
+ export default function SortableTagInput({ value: valueControl, onChange, placeholder, maxTags, disabled, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, ref, }: SortableTagInputProps): import("react").JSX.Element;
34
+ export type { SortableTagInputProps };
@@ -0,0 +1,18 @@
1
+ import type { TagInputCoreProps } from './TagInputCore';
2
+ /**
3
+ * Props for `SortableTagInputCore` — the full `TagInputCoreProps` field
4
+ * set (value/onChange/placeholder/maxTags/disabled/className/id/aria/ref)
5
+ * minus the internal injection seams, which drag reordering replaces.
6
+ */
7
+ type SortableTagInputCoreProps = Omit<TagInputCoreProps, 'renderTag' | 'wrapTagList'>;
8
+ /**
9
+ * Drag-and-drop tag reordering over the @dnd-kit optional peers. This
10
+ * component statically imports `@dnd-kit/core`, `@dnd-kit/sortable` and
11
+ * `@dnd-kit/utilities` — install the trio to use it (the plain
12
+ * `TagInputCore` never touches them). Reorders leave through `onChange`
13
+ * with the new array — the same single exit as add/remove. Keyboard:
14
+ * focus a tag's label, Space lifts, arrows move, Space drops, Escape
15
+ * cancels.
16
+ */
17
+ export default function SortableTagInputCore(props: SortableTagInputCoreProps): import("react").JSX.Element;
18
+ export type { SortableTagInputCoreProps };
@@ -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[]>;
@@ -16,6 +17,9 @@ type TagInputProps = {
16
17
  'aria-invalid'?: boolean;
17
18
  /** 指向 FormItem 渲染的错误 span(id={errorId}),透传给内部 input。 */
18
19
  'aria-describedby'?: string;
20
+ /** Forwarded to the inner text `<input>` (not the root div) — the
21
+ * element form bridges and `ref.current.focus()` reach. */
22
+ ref?: Ref<HTMLInputElement>;
19
23
  };
20
- export default function TagInput({ value: valueControl, onChange, placeholder, maxTags, disabled, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, }: TagInputProps): import("react").JSX.Element;
24
+ export default function TagInput({ value: valueControl, onChange, placeholder, maxTags, disabled, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, ref, }: TagInputProps): import("react").JSX.Element;
21
25
  export type { TagInputProps };
@@ -1,3 +1,4 @@
1
+ import type { Ref } from 'react';
1
2
  type TagInputCoreProps = {
2
3
  value: string[];
3
4
  onChange: (value: string[]) => void;
@@ -15,6 +16,9 @@ type TagInputCoreProps = {
15
16
  'aria-invalid'?: boolean;
16
17
  /** 指向 FormItem 渲染的错误 span(id={errorId}),透传给内部 input。 */
17
18
  'aria-describedby'?: string;
19
+ /** Forwarded to the inner text `<input>` (not the root div) — the
20
+ * element form bridges and `ref.current.focus()` reach. */
21
+ ref?: Ref<HTMLInputElement>;
18
22
  };
19
- export default function TagInputCore({ value: tags, onChange, placeholder, maxTags, disabled, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, }: TagInputCoreProps): import("react").JSX.Element;
20
- export type { TagInputCoreProps };
23
+ export default function TagInputCore({ value: tags, onChange, placeholder, maxTags, disabled, renderTag, wrapTagList, className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedby, ref, }: TagInputCoreProps): import("react").JSX.Element;
24
+ export type { TagInputCoreProps, TagSlot, TagListSlot };
@@ -2,3 +2,7 @@ export { default as TagInput } from './TagInput';
2
2
  export type { TagInputProps } from './TagInput';
3
3
  export { default as TagInputCore } from './TagInputCore';
4
4
  export type { TagInputCoreProps } from './TagInputCore';
5
+ export { default as SortableTagInput } from './SortableTagInput';
6
+ export type { SortableTagInputProps } from './SortableTagInput';
7
+ export { default as SortableTagInputCore } from './SortableTagInputCore';
8
+ export type { SortableTagInputCoreProps } from './SortableTagInputCore';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Shared TagInput skin — the tag list, chip, remove-button and drag classes
3
+ * `TagInputCore` and `SortableTagInputCore` both wear. Component-prefixed
4
+ * basename (never bare `styles.ts`): Linaria derives class slugs from the
5
+ * file basename, so two bare-named sibling style files would collide into
6
+ * the same `haze-styles__*` classes (Badge/Button e2e precedent).
7
+ */
8
+ export declare const listWrap: import("@linaria/core").LinariaClassName;
9
+ export declare const tag: import("@linaria/core").LinariaClassName;
10
+ export declare const removeBtn: import("@linaria/core").LinariaClassName;
11
+ export declare const tagHandle: import("@linaria/core").LinariaClassName;
12
+ export declare const tagDragging: import("@linaria/core").LinariaClassName;
@@ -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 };