@mezzanine-ui/react 0.16.0 → 1.0.0-alpha.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 (454) hide show
  1. package/Accordion/AccordionControlContext.js +1 -0
  2. package/Accordion/AccordionDetails.js +1 -0
  3. package/Accordion/AccordionSummary.js +10 -10
  4. package/Accordion/index.d.ts +6 -3
  5. package/Alert/index.d.ts +3 -2
  6. package/AlertBanner/AlertBanner.d.ts +93 -0
  7. package/AlertBanner/AlertBanner.js +154 -0
  8. package/AlertBanner/index.d.ts +2 -0
  9. package/AlertBanner/index.js +1 -0
  10. package/Anchor/Anchor.js +1 -1
  11. package/Anchor/index.d.ts +2 -1
  12. package/AppBar/index.d.ts +8 -4
  13. package/{Overlay/Overlay.d.ts → Backdrop/Backdrop.d.ts} +12 -16
  14. package/Backdrop/Backdrop.js +40 -0
  15. package/Backdrop/index.d.ts +2 -0
  16. package/Backdrop/index.js +1 -0
  17. package/Badge/Badge.d.ts +20 -14
  18. package/Badge/Badge.js +14 -16
  19. package/Badge/BadgeContainer.d.ts +1 -1
  20. package/Badge/BadgeContainer.js +1 -1
  21. package/Badge/index.d.ts +3 -2
  22. package/Badge/typings.d.ts +48 -0
  23. package/Breadcrumb/Breadcrumb.d.ts +6 -0
  24. package/Breadcrumb/Breadcrumb.js +25 -0
  25. package/Breadcrumb/BreadcrumbItem.d.ts +4 -0
  26. package/Breadcrumb/BreadcrumbItem.js +45 -0
  27. package/Breadcrumb/index.d.ts +2 -0
  28. package/Breadcrumb/index.js +1 -0
  29. package/Breadcrumb/typings.d.ts +70 -0
  30. package/Button/Button.js +24 -19
  31. package/Button/ButtonGroup.d.ts +6 -28
  32. package/Button/ButtonGroup.js +7 -16
  33. package/Button/index.d.ts +4 -10
  34. package/Button/index.js +2 -3
  35. package/Button/typings.d.ts +11 -26
  36. package/Calendar/Calendar.d.ts +31 -2
  37. package/Calendar/Calendar.js +74 -19
  38. package/Calendar/CalendarCell.d.ts +4 -0
  39. package/Calendar/CalendarCell.js +3 -3
  40. package/Calendar/CalendarConfigProviderDayjs.d.ts +21 -0
  41. package/Calendar/CalendarConfigProviderDayjs.js +15 -0
  42. package/Calendar/CalendarConfigProviderLuxon.d.ts +21 -0
  43. package/Calendar/CalendarConfigProviderLuxon.js +15 -0
  44. package/Calendar/CalendarConfigProviderMoment.d.ts +21 -0
  45. package/Calendar/CalendarConfigProviderMoment.js +15 -0
  46. package/Calendar/CalendarContext.d.ts +14 -7
  47. package/Calendar/CalendarContext.js +8 -13
  48. package/Calendar/CalendarControls.d.ts +16 -0
  49. package/Calendar/CalendarControls.js +3 -7
  50. package/Calendar/CalendarDayOfWeek.js +4 -3
  51. package/Calendar/CalendarDays.d.ts +9 -1
  52. package/Calendar/CalendarDays.js +63 -38
  53. package/Calendar/CalendarFooterActions.d.ts +13 -0
  54. package/Calendar/CalendarFooterActions.js +14 -0
  55. package/Calendar/CalendarFooterControl.d.ts +16 -0
  56. package/Calendar/CalendarFooterControl.js +14 -0
  57. package/Calendar/CalendarHalfYears.d.ts +39 -0
  58. package/Calendar/CalendarHalfYears.js +62 -0
  59. package/Calendar/CalendarMonths.js +16 -4
  60. package/Calendar/CalendarQuarters.d.ts +37 -0
  61. package/Calendar/CalendarQuarters.js +64 -0
  62. package/Calendar/CalendarQuickSelect.d.ts +21 -0
  63. package/Calendar/CalendarQuickSelect.js +15 -0
  64. package/Calendar/CalendarWeeks.d.ts +1 -1
  65. package/Calendar/CalendarWeeks.js +89 -44
  66. package/Calendar/CalendarYears.js +13 -3
  67. package/Calendar/RangeCalendar.d.ts +59 -0
  68. package/Calendar/RangeCalendar.js +232 -0
  69. package/Calendar/index.d.ts +33 -10
  70. package/Calendar/index.js +7 -0
  71. package/Calendar/useCalendarControlModifiers.d.ts +4 -4
  72. package/Calendar/useCalendarControlModifiers.js +40 -8
  73. package/Calendar/useCalendarControls.d.ts +2 -0
  74. package/Calendar/useCalendarControls.js +19 -2
  75. package/Calendar/useCalendarModeStack.js +1 -0
  76. package/Calendar/useRangeCalendarControls.d.ts +18 -0
  77. package/Calendar/useRangeCalendarControls.js +115 -0
  78. package/Card/CardActions.js +1 -1
  79. package/Card/index.d.ts +4 -2
  80. package/Checkbox/CheckAll.d.ts +16 -6
  81. package/Checkbox/CheckAll.js +40 -26
  82. package/Checkbox/Checkbox.d.ts +100 -22
  83. package/Checkbox/Checkbox.js +73 -16
  84. package/Checkbox/CheckboxGroup.d.ts +100 -18
  85. package/Checkbox/CheckboxGroup.js +169 -24
  86. package/Checkbox/CheckboxGroupContext.d.ts +0 -2
  87. package/Checkbox/CheckboxGroupContext.js +1 -0
  88. package/Checkbox/index.d.ts +16 -4
  89. package/Checkbox/index.js +6 -2
  90. package/Checkbox/typings.d.ts +37 -0
  91. package/ClearActions/ClearActions.d.ts +41 -0
  92. package/ClearActions/ClearActions.js +23 -0
  93. package/ClearActions/index.d.ts +3 -0
  94. package/ClearActions/index.js +5 -0
  95. package/ConfirmActions/ConfirmActions.d.ts +2 -1
  96. package/ConfirmActions/index.d.ts +2 -1
  97. package/DatePicker/DatePicker.d.ts +12 -1
  98. package/DatePicker/DatePicker.js +41 -9
  99. package/DatePicker/DatePickerCalendar.d.ts +2 -5
  100. package/DatePicker/DatePickerCalendar.js +37 -37
  101. package/DatePicker/index.d.ts +4 -2
  102. package/DateRangePicker/DateRangePicker.d.ts +18 -2
  103. package/DateRangePicker/DateRangePicker.js +143 -100
  104. package/DateRangePicker/DateRangePickerCalendar.d.ts +13 -9
  105. package/DateRangePicker/DateRangePickerCalendar.js +7 -94
  106. package/DateRangePicker/index.d.ts +6 -3
  107. package/DateRangePicker/useDateRangeCalendarControls.js +11 -6
  108. package/DateRangePicker/useDateRangePickerValue.d.ts +38 -15
  109. package/DateRangePicker/useDateRangePickerValue.js +142 -63
  110. package/DateTimePicker/DateTimePicker.d.ts +31 -10
  111. package/DateTimePicker/DateTimePicker.js +179 -94
  112. package/DateTimePicker/index.d.ts +2 -2
  113. package/DateTimePicker/index.js +0 -1
  114. package/Drawer/Drawer.js +2 -2
  115. package/Drawer/index.d.ts +2 -1
  116. package/Dropdown/Dropdown.js +12 -22
  117. package/Dropdown/index.d.ts +2 -1
  118. package/Empty/Empty.d.ts +1 -16
  119. package/Empty/Empty.js +36 -7
  120. package/Empty/icons/EmptyMainInitialDataIcon.d.ts +4 -0
  121. package/Empty/icons/EmptyMainInitialDataIcon.js +9 -0
  122. package/Empty/icons/EmptyMainResultIcon.d.ts +4 -0
  123. package/Empty/icons/EmptyMainResultIcon.js +9 -0
  124. package/Empty/icons/EmptyMainSystemIcon.d.ts +4 -0
  125. package/Empty/icons/EmptyMainSystemIcon.js +9 -0
  126. package/Empty/index.d.ts +2 -1
  127. package/Empty/typings.d.ts +52 -0
  128. package/Form/FormControlContext.js +1 -0
  129. package/Form/FormHintText.d.ts +18 -0
  130. package/Form/FormHintText.js +17 -0
  131. package/Form/FormLabel.js +1 -0
  132. package/Form/index.d.ts +9 -5
  133. package/Form/index.js +1 -1
  134. package/Form/useAutoCompleteValueControl.js +2 -0
  135. package/Form/useCheckboxControlValue.js +0 -1
  136. package/Form/useSelectValueControl.js +2 -0
  137. package/InlineMessage/InlineMessage.d.ts +33 -0
  138. package/InlineMessage/InlineMessage.js +42 -0
  139. package/InlineMessage/InlineMessageGroup.d.ts +24 -0
  140. package/InlineMessage/InlineMessageGroup.js +21 -0
  141. package/InlineMessage/index.d.ts +4 -0
  142. package/InlineMessage/index.js +2 -0
  143. package/Input/ActionButton/ActionButton.d.ts +26 -0
  144. package/Input/ActionButton/ActionButton.js +14 -0
  145. package/Input/ActionButton/index.d.ts +2 -0
  146. package/Input/ActionButton/index.js +1 -0
  147. package/Input/Input.d.ts +147 -42
  148. package/Input/Input.js +195 -27
  149. package/Input/PasswordStrengthIndicator/PasswordStrengthIndicator.d.ts +31 -0
  150. package/Input/PasswordStrengthIndicator/PasswordStrengthIndicator.js +18 -0
  151. package/Input/PasswordStrengthIndicator/index.d.ts +2 -0
  152. package/Input/PasswordStrengthIndicator/index.js +1 -0
  153. package/Input/SelectButton/SelectButton.d.ts +20 -0
  154. package/Input/SelectButton/SelectButton.js +21 -0
  155. package/Input/SelectButton/index.d.ts +2 -0
  156. package/Input/SelectButton/index.js +1 -0
  157. package/Input/SpinnerButton/SpinnerButton.d.ts +19 -0
  158. package/Input/SpinnerButton/SpinnerButton.js +14 -0
  159. package/Input/SpinnerButton/index.d.ts +2 -0
  160. package/Input/SpinnerButton/index.js +1 -0
  161. package/Input/index.d.ts +3 -2
  162. package/Menu/Menu.js +1 -0
  163. package/Menu/index.d.ts +8 -4
  164. package/Message/Message.d.ts +6 -4
  165. package/Message/Message.js +86 -9
  166. package/Message/MessageTimerController.d.ts +14 -0
  167. package/Message/MessageTimerController.js +27 -0
  168. package/Message/index.d.ts +3 -2
  169. package/Modal/Modal.js +2 -2
  170. package/Modal/ModalActions.js +1 -0
  171. package/Modal/ModalControl.js +1 -0
  172. package/Modal/ModalHeader.js +1 -0
  173. package/Modal/index.d.ts +10 -5
  174. package/Modal/useModalContainer.d.ts +1 -1
  175. package/Modal/useModalContainer.js +2 -4
  176. package/Navigation/Navigation.js +37 -34
  177. package/Navigation/NavigationContext.js +1 -0
  178. package/Navigation/NavigationItem.js +1 -0
  179. package/Navigation/NavigationSubMenu.js +16 -26
  180. package/Navigation/index.d.ts +8 -4
  181. package/Notification/Notification.js +0 -1
  182. package/Notification/index.d.ts +3 -2
  183. package/Notifier/NotifierManager.d.ts +15 -2
  184. package/Notifier/NotifierManager.js +60 -18
  185. package/Notifier/createNotifier.d.ts +9 -0
  186. package/Notifier/createNotifier.js +3 -2
  187. package/Notifier/typings.d.ts +3 -1
  188. package/OverflowTooltip/OverflowCounterTag.d.ts +12 -0
  189. package/OverflowTooltip/OverflowCounterTag.js +48 -0
  190. package/OverflowTooltip/OverflowTooltip.d.ts +34 -0
  191. package/OverflowTooltip/OverflowTooltip.js +53 -0
  192. package/OverflowTooltip/index.d.ts +2 -0
  193. package/OverflowTooltip/index.js +2 -0
  194. package/PageFooter/PageFooter.d.ts +73 -8
  195. package/PageFooter/PageFooter.js +34 -3
  196. package/PageFooter/index.d.ts +2 -1
  197. package/PageHeader/PageHeader.d.ts +36 -0
  198. package/PageHeader/PageHeader.js +65 -0
  199. package/PageHeader/index.d.ts +2 -0
  200. package/PageHeader/index.js +1 -0
  201. package/PageToolbar/PageToolbar.d.ts +67 -0
  202. package/PageToolbar/PageToolbar.js +114 -0
  203. package/PageToolbar/index.d.ts +2 -0
  204. package/PageToolbar/index.js +1 -0
  205. package/Pagination/Pagination.d.ts +23 -29
  206. package/Pagination/Pagination.js +3 -4
  207. package/Pagination/PaginationItem.d.ts +1 -1
  208. package/Pagination/PaginationItem.js +6 -3
  209. package/Pagination/PaginationJumper.d.ts +7 -9
  210. package/Pagination/PaginationJumper.js +3 -5
  211. package/Pagination/PaginationPageSize.d.ts +8 -11
  212. package/Pagination/PaginationPageSize.js +5 -4
  213. package/Pagination/index.d.ts +8 -4
  214. package/Pagination/usePagination.d.ts +3 -1
  215. package/Pagination/usePagination.js +30 -21
  216. package/Picker/FormattedInput.d.ts +17 -0
  217. package/Picker/FormattedInput.js +74 -0
  218. package/Picker/MaskFormat.d.ts +39 -0
  219. package/Picker/MaskFormat.js +94 -0
  220. package/Picker/PickerTrigger.d.ts +13 -3
  221. package/Picker/PickerTrigger.js +17 -2
  222. package/Picker/PickerTriggerWithSeparator.d.ts +124 -0
  223. package/Picker/PickerTriggerWithSeparator.js +80 -0
  224. package/Picker/RangePickerTrigger.d.ts +55 -4
  225. package/Picker/RangePickerTrigger.js +65 -7
  226. package/Picker/formatUtils.d.ts +34 -0
  227. package/Picker/formatUtils.js +124 -0
  228. package/Picker/index.d.ts +17 -6
  229. package/Picker/index.js +4 -1
  230. package/Picker/useDateInputFormatter.d.ts +52 -0
  231. package/Picker/useDateInputFormatter.js +382 -0
  232. package/Picker/usePickerValue.d.ts +1 -2
  233. package/Picker/usePickerValue.js +8 -13
  234. package/Popconfirm/Popconfirm.js +1 -1
  235. package/Popconfirm/index.d.ts +2 -1
  236. package/Popover/Popover.js +4 -8
  237. package/Popover/index.d.ts +2 -1
  238. package/Popper/Popper.d.ts +15 -10
  239. package/Popper/Popper.js +88 -17
  240. package/Popper/index.d.ts +2 -1
  241. package/Portal/Portal.d.ts +13 -5
  242. package/Portal/Portal.js +25 -10
  243. package/Portal/index.d.ts +4 -1
  244. package/Portal/index.js +1 -0
  245. package/Portal/portalRegistry.d.ts +17 -0
  246. package/Portal/portalRegistry.js +92 -0
  247. package/Progress/Progress.d.ts +23 -30
  248. package/Progress/Progress.js +71 -21
  249. package/Progress/index.d.ts +3 -2
  250. package/Provider/ConfigProvider.d.ts +1 -0
  251. package/Provider/ConfigProvider.js +1 -0
  252. package/Provider/context.js +1 -0
  253. package/Radio/Radio.d.ts +1 -1
  254. package/Radio/Radio.js +2 -1
  255. package/Radio/RadioGroup.d.ts +1 -1
  256. package/Radio/RadioGroup.js +1 -1
  257. package/Radio/RadioGroupContext.js +1 -0
  258. package/Radio/index.d.ts +4 -2
  259. package/ResultState/ResultState.d.ts +52 -0
  260. package/ResultState/ResultState.js +24 -0
  261. package/ResultState/index.d.ts +2 -0
  262. package/ResultState/index.js +1 -0
  263. package/Select/AutoComplete.d.ts +1 -1
  264. package/Select/AutoComplete.js +2 -1
  265. package/Select/Option.js +1 -0
  266. package/Select/Select.d.ts +1 -1
  267. package/Select/Select.js +2 -1
  268. package/Select/SelectControlContext.js +1 -0
  269. package/Select/SelectTrigger.d.ts +1 -87
  270. package/Select/SelectTrigger.js +26 -21
  271. package/Select/SelectTriggerTags.d.ts +1 -1
  272. package/Select/SelectTriggerTags.js +47 -18
  273. package/Select/TreeSelect.d.ts +1 -1
  274. package/Select/TreeSelect.js +2 -1
  275. package/Select/index.d.ts +14 -7
  276. package/Select/typings.d.ts +99 -0
  277. package/Select/useSelectTriggerTags.d.ts +15 -8
  278. package/Select/useSelectTriggerTags.js +83 -44
  279. package/Selection/Selection.d.ts +98 -0
  280. package/Selection/Selection.js +46 -0
  281. package/Selection/index.d.ts +12 -0
  282. package/Selection/index.js +5 -0
  283. package/Skeleton/Skeleton.d.ts +10 -3
  284. package/Skeleton/Skeleton.js +12 -4
  285. package/Skeleton/index.d.ts +2 -1
  286. package/Slider/Slider.d.ts +44 -7
  287. package/Slider/Slider.js +17 -13
  288. package/Slider/index.d.ts +5 -3
  289. package/Spin/Spin.d.ts +39 -0
  290. package/{Loading/Loading.js → Spin/Spin.js} +9 -9
  291. package/Spin/index.d.ts +2 -0
  292. package/Spin/index.js +1 -0
  293. package/Stepper/Step.d.ts +1 -35
  294. package/Stepper/Step.js +43 -8
  295. package/Stepper/Stepper.d.ts +1 -14
  296. package/Stepper/Stepper.js +49 -15
  297. package/Stepper/index.d.ts +5 -2
  298. package/Stepper/index.js +1 -0
  299. package/Stepper/typings.d.ts +77 -0
  300. package/Stepper/useStepDistance.d.ts +10 -0
  301. package/Stepper/useStepDistance.js +81 -0
  302. package/Stepper/useStepper.d.ts +21 -0
  303. package/Stepper/useStepper.js +26 -0
  304. package/Table/Table.js +2 -2
  305. package/Table/TableBody.js +3 -2
  306. package/Table/TableBodyRow.js +1 -0
  307. package/Table/TableContext.js +1 -0
  308. package/Table/TableExpandedTable.js +1 -0
  309. package/Table/TableHeader.js +1 -0
  310. package/Table/editable/TableEditRenderWrapper.js +1 -0
  311. package/Table/expandable/TableExpandable.js +1 -1
  312. package/Table/index.d.ts +7 -4
  313. package/Table/pagination/TablePagination.js +1 -0
  314. package/Table/pagination/useTablePagination.js +1 -0
  315. package/Table/refresh/TableRefresh.js +3 -1
  316. package/Table/rowSelection/TableRowSelection.js +3 -2
  317. package/Table/sorting/TableSortingIcon.js +2 -1
  318. package/Table/sorting/useTableSorting.js +1 -0
  319. package/Table/useTableFetchMore.js +1 -1
  320. package/Table/useTableScroll.d.ts +4 -8
  321. package/Table/useTableScroll.js +9 -7
  322. package/Tabs/TabPane.js +1 -0
  323. package/Tabs/Tabs.js +9 -4
  324. package/Tabs/index.d.ts +6 -3
  325. package/Tabs/useTabsOverflow.js +4 -3
  326. package/Tag/Tag.d.ts +2 -25
  327. package/Tag/Tag.js +23 -13
  328. package/Tag/TagGroup.d.ts +12 -0
  329. package/Tag/TagGroup.js +41 -0
  330. package/Tag/index.d.ts +2 -1
  331. package/Tag/typings.d.ts +78 -0
  332. package/TextField/TextField.d.ts +78 -19
  333. package/TextField/TextField.js +58 -22
  334. package/TextField/index.d.ts +2 -1
  335. package/Textarea/Textarea.d.ts +19 -51
  336. package/Textarea/Textarea.js +13 -19
  337. package/Textarea/index.d.ts +2 -2
  338. package/TimePanel/TimePanel.d.ts +1 -22
  339. package/TimePanel/TimePanel.js +31 -26
  340. package/TimePanel/TimePanelAction.d.ts +2 -8
  341. package/TimePanel/TimePanelAction.js +2 -2
  342. package/TimePanel/TimePanelColumn.d.ts +0 -13
  343. package/TimePanel/TimePanelColumn.js +9 -11
  344. package/TimePanel/index.d.ts +6 -3
  345. package/TimePicker/TimePicker.d.ts +10 -1
  346. package/TimePicker/TimePicker.js +86 -35
  347. package/TimePicker/TimePickerPanel.d.ts +1 -2
  348. package/TimePicker/TimePickerPanel.js +2 -2
  349. package/TimePicker/index.d.ts +4 -2
  350. package/Toggle/Toggle.d.ts +46 -0
  351. package/Toggle/Toggle.js +29 -0
  352. package/Toggle/index.d.ts +3 -0
  353. package/Toggle/index.js +1 -0
  354. package/Tooltip/Tooltip.d.ts +13 -2
  355. package/Tooltip/Tooltip.js +56 -10
  356. package/Tooltip/index.d.ts +2 -1
  357. package/Tooltip/useDelayMouseEnterLeave.d.ts +1 -2
  358. package/Tooltip/useDelayMouseEnterLeave.js +10 -13
  359. package/Transition/Collapse.d.ts +2 -0
  360. package/Transition/Collapse.js +5 -6
  361. package/Transition/Fade.js +4 -4
  362. package/Transition/Rotate.d.ts +42 -0
  363. package/Transition/Rotate.js +30 -0
  364. package/Transition/Scale.d.ts +13 -0
  365. package/Transition/{Grow.js → Scale.js} +19 -16
  366. package/Transition/Slide.d.ts +7 -0
  367. package/Transition/{Zoom.js → Slide.js} +14 -12
  368. package/Transition/SlideFade.d.ts +3 -0
  369. package/Transition/SlideFade.js +5 -4
  370. package/Transition/Transition.d.ts +2 -2
  371. package/Transition/Translate.d.ts +14 -0
  372. package/Transition/Translate.js +94 -0
  373. package/Transition/index.d.ts +16 -6
  374. package/Transition/index.js +4 -2
  375. package/Transition/useAutoTransitionDuration.d.ts +1 -1
  376. package/Transition/useAutoTransitionDuration.js +3 -3
  377. package/Transition/useSetNodeTransition.js +0 -2
  378. package/Tree/TreeNode.js +7 -6
  379. package/Tree/index.d.ts +10 -5
  380. package/Typography/Typography.d.ts +6 -9
  381. package/Typography/Typography.js +7 -9
  382. package/Typography/index.d.ts +2 -5
  383. package/Upload/Upload.d.ts +175 -0
  384. package/Upload/Upload.js +279 -0
  385. package/Upload/UploadItem.d.ts +82 -0
  386. package/Upload/UploadItem.js +118 -0
  387. package/Upload/UploadPictureCard.d.ts +110 -0
  388. package/Upload/UploadPictureCard.js +101 -0
  389. package/Upload/Uploader.d.ts +161 -0
  390. package/Upload/Uploader.js +120 -0
  391. package/Upload/index.d.ts +8 -6
  392. package/Upload/index.js +4 -5
  393. package/Upload/upload-utils.d.ts +41 -0
  394. package/Upload/upload-utils.js +65 -0
  395. package/_internal/InputCheck/index.d.ts +4 -2
  396. package/_internal/InputTriggerPopper/InputTriggerPopper.js +15 -25
  397. package/_internal/InputTriggerPopper/index.d.ts +2 -1
  398. package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +2 -2
  399. package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +4 -27
  400. package/_internal/SlideFadeOverlay/index.d.ts +2 -1
  401. package/_internal/SlideFadeOverlay/useTopStack.js +1 -0
  402. package/dayjs.d.ts +21 -0
  403. package/dayjs.js +2 -0
  404. package/hooks/useComposeRefs.js +1 -1
  405. package/hooks/useLastCallback.js +3 -1
  406. package/hooks/useScrollLock.d.ts +28 -0
  407. package/hooks/useScrollLock.js +134 -0
  408. package/index.d.ts +126 -58
  409. package/index.js +93 -80
  410. package/luxon.d.ts +21 -0
  411. package/luxon.js +2 -0
  412. package/moment.d.ts +21 -0
  413. package/moment.js +2 -0
  414. package/package.json +13 -17
  415. package/utils/composeRefs.js +0 -1
  416. package/utils/get-css-variable-value.d.ts +1 -0
  417. package/utils/get-css-variable-value.js +9 -0
  418. package/Button/IconButton.d.ts +0 -21
  419. package/Button/IconButton.js +0 -13
  420. package/DateTimePicker/DateTimePickerPanel.d.ts +0 -28
  421. package/DateTimePicker/DateTimePickerPanel.js +0 -49
  422. package/Form/FormMessage.d.ts +0 -7
  423. package/Form/FormMessage.js +0 -18
  424. package/Form/useInputWithTagsModeValue.js +0 -86
  425. package/Loading/Loading.d.ts +0 -33
  426. package/Loading/index.d.ts +0 -1
  427. package/Loading/index.js +0 -1
  428. package/Overlay/Overlay.js +0 -31
  429. package/Overlay/index.d.ts +0 -1
  430. package/Overlay/index.js +0 -1
  431. package/Picker/useRangePickerValue.d.ts +0 -23
  432. package/Picker/useRangePickerValue.js +0 -99
  433. package/Switch/Switch.d.ts +0 -43
  434. package/Switch/Switch.js +0 -28
  435. package/Switch/index.d.ts +0 -2
  436. package/Switch/index.js +0 -1
  437. package/Transition/Grow.d.ts +0 -12
  438. package/Transition/Zoom.d.ts +0 -7
  439. package/Upload/UploadButton.d.ts +0 -9
  440. package/Upload/UploadButton.js +0 -23
  441. package/Upload/UploadInput.d.ts +0 -20
  442. package/Upload/UploadInput.js +0 -24
  443. package/Upload/UploadPicture.d.ts +0 -49
  444. package/Upload/UploadPicture.js +0 -51
  445. package/Upload/UploadPictureBlock.d.ts +0 -20
  446. package/Upload/UploadPictureBlock.js +0 -81
  447. package/Upload/UploadPictureWall.d.ts +0 -81
  448. package/Upload/UploadPictureWall.js +0 -168
  449. package/Upload/UploadPictureWallItem.d.ts +0 -15
  450. package/Upload/UploadPictureWallItem.js +0 -18
  451. package/Upload/UploadResult.d.ts +0 -35
  452. package/Upload/UploadResult.js +0 -29
  453. package/utils/scroll-lock.d.ts +0 -2
  454. package/utils/scroll-lock.js +0 -24
