haze-ui 1.29.0 → 1.30.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 (386) hide show
  1. package/README.md +58 -0
  2. package/cli/theme.mjs +446 -0
  3. package/dist/components/Accordion/Accordion.js +1 -0
  4. package/dist/components/Accordion/AccordionItem.js +3 -0
  5. package/dist/components/Affix/Affix.js +1 -0
  6. package/dist/components/Alert/Alert.js +3 -0
  7. package/dist/components/Anchor/Anchor.js +21 -15
  8. package/dist/components/AppShell/AppShell.js +5 -0
  9. package/dist/components/ApprovalCard/ApprovalCard.js +8 -0
  10. package/dist/components/AspectRatio/AspectRatio.js +2 -0
  11. package/dist/components/AsyncSection/AsyncSection.js +8 -0
  12. package/dist/components/Avatar/Avatar.js +11 -6
  13. package/dist/components/AvatarGroup/AvatarGroup.js +9 -6
  14. package/dist/components/BackToTop/BackToTop.js +5 -4
  15. package/dist/components/Badge/Badge.js +1 -0
  16. package/dist/components/Banner/Banner.js +3 -0
  17. package/dist/components/BottomSheet/BottomSheet.js +21 -16
  18. package/dist/components/Breadcrumb/Breadcrumb.js +11 -7
  19. package/dist/components/Breadcrumb/BreadcrumbItem.js +2 -0
  20. package/dist/components/Button/Button.js +13 -11
  21. package/dist/components/Button/ButtonLink.js +15 -13
  22. package/dist/components/Calendar/Calendar.js +523 -368
  23. package/dist/components/Calendar/date.js +35 -10
  24. package/dist/components/Card/Card.js +1 -0
  25. package/dist/components/Carousel/Carousel.js +157 -60
  26. package/dist/components/Carousel/CarouselSlide.js +3 -1
  27. package/dist/components/Cascader/Cascader.js +48 -35
  28. package/dist/components/Chart/Chart.js +5 -4
  29. package/dist/components/Chart/chart-elements.js +14 -10
  30. package/dist/components/ChatContainer/ChatContainer.js +9 -7
  31. package/dist/components/ChatInput/ChatInput.js +12 -9
  32. package/dist/components/ChatMessage/ChatMessage.js +83 -44
  33. package/dist/components/Checkbox/CheckboxCore.js +2 -0
  34. package/dist/components/Chip/Chip.js +3 -0
  35. package/dist/components/CodeBlock/CodeBlock.js +18 -9
  36. package/dist/components/Collapsible/Collapsible.js +24 -21
  37. package/dist/components/ColorPicker/ColorPicker.js +85 -14
  38. package/dist/components/ColorPicker/ColorPickerCore.js +6 -0
  39. package/dist/components/ColorPicker/ColorPickerPanel.js +277 -0
  40. package/dist/components/ColorPicker/color-math.js +168 -0
  41. package/dist/components/ColorPicker/color-picker-styles.js +7 -0
  42. package/dist/components/ColorPicker/index.js +3 -3
  43. package/dist/components/Combobox/Combobox.js +31 -24
  44. package/dist/components/Combobox/ComboboxGroup.js +7 -5
  45. package/dist/components/Combobox/ComboboxOption.js +1 -0
  46. package/dist/components/Command/Command.js +44 -37
  47. package/dist/components/Command/CommandDialog.js +8 -8
  48. package/dist/components/ConfigProvider/ConfigContext.js +30 -0
  49. package/dist/components/ConfigProvider/ConfigProvider.js +14 -0
  50. package/dist/components/ConfigProvider/index.js +4 -0
  51. package/dist/components/ConfigProvider/useConfigDefaults.js +10 -0
  52. package/dist/components/ConfirmDialog/ConfirmDialog.js +18 -11
  53. package/dist/components/Container/Container.js +1 -0
  54. package/dist/components/ContextMenu/ContextMenu.js +7 -6
  55. package/dist/components/ContextMenu/ContextMenuContent.js +4 -4
  56. package/dist/components/ContextMenu/ContextMenuItem.js +1 -0
  57. package/dist/components/ContextMenu/ContextMenuSeparator.js +1 -0
  58. package/dist/components/ContextMenu/ContextMenuTrigger.js +1 -0
  59. package/dist/components/ConversationList/ConversationItem.js +4 -0
  60. package/dist/components/ConversationList/ConversationList.js +1 -0
  61. package/dist/components/CountUp/CountUp.js +6 -5
  62. package/dist/components/DataTable/CellEditor.js +4 -4
  63. package/dist/components/DataTable/DataTable.js +236 -168
  64. package/dist/components/DateRangePicker/DateRangePickerCore.js +9 -0
  65. package/dist/components/Datepicker/Datepicker.js +14 -11
  66. package/dist/components/Datepicker/DatepickerCore.js +75 -60
  67. package/dist/components/Datepicker/datetime.js +14 -3
  68. package/dist/components/Descriptions/Descriptions.js +6 -0
  69. package/dist/components/Dialog/Dialog.js +13 -11
  70. package/dist/components/DiffViewer/DiffViewer.js +22 -13
  71. package/dist/components/Disclosure/Disclosure.js +10 -7
  72. package/dist/components/Divider/Divider.js +2 -0
  73. package/dist/components/Drawer/Drawer.js +10 -9
  74. package/dist/components/DropdownMenu/DropdownMenu.js +58 -35
  75. package/dist/components/DropdownMenu/DropdownMenuCheckboxItem.js +63 -0
  76. package/dist/components/DropdownMenu/DropdownMenuContent.js +5 -5
  77. package/dist/components/DropdownMenu/DropdownMenuGroup.js +26 -0
  78. package/dist/components/DropdownMenu/DropdownMenuItem.js +29 -10
  79. package/dist/components/DropdownMenu/DropdownMenuRadioGroup.js +30 -0
  80. package/dist/components/DropdownMenu/DropdownMenuRadioItem.js +59 -0
  81. package/dist/components/DropdownMenu/DropdownMenuSeparator.js +1 -0
  82. package/dist/components/DropdownMenu/DropdownMenuSub.js +1 -0
  83. package/dist/components/DropdownMenu/DropdownMenuSubTrigger.js +1 -0
  84. package/dist/components/DropdownMenu/DropdownMenuTrigger.js +1 -0
  85. package/dist/components/DropdownMenu/dropdown-menu-item-styles.js +7 -0
  86. package/dist/components/DropdownMenu/index.js +12 -8
  87. package/dist/components/Ellipsis/Ellipsis.js +11 -8
  88. package/dist/components/Empty/Empty.js +4 -0
  89. package/dist/components/FileInput/FileInput.js +7 -5
  90. package/dist/components/FilePreview/FilePreview.js +19 -1
  91. package/dist/components/Flex/Flex.js +1 -0
  92. package/dist/components/FloatButton/FloatButton.js +4 -0
  93. package/dist/components/FloatButton/FloatButtonGroup.js +18 -13
  94. package/dist/components/Fullscreen/Fullscreen.js +6 -3
  95. package/dist/components/Grid/Grid.js +12 -7
  96. package/dist/components/Grid/GridItem.js +17 -7
  97. package/dist/components/Grid/grid-item-styles.js +58 -0
  98. package/dist/components/HoverCard/HoverCard.js +46 -43
  99. package/dist/components/Icon/Icon.js +1 -0
  100. package/dist/components/Image/Image.js +10 -7
  101. package/dist/components/Image/ImagePreview.js +42 -34
  102. package/dist/components/InlineCompletion/InlineCompletion.js +15 -11
  103. package/dist/components/InlineEdit/InlineEdit.js +8 -6
  104. package/dist/components/Input/InputCore.js +1 -0
  105. package/dist/components/JsonView/JsonView.js +104 -79
  106. package/dist/components/Kbd/Kbd.js +1 -0
  107. package/dist/components/List/List.js +1 -0
  108. package/dist/components/List/ListItem.js +1 -0
  109. package/dist/components/LocaleProvider/LocaleProvider.js +4 -4
  110. package/dist/components/LocaleProvider/ar-sa.js +24 -2
  111. package/dist/components/LocaleProvider/de-de.js +24 -2
  112. package/dist/components/LocaleProvider/es-es.js +24 -2
  113. package/dist/components/LocaleProvider/fr-fr.js +24 -2
  114. package/dist/components/LocaleProvider/it-it.js +24 -2
  115. package/dist/components/LocaleProvider/ja-jp.js +24 -2
  116. package/dist/components/LocaleProvider/ko-kr.js +24 -2
  117. package/dist/components/LocaleProvider/locale.js +24 -2
  118. package/dist/components/LocaleProvider/pt-br.js +24 -2
  119. package/dist/components/LocaleProvider/ru-ru.js +24 -2
  120. package/dist/components/LocaleProvider/zh-cn.js +24 -2
  121. package/dist/components/LogViewer/LogViewer.js +25 -14
  122. package/dist/components/MarkdownRenderer/MarkdownRenderer.js +6 -5
  123. package/dist/components/MarkdownRenderer/markdown-blocks.js +1 -1
  124. package/dist/components/Masonry/Masonry.js +13 -10
  125. package/dist/components/Mentions/MentionsCore.js +15 -11
  126. package/dist/components/Menu/Menu.js +58 -36
  127. package/dist/components/Menu/MenuCheckboxItem.js +63 -0
  128. package/dist/components/Menu/MenuDivider.js +1 -0
  129. package/dist/components/Menu/MenuGroup.js +26 -0
  130. package/dist/components/Menu/MenuItem.js +28 -9
  131. package/dist/components/Menu/MenuRadioGroup.js +30 -0
  132. package/dist/components/Menu/MenuRadioItem.js +59 -0
  133. package/dist/components/Menu/MenuSub.js +1 -0
  134. package/dist/components/Menu/MenuSubTrigger.js +1 -0
  135. package/dist/components/Menu/index.js +11 -7
  136. package/dist/components/Menu/menu-item-styles.js +7 -0
  137. package/dist/components/ModelPicker/ModelPicker.js +3 -0
  138. package/dist/components/NavigationBar/NavLink.js +7 -6
  139. package/dist/components/NavigationBar/NavigationBar.js +4 -0
  140. package/dist/components/NumberInput/NumberInputCore.js +4 -0
  141. package/dist/components/OTPInput/OTPInputCore.js +9 -7
  142. package/dist/components/Pagination/Pagination.js +125 -33
  143. package/dist/components/PasswordInput/PasswordInputCore.js +9 -6
  144. package/dist/components/Popover/Popover.js +9 -7
  145. package/dist/components/Progress/Progress.js +5 -0
  146. package/dist/components/PromptInput/PromptInput.js +49 -41
  147. package/dist/components/QRCode/QRCode.js +9 -7
  148. package/dist/components/Radio/Radio.js +2 -0
  149. package/dist/components/Radio/RadioGroupCore.js +7 -6
  150. package/dist/components/Rating/RatingCore.js +18 -15
  151. package/dist/components/Resizable/Resizable.js +25 -22
  152. package/dist/components/Result/Result.js +5 -0
  153. package/dist/components/ScrollArea/ScrollArea.js +1 -0
  154. package/dist/components/Segmented/SegmentedCore.js +9 -7
  155. package/dist/components/Select/Option.js +1 -0
  156. package/dist/components/Select/OptionGroup.js +1 -0
  157. package/dist/components/Select/SelectCore.js +11 -8
  158. package/dist/components/Select/SelectFloating.js +54 -36
  159. package/dist/components/Sidebar/Sidebar.js +52 -42
  160. package/dist/components/Signature/Signature.js +101 -91
  161. package/dist/components/Skeleton/Skeleton.js +1 -0
  162. package/dist/components/Slider/SliderCore.js +149 -43
  163. package/dist/components/Sources/Sources.js +31 -21
  164. package/dist/components/Spinner/Spinner.js +1 -0
  165. package/dist/components/Stat/Stat.js +7 -0
  166. package/dist/components/StepTimeline/StepTimeline.js +6 -0
  167. package/dist/components/Stepper/Step.js +8 -1
  168. package/dist/components/Stepper/Stepper.js +7 -6
  169. package/dist/components/StreamingText/StreamingText.js +62 -29
  170. package/dist/components/SwipeAction/SwipeAction.js +11 -9
  171. package/dist/components/Switch/SwitchCore.js +9 -5
  172. package/dist/components/Table/Table.js +2 -0
  173. package/dist/components/Table/TableBody.js +1 -0
  174. package/dist/components/Table/TableCell.js +1 -0
  175. package/dist/components/Table/TableHead.js +1 -0
  176. package/dist/components/Table/TableRow.js +1 -0
  177. package/dist/components/Tabs/Tab.js +1 -0
  178. package/dist/components/Tabs/TabList.js +5 -4
  179. package/dist/components/Tabs/TabPanel.js +1 -0
  180. package/dist/components/Tabs/Tabs.js +1 -0
  181. package/dist/components/Tag/Tag.js +2 -0
  182. package/dist/components/TagGroup/SortableTagGroup.js +7 -6
  183. package/dist/components/TagGroup/TagGroup.js +1 -0
  184. package/dist/components/TagGroup/TagGroupItem.js +3 -0
  185. package/dist/components/TagInput/SortableTagInputCore.js +13 -10
  186. package/dist/components/TagInput/TagInputCore.js +17 -12
  187. package/dist/components/Textarea/TextareaCore.js +1 -0
  188. package/dist/components/ThinkingIndicator/ThinkingIndicator.js +18 -4
  189. package/dist/components/TimePicker/TimePicker.js +30 -14
  190. package/dist/components/TimePicker/TimePickerCore.js +1 -0
  191. package/dist/components/TimePicker/TimePickerPanel.js +260 -0
  192. package/dist/components/TimePicker/time-picker-styles.js +7 -0
  193. package/dist/components/TimePicker/time.js +51 -0
  194. package/dist/components/Timeline/Timeline.js +14 -1
  195. package/dist/components/Toast/Toast.js +94 -48
  196. package/dist/components/Toast/ToastContainer.js +60 -56
  197. package/dist/components/Toast/ToastContext.js +3 -1
  198. package/dist/components/Toast/toast2.js +20 -14
  199. package/dist/components/Toast/useToast.js +36 -11
  200. package/dist/components/Toggle/ToggleCore.js +1 -0
  201. package/dist/components/TokenCounter/TokenCounter.js +8 -1
  202. package/dist/components/ToolCallCard/ToolCallCard.js +18 -2
  203. package/dist/components/Toolbar/Toolbar.js +9 -8
  204. package/dist/components/Toolbar/ToolbarButton.js +1 -0
  205. package/dist/components/Toolbar/ToolbarSeparator.js +1 -0
  206. package/dist/components/Toolbar/ToolbarToggle.js +1 -0
  207. package/dist/components/Tooltip/Tooltip.js +46 -42
  208. package/dist/components/Tour/Tour.js +76 -65
  209. package/dist/components/Transfer/TransferCore.js +31 -17
  210. package/dist/components/Tree/SortableTree.js +151 -0
  211. package/dist/components/Tree/Tree.js +163 -154
  212. package/dist/components/Tree/TreeItem.js +52 -39
  213. package/dist/components/Tree/index.js +2 -1
  214. package/dist/components/Tree/sortable-tree-styles.js +7 -0
  215. package/dist/components/Tree/sortable-tree-utils.js +36 -0
  216. package/dist/components/TreeSelect/TreeSelect.js +44 -34
  217. package/dist/components/Typography/Typography.js +3 -0
  218. package/dist/components/Upload/Upload.js +12 -11
  219. package/dist/components/Upload/UploadCore.js +92 -65
  220. package/dist/components/Upload/UploadList.js +177 -105
  221. package/dist/components/VirtualList/VirtualList.js +229 -124
  222. package/dist/components/Watermark/Watermark.js +8 -6
  223. package/dist/css/accordion.css +1 -1
  224. package/dist/css/alert.css +1 -1
  225. package/dist/css/async-section.css +1 -1
  226. package/dist/css/banner.css +1 -1
  227. package/dist/css/bottom-sheet.css +1 -1
  228. package/dist/css/button.css +2 -2
  229. package/dist/css/calendar.css +1 -1
  230. package/dist/css/carousel.css +1 -1
  231. package/dist/css/chat-message.css +1 -1
  232. package/dist/css/checkbox.css +1 -1
  233. package/dist/css/color-picker.css +2 -0
  234. package/dist/css/combobox.css +2 -2
  235. package/dist/css/context-menu.css +1 -1
  236. package/dist/css/dialog.css +1 -1
  237. package/dist/css/drawer.css +1 -1
  238. package/dist/css/dropdown-menu.css +7 -2
  239. package/dist/css/form.css +1 -1
  240. package/dist/css/grid.css +2 -1
  241. package/dist/css/hover-card.css +1 -1
  242. package/dist/css/input.css +1 -1
  243. package/dist/css/menu.css +9 -4
  244. package/dist/css/pagination.css +1 -1
  245. package/dist/css/popover.css +1 -1
  246. package/dist/css/progress.css +1 -1
  247. package/dist/css/radio.css +1 -1
  248. package/dist/css/rating.css +1 -1
  249. package/dist/css/segmented.css +1 -1
  250. package/dist/css/skeleton.css +1 -1
  251. package/dist/css/slider.css +1 -1
  252. package/dist/css/spinner.css +1 -1
  253. package/dist/css/stepper.css +1 -1
  254. package/dist/css/streaming-text.css +1 -1
  255. package/dist/css/switch.css +1 -1
  256. package/dist/css/tabs.css +1 -1
  257. package/dist/css/textarea.css +1 -1
  258. package/dist/css/thinking-indicator.css +1 -1
  259. package/dist/css/time-picker.css +1 -0
  260. package/dist/css/toast.css +1 -1
  261. package/dist/css/toggle.css +1 -1
  262. package/dist/css/tokens.css +1 -1
  263. package/dist/css/tooltip.css +1 -1
  264. package/dist/css/tree.css +2 -1
  265. package/dist/css/upload.css +1 -1
  266. package/dist/css/virtual-list.css +1 -1
  267. package/dist/css-manifest.json +22 -0
  268. package/dist/dates/adapter.js +13 -0
  269. package/dist/dates/gregory.js +44 -0
  270. package/dist/dates/islamic.js +87 -0
  271. package/dist/dates/registry.js +13 -0
  272. package/dist/dates/timezone.js +29 -0
  273. package/dist/design-tokens/cyan-dark.json +355 -0
  274. package/dist/design-tokens/cyan-light.json +355 -0
  275. package/dist/design-tokens/orange-dark.json +355 -0
  276. package/dist/design-tokens/orange-light.json +355 -0
  277. package/dist/design-tokens/rose-dark.json +355 -0
  278. package/dist/design-tokens/rose-light.json +355 -0
  279. package/dist/design-tokens/teal-dark.json +355 -0
  280. package/dist/design-tokens/teal-light.json +355 -0
  281. package/dist/design-tokens/violet-dark.json +355 -0
  282. package/dist/design-tokens/violet-light.json +355 -0
  283. package/dist/form/FormItem.js +71 -63
  284. package/dist/form/FormList.js +6 -6
  285. package/dist/form/form-item-styles.js +7 -0
  286. package/dist/haze-ui.css +63 -48
  287. package/dist/index.js +249 -232
  288. package/dist/mcp-docs.json +1011 -82
  289. package/dist/registry.json +17 -17
  290. package/dist/tokens/index.js +7 -7
  291. package/dist/tokens/motion.js +9 -2
  292. package/dist/tokens/palette.js +244 -84
  293. package/dist/tokens/registry.js +18 -22
  294. package/dist/types/components/Button/Button.d.ts +1 -1
  295. package/dist/types/components/Calendar/Calendar.d.ts +39 -14
  296. package/dist/types/components/Calendar/date.d.ts +51 -0
  297. package/dist/types/components/Calendar/index.d.ts +1 -1
  298. package/dist/types/components/Carousel/Carousel.d.ts +5 -1
  299. package/dist/types/components/Carousel/CarouselSlide.d.ts +3 -3
  300. package/dist/types/components/Chart/Chart.d.ts +13 -6
  301. package/dist/types/components/Chart/chart-elements.d.ts +27 -6
  302. package/dist/types/components/ChatMessage/ChatMessage.d.ts +10 -1
  303. package/dist/types/components/ColorPicker/ColorPicker.d.ts +44 -5
  304. package/dist/types/components/ColorPicker/ColorPickerPanel.d.ts +28 -0
  305. package/dist/types/components/ColorPicker/color-math.d.ts +63 -0
  306. package/dist/types/components/ColorPicker/color-picker-styles.d.ts +50 -0
  307. package/dist/types/components/ConfigProvider/ConfigContext.d.ts +67 -0
  308. package/dist/types/components/ConfigProvider/ConfigProvider.d.ts +25 -0
  309. package/dist/types/components/ConfigProvider/index.d.ts +4 -0
  310. package/dist/types/components/ConfigProvider/useConfigDefaults.d.ts +28 -0
  311. package/dist/types/components/Datepicker/Datepicker.d.ts +23 -10
  312. package/dist/types/components/Datepicker/DatepickerCore.d.ts +40 -10
  313. package/dist/types/components/Datepicker/datetime.d.ts +33 -11
  314. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +12 -2
  315. package/dist/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +26 -0
  316. package/dist/types/components/DropdownMenu/DropdownMenuGroup.d.ts +16 -0
  317. package/dist/types/components/DropdownMenu/DropdownMenuItem.d.ts +7 -1
  318. package/dist/types/components/DropdownMenu/DropdownMenuRadioGroup.d.ts +21 -0
  319. package/dist/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +22 -0
  320. package/dist/types/components/DropdownMenu/dropdown-menu-item-styles.d.ts +29 -0
  321. package/dist/types/components/DropdownMenu/index.d.ts +9 -1
  322. package/dist/types/components/Fullscreen/Fullscreen.d.ts +1 -0
  323. package/dist/types/components/Grid/Grid.d.ts +8 -1
  324. package/dist/types/components/Grid/GridItem.d.ts +24 -1
  325. package/dist/types/components/Grid/grid-item-styles.d.ts +57 -0
  326. package/dist/types/components/HoverCard/HoverCard.d.ts +1 -1
  327. package/dist/types/components/LocaleProvider/locale.d.ts +24 -0
  328. package/dist/types/components/Menu/Menu.d.ts +11 -2
  329. package/dist/types/components/Menu/MenuCheckboxItem.d.ts +25 -0
  330. package/dist/types/components/Menu/MenuGroup.d.ts +16 -0
  331. package/dist/types/components/Menu/MenuItem.d.ts +7 -1
  332. package/dist/types/components/Menu/MenuRadioGroup.d.ts +20 -0
  333. package/dist/types/components/Menu/MenuRadioItem.d.ts +22 -0
  334. package/dist/types/components/Menu/index.d.ts +9 -1
  335. package/dist/types/components/Menu/menu-item-styles.d.ts +28 -0
  336. package/dist/types/components/NavigationBar/NavLink.d.ts +1 -1
  337. package/dist/types/components/Pagination/Pagination.d.ts +17 -3
  338. package/dist/types/components/Sidebar/Sidebar.d.ts +1 -1
  339. package/dist/types/components/Slider/Slider.d.ts +24 -2
  340. package/dist/types/components/Slider/SliderCore.d.ts +41 -3
  341. package/dist/types/components/StreamingText/StreamingText.d.ts +8 -1
  342. package/dist/types/components/TimePicker/TimePicker.d.ts +36 -4
  343. package/dist/types/components/TimePicker/TimePickerPanel.d.ts +26 -0
  344. package/dist/types/components/TimePicker/index.d.ts +1 -0
  345. package/dist/types/components/TimePicker/time-picker-styles.d.ts +30 -0
  346. package/dist/types/components/TimePicker/time.d.ts +49 -0
  347. package/dist/types/components/Toast/Toast.d.ts +19 -6
  348. package/dist/types/components/Toast/ToastContainer.d.ts +1 -1
  349. package/dist/types/components/Toast/ToastContext.d.ts +22 -2
  350. package/dist/types/components/Toast/index.d.ts +1 -1
  351. package/dist/types/components/Toast/toast.d.ts +20 -14
  352. package/dist/types/components/Toast/useToast.d.ts +14 -4
  353. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  354. package/dist/types/components/Tree/SortableTree.d.ts +38 -0
  355. package/dist/types/components/Tree/Tree.d.ts +1 -1
  356. package/dist/types/components/Tree/index.d.ts +2 -0
  357. package/dist/types/components/Tree/sortable-tree-styles.d.ts +36 -0
  358. package/dist/types/components/Tree/sortable-tree-utils.d.ts +40 -0
  359. package/dist/types/components/Upload/Upload.d.ts +17 -10
  360. package/dist/types/components/Upload/UploadCore.d.ts +26 -12
  361. package/dist/types/components/Upload/UploadList.d.ts +10 -7
  362. package/dist/types/components/Upload/index.d.ts +1 -1
  363. package/dist/types/components/Upload/types.d.ts +33 -7
  364. package/dist/types/components/VirtualList/VirtualList.d.ts +79 -26
  365. package/dist/types/components/VirtualList/index.d.ts +1 -1
  366. package/dist/types/dates/adapter.d.ts +74 -0
  367. package/dist/types/dates/gregory.d.ts +10 -0
  368. package/dist/types/dates/index.d.ts +6 -0
  369. package/dist/types/dates/islamic.d.ts +17 -0
  370. package/dist/types/dates/registry.d.ts +13 -0
  371. package/dist/types/dates/timezone.d.ts +36 -0
  372. package/dist/types/form/FormItem.d.ts +31 -1
  373. package/dist/types/form/form-item-styles.d.ts +24 -0
  374. package/dist/types/index.d.ts +19 -11
  375. package/dist/types/tokens/index.d.ts +4 -2
  376. package/dist/types/tokens/motion.d.ts +16 -0
  377. package/dist/types/tokens/palette.d.ts +59 -2
  378. package/dist/types/utils/menuItems.d.ts +126 -0
  379. package/dist/types/utils/menuRadio.d.ts +21 -0
  380. package/dist/utils/floating.js +45 -44
  381. package/dist/utils/menuItems.js +55 -0
  382. package/dist/utils/menuKeyboard.js +31 -31
  383. package/dist/utils/menuRadio.js +28 -0
  384. package/dist/utils/sortable-shared.js +3 -3
  385. package/dist/utils/sortable.js +12 -11
  386. package/package.json +18 -9
