@mezzanine-ui/react 0.6.4

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 (487) hide show
  1. package/Accordion/Accordion.d.ts +24 -0
  2. package/Accordion/Accordion.js +32 -0
  3. package/Accordion/AccordionControlContext.d.ts +9 -0
  4. package/Accordion/AccordionControlContext.js +5 -0
  5. package/Accordion/AccordionDetails.d.ts +10 -0
  6. package/Accordion/AccordionDetails.js +25 -0
  7. package/Accordion/AccordionSummary.d.ts +19 -0
  8. package/Accordion/AccordionSummary.js +50 -0
  9. package/Accordion/index.d.ts +3 -0
  10. package/Accordion/index.js +3 -0
  11. package/Alert/Alert.d.ts +20 -0
  12. package/Alert/Alert.js +20 -0
  13. package/Alert/index.d.ts +2 -0
  14. package/Alert/index.js +1 -0
  15. package/AppBar/AppBar.d.ts +14 -0
  16. package/AppBar/AppBar.js +35 -0
  17. package/AppBar/AppBarBrand.d.ts +5 -0
  18. package/AppBar/AppBarBrand.js +11 -0
  19. package/AppBar/AppBarMain.d.ts +5 -0
  20. package/AppBar/AppBarMain.js +11 -0
  21. package/AppBar/AppBarSupport.d.ts +5 -0
  22. package/AppBar/AppBarSupport.js +11 -0
  23. package/AppBar/index.d.ts +4 -0
  24. package/AppBar/index.js +4 -0
  25. package/Badge/Badge.d.ts +19 -0
  26. package/Badge/Badge.js +27 -0
  27. package/Badge/BadgeContainer.d.ts +8 -0
  28. package/Badge/BadgeContainer.js +14 -0
  29. package/Badge/index.d.ts +2 -0
  30. package/Badge/index.js +2 -0
  31. package/Button/Button.d.ts +11 -0
  32. package/Button/Button.js +37 -0
  33. package/Button/ButtonGroup.d.ts +63 -0
  34. package/Button/ButtonGroup.js +35 -0
  35. package/Button/IconButton.d.ts +21 -0
  36. package/Button/IconButton.js +13 -0
  37. package/Button/index.d.ts +20 -0
  38. package/Button/index.js +8 -0
  39. package/Button/typings.d.ts +44 -0
  40. package/Calendar/Calendar.d.ts +69 -0
  41. package/Calendar/Calendar.js +53 -0
  42. package/Calendar/CalendarCell.d.ts +22 -0
  43. package/Calendar/CalendarCell.js +18 -0
  44. package/Calendar/CalendarContext.d.ts +22 -0
  45. package/Calendar/CalendarContext.js +27 -0
  46. package/Calendar/CalendarControls.d.ts +26 -0
  47. package/Calendar/CalendarControls.js +20 -0
  48. package/Calendar/CalendarDayOfWeek.d.ts +15 -0
  49. package/Calendar/CalendarDayOfWeek.js +18 -0
  50. package/Calendar/CalendarDays.d.ts +38 -0
  51. package/Calendar/CalendarDays.js +48 -0
  52. package/Calendar/CalendarMonths.d.ts +42 -0
  53. package/Calendar/CalendarMonths.js +30 -0
  54. package/Calendar/CalendarWeeks.d.ts +41 -0
  55. package/Calendar/CalendarWeeks.js +54 -0
  56. package/Calendar/CalendarYears.d.ts +40 -0
  57. package/Calendar/CalendarYears.js +34 -0
  58. package/Calendar/index.d.ts +12 -0
  59. package/Calendar/index.js +12 -0
  60. package/Calendar/useCalendarControlModifiers.d.ts +7 -0
  61. package/Calendar/useCalendarControlModifiers.js +26 -0
  62. package/Calendar/useCalendarControls.d.ts +13 -0
  63. package/Calendar/useCalendarControls.js +34 -0
  64. package/Calendar/useCalendarModeStack.d.ts +6 -0
  65. package/Calendar/useCalendarModeStack.js +15 -0
  66. package/Card/Card.d.ts +51 -0
  67. package/Card/Card.js +20 -0
  68. package/Card/CardActions.d.ts +34 -0
  69. package/Card/CardActions.js +16 -0
  70. package/Card/index.d.ts +2 -0
  71. package/Card/index.js +2 -0
  72. package/Checkbox/CheckAll.d.ts +13 -0
  73. package/Checkbox/CheckAll.js +36 -0
  74. package/Checkbox/Checkbox.d.ts +46 -0
  75. package/Checkbox/Checkbox.js +33 -0
  76. package/Checkbox/CheckboxGroup.d.ts +47 -0
  77. package/Checkbox/CheckboxGroup.js +36 -0
  78. package/Checkbox/CheckboxGroupContext.d.ts +9 -0
  79. package/Checkbox/CheckboxGroupContext.js +5 -0
  80. package/Checkbox/index.d.ts +4 -0
  81. package/Checkbox/index.js +3 -0
  82. package/ConfirmActions/ConfirmActions.d.ts +45 -0
  83. package/ConfirmActions/ConfirmActions.js +16 -0
  84. package/ConfirmActions/index.d.ts +1 -0
  85. package/ConfirmActions/index.js +1 -0
  86. package/DatePicker/DatePicker.d.ts +32 -0
  87. package/DatePicker/DatePicker.js +135 -0
  88. package/DatePicker/DatePickerCalendar.d.ts +32 -0
  89. package/DatePicker/DatePickerCalendar.js +61 -0
  90. package/DatePicker/index.d.ts +2 -0
  91. package/DatePicker/index.js +2 -0
  92. package/DateRangePicker/DateRangePicker.d.ts +38 -0
  93. package/DateRangePicker/DateRangePicker.js +187 -0
  94. package/DateRangePicker/DateRangePickerCalendar.d.ts +26 -0
  95. package/DateRangePicker/DateRangePickerCalendar.js +98 -0
  96. package/DateRangePicker/index.d.ts +4 -0
  97. package/DateRangePicker/index.js +4 -0
  98. package/DateRangePicker/useDateRangeCalendarControls.d.ts +15 -0
  99. package/DateRangePicker/useDateRangeCalendarControls.js +93 -0
  100. package/DateRangePicker/useDateRangePickerValue.d.ts +23 -0
  101. package/DateRangePicker/useDateRangePickerValue.js +87 -0
  102. package/DateTimePicker/DateTimePicker.d.ts +28 -0
  103. package/DateTimePicker/DateTimePicker.js +122 -0
  104. package/DateTimePicker/DateTimePickerPanel.d.ts +29 -0
  105. package/DateTimePicker/DateTimePickerPanel.js +51 -0
  106. package/DateTimePicker/index.d.ts +2 -0
  107. package/DateTimePicker/index.js +2 -0
  108. package/Drawer/Drawer.d.ts +18 -0
  109. package/Drawer/Drawer.js +34 -0
  110. package/Drawer/index.d.ts +2 -0
  111. package/Drawer/index.js +1 -0
  112. package/Dropdown/Dropdown.d.ts +25 -0
  113. package/Dropdown/Dropdown.js +60 -0
  114. package/Dropdown/index.d.ts +1 -0
  115. package/Dropdown/index.js +1 -0
  116. package/Empty/Empty.d.ts +18 -0
  117. package/Empty/Empty.js +16 -0
  118. package/Empty/index.d.ts +1 -0
  119. package/Empty/index.js +1 -0
  120. package/Form/FormControlContext.d.ts +9 -0
  121. package/Form/FormControlContext.js +5 -0
  122. package/Form/FormField.d.ts +27 -0
  123. package/Form/FormField.js +24 -0
  124. package/Form/FormLabel.d.ts +11 -0
  125. package/Form/FormLabel.js +17 -0
  126. package/Form/FormMessage.d.ts +8 -0
  127. package/Form/FormMessage.js +18 -0
  128. package/Form/index.d.ts +5 -0
  129. package/Form/index.js +4 -0
  130. package/Form/typings.d.ts +4 -0
  131. package/Form/useAutoCompleteValueControl.d.ts +23 -0
  132. package/Form/useAutoCompleteValueControl.js +58 -0
  133. package/Form/useCheckboxControlValue.d.ts +11 -0
  134. package/Form/useCheckboxControlValue.js +29 -0
  135. package/Form/useControlValueState.d.ts +7 -0
  136. package/Form/useControlValueState.js +15 -0
  137. package/Form/useCustomControlValue.d.ts +5 -0
  138. package/Form/useCustomControlValue.js +18 -0
  139. package/Form/useInputControlValue.d.ts +7 -0
  140. package/Form/useInputControlValue.js +24 -0
  141. package/Form/useInputWithClearControlValue.d.ts +6 -0
  142. package/Form/useInputWithClearControlValue.js +33 -0
  143. package/Form/useRadioControlValue.d.ts +11 -0
  144. package/Form/useRadioControlValue.js +24 -0
  145. package/Form/useSelectValueControl.d.ts +16 -0
  146. package/Form/useSelectValueControl.js +59 -0
  147. package/Form/useSwitchControlValue.d.ts +7 -0
  148. package/Form/useSwitchControlValue.js +24 -0
  149. package/Icon/Icon.d.ts +24 -0
  150. package/Icon/Icon.js +23 -0
  151. package/Icon/index.d.ts +3 -0
  152. package/Icon/index.js +1 -0
  153. package/Input/Input.d.ts +50 -0
  154. package/Input/Input.js +28 -0
  155. package/Input/index.d.ts +2 -0
  156. package/Input/index.js +1 -0
  157. package/LICENSE +21 -0
  158. package/Loading/Loading.d.ts +34 -0
  159. package/Loading/Loading.js +28 -0
  160. package/Loading/index.d.ts +1 -0
  161. package/Loading/index.js +1 -0
  162. package/Menu/Menu.d.ts +29 -0
  163. package/Menu/Menu.js +22 -0
  164. package/Menu/MenuDivider.d.ts +8 -0
  165. package/Menu/MenuDivider.js +14 -0
  166. package/Menu/MenuItem.d.ts +24 -0
  167. package/Menu/MenuItem.js +26 -0
  168. package/Menu/MenuItemGroup.d.ts +13 -0
  169. package/Menu/MenuItemGroup.js +15 -0
  170. package/Menu/index.d.ts +5 -0
  171. package/Menu/index.js +4 -0
  172. package/Message/Message.d.ts +33 -0
  173. package/Message/Message.js +59 -0
  174. package/Message/index.d.ts +2 -0
  175. package/Message/index.js +1 -0
  176. package/Modal/Modal.d.ts +42 -0
  177. package/Modal/Modal.js +75 -0
  178. package/Modal/ModalActions.d.ts +10 -0
  179. package/Modal/ModalActions.js +18 -0
  180. package/Modal/ModalBody.d.ts +8 -0
  181. package/Modal/ModalBody.js +14 -0
  182. package/Modal/ModalControl.d.ts +7 -0
  183. package/Modal/ModalControl.js +8 -0
  184. package/Modal/ModalFooter.d.ts +8 -0
  185. package/Modal/ModalFooter.js +14 -0
  186. package/Modal/ModalHeader.d.ts +20 -0
  187. package/Modal/ModalHeader.js +20 -0
  188. package/Modal/index.d.ts +6 -0
  189. package/Modal/index.js +5 -0
  190. package/Modal/useIsTopModal.d.ts +1 -0
  191. package/Modal/useIsTopModal.js +22 -0
  192. package/Navigation/Navigation.d.ts +29 -0
  193. package/Navigation/Navigation.js +48 -0
  194. package/Navigation/NavigationContext.d.ts +6 -0
  195. package/Navigation/NavigationContext.js +7 -0
  196. package/Navigation/NavigationItem.d.ts +31 -0
  197. package/Navigation/NavigationItem.js +22 -0
  198. package/Navigation/NavigationSubMenu.d.ts +17 -0
  199. package/Navigation/NavigationSubMenu.js +65 -0
  200. package/Navigation/index.d.ts +4 -0
  201. package/Navigation/index.js +4 -0
  202. package/Notification/Notification.d.ts +54 -0
  203. package/Notification/Notification.js +78 -0
  204. package/Notification/index.d.ts +2 -0
  205. package/Notification/index.js +1 -0
  206. package/Notifier/NotifierManager.d.ts +17 -0
  207. package/Notifier/NotifierManager.js +31 -0
  208. package/Notifier/createNotifier.d.ts +21 -0
  209. package/Notifier/createNotifier.js +67 -0
  210. package/Notifier/index.d.ts +2 -0
  211. package/Notifier/index.js +1 -0
  212. package/Notifier/typings.d.ts +28 -0
  213. package/Overlay/Overlay.d.ts +43 -0
  214. package/Overlay/Overlay.js +31 -0
  215. package/Overlay/index.d.ts +1 -0
  216. package/Overlay/index.js +1 -0
  217. package/PageFooter/PageFooter.d.ts +15 -0
  218. package/PageFooter/PageFooter.js +13 -0
  219. package/PageFooter/index.d.ts +1 -0
  220. package/PageFooter/index.js +1 -0
  221. package/Pagination/Pagination.d.ts +78 -0
  222. package/Pagination/Pagination.js +29 -0
  223. package/Pagination/PaginationItem.d.ts +27 -0
  224. package/Pagination/PaginationItem.js +25 -0
  225. package/Pagination/PaginationJumper.d.ts +38 -0
  226. package/Pagination/PaginationJumper.js +52 -0
  227. package/Pagination/index.d.ts +5 -0
  228. package/Pagination/index.js +4 -0
  229. package/Pagination/usePagination.d.ts +16 -0
  230. package/Pagination/usePagination.js +78 -0
  231. package/Picker/PickerTrigger.d.ts +40 -0
  232. package/Picker/PickerTrigger.js +15 -0
  233. package/Picker/RangePickerTrigger.d.ts +64 -0
  234. package/Picker/RangePickerTrigger.js +19 -0
  235. package/Picker/index.d.ts +7 -0
  236. package/Picker/index.js +7 -0
  237. package/Picker/usePickerDocumentEventClose.d.ts +10 -0
  238. package/Picker/usePickerDocumentEventClose.js +27 -0
  239. package/Picker/usePickerInputValue.d.ts +12 -0
  240. package/Picker/usePickerInputValue.js +24 -0
  241. package/Picker/usePickerValue.d.ts +21 -0
  242. package/Picker/usePickerValue.js +58 -0
  243. package/Picker/useRangePickerValue.d.ts +21 -0
  244. package/Picker/useRangePickerValue.js +94 -0
  245. package/Picker/useTabKeyClose.d.ts +2 -0
  246. package/Picker/useTabKeyClose.js +12 -0
  247. package/Popconfirm/Popconfirm.d.ts +16 -0
  248. package/Popconfirm/Popconfirm.js +15 -0
  249. package/Popconfirm/index.d.ts +1 -0
  250. package/Popconfirm/index.js +1 -0
  251. package/Popover/Popover.d.ts +23 -0
  252. package/Popover/Popover.js +45 -0
  253. package/Popover/index.d.ts +1 -0
  254. package/Popover/index.js +1 -0
  255. package/Popper/Popper.d.ts +32 -0
  256. package/Popper/Popper.js +30 -0
  257. package/Popper/index.d.ts +1 -0
  258. package/Popper/index.js +1 -0
  259. package/Portal/Portal.d.ts +20 -0
  260. package/Portal/Portal.js +22 -0
  261. package/Portal/index.d.ts +1 -0
  262. package/Portal/index.js +1 -0
  263. package/Progress/Progress.d.ts +59 -0
  264. package/Progress/Progress.js +32 -0
  265. package/Progress/index.d.ts +2 -0
  266. package/Progress/index.js +1 -0
  267. package/README.md +1 -0
  268. package/Radio/Radio.d.ts +41 -0
  269. package/Radio/Radio.js +31 -0
  270. package/Radio/RadioGroup.d.ts +47 -0
  271. package/Radio/RadioGroup.js +29 -0
  272. package/Radio/RadioGroupContext.d.ts +9 -0
  273. package/Radio/RadioGroupContext.js +5 -0
  274. package/Radio/index.d.ts +3 -0
  275. package/Radio/index.js +2 -0
  276. package/Select/AutoComplete.d.ts +75 -0
  277. package/Select/AutoComplete.js +108 -0
  278. package/Select/Option.d.ts +19 -0
  279. package/Select/Option.js +32 -0
  280. package/Select/Select.d.ts +57 -0
  281. package/Select/Select.js +145 -0
  282. package/Select/SelectControlContext.d.ts +3 -0
  283. package/Select/SelectControlContext.js +5 -0
  284. package/Select/SelectTrigger.d.ts +54 -0
  285. package/Select/SelectTrigger.js +27 -0
  286. package/Select/TreeSelect.d.ts +68 -0
  287. package/Select/TreeSelect.js +198 -0
  288. package/Select/index.d.ts +8 -0
  289. package/Select/index.js +7 -0
  290. package/Select/typings.d.ts +11 -0
  291. package/Skeleton/Skeleton.d.ts +22 -0
  292. package/Skeleton/Skeleton.js +14 -0
  293. package/Skeleton/index.d.ts +1 -0
  294. package/Skeleton/index.js +1 -0
  295. package/Slider/Slider.d.ts +51 -0
  296. package/Slider/Slider.js +172 -0
  297. package/Slider/index.d.ts +3 -0
  298. package/Slider/index.js +2 -0
  299. package/Slider/useSlider.d.ts +31 -0
  300. package/Slider/useSlider.js +104 -0
  301. package/Stepper/Step.d.ts +41 -0
  302. package/Stepper/Step.js +19 -0
  303. package/Stepper/Stepper.d.ts +19 -0
  304. package/Stepper/Stepper.js +33 -0
  305. package/Stepper/index.d.ts +2 -0
  306. package/Stepper/index.js +2 -0
  307. package/Switch/Switch.d.ts +43 -0
  308. package/Switch/Switch.js +29 -0
  309. package/Switch/index.d.ts +2 -0
  310. package/Switch/index.js +1 -0
  311. package/Table/Table.d.ts +79 -0
  312. package/Table/Table.js +111 -0
  313. package/Table/TableBody.d.ts +10 -0
  314. package/Table/TableBody.js +31 -0
  315. package/Table/TableBodyRow.d.ts +11 -0
  316. package/Table/TableBodyRow.js +63 -0
  317. package/Table/TableCell.d.ts +20 -0
  318. package/Table/TableCell.js +23 -0
  319. package/Table/TableContext.d.ts +46 -0
  320. package/Table/TableContext.js +7 -0
  321. package/Table/TableHeader.d.ts +3 -0
  322. package/Table/TableHeader.js +47 -0
  323. package/Table/editable/TableEditRenderWrapper.d.ts +8 -0
  324. package/Table/editable/TableEditRenderWrapper.js +15 -0
  325. package/Table/expandable/TableExpandable.d.ts +24 -0
  326. package/Table/expandable/TableExpandable.js +15 -0
  327. package/Table/index.d.ts +4 -0
  328. package/Table/index.js +3 -0
  329. package/Table/pagination/TablePagination.d.ts +10 -0
  330. package/Table/pagination/TablePagination.js +27 -0
  331. package/Table/pagination/useTablePagination.d.ts +16 -0
  332. package/Table/pagination/useTablePagination.js +49 -0
  333. package/Table/refresh/TableRefresh.d.ts +10 -0
  334. package/Table/refresh/TableRefresh.js +23 -0
  335. package/Table/rowSelection/TableRowSelection.d.ts +19 -0
  336. package/Table/rowSelection/TableRowSelection.js +86 -0
  337. package/Table/rowSelection/useTableRowSelection.d.ts +6 -0
  338. package/Table/rowSelection/useTableRowSelection.js +53 -0
  339. package/Table/sorting/TableSortingIcon.d.ts +11 -0
  340. package/Table/sorting/TableSortingIcon.js +28 -0
  341. package/Table/sorting/useTableSorting.d.ts +10 -0
  342. package/Table/sorting/useTableSorting.js +90 -0
  343. package/Table/useTableFetchMore.d.ts +10 -0
  344. package/Table/useTableFetchMore.js +50 -0
  345. package/Table/useTableLoading.d.ts +5 -0
  346. package/Table/useTableLoading.js +19 -0
  347. package/Table/useTableScroll.d.ts +272 -0
  348. package/Table/useTableScroll.js +170 -0
  349. package/Tabs/Tab.d.ts +19 -0
  350. package/Tabs/Tab.js +16 -0
  351. package/Tabs/TabPane.d.ts +14 -0
  352. package/Tabs/TabPane.js +18 -0
  353. package/Tabs/Tabs.d.ts +39 -0
  354. package/Tabs/Tabs.js +49 -0
  355. package/Tabs/index.d.ts +3 -0
  356. package/Tabs/index.js +3 -0
  357. package/Tabs/useTabsOverflow.d.ts +8 -0
  358. package/Tabs/useTabsOverflow.js +58 -0
  359. package/Tag/Tag.d.ts +29 -0
  360. package/Tag/Tag.js +23 -0
  361. package/Tag/index.d.ts +2 -0
  362. package/Tag/index.js +1 -0
  363. package/TextField/TextField.d.ts +54 -0
  364. package/TextField/TextField.js +39 -0
  365. package/TextField/index.d.ts +2 -0
  366. package/TextField/index.js +1 -0
  367. package/TextField/useTextFieldControl.d.ts +10 -0
  368. package/TextField/useTextFieldControl.js +15 -0
  369. package/Textarea/Textarea.d.ts +58 -0
  370. package/Textarea/Textarea.js +33 -0
  371. package/Textarea/index.d.ts +2 -0
  372. package/Textarea/index.js +1 -0
  373. package/TimePanel/TimePanel.d.ts +66 -0
  374. package/TimePanel/TimePanel.js +67 -0
  375. package/TimePanel/TimePanelAction.d.ts +18 -0
  376. package/TimePanel/TimePanelAction.js +15 -0
  377. package/TimePanel/TimePanelColumn.d.ts +37 -0
  378. package/TimePanel/TimePanelColumn.js +39 -0
  379. package/TimePanel/index.d.ts +3 -0
  380. package/TimePanel/index.js +3 -0
  381. package/TimePicker/TimePicker.d.ts +24 -0
  382. package/TimePicker/TimePicker.js +114 -0
  383. package/TimePicker/TimePickerPanel.d.ts +24 -0
  384. package/TimePicker/TimePickerPanel.js +14 -0
  385. package/TimePicker/index.d.ts +2 -0
  386. package/TimePicker/index.js +2 -0
  387. package/Tooltip/Tooltip.d.ts +25 -0
  388. package/Tooltip/Tooltip.js +37 -0
  389. package/Tooltip/index.d.ts +1 -0
  390. package/Tooltip/index.js +1 -0
  391. package/Tooltip/useDelayMouseEnterLeave.d.ts +12 -0
  392. package/Tooltip/useDelayMouseEnterLeave.js +41 -0
  393. package/Transition/Collapse.d.ts +15 -0
  394. package/Transition/Collapse.js +107 -0
  395. package/Transition/Fade.d.ts +8 -0
  396. package/Transition/Fade.js +84 -0
  397. package/Transition/Grow.d.ts +13 -0
  398. package/Transition/Grow.js +112 -0
  399. package/Transition/SlideFade.d.ts +15 -0
  400. package/Transition/SlideFade.js +93 -0
  401. package/Transition/Transition.d.ts +98 -0
  402. package/Transition/Transition.js +27 -0
  403. package/Transition/Zoom.d.ts +8 -0
  404. package/Transition/Zoom.js +84 -0
  405. package/Transition/getAutoSizeDuration.d.ts +1 -0
  406. package/Transition/getAutoSizeDuration.js +10 -0
  407. package/Transition/getTransitionStyleProps.d.ts +16 -0
  408. package/Transition/getTransitionStyleProps.js +25 -0
  409. package/Transition/index.d.ts +6 -0
  410. package/Transition/index.js +6 -0
  411. package/Transition/reflow.d.ts +4 -0
  412. package/Transition/reflow.js +9 -0
  413. package/Transition/useAutoTransitionDuration.d.ts +6 -0
  414. package/Transition/useAutoTransitionDuration.js +15 -0
  415. package/Transition/useSetNodeTransition.d.ts +7 -0
  416. package/Transition/useSetNodeTransition.js +35 -0
  417. package/Tree/Tree.d.ts +70 -0
  418. package/Tree/Tree.js +131 -0
  419. package/Tree/TreeNode.d.ts +41 -0
  420. package/Tree/TreeNode.js +41 -0
  421. package/Tree/TreeNodeList.d.ts +25 -0
  422. package/Tree/TreeNodeList.js +29 -0
  423. package/Tree/getTreeNodeEntities.d.ts +11 -0
  424. package/Tree/getTreeNodeEntities.js +86 -0
  425. package/Tree/index.d.ts +8 -0
  426. package/Tree/index.js +7 -0
  427. package/Tree/toggleValue.d.ts +4 -0
  428. package/Tree/toggleValue.js +19 -0
  429. package/Tree/traverseTree.d.ts +2 -0
  430. package/Tree/traverseTree.js +11 -0
  431. package/Tree/typings.d.ts +16 -0
  432. package/Tree/useTreeExpandedValue.d.ts +15 -0
  433. package/Tree/useTreeExpandedValue.js +32 -0
  434. package/Typography/Typography.d.ts +43 -0
  435. package/Typography/Typography.js +38 -0
  436. package/Typography/index.d.ts +11 -0
  437. package/Typography/index.js +2 -0
  438. package/Upload/UploadButton.d.ts +10 -0
  439. package/Upload/UploadButton.js +23 -0
  440. package/Upload/UploadInput.d.ts +21 -0
  441. package/Upload/UploadInput.js +22 -0
  442. package/Upload/UploadResult.d.ts +16 -0
  443. package/Upload/UploadResult.js +30 -0
  444. package/Upload/index.d.ts +3 -0
  445. package/Upload/index.js +2 -0
  446. package/_internal/InputCheck/InputCheck.d.ts +33 -0
  447. package/_internal/InputCheck/InputCheck.js +19 -0
  448. package/_internal/InputCheck/InputCheckGroup.d.ts +18 -0
  449. package/_internal/InputCheck/InputCheckGroup.js +14 -0
  450. package/_internal/InputCheck/index.d.ts +3 -0
  451. package/_internal/InputCheck/index.js +2 -0
  452. package/_internal/InputTriggerPopper/InputTriggerPopper.d.ts +18 -0
  453. package/_internal/InputTriggerPopper/InputTriggerPopper.js +44 -0
  454. package/_internal/InputTriggerPopper/index.d.ts +1 -0
  455. package/_internal/InputTriggerPopper/index.js +1 -0
  456. package/hooks/useClickAway.d.ts +5 -0
  457. package/hooks/useClickAway.js +23 -0
  458. package/hooks/useComposeRefs.d.ts +2 -0
  459. package/hooks/useComposeRefs.js +8 -0
  460. package/hooks/useDocumentEscapeKeyDown.d.ts +3 -0
  461. package/hooks/useDocumentEscapeKeyDown.js +20 -0
  462. package/hooks/useDocumentEvents.d.ts +5 -0
  463. package/hooks/useDocumentEvents.js +21 -0
  464. package/hooks/useDocumentTabKeyDown.d.ts +3 -0
  465. package/hooks/useDocumentTabKeyDown.js +19 -0
  466. package/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
  467. package/hooks/useIsomorphicLayoutEffect.js +7 -0
  468. package/hooks/useLastCallback.d.ts +1 -0
  469. package/hooks/useLastCallback.js +11 -0
  470. package/hooks/useLastValue.d.ts +3 -0
  471. package/hooks/useLastValue.js +9 -0
  472. package/hooks/usePreviousValue.d.ts +1 -0
  473. package/hooks/usePreviousValue.js +11 -0
  474. package/hooks/useWindowWidth.d.ts +1 -0
  475. package/hooks/useWindowWidth.js +15 -0
  476. package/index.d.ts +100 -0
  477. package/index.js +148 -0
  478. package/package.json +61 -0
  479. package/utils/composeRefs.d.ts +21 -0
  480. package/utils/composeRefs.js +32 -0
  481. package/utils/cx.d.ts +1 -0
  482. package/utils/getElement.d.ts +3 -0
  483. package/utils/getElement.js +14 -0
  484. package/utils/jsx-types.d.ts +11 -0
  485. package/utils/rename-types.d.ts +5 -0
  486. package/utils/scroll-lock.d.ts +2 -0
  487. package/utils/scroll-lock.js +18 -0