@@ -1,33 +1,67 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { forwardRef, Children, cloneElement } from 'react';
2
+ import { forwardRef, Children, useRef, useCallback, cloneElement, useEffect } from 'react';
3
3
  import { stepperClasses } from '@mezzanine-ui/core/stepper';
4
+ import { useStepDistance } from './useStepDistance.js';
4
5
  import cx from 'clsx';
5
6
 
6
7
  /**
7
8
  * The react component for `mezzanine` stepper.
8
9
  */
9
10
  const Stepper = forwardRef(function Stepper(props, ref) {
10
- const { activeStep = -1, children, className, ...rest } = props;
11
+ const { children, className, currentStep = 0, onStepChange, orientation = 'horizontal', type = 'number', ...rest } = props;
11
12
  const childrenArray = Children.toArray(children);
13
+ const stepperRef = useRef(null);
14
+ const stepRefs = useRef([]);
15
+ const mergedRef = useCallback((element) => {
16
+ stepperRef.current = element;
17
+ if (ref) {
18
+ if (typeof ref === 'function') {
19
+ ref(element);
20
+ }
21
+ else {
22
+ ref.current = element;
23
+ }
24
+ }
25
+ }, [ref]);
26
+ const stepPositions = useStepDistance(orientation, stepperRef, stepRefs, type, childrenArray);
27
+ const getStepStatus = (index, processingIndex) => {
28
+ if (index === processingIndex)
29
+ return 'processing';
30
+ if (index < processingIndex)
31
+ return 'succeeded';
32
+ return 'pending';
33
+ };
12
34
  const stepsWithState = childrenArray.map((element, index) => {
35
+ var _a;
13
36
  const step = element;
14
- const state = {
15
- index,
16
- active: activeStep === index,
17
- completed: activeStep > index,
18
- disabled: activeStep < index,
19
- };
20
- if (step.props.active || step.props.disabled || step.props.completed) {
21
- state.active = false;
22
- state.completed = false;
23
- state.disabled = false;
24
- }
25
37
  return cloneElement(step, {
26
- ...state,
38
+ index,
39
+ orientation,
40
+ ref: (el) => {
41
+ stepRefs.current[index] = el;
42
+ },
43
+ status: getStepStatus(index, currentStep),
44
+ style: {
45
+ '--connect-line-distance': ((_a = stepPositions === null || stepPositions === void 0 ? void 0 : stepPositions.distances) === null || _a === void 0 ? void 0 : _a[index])
46
+ ? `${stepPositions.distances[index]}px`
47
+ : undefined,
48
+ ...step.props.style,
49
+ },
50
+ type,
27
51
  ...step.props,
28
52
  });
29
53
  });
30
- return (jsx("div", { className: cx(stepperClasses.host, className), ref: ref, ...rest, children: stepsWithState }));
54
+ useEffect(() => {
55
+ if (typeof onStepChange === 'function') {
56
+ onStepChange(currentStep);
57
+ }
58
+ }, [currentStep, onStepChange]);
59
+ return (jsx("div", { ...rest, className: cx(stepperClasses.host, {
60
+ [stepperClasses.horizontal]: orientation === 'horizontal',
61
+ [stepperClasses.vertical]: orientation === 'vertical',
62
+ [stepperClasses.dot]: type === 'dot',
63
+ [stepperClasses.number]: type === 'number',
64
+ }, className), ref: mergedRef, children: stepsWithState }));
31
65
  });