@@ -0,0 +1,40 @@
1
+ import type { TreeNodeData } from './types';
2
+ /**
3
+ * Pure move math for SortableTree — no React, no dnd, fully unit-testable.
4
+ * The drag runtime reports a target row; these functions turn that into the
5
+ * `onMove` payload and back into a controlled treeData update.
6
+ */
7
+ /** Payload `SortableTree` reports after a completed drag. */
8
+ export type SortableTreeMoveInfo = {
9
+ /** The dragged node's key. */
10
+ key: string;
11
+ /** The new parent's key — `null` for the root level. */
12
+ parentKey: string | null;
13
+ /**
14
+ * Insertion index among the **new** parent's children, computed after
15
+ * removing the dragged node from the tree — `splice(index, 0, node)`
16
+ * lands exactly.
17
+ */
18
+ index: number;
19
+ };
20
+ /** Every key in the node's own subtree, including itself. */
21
+ export declare function subtreeKeys(node: TreeNodeData): Set<string>;
22
+ /**
23
+ * Resolve a completed drag into the `onMove` payload. Dropping onto a row
24
+ * inserts the dragged node **right after it** — as the target's next
25
+ * sibling at the target's level — so a drop on a same-level row reorders
26
+ * and a drop on a child of another parent reparents. Returns `null` when
27
+ * nothing should happen: drop on itself, on one of its own descendants
28
+ * (the subtree travels as one block and cannot move into itself), back
29
+ * onto its own current position, or an unknown key.
30
+ */
31
+ export declare function resolveTreeMove(data: TreeNodeData[], dragKey: string, overKey: string): SortableTreeMoveInfo | null;
32
+ /**
33
+ * Apply a reported move to a tree array — the controlled `treeData`
34
+ * update a consumer makes in `onMove`: detach the node with its whole
35
+ * subtree, then splice it into the new parent's children. Returns fresh
36
+ * arrays on every changed path (originals untouched). A parent key that
37
+ * no longer resolves falls back to appending at the root level rather
38
+ * than dropping the node.
39
+ */
40
+ export declare function applyTreeMove(data: TreeNodeData[], info: SortableTreeMoveInfo): TreeNodeData[];
@@ -1,9 +1,11 @@
1
1
  import type { ReactNode, Ref } from 'react';