@@ -0,0 +1,38 @@
1
+ /// <reference types="react" />
2
+ import { DateType } from '@mezzanine-ui/core/calendar';
3
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
4
+ import { CalendarDayOfWeekProps } from './CalendarDayOfWeek';
5
+ export interface CalendarDaysProps extends Pick<CalendarDayOfWeekProps, 'displayWeekDayLocale'>, Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'onClick' | 'children'> {
6
+ /**
7
+ * Provide if you have a custom disabling logic. The method takes the date object as its parameter.
8
+ */
9
+ isDateDisabled?: (date: DateType) => boolean;
10
+ /**
11
+ * Provide if you have a custom logic for checking if the date is in range.
12
+ * The method takes the date object as its parameter.
13
+ */
14
+ isDateInRange?: (date: DateType) => boolean;
15
+ /**
16
+ * Click handler for date button.
17
+ */
18
+ onClick?: (date: DateType) => void;
19
+ /**
20
+ * Mouse enter handler for date button.
21
+ */
22
+ onDateHover?: (date: DateType) => void;
23
+ /**
24
+ * The refernce date for getting the month of the calendar.
25
+ */
26
+ referenceDate: DateType;
27
+ /**
28
+ * If provided, each date that matches the same dates in this array will be marked as active.
29
+ */
30
+ value?: DateType[];
31
+ }
32
+ /**
33
+ * The react component for `mezzanine` calendar days. <br />
34
+ * This component displays a monthly calendar whose month is the same as `referenceDate`.
35
+ * You may use it to compose your own calendar.
36
+ */
37
+ declare function CalendarDays(props: CalendarDaysProps): JSX.Element;
38
+ export default CalendarDays;
@@ -0,0 +1,48 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { calendarClasses } from '@mezzanine-ui/core/calendar';
3
+ import { useMemo } from 'react';
4
+ import CalendarCell from './CalendarCell.js';
5
+ import CalendarDayOfWeek from './CalendarDayOfWeek.js';
6
+ import { useCalendarContext } from './CalendarContext.js';
7
+ import cx from 'clsx';
8
+
9
+ /**
10
+ * The react component for `mezzanine` calendar days. <br />
11
+ * This component displays a monthly calendar whose month is the same as `referenceDate`.
12
+ * You may use it to compose your own calendar.
13
+ */
14
+ function CalendarDays(props) {
15
+ const { displayWeekDayLocale: displayWeekDayLocaleFromConfig, getCalendarGrid, getDate, getMonth, getNow, isDateIncluded, isSameDate, setDate, setMonth, } = useCalendarContext();
16
+ const { className, displayWeekDayLocale = displayWeekDayLocaleFromConfig, isDateDisabled, isDateInRange, onClick: onClickProp, onDateHover, referenceDate, value, ...rest } = props;
17
+ const daysGrid = useMemo(() => getCalendarGrid(referenceDate), [getCalendarGrid, referenceDate]);
18
+ return (jsxs("div", Object.assign({}, rest, { className: cx(calendarClasses.board, className) }, { children: [jsx(CalendarDayOfWeek, { displayWeekDayLocale: displayWeekDayLocale }, void 0),
19
+ daysGrid.map((week, index) => (jsx("div", Object.assign({ className: calendarClasses.row }, { children: week.map((dateNum) => {
20
+ const isPrevMonth = index === 0 && dateNum > 7;
21
+ const isNextMonth = index > 3 && dateNum <= 14;
22
+ const thisMonth = getMonth(referenceDate);
23
+ // eslint-disable-next-line no-nested-ternary
24
+ const month = isPrevMonth
25
+ ? thisMonth - 1
26
+ : isNextMonth
27
+ ? thisMonth + 1
28
+ : thisMonth;
29
+ const date = setDate(setMonth(referenceDate, month), dateNum);
30
+ const disabled = isDateDisabled && isDateDisabled(date);
31
+ const inactive = !disabled && (isPrevMonth || isNextMonth);
32
+ const inRange = !inactive && isDateInRange && isDateInRange(date);
33
+ const active = !disabled && !inactive && value && isDateIncluded(date, value);
34
+ const onMouseEnter = onDateHover ? () => {
35
+ onDateHover(date);
36
+ } : undefined;
37
+ const onClick = onClickProp
38
+ ? () => { onClickProp(date); }
39
+ : undefined;
40
+ return (jsx(CalendarCell, Object.assign({ today: isSameDate(date, getNow()), active: active, disabled: isPrevMonth || isNextMonth }, { children: jsx("button", Object.assign({ type: "button", "aria-disabled": disabled, disabled: disabled, onMouseEnter: onMouseEnter, className: cx(calendarClasses.button, {
41
+ [calendarClasses.buttonInRange]: inRange,
42
+ [calendarClasses.buttonActive]: active,
43
+ [calendarClasses.buttonDisabled]: disabled,
44
+ }), onClick: onClick }, { children: dateNum }), void 0) }), `${getMonth(date)}/${getDate(date)}`));
45
+ }) }), `CALENDAR_DAYS/WEEK_OF/${index}`)))] }), void 0));
46
+ }
47
+
48
+ export default CalendarDays;
@@ -0,0 +1,42 @@
1
+ /// <reference types="react" />
2
+ import { DateType } from '@mezzanine-ui/core/calendar';
3
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
4
+ export interface CalendarMonthsProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'onClick' | 'children'> {
5
+ /**
6
+ * The locale you want to use when rendering the names of month.
7
+ * If none provided, it will use the `displayMonthLocale` from calendar context.
8
+ */
9
+ displayMonthLocale?: string;
10
+ /**
11
+ * Provide if you have a custom disabling logic. The method takes the date object as its parameter.
12
+ */
13
+ isMonthDisabled?: (date: DateType) => boolean;
14
+ /**
15
+ * Provide if you have a custom logic for checking if the month is in range.
16
+ * The method takes the date object as its parameter.
17
+ */
18
+ isMonthInRange?: (date: DateType) => boolean;
19
+ /**
20
+ * Click handler for each month button.
21
+ */
22
+ onClick?: (target: DateType) => void;
23
+ /**
24
+ * Mouse enter handler for each month button.
25
+ */
26
+ onMonthHover?: (target: DateType) => void;
27
+ /**
28
+ * The refernce date for computing the date object.
29
+ */
30
+ referenceDate: DateType;
31
+ /**
32
+ * If provided, each month that matches the same months in this array will be marked as active.
33
+ */
34
+ value?: DateType[];
35
+ }
36
+ /**
37
+ * The react component for `mezzanine` calendar months. <br />
38
+ * This component displays a 12 months grid.
39
+ * You may use it to compose your own calendar.
40
+ */
41
+ declare function CalendarMonths(props: CalendarMonthsProps): JSX.Element;
42
+ export default CalendarMonths;
@@ -0,0 +1,30 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { calendarClasses, calendarMonths } from '@mezzanine-ui/core/calendar';
3
+ import { useCalendarContext } from './CalendarContext.js';
4
+ import cx from 'clsx';
5
+
6
+ /**
7
+ * The react component for `mezzanine` calendar months. <br />
8
+ * This component displays a 12 months grid.
9
+ * You may use it to compose your own calendar.
10
+ */
11
+ function CalendarMonths(props) {
12
+ const { displayMonthLocale: displayMonthLocaleFromConfig, getMonthShortNames, isMonthIncluded, setMonth, } = useCalendarContext();
13
+ const { className, displayMonthLocale = displayMonthLocaleFromConfig, isMonthDisabled, isMonthInRange, onClick: onClickProp, onMonthHover, referenceDate, value, ...rest } = props;
14
+ const monthNames = getMonthShortNames(displayMonthLocale);
15
+ return (jsx("div", Object.assign({ className: cx(calendarClasses.board, className) }, rest, { children: jsx("div", Object.assign({ className: calendarClasses.twelveGrid }, { children: calendarMonths.map((month) => {
16
+ const monthDateType = setMonth(referenceDate, month);
17
+ const active = value && isMonthIncluded(monthDateType, value);
18
+ const disabled = isMonthDisabled && isMonthDisabled(monthDateType);
19
+ const inRange = isMonthInRange && isMonthInRange(monthDateType);
20
+ const onClick = onClickProp ? () => { onClickProp(monthDateType); } : undefined;
21
+ const onMouseEnter = onMonthHover ? () => { onMonthHover(monthDateType); } : undefined;
22
+ return (jsx("button", Object.assign({ type: "button", "aria-disabled": disabled, disabled: disabled, className: cx(calendarClasses.button, {
23
+ [calendarClasses.buttonActive]: active,
24
+ [calendarClasses.buttonInRange]: inRange,
25
+ [calendarClasses.buttonDisabled]: disabled,
26
+ }), onClick: onClick, onMouseEnter: onMouseEnter }, { children: monthNames[month] }), month));
27
+ }) }), void 0) }), void 0));
28
+ }
29
+
30
+ export default CalendarMonths;
@@ -0,0 +1,41 @@
1
+ /// <reference types="react" />
2
+ import { DateType } from '@mezzanine-ui/core/calendar';
3
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
4
+ import { CalendarDayOfWeekProps } from './CalendarDayOfWeek';
5
+ export interface CalendarWeeksProps extends Pick<CalendarDayOfWeekProps, 'displayWeekDayLocale'>, Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'onClick' | 'children'> {
6
+ /**
7
+ * Provide if you have a custom disabling logic.
8
+ * The method takes the date object of first date in week as its parameter.
9
+ */
10
+ isWeekDisabled?: (date: DateType) => boolean;
11
+ /**
12
+ * Provide if you have a custom logic for checking if the week is in range.
13
+ * The method takes the date object of first date in week as its parameter.
14
+ */
15
+ isWeekInRange?: (firstDateOfWeek: DateType) => boolean;
16
+ /**
17
+ * Click handler for the button of week row.
18
+ * The method takes the date object of first date in week as its parameter.
19
+ */
20
+ onClick?: (date: DateType) => void;
21
+ /**
22
+ * Mouse enter handler for the button of week row.
23
+ * The method takes the date object of first date in week as its parameter.
24
+ */
25
+ onWeekHover?: (firstDateOfWeek: DateType) => void;
26
+ /**
27
+ * The refernce date for getting the dates of calendar.
28
+ */
29
+ referenceDate: DateType;
30
+ /**
31
+ * The week will be marked as active if the first date of week matches the same date of any value in the array.
32
+ */
33
+ value?: DateType[];
34
+ }
35
+ /**
36
+ * The react component for `mezzanine` calendar weeks. <br />
37
+ * This component displays a monthly calendar whose month is the same as `referenceDate`.
38
+ * You may use it to compose your own calendar.
39
+ */
40
+ declare function CalendarWeeks(props: CalendarWeeksProps): JSX.Element;
41
+ export default CalendarWeeks;
@@ -0,0 +1,54 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { calendarClasses } from '@mezzanine-ui/core/calendar';
3
+ import { useMemo } from 'react';
4
+ import CalendarCell from './CalendarCell.js';
5
+ import CalendarDayOfWeek from './CalendarDayOfWeek.js';
6
+ import { useCalendarContext } from './CalendarContext.js';
7
+ import cx from 'clsx';
8
+
9
+ /**
10
+ * The react component for `mezzanine` calendar weeks. <br />
11
+ * This component displays a monthly calendar whose month is the same as `referenceDate`.
12
+ * You may use it to compose your own calendar.
13
+ */
14
+ function CalendarWeeks(props) {
15
+ const { displayWeekDayLocale: displayWeekDayLocaleFromConfig, getCalendarGrid, getDate, getMonth, getNow, isInMonth, isSameDate, isWeekIncluded, setDate, setMonth, } = useCalendarContext();
16
+ const { className, displayWeekDayLocale = displayWeekDayLocaleFromConfig, isWeekDisabled, isWeekInRange, onClick: onClickProp, onWeekHover, referenceDate, value, ...rest } = props;
17
+ const daysGrid = useMemo(() => getCalendarGrid(referenceDate), [getCalendarGrid, referenceDate]);
18
+ return (jsxs("div", Object.assign({}, rest, { className: cx(calendarClasses.board, className) }, { children: [jsx(CalendarDayOfWeek, { displayWeekDayLocale: displayWeekDayLocale }, void 0),
19
+ daysGrid.map((week, index) => {
20
+ const dates = [];
21
+ const weekStartInPrevMonth = index === 0 && week[0] > 7;
22
+ const weekStartInNextMonth = index > 3 && week[0] <= 14;
23
+ week.forEach((dateNum) => {
24
+ const isPrevMonth = index === 0 && dateNum > 7;
25
+ const isNextMonth = index > 3 && dateNum <= 14;
26
+ const thisMonth = getMonth(referenceDate);
27
+ // eslint-disable-next-line no-nested-ternary
28
+ const month = isPrevMonth
29
+ ? thisMonth - 1
30
+ : isNextMonth
31
+ ? thisMonth + 1
32
+ : thisMonth;
33
+ const date = setDate(setMonth(referenceDate, month), dateNum);
34
+ dates.push(date);
35
+ });
36
+ const disabled = isWeekDisabled && isWeekDisabled(dates[0]);
37
+ const inactive = !disabled && (weekStartInPrevMonth || weekStartInNextMonth);
38
+ const active = !disabled && !inactive && value && isWeekIncluded(dates[0], value);
39
+ const inRange = !disabled && !inactive && isWeekInRange && isWeekInRange(dates[0]);
40
+ const onMouseEnter = onWeekHover ? () => {
41
+ onWeekHover(dates[0]);
42
+ } : undefined;
43
+ const onClick = onClickProp ? () => {
44
+ onClickProp(dates[0]);
45
+ } : undefined;
46
+ return (jsx("button", Object.assign({ type: "button", className: cx(calendarClasses.button, calendarClasses.row, {
47
+ [calendarClasses.buttonActive]: active,
48
+ [calendarClasses.buttonInRange]: inRange,
49
+ [calendarClasses.buttonDisabled]: disabled,
50
+ }), disabled: disabled, "aria-disabled": disabled, onClick: onClick, onMouseEnter: onMouseEnter }, { children: week.map((dateNum, dateIndex) => (jsx(CalendarCell, Object.assign({ today: isSameDate(dates[dateIndex], getNow()), disabled: disabled || !isInMonth(dates[dateIndex], getMonth(referenceDate)), active: active }, { children: dateNum }), `${getMonth(dates[dateIndex])}/${getDate(dates[dateIndex])}`))) }), `CALENDAR_WEEKS/WEEK_OF/${index}`));
51
+ })] }), void 0));
52
+ }
53
+
54
+ export default CalendarWeeks;
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import { DateType } from '@mezzanine-ui/core/calendar';
3
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
4
+ export interface CalendarYearsProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'onClick' | 'children'> {
5
+ /**
6
+ * Provide if you have a custom disabling logic.
7
+ * The method takes the date object as its parameter.
8
+ */
9
+ isYearDisabled?: (date: DateType) => boolean;
10
+ /**
11
+ * Provide if you have a custom logic for checking if the year is in range.
12
+ * The method takes the date object as its parameter.
13
+ */
14
+ isYearInRange?: (date: DateType) => boolean;
15
+ /**
16
+ * Click handler for the button of each year.
17
+ * The method takes the date object as its parameter.
18
+ */
19
+ onClick?: (target: DateType) => void;
20
+ /**
21
+ * Mouse enter handler for the button of each year.
22
+ * The method takes the date object as its parameter.
23
+ */
24
+ onYearHover?: (target: DateType) => void;
25
+ /**
26
+ * The refernce date for getting the years range and computing the date object.
27
+ */
28
+ referenceDate: DateType;
29
+ /**
30
+ * The year will be marked as active if it matches the same year of any value in the array.
31
+ */
32
+ value?: DateType[];
33
+ }
34
+ /**
35
+ * The react component for `mezzanine` calendar years. <br />
36
+ * This component displays a 12 year grid.
37
+ * You may use it to compose your own calendar.
38
+ */
39
+ declare function CalendarYears(props: CalendarYearsProps): JSX.Element;
40
+ export default CalendarYears;
@@ -0,0 +1,34 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { getCalendarYearRange, calendarClasses, calendarYearsBase } from '@mezzanine-ui/core/calendar';
3
+ import { useMemo } from 'react';
4
+ import { useCalendarContext } from './CalendarContext.js';
5
+ import cx from 'clsx';
6
+
7
+ /**
8
+ * The react component for `mezzanine` calendar years. <br />
9
+ * This component displays a 12 year grid.
10
+ * You may use it to compose your own calendar.
11
+ */
12
+ function CalendarYears(props) {
13
+ const { getNow, getYear, isYearIncluded, setYear, } = useCalendarContext();
14
+ const { className, isYearDisabled, isYearInRange, onClick: onClickProp, onYearHover, referenceDate, value, ...rest } = props;
15
+ const [start] = useMemo(() => getCalendarYearRange(getYear(referenceDate)), [getYear, referenceDate]);
16
+ return (jsx("div", Object.assign({ className: cx(calendarClasses.board, className) }, rest, { children: jsx("div", Object.assign({ className: calendarClasses.twelveGrid }, { children: calendarYearsBase.map((base) => {
17
+ const thisYear = base + start;
18
+ const yearDateType = setYear(getNow(), thisYear);
19
+ const disabled = isYearDisabled && isYearDisabled(yearDateType);
20
+ const inactive = !disabled && (base === 0 || base === 11);
21
+ const active = !disabled && !inactive && value && isYearIncluded(yearDateType, value);
22
+ const inRange = isYearInRange && isYearInRange(yearDateType);
23
+ const onClick = onClickProp ? () => { onClickProp(yearDateType); } : undefined;
24
+ const onMouseEnter = onYearHover ? () => { onYearHover(yearDateType); } : undefined;
25
+ return (jsx("button", Object.assign({ type: "button", "aria-disabled": disabled, disabled: disabled, className: cx(calendarClasses.button, {
26
+ [calendarClasses.buttonActive]: active,
27
+ [calendarClasses.buttonInRange]: inRange,
28
+ [calendarClasses.buttonDisabled]: disabled,
29
+ [calendarClasses.buttonInactive]: inactive,
30
+ }), onClick: onClick, onMouseEnter: onMouseEnter }, { children: thisYear }), base + start));
31
+ }) }), void 0) }), void 0));
32
+ }
33
+
34
+ export default CalendarYears;
@@ -0,0 +1,12 @@
1
+ export { CalendarControlModifier, UseCalendarControlModifiersResult, useCalendarControlModifiers, } from './useCalendarControlModifiers';
2
+ export { useCalendarModeStack, } from './useCalendarModeStack';
3
+ export { useCalendarControls, } from './useCalendarControls';
4
+ export { CalendarConfigs, CalendarConfigProviderProps, CalendarContext, useCalendarContext, default as CalendarConfigProvider, } from './CalendarContext';
5
+ export { CalendarYearsProps, default as CalendarYears, } from './CalendarYears';
6
+ export { CalendarWeeksProps, default as CalendarWeeks, } from './CalendarWeeks';
7
+ export { CalendarMonthsProps, default as CalendarMonths, } from './CalendarMonths';
8
+ export { CalendarDaysProps, default as CalendarDays, } from './CalendarDays';
9
+ export { CalendarDayOfWeekProps, default as CalendarDayOfWeek, } from './CalendarDayOfWeek';
10
+ export { CalendarControlsProps, default as CalendarControls, } from './CalendarControls';
11
+ export { CalendarCellProps, default as CalendarCell, } from './CalendarCell';
12
+ export { CalendarProps, default, } from './Calendar';
@@ -0,0 +1,12 @@
1
+ export { useCalendarControlModifiers } from './useCalendarControlModifiers.js';
2
+ export { useCalendarModeStack } from './useCalendarModeStack.js';
3
+ export { useCalendarControls } from './useCalendarControls.js';
4
+ export { default as CalendarConfigProvider, CalendarContext, useCalendarContext } from './CalendarContext.js';
5
+ export { default as CalendarYears } from './CalendarYears.js';
6
+ export { default as CalendarWeeks } from './CalendarWeeks.js';
7
+ export { default as CalendarMonths } from './CalendarMonths.js';
8
+ export { default as CalendarDays } from './CalendarDays.js';
9
+ export { default as CalendarDayOfWeek } from './CalendarDayOfWeek.js';
10
+ export { default as CalendarControls } from './CalendarControls.js';
11
+ export { default as CalendarCell } from './CalendarCell.js';
12
+ export { default } from './Calendar.js';
@@ -0,0 +1,7 @@
1
+ import { CalendarMode, DateType } from '@mezzanine-ui/core/calendar';
2
+ export declare type CalendarControlModifier = (value: DateType) => DateType;
3
+ export declare type UseCalendarControlModifiersResult = Record<CalendarMode, [
4
+ CalendarControlModifier,
5
+ CalendarControlModifier
6
+ ]>;
7
+ export declare function useCalendarControlModifiers(): UseCalendarControlModifiersResult;
@@ -0,0 +1,26 @@
1
+ import { useMemo } from 'react';
2
+ import { useCalendarContext } from './CalendarContext.js';
3
+
4
+ function useCalendarControlModifiers() {
5
+ const { addYear, addMonth, } = useCalendarContext();
6
+ return useMemo(() => ({
7
+ year: [
8
+ (date) => addYear(date, -12),
9
+ (date) => addYear(date, 12),
10
+ ],
11
+ month: [
12
+ (date) => addYear(date, -1),
13
+ (date) => addYear(date, 1),
14
+ ],
15
+ week: [
16
+ (date) => addMonth(date, -1),
17
+ (date) => addMonth(date, 1),
18
+ ],
19
+ day: [
20
+ (date) => addMonth(date, -1),
21
+ (date) => addMonth(date, 1),
22
+ ],
23
+ }), [addYear, addMonth]);
24
+ }
25
+
26
+ export { useCalendarControlModifiers };
@@ -0,0 +1,13 @@
1
+ /// <reference types="moment" />
2
+ /// <reference types="react" />
3
+ import { DateType, CalendarMode } from '@mezzanine-ui/core/calendar';
4
+ export declare function useCalendarControls(referenceDateProp: DateType, mode?: CalendarMode): {
5
+ currentMode: CalendarMode;
6
+ onMonthControlClick: () => void;
7
+ onNext: () => void;
8
+ onPrev: () => void;
9
+ onYearControlClick: () => void;
10
+ popModeStack: () => void;
11
+ referenceDate: import("moment").Moment;
12
+ updateReferenceDate: import("react").Dispatch<import("react").SetStateAction<import("moment").Moment>>;
13
+ };
@@ -0,0 +1,34 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { useCalendarControlModifiers } from './useCalendarControlModifiers.js';
3
+ import { useCalendarModeStack } from './useCalendarModeStack.js';
4
+
5
+ function useCalendarControls(referenceDateProp, mode) {
6
+ const [referenceDate, setReferenceDate] = useState(referenceDateProp);
7
+ useEffect(() => {
8
+ setReferenceDate(referenceDateProp);
9
+ }, [referenceDateProp]);
10
+ const { currentMode, pushModeStack, popModeStack, } = useCalendarModeStack(mode || 'day');
11
+ const modifierGroup = useCalendarControlModifiers();
12
+ const onPrev = () => {
13
+ const [handleMinus] = modifierGroup[currentMode];
14
+ setReferenceDate(handleMinus(referenceDate));
15
+ };
16
+ const onNext = () => {
17
+ const [, handleAdd] = modifierGroup[currentMode];
18
+ setReferenceDate(handleAdd(referenceDate));
19
+ };
20
+ const onMonthControlClick = () => pushModeStack('month');
21
+ const onYearControlClick = () => pushModeStack('year');
22
+ return {
23
+ currentMode,
24
+ onMonthControlClick,
25
+ onNext,
26
+ onPrev,
27
+ onYearControlClick,
28
+ popModeStack,
29
+ referenceDate,
30
+ updateReferenceDate: setReferenceDate,
31
+ };
32
+ }
33
+
34
+ export { useCalendarControls };
@@ -0,0 +1,6 @@
1
+ import { CalendarMode } from '@mezzanine-ui/core/calendar';
2
+ export declare function useCalendarModeStack(mode: CalendarMode): {
3
+ currentMode: CalendarMode;
4
+ pushModeStack: (newMode: CalendarMode) => void;
5
+ popModeStack: () => void;
6
+ };
@@ -0,0 +1,15 @@
1
+ import { useState } from 'react';
2
+
3
+ function useCalendarModeStack(mode) {
4
+ const [modeStack, setModeStack] = useState([mode]);
5
+ const [currentMode] = modeStack;
6
+ const pushModeStack = (newMode) => setModeStack((prev) => [newMode, ...prev]);
7
+ const popModeStack = () => setModeStack((prev) => (prev.length > 1 ? prev.slice(1, prev.length) : prev));
8
+ return {
9
+ currentMode,
10
+ pushModeStack,
11
+ popModeStack,
12
+ };
13
+ }
14
+
15
+ export { useCalendarModeStack };
package/Card/Card.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ import { ReactNode } from 'react';
2
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
3
+ import { TypographyProps } from '../Typography';
4
+ export interface CardProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'title' | 'children'> {
5
+ /**
6
+ * Card footer actions.
7
+ */
8
+ actions?: ReactNode;
9
+ /**
10
+ * Card cover.
11
+ */
12
+ cover?: ReactNode;
13
+ /**
14
+ * The container of the text content(title, subtitle and description).
15
+ */
16
+ contentProps?: Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children'>;
17
+ /**
18
+ * Description under the subtitle. visible if value is not empty.
19
+ */
20
+ description?: string;
21
+ /**
22
+ * Description props
23
+ */
24
+ descriptionProps?: Omit<TypographyProps, 'children'>;
25
+ /**
26
+ * The container of the content and actions.
27
+ */
28
+ metaProps?: Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children'>;
29
+ /**
30
+ * Subtitle under the title. visible if value is not empty.
31
+ */
32
+ subtitle?: ReactNode;
33
+ /**
34
+ * Subtitle props
35
+ */
36
+ subtitleProps?: Omit<TypographyProps, 'children'>;
37
+ /**
38
+ * Card title, visible if value is not empty.
39
+ */
40
+ title?: ReactNode;
41
+ /**
42
+ * Card title props
43
+ * @default 'variant: h3'
44
+ */
45
+ titleProps?: Omit<TypographyProps, 'children'>;
46
+ }
47
+ /**
48
+ * The react component for `mezzanine` card.
49
+ */
50
+ declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
51
+ export default Card;
package/Card/Card.js ADDED
@@ -0,0 +1,20 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { cardClasses } from '@mezzanine-ui/core/card';
4
+ import Typography from '../Typography/Typography.js';
5
+ import cx from 'clsx';
6
+
7
+ /**
8
+ * The react component for `mezzanine` card.
9
+ */
10
+ const Card = forwardRef(function Card(props, ref) {
11
+ const { actions, className, contentProps, cover, description, descriptionProps, metaProps, subtitle, subtitleProps, title, titleProps, ...rest } = props;
12
+ const { variant = 'h3', } = titleProps || {};
13
+ const titleTypography = (title ? (jsx(Typography, Object.assign({ variant: variant }, titleProps, { children: title }), void 0)) : null);
14
+ const subtitleTypography = (subtitle ? (jsx(Typography, Object.assign({}, subtitleProps, { children: subtitle }), void 0)) : null);
15
+ const contentHeader = (titleTypography || subtitleTypography ? (jsxs("div", Object.assign({ className: cardClasses.metaContentsHeader }, { children: [titleTypography, subtitleTypography] }), void 0)) : null);
16
+ const descriptionTypography = (description ? (jsx(Typography, Object.assign({}, descriptionProps, { children: description }), void 0)) : null);
17
+ return (jsxs("div", Object.assign({ ref: ref, className: cx(cardClasses.host, className) }, rest, { children: [cover, jsxs("div", Object.assign({ className: cardClasses.meta }, metaProps, { children: [jsxs("div", Object.assign({ className: cardClasses.metaContents }, contentProps, { children: [contentHeader, descriptionTypography] }), void 0), actions] }), void 0)] }), void 0));
18
+ });
19
+
20
+ export default Card;
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonProps } from '../Button';
3
+ import { ConfirmActionsProps } from '../ConfirmActions';
4
+ export interface CardActionsProps extends ConfirmActionsProps {
5
+ /**
6
+ * Content of cancel button. not render if value is empty.
7
+ */
8
+ cancelText?: string;
9
+ /**
10
+ * Content of confirm button. not render if value is empty.
11
+ */
12
+ confirmText?: string;
13
+ /**
14
+ * Click handler for cancel button.
15
+ */
16
+ onCancel?: ButtonProps['onClick'];
17
+ /**
18
+ * Click handler for confirm button.
19
+ */
20
+ onConfirm?: ButtonProps['onClick'];
21
+ /**
22
+ * Indicate whether confirm button loading and cancel button disabled.
23
+ */
24
+ loading?: boolean;
25
+ /**
26
+ * The action bottom on the left. not render if value is empty.
27
+ */
28
+ otherActions?: ReactNode;
29
+ }
30
+ /**
31
+ * The react component for `mezzanine` cardActions.
32
+ */
33
+ declare const CardActions: import("react").ForwardRefExoticComponent<CardActionsProps & import("react").RefAttributes<HTMLDivElement>>;
34
+ export default CardActions;
@@ -0,0 +1,16 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
+ import { cardActionsClasses } from '@mezzanine-ui/core/card';
4
+ import ConfirmActions from '../ConfirmActions/ConfirmActions.js';
5
+ import cx from 'clsx';
6
+
7
+ /**
8
+ * The react component for `mezzanine` cardActions.
9
+ */
10
+ const CardActions = forwardRef(function CardActions(props, ref) {
11
+ const { cancelText, cancelButtonProps, className, confirmText, confirmButtonProps, hideCancelButton, hideConfirmButton, loading, onCancel, onConfirm, otherActions, ...rest } = props;
12
+ return (jsxs("div", Object.assign({ ref: ref, className: cx(cardActionsClasses.host, className) }, rest, { children: [otherActions || (jsx("div", {}, void 0)),
13
+ jsx(ConfirmActions, { cancelText: cancelText, confirmText: confirmText, cancelButtonProps: cancelButtonProps, confirmButtonProps: confirmButtonProps, hideCancelButton: hideCancelButton || !cancelText, hideConfirmButton: hideConfirmButton || !confirmText, loading: loading }, void 0)] }), void 0));
14
+ });
15
+
16
+ export default CardActions;
@@ -0,0 +1,2 @@
1
+ export { CardActionsProps, default as CardActions, } from './CardActions';
2
+ export { CardProps, default, } from './Card';
package/Card/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default as CardActions } from './CardActions.js';
2
+ export { default } from './Card.js';
@@ -0,0 +1,13 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
3
+ import { CheckboxGroupProps } from './CheckboxGroup';
4
+ export interface CheckAllProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
5
+ children?: ReactElement<CheckboxGroupProps>;
6
+ label?: ReactNode;
7
+ }
8
+ /**
9
+ * The react component for `mezzanine` check all.
10
+ * Only support controlled.
11
+ */
12
+ declare const CheckAll: import("react").ForwardRefExoticComponent<CheckAllProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ export default CheckAll;