32
66
 
33
67
  export { Stepper as default };
@@ -1,2 +1,5 @@
1
- export { StepProps, default as Step } from './Step';
2
- export { StepperProps, default } from './Stepper';
1
+ export type { StepProps } from './typings';
2
+ export { default as Step } from './Step';
3
+ export type { StepperProps } from './typings';
4
+ export { default } from './Stepper';
5
+ export { useStepper } from './useStepper';
package/Stepper/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as Step } from './Step.js';
2
2
  export { default } from './Stepper.js';
3
+ export { useStepper } from './useStepper.js';
@@ -0,0 +1,77 @@
1
+ import { ReactElement } from 'react';
2
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
3
+ export interface StepperProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
4
+ /**
5
+ * Three or more `<Step />` components.
6
+ */
7
+ children: ReactElement<StepProps> | ReactElement<StepProps>[];
8
+ /**
9
+ * Set the processing step index to replace step status.
10
+ * Index is zero-based (0 = first step, 1 = second step, etc.).
11
+ * @default 0
12
+ */
13
+ currentStep?: number;
14
+ /**
15
+ * Callback fired when the step changes.
16
+ * @param stepIndex The current step index after change.
17
+ */
18
+ onStepChange?: (stepIndex: number) => void;
19
+ /**
20
+ * The orientation of the stepper.
21
+ * - 'horizontal': Steps arranged horizontally
22
+ * - 'vertical': Steps arranged vertically
23
+ * @default 'horizontal'
24
+ */
25
+ orientation?: 'horizontal' | 'vertical';
26
+ /**
27
+ * The type of step indicator.
28
+ * - 'dot': Display as dots
29
+ * - 'number': Display as numbers
30
+ * @default 'number'
31
+ */
32
+ type?: 'dot' | 'number';
33
+ }
34
+ export interface StepProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'title' | 'children'> {
35
+ /**
36
+ * The step description, visible if value is not empty.
37
+ */
38
+ description?: string;
39
+ /**
40
+ * Whether the step is disabled.
41
+ * Only applies when status is not 'processing'.
42
+ */
43
+ disabled?: boolean;
44
+ /**
45
+ * Whether the step is in error state.
46
+ * Only applies when status is not 'processing'.
47
+ */
48
+ error?: boolean;
49
+ /**
50
+ * Step index, automatically set by the parent <Stepper />.
51
+ * Zero-based index (0 = first step, 1 = second step, etc.).
52
+ */
53
+ index?: number;
54
+ /**
55
+ * The orientation of the step, inherited from parent Stepper.
56
+ * - 'horizontal': Step arranged horizontally
57
+ * - 'vertical': Step arranged vertically
58
+ */
59
+ orientation?: 'horizontal' | 'vertical';
60
+ /**
61
+ * The current status of the step, automatically set by the parent <Stepper />.
62
+ * - 'processing': Currently active/in progress
63
+ * - 'pending': Waiting to be processed (default for future steps)
64
+ * - 'succeeded': Successfully completed
65
+ */
66
+ status?: 'processing' | 'pending' | 'succeeded';
67
+ /**
68
+ * The step title.
69
+ */
70
+ title?: string;
71
+ /**
72
+ * The type of step indicator, inherited from parent Stepper.
73
+ * - 'dot': Display as dot
74
+ * - 'number': Display as number
75
+ */
76
+ type?: 'dot' | 'number';
77
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ export declare const useStepDistance: (orientation: "horizontal" | "vertical", stepperRef: RefObject<HTMLDivElement | null>, stepRefs: RefObject<(HTMLDivElement | null)[]>, type: "dot" | "number", childrenArray: Array<Exclude<ReactNode, boolean | null | undefined>>) => {
3
+ distances: number[];
4
+ positions: Array<{
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number;
9
+ }>;
10
+ };
@@ -0,0 +1,81 @@
1
+ import { stepClasses } from '@mezzanine-ui/core/stepper';
2
+ import { useState, useLayoutEffect } from 'react';
3
+
4
+ const useStepDistance = (orientation, stepperRef, stepRefs, type, childrenArray) => {
5
+ const [stepPositions, setStepPositions] = useState({ distances: [], positions: [] });
6
+ // Calculate position and distance between each step
7
+ useLayoutEffect(() => {
8
+ const calculatePositions = () => {
9
+ if (!stepperRef.current || stepRefs.current.length === 0)
10
+ return;
11
+ const stepperRect = stepperRef.current.getBoundingClientRect();
12
+ const positions = [];
13
+ const distances = [];
14
+ stepRefs.current.forEach((stepElement) => {
15
+ if (stepElement) {
16
+ const stepRect = stepElement.getBoundingClientRect();
17
+ positions.push({
18
+ x: stepRect.left - stepperRect.left,
19
+ y: stepRect.top - stepperRect.top,
20
+ width: stepRect.width,
21
+ height: stepRect.height,
22
+ });
23
+ }
24
+ });
25
+ // Calculate distance between each pair of adjacent steps
26
+ for (let i = 0; i < positions.length - 1; i += 1) {
27
+ const next = positions[i + 1];
28
+ const currentStepElement = stepRefs.current[i];
29
+ if (orientation === 'horizontal' && type === 'number') {
30
+ // Horizontal number version: from current step title to next step start
31
+ const titleElement = currentStepElement === null || currentStepElement === void 0 ? void 0 : currentStepElement.querySelector(`.${stepClasses.titleConnectLine}`);
32
+ if (titleElement) {
33
+ const titleRect = titleElement.getBoundingClientRect();
34
+ const titleEnd = titleRect.right - stepperRect.left;
35
+ distances.push(next.x - titleEnd);
36
+ }
37
+ else {
38
+ distances.push(0);
39
+ }
40
+ }
41
+ else if (orientation === 'horizontal' && type === 'dot') {
42
+ // Horizontal dot version: calculate x-axis distance from status-indicator
43
+ const statusIndicatorElement = currentStepElement === null || currentStepElement === void 0 ? void 0 : currentStepElement.querySelector(`.${stepClasses.statusIndicator}`);
44
+ if (statusIndicatorElement) {
45
+ const statusIndicatorRect = statusIndicatorElement.getBoundingClientRect();
46
+ const statusIndicatorEnd = statusIndicatorRect.right - stepperRect.left;
47
+ distances.push(next.x +
48
+ next.width / 2 -
49
+ statusIndicatorEnd -
50
+ statusIndicatorElement.clientWidth / 2);
51
+ }
52
+ else {
53
+ distances.push(0);
54
+ }
55
+ }
56
+ else {
57
+ // Vertical orientation: calculate y-axis distance
58
+ const statusIndicatorElement = currentStepElement === null || currentStepElement === void 0 ? void 0 : currentStepElement.querySelector(`.${stepClasses.statusIndicator}`);
59
+ if (statusIndicatorElement) {
60
+ const statusIndicatorRect = statusIndicatorElement.getBoundingClientRect();
61
+ const statusIndicatorEnd = statusIndicatorRect.bottom - stepperRect.top;
62
+ distances.push(next.y - statusIndicatorEnd);
63
+ }
64
+ else {
65
+ distances.push(0);
66
+ }
67
+ }
68
+ }
69
+ setStepPositions({ distances, positions });
70
+ };
71
+ calculatePositions();
72
+ // Add resize listener to recalculate positions on window resize
73
+ window.addEventListener('resize', calculatePositions);
74
+ return () => {
75
+ window.removeEventListener('resize', calculatePositions);
76
+ };
77
+ }, [orientation, type, childrenArray.length, stepperRef, stepRefs]);
78
+ return stepPositions;
79
+ };
80
+
81
+ export { useStepDistance };
@@ -0,0 +1,21 @@
1
+ export interface UseStepperOptions {
2
+ /**
3
+ * The default step index to start from.
4
+ * Index is zero-based (0 = first step, 1 = second step, etc.).
5
+ * @default 0
6
+ */
7
+ defaultStep?: number;
8
+ /**
9
+ * Total number of steps in the stepper.
10
+ * @default Number.MAX_VALUE
11
+ */
12
+ totalSteps?: number;
13
+ }
14
+ export declare const useStepper: ({ defaultStep, totalSteps, }: UseStepperOptions) => {
15
+ currentStep: number;
16
+ goToStep: (step: number) => void;
17
+ isFirstStep: boolean;
18
+ isLastStep: boolean;
19
+ nextStep: () => void;
20
+ prevStep: () => void;
21
+ };
@@ -0,0 +1,26 @@
1
+ import { useState } from 'react';
2
+
3
+ const useStepper = ({ defaultStep = 0, totalSteps = Number.MAX_VALUE, }) => {
4
+ const [currentStep, setCurrentStep] = useState(defaultStep);
5
+ const goToStep = (step) => {
6
+ setCurrentStep(Math.max(0, Math.min(step, totalSteps - 1)));
7
+ };
8
+ const isFirstStep = currentStep === 0;
9
+ const isLastStep = currentStep === totalSteps - 1;
10
+ const nextStep = () => {
11
+ setCurrentStep((prev) => Math.min(prev + 1, totalSteps - 1));
12
+ };
13
+ const prevStep = () => {
14
+ setCurrentStep((prev) => Math.max(prev - 1, 0));
15
+ };
16
+ return {
17
+ currentStep,
18
+ goToStep,
19
+ isFirstStep,
20
+ isLastStep,
21
+ nextStep,
22
+ prevStep,
23
+ };
24
+ };
25
+
26
+ export { useStepper };
package/Table/Table.js CHANGED
@@ -15,7 +15,7 @@ import { useTableDraggable } from './draggable/useTableDraggable.js';
15
15
  import useTableScroll from './useTableScroll.js';
16
16
  import { useComposeRefs } from '../hooks/useComposeRefs.js';
17
17
  import { composeRefs } from '../utils/composeRefs.js';
18
- import Loading from '../Loading/Loading.js';
18
+ import Spin from '../Spin/Spin.js';
19
19
  import cx from 'clsx';
20
20
 
21
21
  const Table = forwardRef(function Table(props, ref) {
@@ -155,7 +155,7 @@ const Table = forwardRef(function Table(props, ref) {
155
155
  }
156
156
  return undefined;
157
157
  }, [bodyRowClassName]);
158
- return (jsx(TableContext.Provider, { value: tableContextValue, children: jsx(TableDataContext.Provider, { value: tableDataContextValue, children: jsx(TableComponentContext.Provider, { value: tableComponentContextValue, children: jsx(DragDropContext, { onBeforeDragStart: onBeforeDragStart, onDragEnd: onDragEnd, children: jsx(Loading, { loading: loading, stretch: true, tip: loadingTip, overlayProps: {
158
+ return (jsx(TableContext.Provider, { value: tableContextValue, children: jsx(TableDataContext.Provider, { value: tableDataContextValue, children: jsx(TableComponentContext.Provider, { value: tableComponentContextValue, children: jsx(DragDropContext, { onBeforeDragStart: onBeforeDragStart, onDragEnd: onDragEnd, children: jsx(Spin, { loading: loading, stretch: true, description: loadingTip, backdropProps: {
159
159
  className: tableClasses.loading,
160
160
  }, children: jsx(Droppable, { droppableId: "mzn-table-dnd", isDropDisabled: !(draggableProp === null || draggableProp === void 0 ? void 0 : draggableProp.enabled), children: (provided) => (jsxs(Fragment, { children: [jsx("div", { ...provided.droppableProps, ref: composeRefs([scrollBody.ref, provided.innerRef]), className: cx(tableClasses.scrollContainer, scrollContainerClassName), onScroll: scrollBody.onScroll, style: tableContextValue.scroll
161
161
  ? {
@@ -1,9 +1,10 @@
1
+ 'use client';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { forwardRef, useContext } from 'react';
3
4
  import { tableClasses } from '@mezzanine-ui/core/table';
4
5
  import { TableDataContext, TableContext } from './TableContext.js';
5
6
  import TableBodyRow from './TableBodyRow.js';
6
- import Loading from '../Loading/Loading.js';
7
+ import Spin from '../Spin/Spin.js';
7
8
  import Empty from '../Empty/Empty.js';
8
9
  import cx from 'clsx';
9
10
 
@@ -24,7 +25,7 @@ const TableBody = forwardRef(function TableBody(props, ref) {
24
25
  const currentDataSource = pagination && !disableAutoSlicing
25
26
  ? dataSource.slice(currentStartCount, currentEndCount)
26
27
  : dataSource;
27
- return (jsxs("tbody", { ...rest, ref: ref, className: cx(tableClasses.body, className), children: [currentDataSource.length ? (currentDataSource.map((rowData, index) => (jsx(TableBodyRow, { className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(rowData), rowData: rowData, rowIndex: index }, (rowData.key || rowData.id))))) : (jsx("tr", { children: jsx("td", { children: jsx(Empty, { ...restEmptyProps, className: cx(tableClasses.bodyEmpty, emptyComponentClassName), fullHeight: emptyComponentFullHeight, children: emptyComponentChildren }) }) })), (fetchMore === null || fetchMore === void 0 ? void 0 : fetchMore.isFetching) ? (jsx("tr", { className: tableClasses.bodyFetchMore, children: jsx("td", { "aria-label": "Loading", children: jsx(Loading, { loading: true }) }) })) : null] }));
28
+ return (jsxs("tbody", { ...rest, ref: ref, className: cx(tableClasses.body, className), children: [currentDataSource.length ? (currentDataSource.map((rowData, index) => (jsx(TableBodyRow, { className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(rowData), rowData: rowData, rowIndex: index }, (rowData.key || rowData.id))))) : (jsx("tr", { children: jsx("td", { children: jsx(Empty, { ...restEmptyProps, className: cx(tableClasses.bodyEmpty, emptyComponentClassName), fullHeight: emptyComponentFullHeight, children: emptyComponentChildren }) }) })), (fetchMore === null || fetchMore === void 0 ? void 0 : fetchMore.isFetching) ? (jsx("tr", { className: tableClasses.bodyFetchMore, children: jsx("td", { "aria-label": "Loading", children: jsx(Spin, { loading: true }) }) })) : null] }));
28
29
  });
29
30
 
30
31
  export { TableBody as default };
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { forwardRef, useContext, useState, useMemo, Fragment, createElement } from 'react';
2
3
  import { jsxs, jsx } from 'react/jsx-runtime';
3
4
  import { tableClasses, getColumnStyle, getCellStyle } from '@mezzanine-ui/core/table';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { createContext } from 'react';
2
3
 
3
4
  const TableContext = createContext(null);
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { forwardRef, useContext } from 'react';
3
4
  import { tableClasses, getColumnStyle, getCellStyle } from '@mezzanine-ui/core/table';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { forwardRef, useContext, useMemo } from 'react';
3
4
  import { tableClasses, getColumnStyle, getCellStyle } from '@mezzanine-ui/core/table';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, Fragment } from 'react/jsx-runtime';
2
3
  import { useContext } from 'react';
3
4
  import { TableComponentContext } from '../TableContext.js';
@@ -18,7 +18,7 @@ const TableExpandable = forwardRef(function TableExpandable(props, ref) {
18
18
  };
19
19
  return (jsx("div", { ...rest, ref: ref, className: cx(tableClasses.collapseAction, className), children: jsx("div", { className: tableClasses.icon, children: showIcon ? (jsx(Icon, { className: cx(tableClasses.icon, {
20
20
  [tableClasses.iconClickable]: expandable,
21
- }), color: expandable ? 'primary' : 'disabled', icon: ChevronDownIcon, onClick: onClick, style: { transform: `rotate(${expanded ? '180deg' : '0'})` } })) : null }) }));
21
+ }), color: expandable ? 'brand' : 'neutral-faint', icon: ChevronDownIcon, onClick: onClick, style: { transform: `rotate(${expanded ? '180deg' : '0'})` } })) : null }) }));
22
22
  });
23
23
 
24
24
  export { TableExpandable as default };
package/Table/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- export { TableProps, default } from './Table';
2
- export { TableRefreshProps, default as TableRefresh, } from './refresh/TableRefresh';
3
- export { TableCellProps, default as TableCell } from './TableCell';
4
- export { EditableBodyCellProps } from './editable/TableEditRenderWrapper';
1
+ export type { TableProps } from './Table';
2
+ export { default } from './Table';
3
+ export { default as TableRefresh } from './refresh/TableRefresh';
4
+ export type { TableRefreshProps } from './refresh/TableRefresh';
5
+ export type { TableCellProps } from './TableCell';
6
+ export { default as TableCell } from './TableCell';
7
+ export type { EditableBodyCellProps } from './editable/TableEditRenderWrapper';
5
8
  export { useTableDraggable } from './draggable/useTableDraggable';
6
9
  export { useTableRowSelection, SELECTED_ALL_KEY, } from './rowSelection/useTableRowSelection';
7
10
  export { default as useTableScroll } from './useTableScroll';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { forwardRef, useContext } from 'react';
3
4
  import { tableClasses } from '@mezzanine-ui/core/table';
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { useContext } from 'react';
2
3
  import { useControlValueState } from '../../Form/useControlValueState.js';
3
4
  import { useLastCallback } from '../../hooks/useLastCallback.js';
@@ -1,5 +1,7 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { forwardRef, useContext, useCallback } from 'react';
4
+ import cx from 'clsx';
3
5
  import { tableClasses } from '@mezzanine-ui/core/table';
4
6
  import { ResetIcon } from '@mezzanine-ui/icons';
5
7
  import { TableContext } from '../TableContext.js';
@@ -14,7 +16,7 @@ const TableRefresh = forwardRef(function TableRefresh(props, ref) {
14
16
  setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
15
17
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
16
18
  }, [onClick, setLoading]);
17
- return (jsx("div", { ref: ref, className: tableClasses.refresh, ...rest, children: jsx(Button, { onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }), children: children || '重新整理' }) }));
19
+ return (jsx("div", { ref: ref, className: cx(tableClasses.refresh, className), ...rest, children: jsx(Button, { onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }), children: children || '重新整理' }) }));
18
20
  });
19
21
 
20
22
  export { TableRefresh as default };
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { forwardRef, useContext, useCallback, useMemo, useEffect, useState } from 'react';
3
4
  import { tableClasses } from '@mezzanine-ui/core/table';
@@ -5,9 +6,9 @@ import xor from 'lodash/xor';
5
6
  import { MoreVerticalIcon } from '@mezzanine-ui/icons';
6
7
  import { TableContext, TableDataContext } from '../TableContext.js';
7
8
  import { SELECTED_ALL_KEY } from './useTableRowSelection.js';
9
+ import Checkbox from '../../Checkbox/Checkbox.js';
8
10
  import Menu from '../../Menu/Menu.js';
9
11
  import MenuItem from '../../Menu/MenuItem.js';
10
- import Checkbox from '../../Checkbox/Checkbox.js';
11
12
  import Dropdown from '../../Dropdown/Dropdown.js';
12
13
  import Icon from '../../Icon/Icon.js';
13
14
  import cx from 'clsx';
@@ -86,7 +87,7 @@ const TableRowSelection = forwardRef(function TableRowSelection(props, ref) {
86
87
  },
87
88
  }, children: (dropdownRef) => (jsx(Icon, { ref: dropdownRef, className: cx(tableClasses.icon, {
88
89
  [tableClasses.iconClickable]: isMenuAllowOpen,
89
- }), color: isMenuAllowOpen ? 'primary' : 'disabled', icon: MoreVerticalIcon, onClick: onIconClicked })) })) : null })) : null] }));
90
+ }), color: isMenuAllowOpen ? 'brand' : 'neutral-faint', icon: MoreVerticalIcon, onClick: onIconClicked })) })) : null })) : null] }));
90
91
  });