2
2
  import type { ControlOrValue } from 'react-use-control';
3
- import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest } from './types';
3
+ import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest, UploadValueItem } from './types';
4
4
  type UploadProps = {
5
- /** Selected files; uncontrolled (accumulating internally) when omitted. */
6
- value?: ControlOrValue<File[]>;
5
+ /** Selected files — local `File` picks mixed freely with `UploadFile`
6
+ * echo entries (files already on the server); uncontrolled
7
+ * (accumulating internally) when omitted. */
8
+ value?: ControlOrValue<UploadValueItem[]>;
7
9
  accept?: string;
8
10
  /** Renders the drag-and-drop drop area (default) or a plain
9
11
  * click-only picker area — see `UploadCoreProps.droppable`. */
@@ -35,9 +37,13 @@ type UploadProps = {
35
37
  showUploadList?: boolean | {
36
38
  itemRender?: UploadListItemRender;
37
39
  };
38
- /** Rendering style of the built-in list (`text` rows or a
39
- * `picture-card` thumbnail grid) — see `UploadCoreProps.listType`. */
40
- listType?: 'text' | 'picture-card';
40
+ /** Rendering style of the built-in list (`text` rows, a `picture`
41
+ * row with a 32px inline thumbnail, or a `picture-card` thumbnail
42
+ * grid) — see `UploadCoreProps.listType`. */
43
+ listType?: 'text' | 'picture' | 'picture-card';
44
+ /** Click handler for `picture` / `picture-card` thumbnails (e.g. a
45
+ * lightbox) — see `UploadCoreProps.onPreview`. */
46
+ onPreview?: (file: UploadValueItem) => void;
41
47
  /** Overrides the built-in remove-button label — see
42
48
  * `UploadCoreProps.removeLabel`. */
43
49
  removeLabel?: string;
@@ -47,13 +53,14 @@ type UploadProps = {
47
53
  /** Status-machine snapshot callback — see
48
54
  * `UploadCoreProps.onStatusChange`. */
49
55
  onStatusChange?: (files: UploadFileStatus[]) => void;
50
- /** Fires with the freshly picked files only — the accumulated list is
51
- * the `value` channel (or internal state when uncontrolled).
52
- * Removals and `clear()` do not fire this (they are not picks). */
56
+ /** Fires with the freshly picked files only (always local `File`s)
57
+ * — the accumulated list is the `value` channel (or internal state
58
+ * when uncontrolled). Removals and `clear()` do not fire this (they
59
+ * are not picks). */
53
60
  onChange?: (files: File[]) => void;
54
61
  className?: string;
55
62
  children?: ReactNode;
56
63
  ref?: Ref<UploadHandle>;
57
64
  };
58
- export default function Upload({ value: valueControl, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, removeLabel, directory, onStatusChange, onChange, className, children, ref, }: UploadProps): import("react").JSX.Element;
65
+ export default function Upload({ value: valueControl, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, onPreview, removeLabel, directory, onStatusChange, onChange, className, children, ref, }: UploadProps): import("react").JSX.Element;
59
66
  export type { UploadProps };
@@ -1,13 +1,17 @@
1
1
  import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
2
- import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest } from './types';
2
+ import type { UploadFileStatus, UploadHandle, UploadListItemRender, UploadRequest, UploadValueItem } from './types';
3
3
  type UploadCoreProps = {
4
4
  /** The selected files — the field value, emitted verbatim (as the
5
- * complete next list) by `onChange`. */
6
- value: File[];
5
+ * complete next list) by `onChange`. Local `File` picks mix freely
6
+ * with `UploadFile` echo entries describing files already on the
7
+ * server; echo entries only render (and stay removable), they never
8
+ * enter the upload pipeline. */
9
+ value: UploadValueItem[];
7
10
  /** Emits the next file list: a single pick replaces `value`, a
8
11
  * `multiple` pick appends to it. Removals from the built-in list
9
- * (and `clear()`) also flow through here. */
10
- onChange: (files: File[]) => void;
12
+ * (and `clear()`) also flow through here — echo entries come back
13
+ * as the very objects the consumer passed in. */
14
+ onChange: (files: UploadValueItem[]) => void;
11
15
  /** Comma-separated accept tokens (`.txt`, `image/*`, `text/plain`) —
12
16
  * the same grammar the native picker uses. Dropped files that do not
13
17
  * match are discarded silently (the native dialog already enforces
@@ -74,12 +78,21 @@ type UploadCoreProps = {
74
78
  };
75
79
  /**
76
80
  * Rendering style of the built-in list (default `text`): `text`
77
- * rows, or a `picture-card` grid of square thumbnail cards —
78
- * object-URL previews for image files (revoked once the card leaves),
79
- * a type-icon fallback for the rest, an upload mask with the live
80
- * percent, and a danger border + retry on error.
81
+ * rows; `picture` — a text row with a 32px inline thumbnail before
82
+ * the name (a `url` image for `UploadFile` echoes, an object-URL
83
+ * preview for image files, a type-icon fallback otherwise); or a
84
+ * `picture-card` grid of square thumbnail cards with the upload
85
+ * mask, danger border + retry on error, and corner remove button.
81
86
  */
82
- listType?: 'text' | 'picture-card';
87
+ listType?: 'text' | 'picture' | 'picture-card';
88
+ /**
89
+ * Click handler for the thumbnails of `picture` / `picture-card`
90
+ * lists — the natural spot to open a lightbox (wire it to
91
+ * `Image`/`ImagePreview`). Receives the value item the thumbnail
92
+ * describes. The remove/retry/cancel buttons sit outside the hit
93
+ * area and keep working.
94
+ */
95
+ onPreview?: (file: UploadValueItem) => void;
83
96
  /**
84
97
  * Overrides the built-in remove-button label (list rows and
85
98
  * picture-card corners); defaults to the locale string.
@@ -95,12 +108,13 @@ type UploadCoreProps = {
95
108
  /**
96
109
  * Fires whenever the tracked entries change (added, removed, status
97
110
  * or percent) with the complete snapshot in value order. Only tracks
98
- * while `request`/`action` or `showUploadList` is in play.
111
+ * while `request`/`action` or `showUploadList` is in play. `UploadFile`
112
+ * echoes report their terminal `status`/`percent` like any row.
99
113
  */
100
114
  onStatusChange?: (files: UploadFileStatus[]) => void;
101
115
  className?: string;
102
116
  children?: ReactNode;
103
117
  ref?: Ref<UploadHandle>;
104
118
  } & Omit<ComponentPropsWithoutRef<'div'>, 'value' | 'onChange' | 'children' | 'onClick' | 'onDrop' | 'onDragOver' | 'onDragEnter' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex'>;
