@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
@@ -5,31 +5,29 @@ export interface PaginationJumperProps extends Omit<DetailedHTMLProps<HTMLAttrib
5
5
  */
6
6
  buttonText?: string;
7
7
  /**
8
- * If `true`, the pagination jumper fields is disabled.
9
- * @default false
8
+ * If `true`, the pagination jumper fields are disabled.
10
9
  */
11
- disabled?: boolean;
10
+ disabled?: true;
12
11
  /**
13
- * The hint text displayed in front of `input`.
12
+ * The hint text displayed in front of input.
14
13
  */
15
14
  hintText?: string;
16
15
  /**
17
- * The hint displayed in the `input` before the user enters a value.
16
+ * The placeholder displayed in the input before the user enters a value.
18
17
  */
19
18
  inputPlaceholder?: string;
20
19
  /**
21
20
  * Callback fired when the page is changed.
22
- *
23
- * @param {number} page The page active.
21
+ * @param {number} page The active page number.
24
22
  */
25
23
  onChange?: (page: number) => void;
26
24
  /**
27
- * Number of data per page
25
+ * Number of items per page.
28
26
  * @default 5
29
27
  */
30
28
  pageSize?: number;
31
29
  /**
32
- * Items total count.
30
+ * Total number of items.
33
31
  * @default 0
34
32
  */
35
33
  total?: number;
@@ -7,7 +7,7 @@ import Input from '../Input/Input.js';
7
7
  import cx from 'clsx';
8
8
 
9
9
  const PaginationJumper = forwardRef((props, ref) => {
10
- const { buttonText, className, disabled = false, hintText, inputPlaceholder, onChange: handleChange, pageSize = 5, total = 0, ...rest } = props;
10
+ const { buttonText, className, disabled, hintText, inputPlaceholder, onChange: handleChange, pageSize = 5, total = 0, ...rest } = props;
11
11
  const [value, setValue] = useState('');
12
12
  const [error, setError] = useState(false);
13
13
  const totalPages = total ? Math.ceil(total / pageSize) : 1;
@@ -38,13 +38,11 @@ const PaginationJumper = forwardRef((props, ref) => {
38
38
  handleClick();
39
39
  }
40
40
  };
41
- return (jsxs("div", { ...rest, ref: ref, className: cx(paginationJumperClasses.host, className), children: [jsx(Typography, { color: disabled ? 'text-disabled' : 'text-primary', component: "div", ellipsis: true, variant: "input2", children: hintText }), jsx(Input, { disabled: disabled, error: error, onChange: (e) => {
41
+ return (jsxs("div", { ...rest, ref: ref, className: cx(paginationJumperClasses.host, className), children: [jsx(Typography, { component: "div", ellipsis: true, variant: "label-primary", children: hintText }), jsx(Input, { size: "sub", disabled: disabled, error: error, variant: "number", className: paginationJumperClasses.input, onChange: (e) => {
42
42
  setValue(e.target.value);
43
43
  }, placeholder: inputPlaceholder, inputProps: {
44
- type: 'number',
45
- className: paginationJumperClasses.input,
46
44
  onKeyDown: handleKeyDown,
47
- }, value: value }), jsx(Button, { disabled: disabled, onClick: handleClick, children: buttonText })] }));
45
+ }, value: value }), jsx(Button, { size: "sub", disabled: disabled, onClick: handleClick, children: buttonText })] }));
48
46
  });
49
47
 
50
48
  export { PaginationJumper as default };
@@ -1,36 +1,33 @@
1
1
  import { DetailedHTMLProps, HTMLAttributes } from 'react';
2
2
  export interface PaginationPageSizeProps extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'> {
3
3
  /**
4
- * If `true`, the pagination page size fields is disabled.
4
+ * If `true`, the pagination page size fields are disabled.
5
5
  * @default false
6
6
  */
7
7
  disabled?: boolean;
8
8
  /**
9
- * Label display before `select`
9
+ * Label displayed before select.
10
10
  */
11
11
  label?: string;
12
12
  /**
13
13
  * Callback fired when the page size is changed.
14
- *
15
- * @param {number} pageSize The page active.
14
+ * @param {number} pageSize The new page size.
16
15
  */
17
16
  onChange?: (pageSize: number) => void;
18
17
  /**
19
- * options for `select` to use
18
+ * Options for select component.
20
19
  * @default [10, 20, 50, 100]
21
20
  */