91
92
 
92
93
  export { TableRowSelection as default };
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { forwardRef, useMemo, useContext } from 'react';
3
4
  import { tableClasses } from '@mezzanine-ui/core/table';
@@ -14,7 +15,7 @@ const TableSortingIcon = forwardRef(function TableSortingIcon(props, ref) {
14
15
  /** styling */
15
16
  const currentType = (key === (sorting === null || sorting === void 0 ? void 0 : sorting.sortedOn) ? sorting.sortedType : 'none');
16
17
  const currentIconStyle = useMemo(() => ({
17
- color: currentType === 'none' ? 'secondary' : 'primary',
18
+ color: currentType === 'none' ? 'neutral' : 'neutral-strong',
18
19
  style: {
19
20
  transform: `rotate(${90 * (currentType === 'asc' ? -1 : 1)}deg)`,
20
21
  },
@@ -56,6 +56,7 @@ function useTableSorting(props) {
56
56
  !equalityFn(prevDataSourceProps, dataSourceProp, true)) {
57
57
  setDataSource(dataSourceProp);
58
58
  }
59
+ // eslint-disable-next-line react-hooks/exhaustive-deps
59
60
  }, [prevDataSourceProps, dataSourceProp]);
60
61
  const getNextSortedType = useCallback((currentType) => {
61
62
  // none -> desc -> asc -> none
@@ -39,7 +39,7 @@ function useTableFetchMore(props) {
39
39
  if (prevSourceLength !== currentSourceLength) {
40
40
  onFetching(false);
41
41
  }
42
- }, [prevSourceLength, currentSourceLength]);
42
+ }, [prevSourceLength, currentSourceLength, onFetching]);
43
43
  return {
44
44
  fetchMore,
45
45
  isFetching,
@@ -69,7 +69,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
69
69
  results?: number | undefined;
70
70
  security?: string | undefined;
71
71
  unselectable?: "on" | "off" | undefined;
72
- popover?: "" | "auto" | "manual" | undefined;
72
+ popover?: "" | "auto" | "manual" | "hint" | undefined;
73
73
  popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
74
74
  popoverTarget?: string | undefined;
75
75
  inert?: boolean | undefined;
@@ -152,7 +152,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
152
152
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
153
153
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
154
154
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
155
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
155
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
156
156
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
157
157
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
158
158
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -202,8 +202,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
202
202
  onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
203
203
  onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
204
204
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
205
- onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
206
- onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
207
205
  onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
208
206
  onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
209
207
  onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
@@ -356,7 +354,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
356
354
  results?: number | undefined;
357
355
  security?: string | undefined;
358
356
  unselectable?: "on" | "off" | undefined;
359
- popover?: "" | "auto" | "manual" | undefined;
357
+ popover?: "" | "auto" | "manual" | "hint" | undefined;
360
358
  popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
361
359
  popoverTarget?: string | undefined;
362
360
  inert?: boolean | undefined;
@@ -439,7 +437,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
439
437
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
440
438
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
441
439
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
442
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
440
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
443
441
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
444
442
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
445
443
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -489,8 +487,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
489
487
  onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
490
488
  onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
491
489
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
492
- onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
493
- onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
494
490
  onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
495
491
  onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
496
492
  onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
@@ -77,7 +77,7 @@ function useTableScroll(props) {
77
77
  !scrollBarTrackRef.current)
78
78
  return;
79
79
  /** 觸控螢幕不需要 scroll bar */
80
- const isTouchEnabled = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
80
+ const isTouchEnabled = navigator.maxTouchPoints > 0;
81
81
  /** firefox 的滾軸只能同時顯示 or 取消,所以乾脆就用原生的(除非能單獨關掉直向的滾軸,只顯示橫向的才行) */
82
82
  const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
83
83
  if (isTouchEnabled || isFirefox)
@@ -98,7 +98,7 @@ function useTableScroll(props) {
98
98
  `${scrollBarSize}px`;
99
99
  }
100
100
  resetPointerOffset();
101
- }, []);
101
+ }, [resetPointerOffset, scrollBarSize]);
102
102
  /** when use mouse to drag scroll bar, get cursor position */