105
- export default function UploadCore({ value, onChange, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, removeLabel, directory, onStatusChange, className, children, ref, ...rest }: UploadCoreProps): import("react").JSX.Element;
119
+ export default function UploadCore({ value, onChange, accept, droppable, beforeUpload, maxCount, multiple, request, action, method, headers, name, data, manual, showUploadList, listType, onPreview, removeLabel, directory, onStatusChange, className, children, ref, ...rest }: UploadCoreProps): import("react").JSX.Element;
106
120
  export type { UploadCoreProps };
@@ -1,18 +1,21 @@
1
- import type { UploadEntry, UploadListItemRender } from './types';
1
+ import type { UploadEntry, UploadListItemRender, UploadValueItem } from './types';
2
2
  type UploadListProps = {
3
3
  /** Tracked rows, in value order. */
4
4
  entries: UploadEntry[];
5
- /** Rendering style of the built-in list: `text` rows (default) or a
5
+ /** Rendering style of the built-in list: `text` rows (default), a
6
+ * `picture` text row with a 32px inline thumbnail, or a
6
7
  * `picture-card` grid of square thumbnail cards. */
7
- listType?: 'text' | 'picture-card';
8
+ listType?: 'text' | 'picture' | 'picture-card';
8
9
  /** Overrides the remove-button label (text rows and picture-card
9
10
  * corners alike); defaults to the locale string. */
10
11
  removeLabel?: string;
11
12
  /** Replaces the default row/cell rendering entirely. */
12
13
  itemRender?: UploadListItemRender;
13
- onRemove: (file: File) => void;
14
- onRetry: (file: File) => void;
15
- onCancel: (file: File) => void;
14
+ /** Click handler for `picture` / `picture-card` thumbnails. */
15
+ onPreview?: (file: UploadValueItem) => void;
16
+ onRemove: (file: UploadValueItem) => void;
17
+ onRetry: (file: UploadValueItem) => void;
18
+ onCancel: (file: UploadValueItem) => void;
16
19
  };