22
21
  options?: number[];
23
22
  /**
24
- * Callback to custom render option name
23
+ * Callback to render custom option name.
24
+ * @param {number} pageSize The page size value.
25
+ * @returns {string}
25
26
  * @default (p) => `${p}`
26
27
  */
27
28
  renderOptionName?: (pageSize: number) => string;
28
29
  /**
29
- * unit display after `select`
30
- */
31
- unit?: string;
32
- /**
33
- * Current page size value
30
+ * Current page size value.
34
31
  */
35
32
  value?: number;
36
33
  }
@@ -2,19 +2,20 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { forwardRef, useMemo } from 'react';
3
3
  import { paginationPageSizeClasses } from '@mezzanine-ui/core/pagination';
4
4
  import Typography from '../Typography/Typography.js';
5
- import Select from '../Select/Select.js';
6
- import Option from '../Select/Option.js';
5
+ import SelectTrigger from '../Select/SelectTrigger.js';
7
6
  import cx from 'clsx';
8
7
 
9
8
  const PaginationPageSize = forwardRef((props, ref) => {
10
- const { className, disabled = false, label, onChange, options = [10, 20, 50, 100], renderOptionName = (p) => `${p}`, unit, value, ...rest } = props;
9
+ const { className, disabled = false, label,
10
+ /* TODO: waiting Select onChange, Dropdown Menu options */
11
+ onChange, options = [10, 20, 50, 100], renderOptionName = (p) => `${p}`, value, ...rest } = props;
11
12
  const currentValue = useMemo(() => value
12
13
  ? {
13
14
  id: `${value}`,
14
15
  name: renderOptionName(value),
15
16
  }
16
17
  : undefined, [value, renderOptionName]);
17
- return (jsxs("div", { ...rest, ref: ref, className: cx(paginationPageSizeClasses.host, className), children: [label ? (jsx(Typography, { color: "text-secondary", component: "div", ellipsis: true, variant: "button3", children: label })) : null, jsx(Select, { disabled: disabled, value: currentValue, onChange: (nextSelection) => onChange === null || onChange === void 0 ? void 0 : onChange(Number(nextSelection.id)), className: paginationPageSizeClasses.select, children: options.map((opt) => (jsx(Option, { value: `${opt}`, children: renderOptionName(opt) }, opt))) }), unit ? (jsx(Typography, { color: "text-secondary", component: "div", ellipsis: true, variant: "button3", children: unit })) : null] }));
18
+ return (jsxs("div", { ...rest, ref: ref, className: cx(paginationPageSizeClasses.host, className), children: [label ? (jsx(Typography, { component: "div", ellipsis: true, variant: "label-primary", children: label })) : null, jsx(SelectTrigger, { className: paginationPageSizeClasses.select, disabled: disabled, size: "sub", value: currentValue })] }));
18
19
  });
19
20
 
20
21
  export { PaginationPageSize as default };
@@ -1,6 +1,10 @@
1
1
  export type { PaginationItemType } from '@mezzanine-ui/core/pagination';
2
- export { PaginationProps, default } from './Pagination';
3
- export { PaginationItemProps, default as PaginationItem, } from './PaginationItem';
4
- export { PaginationJumperProps, default as PaginationJumper, } from './PaginationJumper';
5
- export { PaginationPageSizeProps, default as PaginationPageSize, } from './PaginationPageSize';
2
+ export type { PaginationProps } from './Pagination';
3
+ export { default } from './Pagination';
4
+ export { default as PaginationItem } from './PaginationItem';
5
+ export type { PaginationItemProps } from './PaginationItem';
6
+ export { default as PaginationJumper } from './PaginationJumper';
7
+ export type { PaginationJumperProps } from './PaginationJumper';
8
+ export { default as PaginationPageSize } from './PaginationPageSize';
9
+ export type { PaginationPageSizeProps } from './PaginationPageSize';
6
10
  export { usePagination } from './usePagination';
@@ -3,10 +3,12 @@ export interface UsePaginationParams {
3
3
  boundaryCount?: number;
4
4
  current?: number;
5
5
  disabled?: boolean;
6
+ hideFirstButton?: boolean;
7
+ hideLastButton?: boolean;
6
8
  hideNextButton?: boolean;
7
9
  hidePreviousButton?: boolean;
8
- pageSize?: number;
9
10
  onChange?: (page: number) => void;
11
+ pageSize?: number;
10
12
  siblingCount?: number;
11
13
  total?: number;
12
14
  }