103
103
  const onScrollBarMouseDown = useCallback(({ clientY }) => {
104
104
  const { current: scrollBar } = scrollBarRef;
@@ -107,7 +107,7 @@ function useTableScroll(props) {
107
107
  const { top: initScrollBarTop } = scrollBar.getBoundingClientRect();
108
108
  setPointerOffset(clientY - initScrollBarTop);
109
109
  }, []);
110
- const onScrollBarMouseUp = useCallback(() => resetPointerOffset(), []);
110
+ const onScrollBarMouseUp = useCallback(() => resetPointerOffset(), [resetPointerOffset]);
111
111
  /** 偵測 table 高度是否發生變化,有的話就要重新計算 scroll bar 長度 */
112
112
  useEffect(() => {
113
113
  const { current: table } = tableRef;
@@ -122,7 +122,7 @@ function useTableScroll(props) {
122
122
  };
123
123
  }
124
124
  return () => { };
125
- }, []);
125
+ }, [onSetScrollBarHeight]);
126
126
  useEffect(() => {
127
127
  const { current: body } = scrollRef;
128
128
  const { current: scrollBar } = scrollBarRef;
@@ -208,7 +208,7 @@ function useTableScroll(props) {
208
208
  scrollBarRef.current.childNodes[0].style.width =
209
209
  `${scrollBarSize + 6}px`;
210
210
  }
211
- }, []);
211
+ }, [scrollBarSize]);
212
212
  /** scroll table directly */