17
- export default function UploadList({ entries, listType, removeLabel, itemRender, onRemove, onRetry, onCancel, }: UploadListProps): import("react").JSX.Element;
20
+ export default function UploadList({ entries, listType, removeLabel, itemRender, onPreview, onRemove, onRetry, onCancel, }: UploadListProps): import("react").JSX.Element;
18
21
  export type { UploadListProps };
@@ -2,4 +2,4 @@ export { default as Upload } from './Upload';
2
2
  export type { UploadProps } from './Upload';
3
3
  export { default as UploadCore } from './UploadCore';
4
4
  export type { UploadCoreProps } from './UploadCore';
5
- export type { UploadHandle, UploadStatus, UploadFileStatus, UploadRequest, UploadRequestOptions, UploadListItemActions, UploadListItemRender, } from './types';
5
+ export type { UploadHandle, UploadStatus, UploadFile, UploadValueItem, UploadFileStatus, UploadRequest, UploadRequestOptions, UploadListItemActions, UploadListItemRender, } from './types';
@@ -2,10 +2,33 @@ import type { ReactNode } from 'react';
2
2
  /** Lifecycle of one tracked file while an upload executor (`request`
3
3
  * or `action`) is armed. */
4
4
  type UploadStatus = 'idle' | 'uploading' | 'success' | 'error';