@@ -1,11 +1,11 @@
1
- import { useMemo } from 'react';
1
+ import { useMemo, useCallback } from 'react';
2
2
 
3
3
  const range = (start, end) => {
4
4
  const length = end - start + 1;
5
5
  return Array.from({ length }, (_, i) => start + i);
6
6
  };
7
7
  function usePagination(props = {}) {
8
- const { boundaryCount = 1, current = 1, disabled = false, hideNextButton = false, hidePreviousButton = false, pageSize = 10, onChange: handleChange, siblingCount = 1, total = 0, } = props;
8
+ const { boundaryCount = 1, current = 1, disabled = false, onChange: handleChange, pageSize = 10, siblingCount = 1, total = 0, } = props;
9
9
  const totalPages = total ? Math.ceil(total / pageSize) : 1;
10
10
  const itemList = useMemo(() => {
11
11
  const startPages = range(1, Math.min(boundaryCount, totalPages));
@@ -13,37 +13,30 @@ function usePagination(props = {}) {
13
13
  const siblingsStart = Math.max(Math.min(current - siblingCount, totalPages - boundaryCount - siblingCount * 2 - 1), boundaryCount + 2);
14
14
  const siblingsEnd = Math.min(Math.max(current + siblingCount, boundaryCount + siblingCount * 2 + 2), endPages.length > 0 ? endPages[0] - 2 : totalPages - 1);
15
15
  return [
16
- ...(hidePreviousButton ? [] : ['previous']),
16
+ 'first',
17
+ 'previous',
17
18
  ...startPages,
18
- // eslint-disable-next-line no-nested-ternary
19
19
  ...(siblingsStart > boundaryCount + 2
20
20
  ? ['ellipsis']
21
21
  : boundaryCount + 1 < totalPages - boundaryCount
22
22
  ? [boundaryCount + 1]
23
23
  : []),
24
24
  ...range(siblingsStart, siblingsEnd),
25
- // eslint-disable-next-line no-nested-ternary
26
25
  ...(siblingsEnd < totalPages - boundaryCount - 1
27
26
  ? ['ellipsis']
28
27
  : totalPages - boundaryCount > boundaryCount
29
28
  ? [totalPages - boundaryCount]
30
29
  : []),
31
30
  ...endPages,
32
- ...(hideNextButton ? [] : ['next']),
31
+ 'next',
32
+ 'last',
33
33
  ];
34
- }, [
35
- boundaryCount,
36
- current,
37
- hideNextButton,
38
- hidePreviousButton,
39
- siblingCount,
40
- totalPages,
41
- ]);
42
- const handleClick = (page) => {
34
+ }, [boundaryCount, current, siblingCount, totalPages]);
35
+ const handleClick = useCallback((page) => {
43
36
  if (handleChange) {
44
37
  handleChange(page);
45
38
  }
46
- };
39
+ }, [handleChange]);
47
40
  const items = useMemo(() => itemList.map((item) => {
48
41
  if (typeof item === 'number') {
49
42
  return {
@@ -61,28 +54,44 @@ function usePagination(props = {}) {
61
54
  }
62
55
  const restItemProps = {
63
56
  previous: {
64
- 'aria-label': 'Go to previous Page',
65
- disabled: disabled || current - 1 < 1,
57
+ 'aria-label': 'Go to previous page',
58
+ disabled: disabled || current === 1,
66
59
  onClick: () => {
67
60
  handleClick(current - 1);
68
61
  },
69
62
  type: item,
70
63
  },
71
64
  next: {
72
- 'aria-label': 'Go to next Page',
73
- disabled: disabled || current + 1 > totalPages,
65
+ 'aria-label': 'Go to next page',
66
+ disabled: disabled || current === totalPages,
74
67
  onClick: () => {
75
68
  handleClick(current + 1);
76
69
  },
77
70
  type: item,
78
71
  },
72
+ first: {
73
+ 'aria-label': 'Go to first page',
74
+ disabled: disabled || current === 1,
75
+ onClick: () => {
76
+ handleClick(1);
77
+ },
78
+ type: item,
79
+ },
80
+ last: {
81
+ 'aria-label': 'Go to last page',
82
+ disabled: disabled || current === totalPages,
83
+ onClick: () => {
84
+ handleClick(totalPages);
85
+ },
86
+ type: item,
87
+ },
79
88
  ellipsis: {
80
89
  disabled,
81
90
  type: item,
82
91
  },
83
92
  };
84
93
  return restItemProps[item] || { type: item };
85
- }), [current, disabled, itemList, totalPages]);
94
+ }), [current, disabled, itemList, totalPages, handleClick]);
86
95
  return {
87
96
  items,
88
97
  };
