haze-ui 1.24.1 → 1.26.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 (422) hide show
  1. package/README.md +237 -0
  2. package/dist/components/Accordion/Accordion.js +1 -0
  3. package/dist/components/Accordion/AccordionItem.js +1 -0
  4. package/dist/components/Accordion/index.js +1 -0
  5. package/dist/components/Affix/Affix.js +1 -0
  6. package/dist/components/Affix/index.js +1 -0
  7. package/dist/components/Alert/Alert.js +20 -18
  8. package/dist/components/Alert/index.js +1 -0
  9. package/dist/components/ApprovalCard/ApprovalCard.js +28 -25
  10. package/dist/components/ApprovalCard/index.js +1 -0
  11. package/dist/components/AspectRatio/AspectRatio.js +1 -0
  12. package/dist/components/AspectRatio/index.js +1 -0
  13. package/dist/components/AsyncSection/AsyncSection.js +33 -30
  14. package/dist/components/AsyncSection/index.js +1 -0
  15. package/dist/components/Avatar/Avatar.js +1 -0
  16. package/dist/components/Avatar/index.js +1 -0
  17. package/dist/components/AvatarGroup/AvatarGroup.js +30 -0
  18. package/dist/components/AvatarGroup/index.js +3 -0
  19. package/dist/components/BackToTop/BackToTop.js +16 -14
  20. package/dist/components/BackToTop/index.js +1 -0
  21. package/dist/components/Badge/Badge.js +1 -0
  22. package/dist/components/Badge/index.js +1 -0
  23. package/dist/components/Banner/Banner.js +20 -18
  24. package/dist/components/Banner/index.js +1 -0
  25. package/dist/components/BottomSheet/BottomSheet.js +1 -0
  26. package/dist/components/BottomSheet/index.js +1 -0
  27. package/dist/components/Breadcrumb/Breadcrumb.js +19 -17
  28. package/dist/components/Breadcrumb/BreadcrumbItem.js +1 -0
  29. package/dist/components/Breadcrumb/index.js +1 -0
  30. package/dist/components/Button/Button.js +1 -0
  31. package/dist/components/Button/ButtonLink.js +1 -0
  32. package/dist/components/Button/index.js +1 -0
  33. package/dist/components/Button/styles.js +1 -0
  34. package/dist/components/Calendar/Calendar.js +124 -0
  35. package/dist/components/Calendar/date.js +54 -0
  36. package/dist/components/Calendar/index.js +3 -0
  37. package/dist/components/Card/Card.js +1 -0
  38. package/dist/components/Card/index.js +1 -0
  39. package/dist/components/Carousel/Carousel.js +43 -40
  40. package/dist/components/Carousel/CarouselSlide.js +1 -0
  41. package/dist/components/Carousel/index.js +1 -0
  42. package/dist/components/Cascader/Cascader.js +228 -0
  43. package/dist/components/Cascader/index.js +3 -0
  44. package/dist/components/ChatContainer/ChatContainer.js +1 -0
  45. package/dist/components/ChatContainer/index.js +1 -0
  46. package/dist/components/ChatInput/ChatInput.js +31 -29
  47. package/dist/components/ChatInput/index.js +1 -0
  48. package/dist/components/ChatMessage/ChatMessage.js +29 -27
  49. package/dist/components/ChatMessage/index.js +1 -0
  50. package/dist/components/Checkbox/Checkbox.js +1 -0
  51. package/dist/components/Checkbox/CheckboxCore.js +1 -0
  52. package/dist/components/Checkbox/index.js +1 -0
  53. package/dist/components/Chip/Chip.js +21 -19
  54. package/dist/components/Chip/index.js +1 -0
  55. package/dist/components/CodeBlock/CodeBlock.js +1 -0
  56. package/dist/components/CodeBlock/index.js +1 -0
  57. package/dist/components/Collapsible/Collapsible.js +1 -0
  58. package/dist/components/Collapsible/index.js +1 -0
  59. package/dist/components/ColorPicker/ColorPicker.js +1 -0
  60. package/dist/components/ColorPicker/ColorPickerCore.js +29 -26
  61. package/dist/components/ColorPicker/index.js +1 -0
  62. package/dist/components/Combobox/Combobox.js +70 -41
  63. package/dist/components/Combobox/ComboboxOption.js +9 -5
  64. package/dist/components/Combobox/index.js +1 -0
  65. package/dist/components/Command/Command.js +1 -0
  66. package/dist/components/Command/index.js +1 -0
  67. package/dist/components/ConfirmDialog/ConfirmDialog.js +41 -39
  68. package/dist/components/ConfirmDialog/index.js +1 -0
  69. package/dist/components/Container/Container.js +1 -0
  70. package/dist/components/Container/index.js +1 -0
  71. package/dist/components/ContextMenu/ContextMenu.js +1 -0
  72. package/dist/components/ContextMenu/ContextMenuContent.js +1 -0
  73. package/dist/components/ContextMenu/ContextMenuContext.js +1 -0
  74. package/dist/components/ContextMenu/ContextMenuItem.js +1 -0
  75. package/dist/components/ContextMenu/ContextMenuSeparator.js +1 -0
  76. package/dist/components/ContextMenu/ContextMenuTrigger.js +1 -0
  77. package/dist/components/ContextMenu/index.js +1 -0
  78. package/dist/components/ConversationList/ConversationItem.js +1 -0
  79. package/dist/components/ConversationList/ConversationList.js +1 -0
  80. package/dist/components/ConversationList/index.js +1 -0
  81. package/dist/components/DataTable/DataTable.js +193 -0
  82. package/dist/components/DataTable/index.js +3 -0
  83. package/dist/components/DateRangePicker/DateRangePicker.js +1 -0
  84. package/dist/components/DateRangePicker/DateRangePickerCore.js +22 -19
  85. package/dist/components/DateRangePicker/index.js +1 -0
  86. package/dist/components/Datepicker/Datepicker.js +11 -8
  87. package/dist/components/Datepicker/DatepickerCore.js +19 -16
  88. package/dist/components/Datepicker/index.js +1 -0
  89. package/dist/components/Dialog/Dialog.js +1 -0
  90. package/dist/components/Dialog/index.js +1 -0
  91. package/dist/components/DiffViewer/DiffViewer.js +1 -0
  92. package/dist/components/DiffViewer/index.js +1 -0
  93. package/dist/components/Disclosure/Disclosure.js +1 -0
  94. package/dist/components/Disclosure/index.js +1 -0
  95. package/dist/components/Divider/Divider.js +1 -0
  96. package/dist/components/Divider/index.js +1 -0
  97. package/dist/components/Drawer/Drawer.js +1 -0
  98. package/dist/components/Drawer/index.js +1 -0
  99. package/dist/components/DropdownMenu/DropdownMenu.js +1 -0
  100. package/dist/components/DropdownMenu/DropdownMenuContent.js +1 -0
  101. package/dist/components/DropdownMenu/DropdownMenuContext.js +1 -0
  102. package/dist/components/DropdownMenu/DropdownMenuItem.js +1 -0
  103. package/dist/components/DropdownMenu/DropdownMenuSeparator.js +1 -0
  104. package/dist/components/DropdownMenu/DropdownMenuTrigger.js +1 -0
  105. package/dist/components/DropdownMenu/index.js +1 -0
  106. package/dist/components/Empty/Empty.js +22 -19
  107. package/dist/components/Empty/index.js +1 -0
  108. package/dist/components/FileInput/FileInput.js +15 -13
  109. package/dist/components/FileInput/index.js +1 -0
  110. package/dist/components/Flex/Flex.js +1 -0
  111. package/dist/components/Flex/index.js +1 -0
  112. package/dist/components/Grid/Grid.js +1 -0
  113. package/dist/components/Grid/GridItem.js +1 -0
  114. package/dist/components/Grid/index.js +1 -0
  115. package/dist/components/HoverCard/HoverCard.js +54 -0
  116. package/dist/components/HoverCard/index.js +3 -0
  117. package/dist/components/Icon/Icon.js +1 -0
  118. package/dist/components/Icon/index.js +1 -0
  119. package/dist/components/Image/Image.js +1 -0
  120. package/dist/components/Image/index.js +1 -0
  121. package/dist/components/InlineEdit/InlineEdit.js +33 -31
  122. package/dist/components/InlineEdit/index.js +1 -0
  123. package/dist/components/Input/Input.js +1 -0
  124. package/dist/components/Input/InputCore.js +1 -0
  125. package/dist/components/Input/index.js +1 -0
  126. package/dist/components/Kbd/Kbd.js +22 -0
  127. package/dist/components/Kbd/index.js +3 -0
  128. package/dist/components/List/List.js +1 -0
  129. package/dist/components/List/ListItem.js +1 -0
  130. package/dist/components/List/index.js +1 -0
  131. package/dist/components/LocaleProvider/LocaleContext.js +6 -0
  132. package/dist/components/LocaleProvider/LocaleProvider.js +22 -0
  133. package/dist/components/LocaleProvider/index.js +6 -0
  134. package/dist/components/LocaleProvider/locale.js +132 -0
  135. package/dist/components/LocaleProvider/useStrings.js +27 -0
  136. package/dist/components/LocaleProvider/zh-cn.js +128 -0
  137. package/dist/components/LogViewer/LogViewer.js +45 -43
  138. package/dist/components/LogViewer/index.js +1 -0
  139. package/dist/components/MarkdownRenderer/MarkdownRenderer.js +20 -19
  140. package/dist/components/MarkdownRenderer/index.js +1 -0
  141. package/dist/components/MarkdownRenderer/markdown-blocks.js +42 -0
  142. package/dist/components/Mentions/Mentions.js +17 -0
  143. package/dist/components/Mentions/MentionsCore.js +116 -0
  144. package/dist/components/Mentions/index.js +4 -0
  145. package/dist/components/Menu/Menu.js +1 -0
  146. package/dist/components/Menu/MenuDivider.js +1 -0
  147. package/dist/components/Menu/MenuItem.js +1 -0
  148. package/dist/components/Menu/index.js +1 -0
  149. package/dist/components/ModelPicker/ModelPicker.js +17 -15
  150. package/dist/components/ModelPicker/index.js +1 -0
  151. package/dist/components/NavigationBar/NavLink.js +1 -0
  152. package/dist/components/NavigationBar/NavigationBar.js +1 -0
  153. package/dist/components/NavigationBar/index.js +1 -0
  154. package/dist/components/NumberInput/NumberInput.js +1 -0
  155. package/dist/components/NumberInput/NumberInputCore.js +35 -33
  156. package/dist/components/NumberInput/index.js +1 -0
  157. package/dist/components/OTPInput/OTPInput.js +1 -0
  158. package/dist/components/OTPInput/OTPInputCore.js +36 -30
  159. package/dist/components/OTPInput/index.js +1 -0
  160. package/dist/components/Pagination/Pagination.js +32 -30
  161. package/dist/components/Pagination/index.js +1 -0
  162. package/dist/components/PasswordInput/PasswordInput.js +1 -0
  163. package/dist/components/PasswordInput/PasswordInputCore.js +23 -21
  164. package/dist/components/PasswordInput/index.js +1 -0
  165. package/dist/components/Popover/Popover.js +1 -0
  166. package/dist/components/Popover/index.js +1 -0
  167. package/dist/components/Progress/Progress.js +41 -39
  168. package/dist/components/Progress/index.js +1 -0
  169. package/dist/components/Radio/Radio.js +1 -0
  170. package/dist/components/Radio/RadioContext.js +1 -0
  171. package/dist/components/Radio/RadioGroup.js +1 -0
  172. package/dist/components/Radio/RadioGroupCore.js +1 -0
  173. package/dist/components/Radio/index.js +1 -0
  174. package/dist/components/Rating/Rating.js +1 -0
  175. package/dist/components/Rating/RatingCore.js +29 -26
  176. package/dist/components/Rating/index.js +1 -0
  177. package/dist/components/Resizable/Resizable.js +1 -0
  178. package/dist/components/Resizable/index.js +1 -0
  179. package/dist/components/ScrollArea/ScrollArea.js +1 -0
  180. package/dist/components/ScrollArea/index.js +1 -0
  181. package/dist/components/Segmented/Segmented.js +1 -0
  182. package/dist/components/Segmented/SegmentedCore.js +1 -0
  183. package/dist/components/Segmented/index.js +1 -0
  184. package/dist/components/Select/Option.js +1 -0
  185. package/dist/components/Select/Select.js +1 -0
  186. package/dist/components/Select/SelectCore.js +1 -0
  187. package/dist/components/Select/index.js +1 -0
  188. package/dist/components/Sidebar/Sidebar.js +113 -0
  189. package/dist/components/Sidebar/index.js +3 -0
  190. package/dist/components/Skeleton/Skeleton.js +1 -0
  191. package/dist/components/Skeleton/index.js +1 -0
  192. package/dist/components/Slider/Slider.js +1 -0
  193. package/dist/components/Slider/SliderCore.js +1 -0
  194. package/dist/components/Slider/index.js +1 -0
  195. package/dist/components/Spinner/Spinner.js +15 -12
  196. package/dist/components/Spinner/index.js +1 -0
  197. package/dist/components/Stat/Stat.js +1 -0
  198. package/dist/components/Stat/index.js +1 -0
  199. package/dist/components/StepTimeline/StepTimeline.js +1 -0
  200. package/dist/components/StepTimeline/index.js +1 -0
  201. package/dist/components/Stepper/Step.js +1 -0
  202. package/dist/components/Stepper/Stepper.js +1 -0
  203. package/dist/components/Stepper/StepperContext.js +1 -0
  204. package/dist/components/Stepper/index.js +1 -0
  205. package/dist/components/StreamingText/StreamingText.js +39 -18
  206. package/dist/components/StreamingText/index.js +1 -0
  207. package/dist/components/SwipeAction/SwipeAction.js +1 -0
  208. package/dist/components/SwipeAction/index.js +1 -0
  209. package/dist/components/Switch/Switch.js +1 -0
  210. package/dist/components/Switch/SwitchCore.js +1 -0
  211. package/dist/components/Switch/index.js +1 -0
  212. package/dist/components/Table/Table.js +1 -0
  213. package/dist/components/Table/TableBody.js +1 -0
  214. package/dist/components/Table/TableCell.js +1 -0
  215. package/dist/components/Table/TableHead.js +1 -0
  216. package/dist/components/Table/TableRow.js +1 -0
  217. package/dist/components/Table/index.js +1 -0
  218. package/dist/components/Tabs/Tab.js +1 -0
  219. package/dist/components/Tabs/TabList.js +1 -0
  220. package/dist/components/Tabs/TabPanel.js +1 -0
  221. package/dist/components/Tabs/Tabs.js +1 -0
  222. package/dist/components/Tabs/TabsContext.js +1 -0
  223. package/dist/components/Tabs/index.js +1 -0
  224. package/dist/components/Tag/Tag.js +17 -14
  225. package/dist/components/Tag/index.js +1 -0
  226. package/dist/components/TagGroup/TagGroup.js +1 -0
  227. package/dist/components/TagGroup/TagGroupItem.js +13 -10
  228. package/dist/components/TagGroup/index.js +1 -0
  229. package/dist/components/TagInput/TagInput.js +1 -0
  230. package/dist/components/TagInput/TagInputCore.js +53 -50
  231. package/dist/components/TagInput/index.js +1 -0
  232. package/dist/components/Textarea/Textarea.js +1 -0
  233. package/dist/components/Textarea/TextareaCore.js +1 -0
  234. package/dist/components/Textarea/index.js +1 -0
  235. package/dist/components/ThinkingIndicator/ThinkingIndicator.js +14 -11
  236. package/dist/components/ThinkingIndicator/index.js +1 -0
  237. package/dist/components/TimePicker/TimePicker.js +1 -0
  238. package/dist/components/TimePicker/TimePickerCore.js +1 -0
  239. package/dist/components/TimePicker/index.js +1 -0
  240. package/dist/components/Timeline/Timeline.js +1 -0
  241. package/dist/components/Timeline/index.js +1 -0
  242. package/dist/components/Toast/Toast.js +36 -30
  243. package/dist/components/Toast/ToastContainer.js +45 -28
  244. package/dist/components/Toast/ToastContext.js +1 -0
  245. package/dist/components/Toast/index.js +5 -3
  246. package/dist/components/Toast/toast2.js +45 -0
  247. package/dist/components/Toast/useToast.js +1 -0
  248. package/dist/components/TokenCounter/TokenCounter.js +20 -18
  249. package/dist/components/TokenCounter/index.js +1 -0
  250. package/dist/components/ToolCallCard/ToolCallCard.js +40 -37
  251. package/dist/components/ToolCallCard/index.js +1 -0
  252. package/dist/components/Toolbar/Toolbar.js +60 -0
  253. package/dist/components/Toolbar/ToolbarButton.js +26 -0
  254. package/dist/components/Toolbar/ToolbarContext.js +9 -0
  255. package/dist/components/Toolbar/ToolbarSeparator.js +23 -0
  256. package/dist/components/Toolbar/index.js +5 -0
  257. package/dist/components/Tooltip/Tooltip.js +1 -0
  258. package/dist/components/Tooltip/index.js +1 -0
  259. package/dist/components/Tour/Tour.js +198 -0
  260. package/dist/components/Tour/index.js +3 -0
  261. package/dist/components/Transfer/Transfer.js +1 -0
  262. package/dist/components/Transfer/TransferCore.js +62 -67
  263. package/dist/components/Transfer/index.js +1 -0
  264. package/dist/components/Tree/Tree.js +1 -0
  265. package/dist/components/Tree/TreeItem.js +57 -55
  266. package/dist/components/Tree/index.js +1 -0
  267. package/dist/components/Tree/utils.js +1 -0
  268. package/dist/components/Typography/Typography.js +1 -0
  269. package/dist/components/Typography/index.js +1 -0
  270. package/dist/components/Upload/Upload.js +1 -0
  271. package/dist/components/Upload/UploadCore.js +37 -35
  272. package/dist/components/Upload/index.js +1 -0
  273. package/dist/components/VirtualList/VirtualList.js +141 -26
  274. package/dist/components/VirtualList/index.js +1 -0
  275. package/dist/css/accordion.css +1 -1
  276. package/dist/css/affix.css +1 -1
  277. package/dist/css/alert.css +1 -1
  278. package/dist/css/approval-card.css +1 -1
  279. package/dist/css/async-section.css +1 -1
  280. package/dist/css/avatar-group.css +2 -0
  281. package/dist/css/back-to-top.css +1 -1
  282. package/dist/css/breadcrumb.css +1 -1
  283. package/dist/css/button.css +1 -1
  284. package/dist/css/calendar.css +2 -0
  285. package/dist/css/carousel.css +1 -1
  286. package/dist/css/cascader.css +2 -0
  287. package/dist/css/chat-input.css +1 -1
  288. package/dist/css/chat-message.css +1 -1
  289. package/dist/css/checkbox.css +1 -1
  290. package/dist/css/chip.css +1 -1
  291. package/dist/css/code-block.css +1 -1
  292. package/dist/css/color-picker.css +1 -1
  293. package/dist/css/combobox.css +1 -1
  294. package/dist/css/command.css +1 -1
  295. package/dist/css/container.css +1 -1
  296. package/dist/css/context-menu.css +1 -1
  297. package/dist/css/conversation-list.css +1 -1
  298. package/dist/css/data-table.css +2 -0
  299. package/dist/css/date-range-picker.css +1 -1
  300. package/dist/css/datepicker.css +1 -2
  301. package/dist/css/diff-viewer.css +1 -1
  302. package/dist/css/disclosure.css +1 -1
  303. package/dist/css/dropdown-menu.css +1 -1
  304. package/dist/css/file-input.css +1 -1
  305. package/dist/css/hover-card.css +2 -0
  306. package/dist/css/inline-edit.css +1 -1
  307. package/dist/css/input.css +1 -1
  308. package/dist/css/kbd.css +2 -0
  309. package/dist/css/list.css +1 -1
  310. package/dist/css/log-viewer.css +1 -1
  311. package/dist/css/markdown-renderer.css +1 -1
  312. package/dist/css/mentions.css +2 -0
  313. package/dist/css/menu.css +1 -1
  314. package/dist/css/model-picker.css +1 -1
  315. package/dist/css/navigation-bar.css +2 -2
  316. package/dist/css/number-input.css +1 -1
  317. package/dist/css/otp-input.css +1 -1
  318. package/dist/css/pagination.css +1 -1
  319. package/dist/css/password-input.css +1 -1
  320. package/dist/css/progress.css +1 -1
  321. package/dist/css/radio.css +1 -1
  322. package/dist/css/rating.css +1 -1
  323. package/dist/css/resizable.css +1 -1
  324. package/dist/css/segmented.css +1 -1
  325. package/dist/css/select.css +1 -1
  326. package/dist/css/sidebar.css +2 -0
  327. package/dist/css/slider.css +1 -1
  328. package/dist/css/step-timeline.css +1 -1
  329. package/dist/css/stepper.css +1 -1
  330. package/dist/css/streaming-text.css +1 -1
  331. package/dist/css/swipe-action.css +1 -1
  332. package/dist/css/switch.css +1 -1
  333. package/dist/css/table.css +1 -1
  334. package/dist/css/tabs.css +1 -1
  335. package/dist/css/tag-input.css +1 -1
  336. package/dist/css/tag.css +1 -1
  337. package/dist/css/textarea.css +1 -1
  338. package/dist/css/time-picker.css +1 -1
  339. package/dist/css/token-counter.css +1 -1
  340. package/dist/css/tokens.css +1 -1
  341. package/dist/css/toolbar.css +4 -0
  342. package/dist/css/tour.css +2 -0
  343. package/dist/css/tree.css +1 -1
  344. package/dist/css/upload.css +1 -1
  345. package/dist/css/virtual-list.css +1 -1
  346. package/dist/css-manifest.json +29 -1
  347. package/dist/form/FormItem.js +1 -0
  348. package/dist/form/index.js +1 -0
  349. package/dist/haze-ui.css +74 -63
  350. package/dist/hooks/useClipboard.js +30 -0
  351. package/dist/hooks/useDebouncedCallback.js +17 -0
  352. package/dist/hooks/useDebouncedValue.js +12 -0
  353. package/dist/hooks/useMediaQuery.js +13 -0
  354. package/dist/hooks/usePrefersReducedMotion.js +9 -0
  355. package/dist/hooks/useTitle.js +1 -0
  356. package/dist/index.js +139 -115
  357. package/dist/registry.json +247 -0
  358. package/dist/tokens/colors.js +1 -0
  359. package/dist/tokens/index.js +1 -0
  360. package/dist/tokens/motion.js +1 -0
  361. package/dist/tokens/oklch.js +1 -0
  362. package/dist/tokens/palette.js +1 -0
  363. package/dist/tokens/registry.js +1 -0
  364. package/dist/tokens/spacing.js +1 -0
  365. package/dist/tokens/typography.js +1 -0
  366. package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +9 -0
  367. package/dist/types/components/AvatarGroup/index.d.ts +2 -0
  368. package/dist/types/components/Calendar/Calendar.d.ts +21 -0
  369. package/dist/types/components/Calendar/date.d.ts +79 -0
  370. package/dist/types/components/Calendar/index.d.ts +2 -0
  371. package/dist/types/components/Cascader/Cascader.d.ts +26 -0
  372. package/dist/types/components/Cascader/index.d.ts +2 -0
  373. package/dist/types/components/Combobox/Combobox.d.ts +7 -1
  374. package/dist/types/components/Combobox/ComboboxOption.d.ts +13 -1
  375. package/dist/types/components/DataTable/DataTable.d.ts +102 -0
  376. package/dist/types/components/DataTable/index.d.ts +2 -0
  377. package/dist/types/components/Datepicker/Datepicker.d.ts +3 -1
  378. package/dist/types/components/Datepicker/DatepickerCore.d.ts +3 -1
  379. package/dist/types/components/HoverCard/HoverCard.d.ts +49 -0
  380. package/dist/types/components/HoverCard/index.d.ts +2 -0
  381. package/dist/types/components/Kbd/Kbd.d.ts +6 -0
  382. package/dist/types/components/Kbd/index.d.ts +2 -0
  383. package/dist/types/components/LocaleProvider/LocaleContext.d.ts +19 -0
  384. package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +16 -0
  385. package/dist/types/components/LocaleProvider/index.d.ts +7 -0
  386. package/dist/types/components/LocaleProvider/locale.d.ts +182 -0
  387. package/dist/types/components/LocaleProvider/useStrings.d.ts +10 -0
  388. package/dist/types/components/LocaleProvider/zh-cn.d.ts +13 -0
  389. package/dist/types/components/MarkdownRenderer/markdown-blocks.d.ts +6 -0
  390. package/dist/types/components/Mentions/Mentions.d.ts +17 -0
  391. package/dist/types/components/Mentions/MentionsCore.d.ts +21 -0
  392. package/dist/types/components/Mentions/index.d.ts +4 -0
  393. package/dist/types/components/Sidebar/Sidebar.d.ts +64 -0
  394. package/dist/types/components/Sidebar/index.d.ts +4 -0
  395. package/dist/types/components/Toast/index.d.ts +2 -0
  396. package/dist/types/components/Toast/toast.d.ts +46 -0
  397. package/dist/types/components/Toolbar/Toolbar.d.ts +16 -0
  398. package/dist/types/components/Toolbar/ToolbarButton.d.ts +20 -0
  399. package/dist/types/components/Toolbar/ToolbarContext.d.ts +5 -0
  400. package/dist/types/components/Toolbar/ToolbarSeparator.d.ts +14 -0
  401. package/dist/types/components/Toolbar/index.d.ts +6 -0
  402. package/dist/types/components/Tour/Tour.d.ts +46 -0
  403. package/dist/types/components/Tour/index.d.ts +2 -0
  404. package/dist/types/components/VirtualList/VirtualList.d.ts +58 -4
  405. package/dist/types/components/VirtualList/index.d.ts +1 -1
  406. package/dist/types/hooks/index.d.ts +6 -0
  407. package/dist/types/hooks/useClipboard.d.ts +31 -0
  408. package/dist/types/hooks/useDebouncedCallback.d.ts +21 -0
  409. package/dist/types/hooks/useDebouncedValue.d.ts +20 -0
  410. package/dist/types/hooks/useMediaQuery.d.ts +17 -0
  411. package/dist/types/hooks/usePrefersReducedMotion.d.ts +14 -0
  412. package/dist/types/index.d.ts +28 -4
  413. package/dist/utils/classnames.js +1 -0
  414. package/dist/utils/collision.js +1 -0
  415. package/dist/utils/floating.js +1 -0
  416. package/dist/utils/focus-scope.js +1 -0
  417. package/dist/utils/focus.js +1 -0
  418. package/dist/utils/menuKeyboard.js +1 -0
  419. package/dist/utils/presence.js +1 -0
  420. package/package.json +34 -18
  421. package/dist/components/Datepicker/Calendar.js +0 -120
  422. package/dist/types/components/Datepicker/Calendar.d.ts +0 -8