5
- /** Status snapshot for one tracked file — the shape surfaced through
6
- * `onStatusChange` and `showUploadList.itemRender`. */
5
+ /** A file that already lives on the server: described by metadata
6
+ * instead of a local `File` object. Passed through `value` to echo an
7
+ * existing upload — rendered in the built-in list (a `url` thumbnail
8
+ * for the picture list types), removable, but never re-entering the
9
+ * upload pipeline (`beforeUpload`/`request`/`action` only ever see
10
+ * real `File` objects). */
11
+ type UploadFile = {
12
+ /** Stable identity for list keys. When omitted, one is generated per
13
+ * object instance and reused across renders. */
14
+ uid?: string;
15
+ name: string;
16
+ /** Remote source rendered as the thumbnail in picture list types. */
17
+ url?: string;
18
+ /** Bytes, when the server reports them. */
19
+ size?: number;
20
+ /** Terminal state of the echoed upload — defaults to `success`. */
21
+ status?: 'success' | 'error';
22
+ /** 0–100, clamped; purely informational for echo entries. */
23
+ percent?: number;
24
+ };
25
+ /** One item of the value channel: a picked local `File` (enters the
26
+ * upload pipeline) or an `UploadFile` echo (terminal). */
27
+ type UploadValueItem = File | UploadFile;
28
+ /** Status snapshot for one tracked value item — the shape surfaced
29
+ * through `onStatusChange` and `showUploadList.itemRender`. */
7
30
  type UploadFileStatus = {
8
- file: File;
31
+ file: UploadValueItem;
9
32
  status: UploadStatus;
10
33
  /** 0–100, clamped; forced to 100 when the upload succeeds. */
11
34
  percent: number;
@@ -32,8 +55,9 @@ type UploadListItemActions = {
32
55
  /** Abort the in-flight upload and drop the file (uploading state). */
33
56
  cancel: () => void;
34
57
  };
35
- /** Custom renderer replacing a built-in list row. */
36
- type UploadListItemRender = (file: File, status: UploadStatus, percent: number, actions: UploadListItemActions) => ReactNode;
58
+ /** Custom renderer replacing a built-in list row. Echo entries
59
+ * (`UploadFile` items) reach it the same way local files do. */
60
+ type UploadListItemRender = (file: UploadValueItem, status: UploadStatus, percent: number, actions: UploadListItemActions) => ReactNode;
37
61
  /**
38
62
  * Imperative surface (`ref.current?.…`) — the same React 19
39
63
  * ref-as-prop channel `DialogHandle` uses:
@@ -53,8 +77,10 @@ type UploadHandle = {
53
77
  clear: () => void;
54
78
  };
55
79
  /** Internal tracked row: public status snapshot plus the stable uid the
56
- * list keys on (File objects have no serializable identity). */
80
+ * list keys on (value items carry no serializable identity). Echo
81
+ * entries hold their terminal `status`/`percent` from the
82
+ * `UploadFile` description. */
57
83
  type UploadEntry = UploadFileStatus & {
58
84
  uid: string;
59
85
  };
60
- export type { UploadStatus, UploadFileStatus, UploadRequestOptions, UploadRequest, UploadListItemActions, UploadListItemRender, UploadHandle, UploadEntry, };
86
+ export type { UploadStatus, UploadFile, UploadValueItem, UploadFileStatus, UploadRequestOptions, UploadRequest, UploadListItemActions, UploadListItemRender, UploadHandle, UploadEntry, };
@@ -1,4 +1,6 @@
1
1
  import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react';
2
+ /** Orientation of the scroll axis. */
3
+ type VirtualListOrientation = 'vertical' | 'horizontal';
2
4
  /** Alignment of a row after an imperative `scrollToIndex` call. */
3
5
  type VirtualListAlign = 'start' | 'center' | 'end' | 'auto';
4
6
  /**
@@ -16,6 +18,11 @@ type VirtualListHandle = {
16
18
  * a no-op when the row is already fully visible; rows entering from
17
19
  * above align to `'end'` (keeps preceding context on screen), rows
18
20
  * entering from below align to `'start'`.
21
+ *
22
+ * In grid mode (`columns > 1`) `index` is the item index and maps to
23
+ * its row/column cell: the row axis honors `align`, the column axis is
24
+ * brought into view minimally. In horizontal orientation the same
25
+ * semantics apply along the x axis.
19
26
  */
20
27
  scrollToIndex: (index: number, align?: VirtualListAlign) => void;
21
28
  };
@@ -30,50 +37,96 @@ type VirtualListGroup = {
30
37
  };
31
38
  type VirtualListProps<T> = {
32
39
  items: T[];
33
- /** Scrollport height in px. */
40
+ /**
41
+ * Scrollport height in px (the cross-axis size when
42
+ * `orientation='horizontal'`).
43
+ */
34
44
  height: number;
35
45
  /**
36
- * Row height in px. Exact in fixed mode; in dynamic mode only the
46
+ * Scrollport width in px — only used with `orientation='horizontal'`:
47
+ * fixes the port width and serves as the main-axis extent until the
48
+ * real `clientWidth` is measured. Ignored in vertical orientation.
49
+ */
50
+ width?: number;
51
+ /**
52
+ * Extent of one item along the scroll axis: row height in vertical
53
+ * lists, item width with `orientation='horizontal'`, and row height in
54
+ * grid mode. Exact in fixed mode; in dynamic mode only the
37
55
  * pre-measurement estimate (pass `estimatedItemHeight` to opt in).
38
56
  */
39
57
  itemHeight: number;
40
58
  /**
41
- * Provide to enable dynamic row heights: every mounted row is measured
42
- * with a ResizeObserver and cached by index. Row offsets come from a
43
- * prefix sum over measured heights (never-rendered rows fall back to
44
- * this estimate), so layout stays correct as rows resize. Cached
45
- * heights survive `items` updates and are truncated when the list
59
+ * Provide to enable dynamic heights along the scroll axis: every
60
+ * mounted unit (row — in grid mode the whole row wrapper) is measured
61
+ * with a ResizeObserver and cached by index. Unit offsets come from a
62
+ * prefix sum over measured sizes (never-rendered units fall back to
63
+ * this estimate), so layout stays correct as units resize. Cached
64
+ * sizes survive `items` updates and are truncated when the list
46
65
  * shrinks.
47
66
  */
48
67
  estimatedItemHeight?: number;
49
68
  /**
50
- * Optional sticky group headers. A header pins to the scrollport top
51
- * while its group spans the viewport and slides away when the next
52
- * header reaches it. Header positions derive from the same offset
53
- * system as rows, so fixed and dynamic modes are both supported.
54
- * Headers overlay rows — they occupy no layout space in the list.
69
+ * Grid mode: lay items out in a row-major grid with this many columns
70
+ * and virtualize both axes — rows are windowed along the scroll axis
71
+ * exactly like a vertical list, columns are windowed against the
72
+ * rendered `clientWidth`. Item `index` maps to row
73
+ * `Math.floor(index / columns)`, column `index % columns`. Only
74
+ * supported in the (default) vertical orientation; combining it with
75
+ * `orientation='horizontal'` logs a dev error and renders a plain
76
+ * horizontal list.
77
+ */
78
+ columns?: number;
79
+ /**
80
+ * Column width in px (grid mode only); defaults to `itemHeight`.
81
+ * Columns are not dynamically measured.
82
+ */
83
+ columnWidth?: number;
84
+ /**
85
+ * Scroll axis of the list. `'vertical'` (default) keeps the existing
86
+ * behavior byte-for-byte. `'horizontal'` mirrors the whole windowing
87
+ * system — prefix sums, dynamic measurement, `scrollToIndex`, reverse
88
+ * and sticky group headers — onto the x axis: items are sized by
89
+ * `itemHeight` along it, headers pin to the inline-start edge, and
90
+ * offsets stay *logical* so RTL keeps item 0 at the inline-start edge
91
+ * (the physical right edge): RTL `scrollLeft` reads 0 at the start and
92
+ * goes negative toward the end, which the internal offset scale
93
+ * normalizes.
94
+ */
95
+ orientation?: VirtualListOrientation;
96
+ /**
97
+ * Optional sticky group headers. A header pins to the scrollport's
98
+ * inline-start (vertical: top) while its group spans the viewport and
99
+ * slides away when the next header reaches it. Header positions derive
100
+ * from the same offset system as rows, so fixed and dynamic modes are
101
+ * both supported; in grid mode a header aligns with the row containing
102
+ * its first item (row granularity). Headers overlay rows — they occupy
103
+ * no layout space in the list.
55
104
  */
56
105
  groups?: VirtualListGroup[];
57
106
  renderItem: (item: T, index: number) => ReactNode;
58
- /** Extra rows kept mounted above/below the visible window. */
107
+ /**
108
+ * Extra units kept mounted on either side of the visible window —
109
+ * rows along the scroll axis, and columns in grid mode.
110
+ */
59
111
  overscan?: number;
60
112
  /**
61
- * Chat orientation (opt-in): rows anchor to the scrollport bottom with
62
- * index 0 at the bottom edge and later indices stacking upward — the
63
- * natural geometry for a newest-at-bottom log where new items are
64
- * prepended. The viewport parks at the bottom on mount and stays glued
65
- * there across appends while the user is parked at the bottom; a
66
- * reader who scrolled up keeps their position (rows keep their
67
- * top-origin coordinates as content grows upward, so nothing jumps).
113
+ * Chat orientation (opt-in): units anchor to the scrollport's end edge
114
+ * (vertical: bottom; horizontal: inline-end) with index 0 at that edge
115
+ * and later indices stacking toward the start — the natural geometry
116
+ * for a newest-at-the-edge log where new items are prepended. The
117
+ * viewport parks at the end on mount and stays glued there across
118
+ * appends while the user is parked there; a reader who scrolled back
119
+ * keeps their position (units keep their start-origin coordinates as
120
+ * content grows toward the start, so nothing jumps).
68
121
  *
69
- * `scrollToIndex` keeps its signature; alignments mirror vertically —
70
- * `'start'` pins the row's bottom edge to the viewport bottom,
71
- * `'end'` its top edge to the viewport top. The `VirtualListHandle`
72
- * API is unchanged.
122
+ * `scrollToIndex` keeps its signature; alignments mirror along the
123
+ * scroll axis — `'start'` pins the unit's end edge to the viewport's
124
+ * end edge, `'end'` its start edge to the viewport's start edge. The
125
+ * `VirtualListHandle` API is unchanged.
73
126
  */
74
127
  reverse?: boolean;
75
128
  className?: string;
76
129
  ref?: Ref<VirtualListHandle>;
77
130
  } & Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