@@ -0,0 +1,17 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { type UseDateInputFormatterProps } from './useDateInputFormatter';
3
+ export interface FormattedInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'>, Pick<UseDateInputFormatterProps, 'errorMessages' | 'validate' | 'format' | 'onChange'> {
4
+ /**
5
+ * Placeholder to show when not focused and value is empty
6
+ */
7
+ placeholder?: string;
8
+ /**
9
+ * The current value
10
+ */
11
+ value?: string;
12
+ }
13
+ /**
14
+ * Formatted input component with mixed-color placeholder
15
+ */
16
+ declare const FormattedInput: import("react").ForwardRefExoticComponent<FormattedInputProps & import("react").RefAttributes<HTMLInputElement>>;
17
+ export default FormattedInput;
@@ -0,0 +1,74 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { forwardRef, useRef } from 'react';
3
+ import { pickerClasses } from '@mezzanine-ui/core/picker';
4
+ import { useDateInputFormatter } from './useDateInputFormatter.js';
5
+ import { useComposeRefs } from '../hooks/useComposeRefs.js';
6
+ import { parseFormatSegments, getTemplateWithoutBrackets, findPreviousMaskSegment, isMaskSegmentFilled } from './formatUtils.js';
7
+ import cx from 'clsx';
8
+
9
+ /**
10
+ * Formatted input component with mixed-color placeholder
11
+ */
12
+ const FormattedInput = forwardRef(function FormattedInput(props, ref) {
13
+ const { className, disabled, errorMessages = {
14
+ enabled: true,
15
+ invalidInput: 'Input value is not valid.',
16
+ invalidPaste: 'Pasted content is not valid.',
17
+ }, format, placeholder, validate, value: externalValue, onChange, onFocus, onBlur, ...inputProps } = props;
18
+ const internalInputRef = useRef(null);
19
+ const composedRef = useComposeRefs([ref, internalInputRef]);
20
+ const { value, focused, handleKeyDown, handleFocus, handleBlur, handlePaste, } = useDateInputFormatter({
21
+ errorMessages,
22
+ format,
23
+ value: externalValue,
24
+ onChange,
25
+ inputRef: internalInputRef,
26
+ onFocus,
27
+ onBlur,
28
+ validate,
29
+ });
30
+ const segments = useRef(parseFormatSegments(format)).current;
31
+ const renderMixedColorDisplay = () => {
32
+ const currentValue = value || '';
33
+ // Show placeholder when no value
34
+ if (currentValue === getTemplateWithoutBrackets(format) && placeholder) {
35
+ return null;
36
+ }
37
+ // Show format mask when focused or has value
38
+ const displaySegments = [];
39
+ for (const segment of segments) {
40
+ if (segment.type === 'mask') {
41
+ // Render each character of the mask segment
42
+ for (let i = segment.start; i < segment.end; i++) {
43
+ displaySegments.push({
44
+ text: currentValue[i] || segment.text[i - segment.start],
45
+ filled: /\d/.test(currentValue[i]),
46
+ });
47
+ }
48
+ }
49
+ else {
50
+ // Separator or literal - show as filled if previous mask segment is filled
51
+ const prevMask = findPreviousMaskSegment(segments, segment.start);
52
+ const isFilled = prevMask
53
+ ? isMaskSegmentFilled(currentValue, prevMask)
54
+ : false;
55
+ displaySegments.push({
56
+ text: segment.text,
57
+ filled: isFilled,
58
+ });
59
+ }
60
+ }
61
+ return (jsx("div", { "aria-hidden": "true", className: pickerClasses.formattedInputDisplay, children: displaySegments.map((segment, index) => (jsx("span", { className: cx(pickerClasses.formattedInputSegment, segment.filled && pickerClasses.formattedInputSegmentFilled, disabled && pickerClasses.formattedInputSegmentDisabled), children: segment.text }, index))) }));
62
+ };
63
+ const renderPlaceholder = () => {
64
+ if (value === getTemplateWithoutBrackets(format)) {
65
+ if (focused)
66
+ return getTemplateWithoutBrackets(format);
67
+ return placeholder;
68
+ }
69
+ return undefined;
70
+ };
71
+ return (jsxs("div", { className: pickerClasses.formattedInput, children: [jsx("input", { ...inputProps, ref: composedRef, className: cx(pickerClasses.inputMono, pickerClasses.formattedInputHidden, className), disabled: disabled, type: "text", value: value === getTemplateWithoutBrackets(format) ? '' : value, placeholder: renderPlaceholder(), onChange: () => { }, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, onPaste: handlePaste }), renderMixedColorDisplay()] }));
72
+ });
73
+
74
+ export { FormattedInput as default };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Format keys that can be used in mask format
3
+ */
4
+ export declare const FORMAT_KEYS: string[];
5
+ /**
6
+ * Cell represents a single mask field or separator in the format
7
+ */
8
+ export interface Cell {
9
+ /** Text content of this cell */
10
+ text: string;
11
+ /** Mask key if this is an editable field (e.g., 'YYYY', 'MM'), undefined for separators */
12
+ mask?: string;
13
+ /** Start position in the format string */
14
+ start: number;
15
+ /** End position in the format string */
16
+ end: number;
17
+ }
18
+ /**
19
+ * Get valid range for a mask field
20
+ * @param key Mask key (e.g., 'YYYY', 'MM', 'DD')
21
+ * @returns [min, max] tuple
22
+ */
23
+ export declare function getMaskRange(key: string): [number, number];
24
+ /**
25
+ * MaskFormat class parses format string into cells for mask input
26
+ */
27
+ export default class MaskFormat {
28
+ /** All cells including separators */
29
+ cells: Cell[];
30
+ /** Only editable mask cells (excludes separators) */
31
+ maskCells: Cell[];
32
+ constructor(format: string);
33
+ /**
34
+ * Check if text matches this format
35
+ * @param text Input text to validate
36
+ * @returns true if text structure matches format
37
+ */
38
+ match(text: string): boolean;
39
+ }
@@ -0,0 +1,94 @@
1
+ import { parseFormatSegments } from './formatUtils.js';
2
+
3
+ /**
4
+ * Get valid range for a mask field
5
+ * @param key Mask key (e.g., 'YYYY', 'MM', 'DD')
6
+ * @returns [min, max] tuple
7
+ */
8
+ function getMaskRange(key) {
9
+ switch (key) {
10
+ case 'YYYY':
11
+ case 'gggg':
12
+ case 'GGGG':
13
+ return [1000, 9999];
14
+ case 'WW':
15
+ case 'ww':
16
+ return [1, 53];
17
+ case 'MM':
18
+ return [1, 12];
19
+ case 'DD':
20
+ return [1, 31];
21
+ case 'HH':
22
+ return [0, 23];
23
+ case 'n':
24
+ return [1, 2]; // Half-year number: 1 or 2
25
+ case 'mm':
26
+ case 'ss':
27
+ return [0, 59];
28
+ case 'SSS':
29
+ return [0, 999];
30
+ case 'Q':
31
+ return [1, 4];
32
+ default:
33
+ return [0, 99];
34
+ }
35
+ }
36
+ /**
37
+ * MaskFormat class parses format string into cells for mask input
38
+ */
39
+ class MaskFormat {
40
+ constructor(format) {
41
+ this.cells = [];
42
+ this.maskCells = [];
43
+ const segments = parseFormatSegments(format);
44
+ for (const segment of segments) {
45
+ let cell;
46
+ if (segment.type === 'mask') {
47
+ cell = {
48
+ text: segment.text,
49
+ mask: segment.text,
50
+ start: segment.start,
51
+ end: segment.end,
52
+ };
53
+ this.maskCells.push(cell);
54
+ }
55
+ else {
56
+ cell = {
57
+ text: segment.text,
58
+ start: segment.start,
59
+ end: segment.end,
60
+ };
61
+ }
62
+ this.cells.push(cell);
63
+ }
64
+ }
65
+ /**
66
+ * Check if text matches this format
67
+ * @param text Input text to validate
68
+ * @returns true if text structure matches format
69
+ */
70
+ match(text) {
71
+ var _a;
72
+ if (text.length !== ((_a = this.cells[this.cells.length - 1]) === null || _a === void 0 ? void 0 : _a.end)) {
73
+ return false;
74
+ }
75
+ for (const cell of this.cells) {
76
+ const cellText = text.slice(cell.start, cell.end);
77
+ if (cell.mask) {
78
+ // Editable field should be all digits
79
+ if (!/^\d+$/.test(cellText)) {
80
+ return false;
81
+ }
82
+ }
83
+ else {
84
+ // Separator should match exactly
85
+ if (cellText !== cell.text) {
86
+ return false;
87
+ }
88
+ }
89
+ }
90
+ return true;
91
+ }
92
+ }
93
+
94
+ export { MaskFormat as default, getMaskRange };
@@ -1,7 +1,13 @@
1
- import { ChangeEventHandler, RefObject } from 'react';
1
+ import { ChangeEventHandler, ReactNode, RefObject } from 'react';
2
2
  import { TextFieldProps } from '../TextField';