213
213
  const setScrollBarTop = useCallback(() => {
214
214
  if (scrollRef.current) {
@@ -224,7 +224,7 @@ function useTableScroll(props) {
224
224
  scrollBarTrackRef.current.style.height = `${tableHeight - HEADER_DEFAULT_HEIGHT}px`;
225
225
  }
226
226
  }
227
- }, [scrollBarHeight, pointerOffset]);
227
+ }, [pointerOffset]);
228
228
  const onScroll = useCallback((scrollTarget) => {
229
229
  /** 使用者開始橫向滾動 */
230
230
  if (scrollTarget.target.scrollLeft) {
@@ -270,7 +270,9 @@ function useTableScroll(props) {
270
270
  ...defaultScrollBarTrackStyle,
271
271
  height: `${(_b = (_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0}px`,
272
272
  });
273
- }, [scrollBarHeight]);
273
+ },
274
+ // eslint-disable-next-line react-hooks/exhaustive-deps
275
+ [scrollBarHeight]);
274
276
  /** composing result */
275
277
  const tableScrollContainer = {
276
278
  ref: scrollRef,
package/Tabs/TabPane.js CHANGED
@@ -11,6 +11,7 @@ const TabPane = forwardRef(function TabPane(props, ref) {
11
11
  /**
12
12
  * Ignore it
13
13
  */
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
15
  tab, ...rest } = props;
15
16
  return (jsx("div", { ...rest, ref: ref, className: cx(tabsClasses.pane, className), children: children }));
16
17
  });