78
- export default function VirtualList<T>({ items, height, itemHeight, estimatedItemHeight, groups, renderItem, overscan, reverse, className, style, ref, ...rest }: VirtualListProps<T>): import("react").JSX.Element;
79
- export type { VirtualListProps, VirtualListHandle, VirtualListGroup, VirtualListAlign, };
131
+ export default function VirtualList<T>({ items, height, width, itemHeight, estimatedItemHeight, columns, columnWidth, orientation, groups, renderItem, overscan, reverse, className, style, ref, ...rest }: VirtualListProps<T>): import("react").JSX.Element;
132
+ export type { VirtualListProps, VirtualListHandle, VirtualListGroup, VirtualListAlign, VirtualListOrientation, };
@@ -1,2 +1,2 @@
1
1
  export { default as VirtualList } from './VirtualList';
2
- export type { VirtualListProps, VirtualListHandle, VirtualListGroup, VirtualListAlign } from './VirtualList';
2
+ export type { VirtualListProps, VirtualListHandle, VirtualListGroup, VirtualListAlign, VirtualListOrientation } from './VirtualList';
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Calendar-agnostic date adapter contract.
3
+ *
4
+ * `src/lib/components/Calendar/date.ts` owns the complete Gregorian math
5
+ * (month lengths, view shifts, ISO weeks, value parsing); this module is
6
+ * the adapter layer above it that lets consumers reason about *any*
7
+ * calendar's civil dates. The contract is deliberately shaped after the
8
+ * operations Calendar actually performs on dates — month lengths for grid
9
+ * building, month shifts for view navigation, name lists for headers —
10
+ * nothing more.
11
+ *
12
+ * Semantics (inherited from date.ts): every `(year, month, day)` triple is
13
+ * a civil calendar date realized as a *local* Date at midnight. DST
14
+ * transitions never move midnight, so `toGregorian` output always
15
+ * round-trips through `fromGregorian` exactly, and internal conversion
16
+ * arithmetic rides the UTC civil timeline (whole-day millisecond spans
17
+ * with no DST drift) before materializing the local-midnight result.
18
+ */
19
+ /** Civil date parts in a specific calendar. `month` is 0-based — the
20
+ * same `Date#getMonth` convention every date.ts function uses (0 = the
21
+ * calendar's first month, 11 = its last) — while `day` is 1-based. */
22
+ export type CivilDateParts = {
23
+ year: number;
24
+ month: number;
25
+ day: number;
26
+ };
27
+ /** Calendars with a built-in adapter. `islamic-umalqura` is the
28
+ * Umm al-Qura tabulation Node and browsers ship in full ICU; valid there
29
+ * roughly 1300–1600 AH (Gregorian ~1882–2174), beyond which ICU falls
30
+ * back to computed approximations (still self-consistent through this
31
+ * adapter, which routes every conversion through Intl). */
32
+ export type HazeCalendarIdentifier = 'gregory' | 'islamic-umalqura';
33
+ /** Month-name width, mirroring Intl's `month` option values. */
34
+ export type MonthNameStyle = 'long' | 'short' | 'narrow';
35
+ /**
36
+ * Operations on a calendar's civil dates. All members are pure: no
37
+ * internal state, no mutation of arguments.
38
+ */
39
+ export type HazeDateAdapter = {
40
+ /** Which calendar this adapter speaks; matches the `calendar` string
41
+ * Intl accepts. */
42
+ readonly identifier: HazeCalendarIdentifier;
43
+ /** Hijri/lunar-equivalent parts of a Date's **local civil date** (the
44
+ * date.ts midnight semantics — never the UTC reading of the
45
+ * instant). */
46
+ fromGregorian(date: Date): CivilDateParts;
47
+ /** Local-midnight Date of a civil date in this calendar. Out-of-range
48
+ * month indices normalize with carry (month 12 → next January,
49
+ * mirroring date.ts); a `day` that exists in no month of the calendar
50
+ * throws `RangeError` — never the silent `new Date` rollover. */
51
+ toGregorian(parts: CivilDateParts): Date;
52
+ /** Number of days in a month. Out-of-range months normalize with
53
+ * carry, like date.ts's Gregorian helper. */
54
+ getDaysInMonth(year: number, month: number): number;
55
+ /** Shift by whole calendar months with year carry, truncating the day
56
+ * to the target month's length (1430-12-30 + 1 → next year's month 1
57
+ * day 29 when that month has 29 days). Pure integer arithmetic on the
58
+ * month index — no Date rollover hazards. */
59
+ addMonths(parts: CivilDateParts, delta: number): CivilDateParts;
60
+ /** Twelve month names, index 0 = first month of the calendar year.
61
+ * `locale` defaults to the adapter's base presentation locale ('en'
62
+ * for the built-ins, matching Intl's calendar-extended locales). */
63
+ monthNames(locale?: string, style?: MonthNameStyle): string[];
64
+ /** Era abbreviation for a year ("AH" for Hijri, "AD"/"BC" for
65
+ * Gregorian), via Intl. Optional: consumers that render no era skip
66
+ * it. */
67
+ era?(year: number, locale?: string): string;
68
+ };
69
+ /**
70
+ * Era part of a UTC-civil date in `calendar` via Intl's `era` piece —
71
+ * the shared implementation behind both built-in adapters' `era` members
72
+ * (internal helper; not part of the public dates surface).
73
+ */
74
+ export declare function eraOfDate(date: Date, calendar: HazeCalendarIdentifier, locale: string): string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Gregorian adapter — a thin shim over the calendar math Calendar already
3
+ * uses (`src/lib/components/Calendar/date.ts`, imported here, never
4
+ * duplicated). `fromGregorian`/`toGregorian` are identity mappings
5
+ * between local-civil Dates and their parts; month-length and view-shift
6
+ * semantics are date.ts's own, so a Calendar wired to this adapter
7
+ * behaves exactly like today's hard-wired Gregorian code paths.
8
+ */
9
+ import type { HazeDateAdapter } from './adapter';
10
+ export declare const gregoryAdapter: HazeDateAdapter;
@@ -0,0 +1,6 @@
1
+ export { gregoryAdapter } from './gregory';
2
+ export { islamicUmalquraAdapter } from './islamic';
3
+ export { getAdapter } from './registry';
4
+ export type { CivilDateParts, HazeDateAdapter, HazeCalendarIdentifier, MonthNameStyle, } from './adapter';
5
+ export { formatInTimeZone, getZonedParts } from './timezone';
6
+ export type { ZonedParts } from './timezone';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Islamic (Hijri) adapter for the Umm al-Qura tabulation — the calendar
3
+ * Node 20+ and every modern browser ship in full ICU
4
+ * (`islamic-umalqura`). There is no `new HijriDate()`, so both
5
+ * conversion directions route through Intl: forward via
6
+ * `formatToParts` on the UTC civil timeline, backward via a seeded
7
+ * linear search that refines against the forward conversion until the
8
+ * round-trip matches exactly. All arithmetic is whole-day UTC
9
+ * milliseconds (no DST drift); results materialize as local-midnight
10
+ * Dates per the date.ts civil semantics.
11
+ *
12
+ * ICU's Umm al-Qura data covers roughly 1300–1600 AH; outside that span
13
+ * ICU falls back to computed months, which this adapter stays
14
+ * self-consistent with (every conversion still passes through Intl).
15
+ */
16
+ import type { HazeDateAdapter } from './adapter';
17
+ export declare const islamicUmalquraAdapter: HazeDateAdapter;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Adapter registry — resolves calendar identifiers to the shared
3
+ * adapter singletons. Lives in its own module so the adapter modules
4
+ * only depend on the contract (`./adapter`), keeping the module graph
5
+ * acyclic.
6
+ */
7
+ import type { HazeCalendarIdentifier, HazeDateAdapter } from './adapter';
8
+ /**
9
+ * Adapter lookup by calendar identifier. Returns the shared singleton
10
+ * adapters (`gregoryAdapter`, `islamicUmalquraAdapter`); throws
11
+ * `RangeError` for identifiers with no built-in adapter.
12
+ */
13
+ export declare function getAdapter(identifier: HazeCalendarIdentifier): HazeDateAdapter;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Time-zone formatting utilities on top of `Intl.DateTimeFormat`.
3
+ *
4
+ * Both functions construct their formatter per call — correct and
5
+ * dependency-free; callers on hot paths should hoist their own
6
+ * `Intl.DateTimeFormat` instead.
7
+ */
8
+ /** Wall-clock parts of an instant inside a time zone. `month` is 0-based
9
+ * (the same `Date#getMonth` convention as the dates adapters and
10
+ * Calendar's date.ts), `hour` runs 0–23 (`h23` cycle). */
11
+ export type ZonedParts = {
12
+ year: number;
13
+ month: number;
14
+ day: number;
15
+ hour: number;
16
+ minute: number;
17
+ };
18
+ /**
19
+ * Format an instant in a named IANA time zone.
20
+ *
21
+ * `options` are passed through to `Intl.DateTimeFormat` (any locale or
22
+ * calendar preferences come from the runtime's default locale), with one
23
+ * override: an explicit `timeZone` inside `options` loses to the
24
+ * `timeZone` parameter. Throws the `RangeError` Intl emits for an
25
+ * unknown zone (or an invalid Date) — callers validate zones they do
26
+ * not control.
27
+ */
28
+ export declare function formatInTimeZone(date: Date, timeZone: string, options: Intl.DateTimeFormatOptions): string;
29
+ /**
30
+ * Zoned wall-clock parts (`year`/`month`/`day`/`hour`/`minute`) of an
31
+ * instant — the pieces a zoned date picker or scheduler compares. The
32
+ * formatter pins `en-US` (gregorian digits) and `h23` so the numbers are
33
+ * deterministic; localization is `formatInTimeZone`'s job. Throws the
34
+ * `RangeError` Intl emits for an unknown zone.
35
+ */
36
+ export declare function getZonedParts(date: Date, timeZone: string): ZonedParts;
@@ -110,6 +110,29 @@ export type FormItemOwnProps<TValues extends Record<string, any> = any, P extend
110
110
  form?: FormInstance<TValues>;