3
3
  import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
4
- export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | 'defaultChecked'> {
4
+ import { FormattedInputProps } from './FormattedInput';
5
+ export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'defaultChecked' | 'disabled' | 'readonly' | 'typing'>, Pick<FormattedInputProps, 'errorMessages' | 'validate' | 'format'> {
6
+ /**
7
+ * Whether the input is disabled.
8
+ * @default false
9
+ */
10
+ disabled?: boolean;
5
11
  /**
6
12
  * React ref for the input element.
7
13
  */
@@ -9,7 +15,7 @@ export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'chi
9
15
  /**
10
16
  * Change handler for the input element.
11
17
  */
12
- onChange?: ChangeEventHandler;
18
+ onChange?: ChangeEventHandler<HTMLInputElement>;
13
19
  /**
14
20
  * Placeholder for the input element.
15
21
  */
@@ -24,6 +30,10 @@ export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'chi
24
30
  * @default false
25
31
  */
26
32
  required?: boolean;
33
+ /**
34
+ * Custom suffix element. If not provided, defaults to CalendarIcon.
35
+ */
36
+ suffix?: ReactNode;
27
37
  /**
28
38
  * The value of the input element.
29
39
  */
@@ -1,6 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { pickerClasses } from '@mezzanine-ui/core/picker';
3
3
  import { forwardRef } from 'react';
4
+ import FormattedInput from './FormattedInput.js';
4
5
  import TextField from '../TextField/TextField.js';
5
6
  import cx from 'clsx';
6
7
 
@@ -8,8 +9,22 @@ import cx from 'clsx';
8
9
  * The react component for `mezzanine` picker trigger.
9
10
  */
10
11
  const PickerTrigger = forwardRef(function PickerTrigger(props, ref) {
11
- const { className, clearable, disabled, inputProps, inputRef, onChange, placeholder, readOnly, required, value, ...restTextFieldProps } = props;
12
- return (jsx(TextField, { ...restTextFieldProps, ref: ref, active: !!value, className: cx(pickerClasses.host, className), clearable: !readOnly && clearable, disabled: disabled, children: jsx("input", { ...inputProps, ref: inputRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onChange, placeholder: placeholder, readOnly: readOnly, required: required, value: value }) }));
12
+ const { className, clearable = true, disabled, errorMessages, format, inputProps, inputRef, onChange, placeholder, readOnly, required, suffix, validate, value, ...restTextFieldProps } = props;
13
+ // TextField requires disabled and readonly to be mutually exclusive
14
+ let defaultTextFieldProps = {};
15
+ if (disabled) {
16
+ defaultTextFieldProps = { disabled: true };
17
+ }
18
+ else if (readOnly) {
19
+ defaultTextFieldProps = { readonly: true };
20
+ }
21
+ return (jsx(TextField, { ...restTextFieldProps, ...defaultTextFieldProps, ref: ref, className: cx(pickerClasses.host, className), clearable: !readOnly && clearable, suffix: suffix, children: jsx(FormattedInput, { ...inputProps, ref: inputRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, errorMessages: errorMessages, format: format, onChange: (formatted, _rawDigits) => {
22
+ if (onChange) {
23
+ onChange({
24
+ target: { value: formatted },
25
+ });
26
+ }
27
+ }, placeholder: placeholder, readOnly: readOnly, required: required, validate: validate, value: value }) }));
13
28
  });
14
29
 
15
30
  export { PickerTrigger as default };