@@ -1,31 +1,33 @@
1
1
 
2
+ "use client";
2
3
  import { classnames as e } from "../../utils/classnames.js";
4
+ import { useStrings as t } from "../LocaleProvider/useStrings.js";
3
5
  /* empty css */
4
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
6
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
7
  //#region src/lib/components/TokenCounter/TokenCounter.tsx
6
- var r = "haze-TokenCounter__wrapper", i = "haze-TokenCounter__bar", a = "haze-TokenCounter__fill", o = "haze-TokenCounter__fillNormal", s = "haze-TokenCounter__fillWarning", c = "haze-TokenCounter__fillDanger", l = "haze-TokenCounter__info", u = "haze-TokenCounter__count";
7
- function d({ used: d, max: f, label: p, className: m }) {
8
- let h = f > 0 ? Math.min(100, d / f * 100) : 0, g = h > 90 ? c : h > 70 ? s : o;
9
- return /* @__PURE__ */ n("div", {
10
- className: e([r, m]),
11
- children: [/* @__PURE__ */ n("div", {
12
- className: e([l]),
13
- children: [/* @__PURE__ */ t("span", { children: p || "Tokens" }), /* @__PURE__ */ n("span", {
14
- className: e([u]),
8
+ var i = "haze-TokenCounter__wrapper", a = "haze-TokenCounter__bar", o = "haze-TokenCounter__fill", s = "haze-TokenCounter__fillNormal", c = "haze-TokenCounter__fillWarning", l = "haze-TokenCounter__fillDanger", u = "haze-TokenCounter__info", d = "haze-TokenCounter__count";
9
+ function f({ used: f, max: p, label: m, className: h }) {
10
+ let g = p > 0 ? Math.min(100, f / p * 100) : 0, _ = g > 90 ? l : g > 70 ? c : s, v = t("tokenCounter");
11
+ return /* @__PURE__ */ r("div", {
12
+ className: e([i, h]),
13
+ children: [/* @__PURE__ */ r("div", {
14
+ className: e([u]),
15
+ children: [/* @__PURE__ */ n("span", { children: m || v.label }), /* @__PURE__ */ r("span", {
16
+ className: e([d]),
15
17
  children: [
16
- d.toLocaleString(),
18
+ f.toLocaleString(),
17
19
  " / ",
18
- f.toLocaleString()
20
+ p.toLocaleString()
19
21
  ]
20
22
  })]
21
- }), /* @__PURE__ */ t("div", {
22
- className: e([i]),
23
- children: /* @__PURE__ */ t("div", {
24
- style: { width: `${h}%` },
25
- className: e([a, g])
23
+ }), /* @__PURE__ */ n("div", {
24
+ className: e([a]),
25
+ children: /* @__PURE__ */ n("div", {
26
+ style: { width: `${g}%` },
27
+ className: e([o, _])
26
28
  })
27
29
  })]
28
30
  });
29
31
  }
30
32
  //#endregion
31
- export { d as default };
33
+ export { f as default };
@@ -1,2 +1,3 @@
1
+ "use client";
1
2
  import e from "./TokenCounter.js";
2
3
  export { e as TokenCounter };
@@ -1,54 +1,57 @@
1
1
 
2
+ "use client";
2
3
  import { classnames as e } from "../../utils/classnames.js";
4
+ import { useStrings as t } from "../LocaleProvider/useStrings.js";
3
5
  /* empty css */
4
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
6
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
7
  //#region src/lib/components/ToolCallCard/ToolCallCard.tsx
6
- var r = "haze-ToolCallCard__card", i = "haze-ToolCallCard__header", a = "haze-ToolCallCard__statusIcon", o = "haze-ToolCallCard__statusPending", s = "haze-ToolCallCard__statusRunning", c = "haze-ToolCallCard__statusDone", l = "haze-ToolCallCard__statusError", u = "haze-ToolCallCard__body", d = "haze-ToolCallCard__section", f = "haze-ToolCallCard__sectionLabel", p = "haze-ToolCallCard__content", m = {
7
- pending: o,
8
- running: s,
9
- done: c,
10
- error: l
11
- }, h = {
12
- pending: "Pending",
13
- running: "Running...",
14
- done: "Done",
15
- error: "Error"
8
+ var i = "haze-ToolCallCard__card", a = "haze-ToolCallCard__header", o = "haze-ToolCallCard__statusIcon", s = "haze-ToolCallCard__statusPending", c = "haze-ToolCallCard__statusRunning", l = "haze-ToolCallCard__statusDone", u = "haze-ToolCallCard__statusError", d = "haze-ToolCallCard__body", f = "haze-ToolCallCard__section", p = "haze-ToolCallCard__sectionLabel", m = "haze-ToolCallCard__content", h = {
9
+ pending: s,
10
+ running: c,
11
+ done: l,
12
+ error: u
16
13
  };
17
- function g({ name: o, input: s, output: c, status: l = "pending", className: g }) {
18
- return /* @__PURE__ */ n("div", {
19
- className: e([r, g]),
20
- children: [/* @__PURE__ */ n("div", {
21
- className: e([i]),
14
+ function g({ name: s, input: c, output: l, status: u = "pending", className: g }) {
15
+ let _ = t("toolCallCard"), v = {
16
+ pending: _.pending,
17
+ running: _.running,
18
+ done: _.done,
19
+ error: _.error
20
+ };
21
+ return /* @__PURE__ */ r("div", {
22
+ className: e([i, g]),
23
+ children: [/* @__PURE__ */ r("div", {
24
+ className: e([a]),
22
25
  children: [
23
- /* @__PURE__ */ t("span", { className: e([a, m[l]]) }),
24
- /* @__PURE__ */ t("span", { children: o }),
25
- /* @__PURE__ */ t("span", {
26
+ /* @__PURE__ */ n("span", { className: e([o, h[u]]) }),
27
+ /* @__PURE__ */ n("span", { children: s }),
28
+ /* @__PURE__ */ n("span", {
26
29
  style: {
27
- marginLeft: "auto",
30
+ marginInlineStart: "auto",
28
31
  color: "var(--haze-color-text-muted)"
29
32
  },
30
- children: h[l]
33
+ children: v[u]
31
34
  })
32
35
  ]
33
- }), (s || c) && /* @__PURE__ */ n("div", {
34
- className: e([u]),
35
- children: [s && /* @__PURE__ */ n("div", {
36
- className: e([d]),
37
- children: [/* @__PURE__ */ t("div", {
38
- className: e([f]),
39
- children: "Input"
40
- }), /* @__PURE__ */ t("div", {
36
+ }), (c || l) && /* @__PURE__ */ r("div", {
37
+ className: e([d]),
38
+ children: [c && /* @__PURE__ */ r("div", {
39
+ className: e([f]),
40
+ children: [/* @__PURE__ */ n("div", {
41
41
  className: e([p]),
42
- children: s
42
+ children: _.inputLabel
43
+ }), /* @__PURE__ */ n("div", {
44
+ className: e([m]),
45
+ children: c
43
46
  })]
44
- }), c && /* @__PURE__ */ n("div", {
45
- className: e([d]),
46
- children: [/* @__PURE__ */ t("div", {
47
- className: e([f]),
48
- children: "Output"
49
- }), /* @__PURE__ */ t("div", {
47
+ }), l && /* @__PURE__ */ r("div", {
48
+ className: e([f]),
49
+ children: [/* @__PURE__ */ n("div", {
50
50
  className: e([p]),
51
- children: c
51
+ children: _.outputLabel
52
+ }), /* @__PURE__ */ n("div", {
53
+ className: e([m]),
54
+ children: l
52
55
  })]
53
56
  })]
54
57
  })]
@@ -1,2 +1,3 @@
1
+ "use client";
1
2
  import e from "./ToolCallCard.js";
2
3
  export { e as ToolCallCard };
@@ -0,0 +1,60 @@
1
+
2
+ "use client";
3
+ import { classnames as e } from "../../utils/classnames.js";
4
+ import { getEnabledMenuItems as t, useRovingTabindex as n } from "../../utils/menuKeyboard.js";
5
+ import { ToolbarProvider as r } from "./ToolbarContext.js";
6
+ /* empty css */
7
+ import { jsx as i } from "react/jsx-runtime";
8
+ import { useCallback as a, useRef as o } from "react";
9
+ //#region src/lib/components/Toolbar/Toolbar.tsx
10
+ var s = "[data-haze-toolbar-item]:not([disabled])", c = "haze-Toolbar__toolbar", l = "haze-Toolbar__vertical";
11
+ function u(e, n) {
12
+ return a((r) => {
13
+ let i = e === "horizontal" ? "ArrowRight" : "ArrowDown", a = e === "horizontal" ? "ArrowLeft" : "ArrowUp";
14
+ if (r.key !== i && r.key !== a && r.key !== "Home" && r.key !== "End") return;
15
+ let o = t(n.current, s);
16
+ if (o.length === 0) return;
17
+ let c = o.indexOf(document.activeElement), l = (e) => o[e]?.focus();
18
+ switch (r.preventDefault(), r.key) {
19
+ case i:
20
+ l((c + 1) % o.length);
21
+ return;
22
+ case a:
23
+ l((c - 1 + o.length) % o.length);
24
+ return;
25
+ case "Home":
26
+ l(0);
27
+ return;
28
+ case "End":
29
+ l(o.length - 1);
30
+ return;
31
+ }
32
+ }, [e, n]);
33
+ }
34
+ function d({ orientation: t = "horizontal", className: a, children: d, ...f }) {
35
+ let p = o(null);
36
+ n({
37
+ menuRef: p,
38
+ active: !0,
39
+ selector: s
40
+ });
41
+ let m = u(t, p);
42
+ return /* @__PURE__ */ i(r, {
43
+ value: t,
44
+ children: i("div", {
45
+ ref: p,
46
+ role: "toolbar",
47
+ "aria-orientation": t,
48
+ onKeyDown: m,
49
+ ...f,
50
+ className: e([
51
+ c,
52
+ t === "vertical" && l,
53
+ a
54
+ ]),
55
+ children: d
56
+ })
57
+ });
58
+ }
59
+ //#endregion
60
+ export { d as default };
@@ -0,0 +1,26 @@
1
+
2
+ "use client";
3
+ import { classnames as e } from "../../utils/classnames.js";
4
+ import { base as t, sizes as n, squareSizes as r, variants as i } from "../Button/styles.js";
5
+ /* empty css */
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ //#region src/lib/components/Toolbar/ToolbarButton.tsx
8
+ var o = "haze-ToolbarButton__toolbarItem";
9
+ function s({ variant: s = "ghost", size: c = "md", square: l = !1, className: u, ...d }) {
10
+ let f = l ? r[c] : n[c];
11
+ return /* @__PURE__ */ a("button", {
12
+ type: "button",
13
+ "data-haze-toolbar-item": "",
14
+ tabIndex: -1,
15
+ ...d,
16
+ className: e([
17
+ t,
18
+ i[s],
19
+ f,
20
+ o,
21
+ u
22
+ ])
23
+ });
24
+ }
25
+ //#endregion
26
+ export { s as default };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { createContext as e, useContext as t } from "react";
3
+ //#region src/lib/components/Toolbar/ToolbarContext.ts
4
+ var n = e(void 0), r = n.Provider;
5
+ function i() {
6
+ return t(n) ?? "horizontal";
7
+ }
8
+ //#endregion
9
+ export { r as ToolbarProvider, i as useToolbarOrientation };
@@ -0,0 +1,23 @@
1
+
2
+ "use client";
3
+ import { classnames as e } from "../../utils/classnames.js";
4
+ import { useToolbarOrientation as t } from "./ToolbarContext.js";
5
+ /* empty css */
6
+ import { jsx as n } from "react/jsx-runtime";
7
+ //#region src/lib/components/Toolbar/ToolbarSeparator.tsx
8
+ var r = "haze-ToolbarSeparator__separator", i = "haze-ToolbarSeparator__horizontalRule";
9
+ function a({ className: a, ...o }) {
10
+ let s = t() === "vertical";
11
+ return /* @__PURE__ */ n("div", {
12
+ role: "separator",
13
+ "aria-orientation": s ? "horizontal" : "vertical",
14
+ ...o,
15
+ className: e([
16
+ r,
17
+ s && i,
18
+ a
19
+ ])
20
+ });
21
+ }
22
+ //#endregion
23
+ export { a as default };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import e from "./Toolbar.js";
3
+ import t from "./ToolbarButton.js";
4
+ import n from "./ToolbarSeparator.js";
5
+ export { e as Toolbar, t as ToolbarButton, n as ToolbarSeparator };
@@ -1,4 +1,5 @@
1
1
 
2
+ "use client";
2
3
  import { classnames as e } from "../../utils/classnames.js";
3
4
  import { floatingPlacementClasses as t, useFloating as n, useFloatingPosition as r } from "../../utils/floating.js";
4
5
  /* empty css */
@@ -1,2 +1,3 @@
1
+ "use client";
1
2
  import e from "./Tooltip.js";
2
3
  export { e as Tooltip };
@@ -0,0 +1,198 @@
1
+
2
+ "use client";
3
+ import { classnames as e } from "../../utils/classnames.js";
4
+ import { Presence as t } from "../../utils/presence.js";
5
+ import { computeFloatingPosition as n, resolvePadding as r } from "../../utils/collision.js";
6
+ import { formatString as i } from "../LocaleProvider/locale.js";
7
+ import { useStrings as a } from "../LocaleProvider/useStrings.js";
8
+ /* empty css */
9
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
10
+ import { useCallback as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
11
+ import { useControl as p } from "react-use-control";
12
+ import { createPortal as m } from "react-dom";
13
+ //#region src/lib/components/Tour/Tour.tsx
14
+ var h = 8, g = 16;
15
+ function _(e) {
16
+ let { target: t } = e;
17
+ if (typeof t == "function") return t();
18
+ try {
19
+ return document.querySelector(t);
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
24
+ var v = "haze-Tour__overlay", y = "haze-Tour__spotlight", b = "haze-Tour__mask", ee = "haze-Tour__card", te = "haze-Tour__centeredCard", ne = "haze-Tour__titleStyle", re = "haze-Tour__bodyStyle", x = "haze-Tour__footerStyle", S = "haze-Tour__counterStyle", C = "haze-Tour__btn", w = "haze-Tour__subtleBtn", ie = "haze-Tour__primaryBtn";
25
+ function T({ steps: T, open: E, current: D, onClose: O, onStepChange: k, maskClosable: A = !1, className: j, ...M }) {
26
+ let [N, P] = p(E, !1), [F, I] = p(D, 0), L = a("tour"), R = `haze-tour-title-${u()}`, z = `haze-tour-step-${u()}`, B = T.length, V = Math.min(Math.max(F, 0), Math.max(B - 1, 0)), H = B > 0 ? T[V] : void 0, U = V >= B - 1, W = H?.placement ?? "bottom", G = i(L.stepOf, {
27
+ current: V + 1,
28
+ total: B
29
+ }), [K, q] = f(N);
30
+ N !== K && (q(N), N && D === void 0 && I(0));
31
+ let J = d(null), Y = d(-1), [X, ae] = f(null), Z = d(null), Q = c((e) => {
32
+ P(!1), O?.(e);
33
+ }, [O, P]), $ = c((e) => {
34
+ I(e), k?.(e);
35
+ }, [k, I]);
36
+ return l(() => {
37
+ if (!N) return;
38
+ let e = B > 0 ? T[V] : void 0, t = J.current;
39
+ if (!e || !t) return;
40
+ let i = _(e);
41
+ i?.scrollIntoView({ block: "nearest" });
42
+ let a = (e) => {
43
+ let t = Z.current;
44
+ (t === null != (e === null) || t !== null && e !== null && (t.top !== e.top || t.left !== e.left || t.width !== e.width || t.height !== e.height)) && (Z.current = e, ae(e));
45
+ }, o = () => {
46
+ let e = i?.getBoundingClientRect();
47
+ if (!i || !e || e.width === 0 && e.height === 0) {
48
+ t.style.top = "", t.style.left = "", a(null);
49
+ return;
50
+ }
51
+ let o = t.getBoundingClientRect(), { top: s, left: c } = n({
52
+ trigger: e,
53
+ panel: {
54
+ width: o.width,
55
+ height: o.height
56
+ },
57
+ viewport: {
58
+ width: window.innerWidth,
59
+ height: window.innerHeight
60
+ },
61
+ placement: W,
62
+ gap: {
63
+ below: g,
64
+ above: g,
65
+ before: g,
66
+ after: g
67
+ },
68
+ strategy: {
69
+ flip: !0,
70
+ shift: !0,
71
+ padding: r()
72
+ }
73
+ });
74
+ t.style.top = `${s}px`, t.style.left = `${c}px`, a({
75
+ top: e.top - h,
76
+ left: e.left - h,
77
+ width: e.width + 16,
78
+ height: e.height + 16
79
+ });
80
+ };
81
+ o();
82
+ let s = 0, c = () => {
83
+ s ||= requestAnimationFrame(() => {
84
+ s = 0, o();
85
+ });
86
+ };
87
+ return window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
88
+ s && cancelAnimationFrame(s), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
89
+ };
90
+ }, [
91
+ N,
92
+ T,
93
+ V,
94
+ B,
95
+ W
96
+ ]), l(() => {
97
+ if (!N) {
98
+ Y.current = -1;
99
+ return;
100
+ }
101
+ Y.current !== V && (Y.current = V, J.current?.focus());
102
+ }, [N, V]), l(() => {
103
+ if (!N || B === 0) return;
104
+ let e = (e) => {
105
+ if (e.defaultPrevented) return;
106
+ if (e.key === "Escape") {
107
+ Q("skip");
108
+ return;
109
+ }
110
+ let t = e.target;
111
+ t instanceof HTMLElement && (t.isContentEditable || t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT") || (e.key === "ArrowRight" && !U ? (e.preventDefault(), $(V + 1)) : e.key === "ArrowLeft" && V > 0 && (e.preventDefault(), $(V - 1)));
112
+ };
113
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
114
+ }, [
115
+ N,
116
+ B,
117
+ V,
118
+ U,
119
+ Q,
120
+ $
121
+ ]), !H || typeof document > "u" ? null : m(/* @__PURE__ */ o(t, {
122
+ present: N,
123
+ children: s("div", {
124
+ onClick: A ? (e) => {
125
+ N && e.target === e.currentTarget && Q("skip");
126
+ } : void 0,
127
+ className: e([v]),
128
+ children: [X === null ? /* @__PURE__ */ o("div", {
129
+ "aria-hidden": "true",
130
+ className: e([b])
131
+ }) : /* @__PURE__ */ o("div", {
132
+ "data-haze-tour-spotlight": "",
133
+ "aria-hidden": "true",
134
+ style: {
135
+ top: X.top,
136
+ left: X.left,
137
+ width: X.width,
138
+ height: X.height
139
+ },
140
+ className: e([y])
141
+ }), /* @__PURE__ */ s("div", {
142
+ ref: J,
143
+ role: "dialog",
144
+ "aria-modal": "false",
145
+ "aria-labelledby": H.title === void 0 ? z : R,
146
+ tabIndex: -1,
147
+ ...M,
148
+ className: e([
149
+ ee,
150
+ X === null && te,
151
+ j
152
+ ]),
153
+ children: [
154
+ H.title !== void 0 && /* @__PURE__ */ o("h2", {
155
+ id: R,
156
+ className: e([ne]),
157
+ children: H.title
158
+ }),
159
+ /* @__PURE__ */ o("div", {
160
+ className: e([re]),
161
+ children: H.content
162
+ }),
163
+ /* @__PURE__ */ s("div", {
164
+ className: e([x]),
165
+ children: [
166
+ /* @__PURE__ */ o("span", {
167
+ id: z,
168
+ className: e([S]),
169
+ children: G
170
+ }),
171
+ /* @__PURE__ */ o("button", {
172
+ type: "button",
173
+ onClick: () => Q("skip"),
174
+ className: e([C, w]),
175
+ children: L.skip
176
+ }),
177
+ /* @__PURE__ */ o("button", {
178
+ type: "button",
179
+ disabled: V === 0,
180
+ onClick: () => $(V - 1),
181
+ className: e([C, w]),
182
+ children: L.back
183
+ }),
184
+ /* @__PURE__ */ o("button", {
185
+ type: "button",
186
+ onClick: () => U ? Q("done") : $(V + 1),
187
+ className: e([C, ie]),
188
+ children: U ? L.done : L.next
189
+ })
190
+ ]
191
+ })
192
+ ]
193
+ })]
194
+ })
195
+ }), document.body);
196
+ }
197
+ //#endregion
198
+ export { T as default };
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import e from "./Tour.js";
3
+ export { e as Tour };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import e from "./TransferCore.js";
2
3
  import { jsx as t } from "react/jsx-runtime";
3
4
  import { useControl as n } from "react-use-control";
@@ -1,90 +1,85 @@
1
1
 
2
+ "use client";
2
3
  import { classnames as e } from "../../utils/classnames.js";
4
+ import { formatString as t } from "../LocaleProvider/locale.js";
5
+ import { useStrings as n } from "../LocaleProvider/useStrings.js";
3
6
  /* empty css */
4
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useState as r } from "react";
7
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
8
+ import { useState as a } from "react";
6
9
  //#region src/lib/components/Transfer/TransferCore.tsx
7
- var i = "haze-TransferCore__container", a = "haze-TransferCore__panel", o = "haze-TransferCore__panelHeader", s = "haze-TransferCore__panelBody", c = "haze-TransferCore__itemStyle", l = "haze-TransferCore__actions", u = "haze-TransferCore__actionBtn";
8
- function d({ dataSource: d, value: f, onChange: p, className: m, ...h }) {
9
- let [g, _] = r([]), [v, y] = r([]), b = d.filter((e) => !f.includes(e.key)), x = d.filter((e) => f.includes(e.key)), S = (e) => {
10
- _((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
11
- }, C = (e) => {
10
+ var o = "haze-TransferCore__container", s = "haze-TransferCore__panel", c = "haze-TransferCore__panelHeader", l = "haze-TransferCore__panelBody", u = "haze-TransferCore__itemStyle", d = "haze-TransferCore__actions", f = "haze-TransferCore__actionBtn";
11
+ function p({ dataSource: p, value: m, onChange: h, className: g, ..._ }) {
12
+ let [v, y] = a([]), [b, x] = a([]), S = n("transfer"), C = p.filter((e) => !m.includes(e.key)), w = p.filter((e) => m.includes(e.key)), T = (e) => {
12
13
  y((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13
- }, w = () => {
14
- g.length !== 0 && (p([...f, ...g], "right", g), _([]));
15
- }, T = () => {
16
- v.length !== 0 && (p(f.filter((e) => !v.includes(e)), "left", v), y([]));
14
+ }, E = (e) => {
15
+ x((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
16
+ }, D = () => {
17
+ v.length !== 0 && (h([...m, ...v], "right", v), y([]));
18
+ }, O = () => {
19
+ b.length !== 0 && (h(m.filter((e) => !b.includes(e)), "left", b), x([]));
17
20
  };
18
- return /* @__PURE__ */ n("div", {
19
- ...h,
20
- className: e([i, m]),
21
+ return /* @__PURE__ */ i("div", {
22
+ ..._,
23
+ className: e([o, g]),
21
24
  children: [
22
- /* @__PURE__ */ n("div", {
23
- className: e([a]),
24
- children: [/* @__PURE__ */ n("div", {
25
- className: e([o]),
26
- children: [
27
- "Source (",
28
- b.length,
29
- ")"
30
- ]
31
- }), /* @__PURE__ */ t("div", {
32
- className: e([s]),
33
- children: b.map((r) => /* @__PURE__ */ n("label", {
34
- className: e([c]),
35
- children: [/* @__PURE__ */ t("input", {
25
+ /* @__PURE__ */ i("div", {
26
+ className: e([s]),
27
+ children: [/* @__PURE__ */ r("div", {
28
+ className: e([c]),
29
+ children: t(S.source, { count: C.length })
30
+ }), /* @__PURE__ */ r("div", {
31
+ className: e([l]),
32
+ children: C.map((t) => /* @__PURE__ */ i("label", {
33
+ className: e([u]),
34
+ children: [/* @__PURE__ */ r("input", {
36
35
  type: "checkbox",
37
- checked: g.includes(r.key),
38
- disabled: r.disabled,
39
- onChange: () => S(r.key),
40
- "aria-label": r.title
41
- }), r.title]
42
- }, r.key))
36
+ checked: v.includes(t.key),
37
+ disabled: t.disabled,
38
+ onChange: () => T(t.key),
39
+ "aria-label": t.title
40
+ }), t.title]
41
+ }, t.key))
43
42
  })]
44
43
  }),
45
- /* @__PURE__ */ n("div", {
46
- className: e([l]),
47
- children: [/* @__PURE__ */ t("button", {
44
+ /* @__PURE__ */ i("div", {
45
+ className: e([d]),
46
+ children: [/* @__PURE__ */ r("button", {
48
47
  type: "button",
49
- disabled: g.length === 0,
50
- onClick: w,
51
- "aria-label": ">",
52
- className: e([u]),
48
+ disabled: v.length === 0,
49
+ onClick: D,
50
+ "aria-label": S.moveToTarget,
51
+ className: e([f]),
53
52
  children: "›"
54
- }), /* @__PURE__ */ t("button", {
53
+ }), /* @__PURE__ */ r("button", {
55
54
  type: "button",
56
- disabled: v.length === 0,
57
- onClick: T,
58
- "aria-label": "<",
59
- className: e([u]),
55
+ disabled: b.length === 0,
56
+ onClick: O,
57
+ "aria-label": S.moveToSource,
58
+ className: e([f]),
60
59
  children: "‹"
61
60
  })]
62
61
  }),
63
- /* @__PURE__ */ n("div", {
64
- className: e([a]),
65
- children: [/* @__PURE__ */ n("div", {
66
- className: e([o]),
67
- children: [
68
- "Target (",
69
- x.length,
70
- ")"
71
- ]
72
- }), /* @__PURE__ */ t("div", {
73
- className: e([s]),
74
- children: x.map((r) => /* @__PURE__ */ n("label", {
75
- className: e([c]),
76
- children: [/* @__PURE__ */ t("input", {
62
+ /* @__PURE__ */ i("div", {
63
+ className: e([s]),
64
+ children: [/* @__PURE__ */ r("div", {
65
+ className: e([c]),
66
+ children: t(S.target, { count: w.length })
67
+ }), /* @__PURE__ */ r("div", {
68
+ className: e([l]),
69
+ children: w.map((t) => /* @__PURE__ */ i("label", {
70
+ className: e([u]),
71
+ children: [/* @__PURE__ */ r("input", {
77
72
  type: "checkbox",
78
- checked: v.includes(r.key),
79
- disabled: r.disabled,
80
- onChange: () => C(r.key),
81
- "aria-label": r.title
82
- }), r.title]
83
- }, r.key))
73
+ checked: b.includes(t.key),
74
+ disabled: t.disabled,
75
+ onChange: () => E(t.key),
76
+ "aria-label": t.title
77
+ }), t.title]
78
+ }, t.key))
84
79
  })]
85
80
  })
86
81
  ]
87
82
  });
88
83
  }
89
84
  //#endregion
90
- export { d as default };
85
+ export { p as default };