111
111
  name: P;
112
112
  label?: ReactNode;
113
+ /**
114
+ * Layout mode of the item. `'vertical'` (default) stacks the label
115
+ * above the control — the exact historical rendering. `'horizontal'`
116
+ * puts the label in a left column and the control in a right one,
117
+ * with the error message placed under the control column so sibling
118
+ * items keep their controls vertically aligned. `'inline'` flows
119
+ * label + control + error on a single row and adds a trailing
120
+ * `margin-inline-end` so consecutive inline items space themselves.
121
+ */
122
+ layout?: 'vertical' | 'horizontal' | 'inline';
123
+ /**
124
+ * Width of the label column in the `'horizontal'` layout: a number is
125
+ * treated as pixels, a string is used verbatim as a CSS width (e.g.
126
+ * `'8em'`). Omit for `auto` (content-driven). Ignored in the other
127
+ * layouts.
128
+ */
129
+ labelWidth?: number | string;
130
+ /**
131
+ * Text alignment inside the label column in the `'horizontal'`
132
+ * layout: `'right'` (default — the AntD convention, labels hugging
133
+ * their controls) or `'left'`. Ignored in the other layouts.
134
+ */
135
+ labelAlign?: 'left' | 'right';
113
136
  /** Field-level validator, registered through react-f0rm's own
114
137
  * `useField` channel — validated per the form's `mode` and on submit.
115
138
  * With a typed form the value argument is `PathValueOf<TValues, P>`. */
@@ -308,6 +331,13 @@ export type FormItemProps<TValues extends Record<string, any> = any, P extends F
308
331
  * When the field has errors, the first error's message is rendered into a
309
332
  * `<span id={errorId} role='alert'>` next to the control; with no errors
310
333
  * no extra element is rendered.
334
+ *
335
+ * Layout: the default `layout='vertical'` stacks label above control;
336
+ * `layout='horizontal'` pairs a fixed label column (`labelWidth`,
337
+ * `labelAlign='right'` by default) with the control, the error slotting
338
+ * under the control column; `layout='inline'` flows label + control +
339
+ * error on one row with an automatic inter-item `margin-inline-end`.
340
+ * The id/label/aria wiring is identical in all three layouts.
311
341
  */
312
- export default function FormItem<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name, TInputProps extends Record<string, any> = Record<never, never>, TRawElement extends FormItemRawElement = never>({ form, name, label, validate, mode, validateDebounce, delayError, rules, className, renderError, as: As, asProps, input: Input, eventToValue, valueToProps, children, ...inputProps }: FormItemProps<TValues, P, TInputProps, TRawElement>): import("react").JSX.Element;
342
+ export default function FormItem<TValues extends Record<string, any> = any, P extends FieldPath<TValues> | Name = Name, TInputProps extends Record<string, any> = Record<never, never>, TRawElement extends FormItemRawElement = never>({ form, name, label, layout, labelWidth, labelAlign, validate, mode, validateDebounce, delayError, rules, className, renderError, as: As, asProps, input: Input, eventToValue, valueToProps, children, ...inputProps }: FormItemProps<TValues, P, TInputProps, TRawElement>): import("react").JSX.Element;
313
343
  export {};