@mezzanine-ui/react 0.9.2 → 0.10.2

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 (184) hide show
  1. package/Accordion/Accordion.js +5 -4
  2. package/Accordion/AccordionDetails.js +2 -2
  3. package/Accordion/AccordionSummary.js +3 -4
  4. package/Alert/Alert.js +1 -3
  5. package/AppBar/AppBar.js +1 -1
  6. package/AppBar/AppBarBrand.d.ts +1 -1
  7. package/AppBar/AppBarBrand.js +1 -1
  8. package/AppBar/AppBarMain.d.ts +1 -1
  9. package/AppBar/AppBarMain.js +1 -1
  10. package/AppBar/AppBarSupport.d.ts +1 -1
  11. package/AppBar/AppBarSupport.js +1 -1
  12. package/Badge/Badge.js +2 -2
  13. package/Badge/BadgeContainer.d.ts +1 -1
  14. package/Badge/BadgeContainer.js +1 -1
  15. package/Button/Button.d.ts +2 -2
  16. package/Button/Button.js +7 -5
  17. package/Button/ButtonGroup.js +7 -5
  18. package/Button/IconButton.d.ts +3 -3
  19. package/Button/IconButton.js +1 -1
  20. package/Calendar/Calendar.js +9 -10
  21. package/Calendar/CalendarCell.js +2 -2
  22. package/Calendar/CalendarContext.d.ts +3 -3
  23. package/Calendar/CalendarContext.js +20 -12
  24. package/Calendar/CalendarControls.js +3 -3
  25. package/Calendar/CalendarDayOfWeek.js +1 -1
  26. package/Calendar/CalendarDays.js +4 -5
  27. package/Calendar/CalendarMonths.js +4 -4
  28. package/Calendar/CalendarWeeks.js +4 -5
  29. package/Calendar/CalendarYears.js +4 -4
  30. package/Calendar/useCalendarControls.d.ts +2 -3
  31. package/Card/Card.js +5 -5
  32. package/Card/CardActions.js +1 -2
  33. package/Checkbox/CheckAll.js +2 -2
  34. package/Checkbox/Checkbox.js +5 -3
  35. package/Checkbox/CheckboxGroup.js +5 -5
  36. package/ConfirmActions/ConfirmActions.js +1 -2
  37. package/DatePicker/DatePicker.js +2 -3
  38. package/DatePicker/DatePickerCalendar.js +1 -1
  39. package/DateRangePicker/DateRangePicker.js +2 -3
  40. package/DateRangePicker/DateRangePickerCalendar.js +3 -4
  41. package/DateRangePicker/useDateRangeCalendarControls.d.ts +1 -2
  42. package/DateRangePicker/useDateRangePickerValue.d.ts +12 -13
  43. package/DateTimePicker/DateTimePicker.js +2 -3
  44. package/DateTimePicker/DateTimePickerPanel.js +1 -3
  45. package/Drawer/Drawer.js +1 -1
  46. package/Dropdown/Dropdown.d.ts +1 -1
  47. package/Dropdown/Dropdown.js +2 -2
  48. package/Empty/Empty.js +3 -4
  49. package/Form/FormField.js +2 -2
  50. package/Form/FormLabel.js +1 -2
  51. package/Form/FormMessage.d.ts +1 -1
  52. package/Form/FormMessage.js +1 -1
  53. package/Form/useAutoCompleteValueControl.d.ts +30 -11
  54. package/Form/useAutoCompleteValueControl.js +71 -31
  55. package/Form/useInputWithTagsModeValue.js +2 -1
  56. package/Form/useSelectValueControl.d.ts +1 -1
  57. package/Icon/Icon.d.ts +4 -0
  58. package/Icon/Icon.js +4 -4
  59. package/Input/Input.d.ts +1 -1
  60. package/Input/Input.js +5 -4
  61. package/Loading/Loading.js +4 -5
  62. package/Menu/Menu.js +5 -3
  63. package/Menu/MenuDivider.d.ts +1 -1
  64. package/Menu/MenuDivider.js +1 -1
  65. package/Menu/MenuItem.js +2 -3
  66. package/Menu/MenuItemGroup.js +1 -2
  67. package/Message/Message.js +2 -3
  68. package/Modal/Modal.js +5 -5
  69. package/Modal/ModalActions.js +1 -1
  70. package/Modal/ModalBody.d.ts +1 -1
  71. package/Modal/ModalBody.js +1 -1
  72. package/Modal/ModalFooter.d.ts +1 -1
  73. package/Modal/ModalFooter.js +1 -1
  74. package/Modal/ModalHeader.js +2 -3
  75. package/Modal/useModalContainer.js +1 -1
  76. package/Navigation/Navigation.js +2 -2
  77. package/Navigation/NavigationItem.js +1 -1
  78. package/Navigation/NavigationSubMenu.js +3 -5
  79. package/Notification/Notification.js +2 -7
  80. package/Notifier/NotifierManager.js +1 -1
  81. package/Notifier/createNotifier.js +1 -1
  82. package/Overlay/Overlay.js +3 -3
  83. package/PageFooter/PageFooter.js +1 -2
  84. package/Pagination/Pagination.js +2 -3
  85. package/Pagination/PaginationItem.js +4 -4
  86. package/Pagination/PaginationJumper.js +2 -4
  87. package/Picker/PickerTrigger.d.ts +1 -1
  88. package/Picker/PickerTrigger.js +2 -2
  89. package/Picker/RangePickerTrigger.d.ts +1 -1
  90. package/Picker/RangePickerTrigger.js +2 -4
  91. package/Picker/usePickerInputValue.d.ts +2 -2
  92. package/Picker/usePickerValue.d.ts +6 -7
  93. package/Picker/useRangePickerValue.d.ts +9 -10
  94. package/Popconfirm/Popconfirm.js +1 -1
  95. package/Popover/Popover.js +2 -3
  96. package/Popper/Popper.js +2 -2
  97. package/Portal/Portal.js +1 -1
  98. package/Progress/Progress.js +9 -9
  99. package/Provider/ConfigProvider.d.ts +8 -0
  100. package/Provider/ConfigProvider.js +13 -0
  101. package/Provider/context.d.ts +6 -0
  102. package/Provider/context.js +7 -0
  103. package/Provider/index.d.ts +4 -0
  104. package/Provider/index.js +2 -0
  105. package/Radio/Radio.js +5 -3
  106. package/Radio/RadioGroup.js +5 -5
  107. package/Select/AutoComplete.d.ts +40 -14
  108. package/Select/AutoComplete.js +37 -28
  109. package/Select/Option.js +2 -2
  110. package/Select/Select.d.ts +2 -51
  111. package/Select/Select.js +15 -49
  112. package/Select/SelectTrigger.d.ts +8 -1
  113. package/Select/SelectTrigger.js +8 -12
  114. package/Select/SelectTriggerTags.d.ts +19 -0
  115. package/Select/SelectTriggerTags.js +33 -0
  116. package/Select/TreeSelect.js +3 -4
  117. package/Select/index.d.ts +1 -0
  118. package/Select/index.js +1 -0
  119. package/Select/useSelectTriggerTags.d.ts +19 -0
  120. package/Select/useSelectTriggerTags.js +61 -0
  121. package/Skeleton/Skeleton.js +1 -1
  122. package/Slider/Slider.d.ts +1 -1
  123. package/Slider/Slider.js +7 -11
  124. package/Stepper/Step.js +2 -2
  125. package/Stepper/Stepper.js +1 -1
  126. package/Switch/Switch.js +2 -3
  127. package/Table/Table.d.ts +1 -1
  128. package/Table/Table.js +3 -10
  129. package/Table/TableBody.js +2 -4
  130. package/Table/TableBodyRow.js +4 -7
  131. package/Table/TableCell.js +3 -3
  132. package/Table/TableExpandedTable.js +5 -6
  133. package/Table/TableHeader.d.ts +2 -1
  134. package/Table/TableHeader.js +3 -6
  135. package/Table/editable/TableEditRenderWrapper.js +2 -2
  136. package/Table/expandable/TableExpandable.js +2 -2
  137. package/Table/pagination/TablePagination.js +1 -2
  138. package/Table/refresh/TableRefresh.js +1 -1
  139. package/Table/rowSelection/TableRowSelection.js +5 -6
  140. package/Table/sorting/TableSortingIcon.js +2 -2
  141. package/Table/sorting/useTableSorting.d.ts +2 -2
  142. package/Table/useTableScroll.d.ts +178 -178
  143. package/Tabs/Tab.js +2 -2
  144. package/Tabs/TabPane.js +1 -1
  145. package/Tabs/Tabs.js +1 -3
  146. package/Tag/Tag.js +7 -6
  147. package/TextField/TextField.js +7 -5
  148. package/TextField/useTextFieldControl.d.ts +2 -2
  149. package/Textarea/Textarea.d.ts +1 -1
  150. package/Textarea/Textarea.js +5 -4
  151. package/TimePanel/TimePanel.js +1 -4
  152. package/TimePanel/TimePanelAction.js +1 -1
  153. package/TimePanel/TimePanelColumn.js +2 -5
  154. package/TimePicker/TimePicker.js +2 -3
  155. package/TimePicker/TimePickerPanel.js +1 -1
  156. package/Tooltip/Tooltip.js +3 -3
  157. package/Transition/Collapse.js +3 -2
  158. package/Transition/Fade.js +2 -2
  159. package/Transition/Grow.js +3 -2
  160. package/Transition/SlideFade.js +2 -2
  161. package/Transition/Transition.js +2 -2
  162. package/Transition/Zoom.js +2 -2
  163. package/Tree/Tree.js +1 -1
  164. package/Tree/TreeNode.js +9 -9
  165. package/Tree/TreeNodeList.js +5 -4
  166. package/Tree/getTreeNodeEntities.js +6 -3
  167. package/Typography/Typography.d.ts +2 -2
  168. package/Typography/Typography.js +2 -2
  169. package/Upload/UploadButton.js +2 -2
  170. package/Upload/UploadInput.js +1 -1
  171. package/Upload/UploadPicture.js +1 -1
  172. package/Upload/UploadPictureBlock.js +2 -8
  173. package/Upload/UploadPictureWall.d.ts +1 -1
  174. package/Upload/UploadPictureWall.js +1 -2
  175. package/Upload/UploadPictureWallItem.js +1 -1
  176. package/Upload/UploadResult.d.ts +19 -0
  177. package/Upload/UploadResult.js +6 -7
  178. package/_internal/InputCheck/InputCheck.js +2 -3
  179. package/_internal/InputCheck/InputCheckGroup.js +1 -1
  180. package/_internal/InputTriggerPopper/InputTriggerPopper.js +2 -2
  181. package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -1
  182. package/index.d.ts +3 -1
  183. package/index.js +3 -0
  184. package/package.json +12 -12
@@ -16,7 +16,7 @@ const NavigationItem = forwardRef((props, ref) => {
16
16
  onClick(eventKey);
17
17
  }
18
18
  }, [eventKey, onClick, orientation]);
19
- return (jsxs("li", Object.assign({}, rest, { ref: ref, className: cx(navigationItemClasses.host, active && navigationItemClasses.active, className), role: "menuitem", onClick: handleClick, onKeyDown: () => { } }, { children: [icon && (jsx(Icon, { className: navigationItemClasses.icon, icon: icon }, void 0)), children] }), void 0));
19
+ return (jsxs("li", { ...rest, ref: ref, className: cx(navigationItemClasses.host, active && navigationItemClasses.active, className), role: "menuitem", onClick: handleClick, onKeyDown: () => { }, children: [icon && (jsx(Icon, { className: navigationItemClasses.icon, icon: icon })), children] }));
20
20
  });
21
21
  var NavigationItem$1 = NavigationItem;
22
22
 
@@ -54,12 +54,10 @@ const NavigationSubMenu = forwardRef((props, ref) => {
54
54
  open,
55
55
  orientation,
56
56
  ]);
57
- const WrapChildren = (jsx("ul", Object.assign({ className: navigationSubMenuClasses.group }, { children: children }), void 0));
58
- return (jsxs(NavigationItem, Object.assign({}, rest, { ref: composedNodeRef, className: cx(navigationSubMenuClasses.host, active && navigationSubMenuClasses.active, open && navigationSubMenuClasses.open, (icon && orientation === 'vertical') && navigationSubMenuClasses.indent, className), onClick: () => setOpen(!open) }, { children: [jsxs("div", Object.assign({ className: navigationSubMenuClasses.title }, { children: [icon && (jsx(Icon, { className: navigationSubMenuClasses.icon, icon: icon }, void 0)), title, jsx(Icon, { className: navigationSubMenuClasses.toggleIcon, icon: GroupToggleIcon }, void 0)] }), void 0),
59
- orientation === 'horizontal' && (jsx(Popper, Object.assign({ anchor: nodeRef, disablePortal: true, open: !!open, options: popperOptions }, { children: WrapChildren }), void 0)),
60
- orientation === 'vertical' && (jsx(Collapse, Object.assign({ style: {
57
+ const WrapChildren = (jsx("ul", { className: navigationSubMenuClasses.group, children: children }));
58
+ return (jsxs(NavigationItem, { ...rest, ref: composedNodeRef, className: cx(navigationSubMenuClasses.host, active && navigationSubMenuClasses.active, open && navigationSubMenuClasses.open, (icon && orientation === 'vertical') && navigationSubMenuClasses.indent, className), onClick: () => setOpen(!open), children: [jsxs("div", { className: navigationSubMenuClasses.title, children: [icon && (jsx(Icon, { className: navigationSubMenuClasses.icon, icon: icon })), title, jsx(Icon, { className: navigationSubMenuClasses.toggleIcon, icon: GroupToggleIcon })] }), orientation === 'horizontal' && (jsx(Popper, { anchor: nodeRef, disablePortal: true, open: !!open, options: popperOptions, children: WrapChildren })), orientation === 'vertical' && (jsx(Collapse, { style: {
61
59
  width: '100%',
62
- }, in: !!open }, { children: WrapChildren }), void 0))] }), void 0));
60
+ }, in: !!open, children: WrapChildren }))] }));
63
61
  });
64
62
  var NavigationSubMenu$1 = NavigationSubMenu;
65
63
 
@@ -50,16 +50,11 @@ const Notification = ((props) => {
50
50
  }
51
51
  Notification.remove(reference);
52
52
  };
53
- return (jsx(SlideFade, Object.assign({ in: open, appear: true, onExited: onExited, direction: direction }, restTransitionProps, { children: jsxs("div", Object.assign({ className: cx(notificationClasses.host, severity ? notificationClasses.severity(severity) : undefined) }, { children: [targetIcon ? (jsx("div", Object.assign({ className: notificationClasses.iconContainer }, { children: jsx(Icon, { icon: targetIcon, className: notificationClasses.severityIcon }, void 0) }), void 0)) : null,
54
- jsxs("div", Object.assign({ className: notificationClasses.body }, { children: [jsx("h4", Object.assign({ className: notificationClasses.title }, { children: title }), void 0),
55
- jsx("div", Object.assign({ className: notificationClasses.content }, { children: children }), void 0),
56
- onConfirm && !severity ? (jsxs(ButtonGroup, Object.assign({ className: notificationClasses.action }, { children: [jsx(Button, Object.assign({ variant: "contained", onClick: onConfirm }, { children: confirmText }), void 0),
57
- jsx(Button, Object.assign({ variant: "outlined", onClick: onCancel || onClose }, { children: cancelText }), void 0)] }), void 0)) : null] }), void 0),
58
- jsx(Icon, { icon: TimesIcon, className: notificationClasses.closeIcon, onClick: onClose }, void 0)] }), void 0) }), void 0));
53
+ return (jsx(SlideFade, { in: open, appear: true, onExited: onExited, direction: direction, ...restTransitionProps, children: jsxs("div", { className: cx(notificationClasses.host, severity ? notificationClasses.severity(severity) : undefined), children: [targetIcon ? (jsx("div", { className: notificationClasses.iconContainer, children: jsx(Icon, { icon: targetIcon, className: notificationClasses.severityIcon }) })) : null, jsxs("div", { className: notificationClasses.body, children: [jsx("h4", { className: notificationClasses.title, children: title }), jsx("div", { className: notificationClasses.content, children: children }), onConfirm && !severity ? (jsxs(ButtonGroup, { className: notificationClasses.action, children: [jsx(Button, { variant: "contained", onClick: onConfirm, children: confirmText }), jsx(Button, { variant: "outlined", onClick: onCancel || onClose, children: cancelText })] })) : null] }), jsx(Icon, { icon: TimesIcon, className: notificationClasses.closeIcon, onClick: onClose })] }) }));
59
54
  });
60
55
  const { add, config, destroy, remove, } = createNotifier({
61
56
  duration: false,
62
- render: (notif) => jsx(Notification, Object.assign({}, notif), void 0),
57
+ render: (notif) => jsx(Notification, { ...notif }),
63
58
  setRoot: (root) => {
64
59
  root.setAttribute('class', notificationClasses.root);
65
60
  },
@@ -25,7 +25,7 @@ function NotifierManager(props) {
25
25
  },
26
26
  }), []);
27
27
  useImperativeHandle(controllerRef, () => controller, [controller]);
28
- return (jsx(Fragment, { children: notifiersShouldRendered.map((notifier) => (jsx(Fragment$1, { children: render(notifier) }, notifier.key))) }, void 0));
28
+ return (jsx(Fragment, { children: notifiersShouldRendered.map((notifier) => (jsx(Fragment$1, { children: render(notifier) }, notifier.key))) }));
29
29
  }
30
30
 
31
31
  export { NotifierManager as default };
@@ -37,7 +37,7 @@ function createNotifier(props) {
37
37
  controllerRef.current.add(resolvedNotifier);
38
38
  }
39
39
  else {
40
- render((jsx(NotifierManager, { controllerRef: controllerRef, defaultNotifiers: [resolvedNotifier], maxCount: currentConfig.maxCount, render: renderNotifier }, void 0)), root);
40
+ render((jsx(NotifierManager, { controllerRef: controllerRef, defaultNotifiers: [resolvedNotifier], maxCount: currentConfig.maxCount, render: renderNotifier })), root);
41
41
  }
42
42
  return resolvedNotifier.key;
43
43
  },
@@ -11,10 +11,10 @@ import cx from 'clsx';
11
11
  const Overlay = forwardRef(function Overlay(props, ref) {
12
12
  const { children, className, container, disableCloseOnBackdropClick = false, disablePortal, hideBackdrop = false, invisibleBackdrop = false, onBackdropClick, onClose, onSurface, open = false, ...rest } = props;
13
13
  const fixedAtBody = Boolean(!container);
14
- return (jsx(Portal, Object.assign({ container: container, disablePortal: disablePortal }, { children: jsxs("div", Object.assign({}, rest, { ref: ref, className: cx(overlayClasses.host, {
14
+ return (jsx(Portal, { container: container, disablePortal: disablePortal, children: jsxs("div", { ...rest, ref: ref, className: cx(overlayClasses.host, {
15
15
  [overlayClasses.hostFixed]: fixedAtBody,
16
16
  [overlayClasses.hostOpen]: open,
17
- }, className) }, { children: [hideBackdrop ? null : (jsx(Fade, Object.assign({ in: open }, { children: jsx("div", { "aria-hidden": true, className: cx(overlayClasses.backdrop, {
17
+ }, className), children: [hideBackdrop ? null : (jsx(Fade, { in: open, children: jsx("div", { "aria-hidden": true, className: cx(overlayClasses.backdrop, {
18
18
  [overlayClasses.backdropFixed]: fixedAtBody,
19
19
  [overlayClasses.invisible]: invisibleBackdrop,
20
20
  [overlayClasses.backdropOnSurface]: onSurface,
@@ -25,7 +25,7 @@ const Overlay = forwardRef(function Overlay(props, ref) {
25
25
  if (onBackdropClick) {
26
26
  onBackdropClick(event);
27
27
  }
28
- } }, void 0) }), void 0)), children] }), void 0) }), void 0));
28
+ } }) })), children] }) }));
29
29
  });
30
30
  var Overlay$1 = Overlay;
31
31
 
@@ -6,8 +6,7 @@ import cx from 'clsx';
6
6
 
7
7
  const PageFooter = forwardRef(function PageFooter(props, ref) {
8
8
  const { className, actionClassName, cancelButtonProps, cancelText, children, danger, loading, confirmButtonProps, confirmText, hideCancelButton, hideConfirmButton, onCancel, onConfirm, ...rest } = props;
9
- return (jsxs("footer", Object.assign({ ref: ref }, rest, { className: cx(pageFooterClasses.host, className) }, { children: [jsx("div", Object.assign({ className: actionClassName }, { children: children }), void 0),
10
- jsx(ConfirmActions, { cancelText: cancelText, confirmText: confirmText, cancelButtonProps: cancelButtonProps, confirmButtonProps: confirmButtonProps, danger: danger, hideCancelButton: hideCancelButton, hideConfirmButton: hideConfirmButton, loading: loading, onCancel: onCancel, onConfirm: onConfirm }, void 0)] }), void 0));
9
+ return (jsxs("footer", { ref: ref, ...rest, className: cx(pageFooterClasses.host, className), children: [jsx("div", { className: actionClassName, children: children }), jsx(ConfirmActions, { cancelText: cancelText, confirmText: confirmText, cancelButtonProps: cancelButtonProps, confirmButtonProps: confirmButtonProps, danger: danger, hideCancelButton: hideCancelButton, hideConfirmButton: hideConfirmButton, loading: loading, onCancel: onCancel, onConfirm: onConfirm })] }));
11
10
  });
12
11
  var PageFooter$1 = PageFooter;
13
12
 
@@ -10,7 +10,7 @@ import cx from 'clsx';
10
10
  * The react component for `mezzanine` pagination.
11
11
  */
12
12
  const Pagination = forwardRef((props, ref) => {
13
- const { className, boundaryCount = 1, buttonText, current = 1, disabled = false, hideNextButton = false, hidePreviousButton = false, hintText, inputPlaceholder, itemRender = (item) => jsx(PaginationItem, Object.assign({}, item), void 0), onChange, pageSize = 5, showJumper = false, siblingCount = 1, total = 0, ...rest } = props;
13
+ const { className, boundaryCount = 1, buttonText, current = 1, disabled = false, hideNextButton = false, hidePreviousButton = false, hintText, inputPlaceholder, itemRender = (item) => jsx(PaginationItem, { ...item }), onChange, pageSize = 5, showJumper = false, siblingCount = 1, total = 0, ...rest } = props;
14
14
  const { items } = usePagination({
15
15
  boundaryCount,
16
16
  current,
@@ -22,8 +22,7 @@ const Pagination = forwardRef((props, ref) => {
22
22
  siblingCount,
23
23
  total,
24
24
  });
25
- return (jsx("nav", Object.assign({}, rest, { ref: ref, "aria-label": "pagination navigation", className: cx(paginationClasses.host, className) }, { children: jsxs("ul", Object.assign({ className: paginationClasses.container }, { children: [items.map((item, index) => (jsx("li", Object.assign({ className: paginationClasses.item }, { children: itemRender(item) }), index))),
26
- showJumper && (jsx("li", Object.assign({ className: paginationClasses.jumper }, { children: jsx(PaginationJumper, { buttonText: buttonText, disabled: disabled, hintText: hintText, inputPlaceholder: inputPlaceholder, onChange: onChange, pageSize: pageSize, total: total }, void 0) }), void 0))] }), void 0) }), void 0));
25
+ return (jsx("nav", { ...rest, ref: ref, "aria-label": "pagination navigation", className: cx(paginationClasses.host, className), children: jsxs("ul", { className: paginationClasses.container, children: [items.map((item, index) => (jsx("li", { className: paginationClasses.item, children: itemRender(item) }, index))), showJumper && (jsx("li", { className: paginationClasses.jumper, children: jsx(PaginationJumper, { buttonText: buttonText, disabled: disabled, hintText: hintText, inputPlaceholder: inputPlaceholder, onChange: onChange, pageSize: pageSize, total: total }) }))] }) }));
27
26
  });
28
27
  var Pagination$1 = Pagination;
29
28
 
@@ -12,13 +12,13 @@ const PaginationItem = forwardRef((props, ref) => {
12
12
  previous: ChevronLeftIcon,
13
13
  };
14
14
  const ButtonIcon = icons[type];
15
- return type === 'ellipsis' ? (jsx("div", Object.assign({}, rest, { ref: ref, className: cx(paginationItemClasses.host, paginationItemClasses.ellipsis, {
15
+ return type === 'ellipsis' ? (jsx("div", { ...rest, ref: ref, className: cx(paginationItemClasses.host, paginationItemClasses.ellipsis, {
16
16
  [paginationItemClasses.disabled]: disabled,
17
- }, className) }, { children: "..." }), void 0)) : (createElement("button", Object.assign({}, rest, { ref: ref, key: page, disabled: disabled, className: cx(paginationItemClasses.host, paginationItemClasses.button, {
17
+ }, className), children: "..." })) : (createElement("button", { ...rest, ref: ref, key: page, disabled: disabled, className: cx(paginationItemClasses.host, paginationItemClasses.button, {
18
18
  [paginationItemClasses.active]: active,
19
19
  [paginationItemClasses.disabled]: disabled,
20
- }, className), type: "button" }),
21
- ButtonIcon && jsx(Icon, { icon: ButtonIcon }, void 0),
20
+ }, className), type: "button" },
21
+ ButtonIcon && jsx(Icon, { icon: ButtonIcon }),
22
22
  type === 'page' && page));
23
23
  });
24
24
  var PaginationItem$1 = PaginationItem;
@@ -38,15 +38,13 @@ const PaginationJumper = forwardRef((props, ref) => {
38
38
  handleClick();
39
39
  }
40
40
  };
41
- return (jsxs("div", Object.assign({}, rest, { ref: ref, className: cx(paginationJumperClasses.host, className) }, { children: [jsx(Typography, Object.assign({ color: disabled ? 'text-disabled' : 'text-primary', component: "div", ellipsis: true, variant: "input2" }, { children: hintText }), void 0),
42
- jsx(Input, { disabled: disabled, error: error, onChange: (e) => {
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) => {
43
42
  setValue(e.target.value);
44
43
  }, placeholder: inputPlaceholder, inputProps: {
45
44
  type: 'number',
46
45
  className: paginationJumperClasses.input,
47
46
  onKeyDown: handleKeyDown,
48
- }, value: value }, void 0),
49
- jsx(Button, Object.assign({ disabled: disabled, onClick: handleClick }, { children: buttonText }), void 0)] }), void 0));
47
+ }, value: value }), jsx(Button, { disabled: disabled, onClick: handleClick, children: buttonText })] }));
50
48
  });
51
49
  var PaginationJumper$1 = PaginationJumper;
52
50
 
@@ -1,7 +1,7 @@
1
1
  import { ChangeEventHandler, 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' | 'defualtChecked'> {
4
+ export interface PickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | 'defaultChecked'> {
5
5
  /**
6
6
  * React ref for the input element.
7
7
  */
@@ -8,8 +8,8 @@ import cx from 'clsx';
8
8
  * The react component for `mezzanine` picker trigger.
9
9
  */
10
10
  const PickerTrigger = forwardRef(function PickerTrigger(props, ref) {
11
- const { className, disabled, inputProps, inputRef, onChange, placeholder, readOnly, required, value, ...restTextFieldProps } = props;
12
- return (jsx(TextField, Object.assign({}, restTextFieldProps, { ref: ref, active: !!value, className: cx(pickerClasses.host, className), disabled: disabled }, { children: jsx("input", Object.assign({}, 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 }), void 0) }), void 0));
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 }) }));
13
13
  });
14
14
  var PickerTrigger$1 = PickerTrigger;
15
15
 
@@ -1,7 +1,7 @@
1
1
  import { ChangeEventHandler, MouseEventHandler, RefObject } from 'react';
2
2
  import { TextFieldProps } from '../TextField';
3
3
  import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
4
- export interface RangePickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | 'defualtChecked' | 'placeholder'> {
4
+ export interface RangePickerTriggerProps extends Omit<TextFieldProps, 'active' | 'children' | 'suffix' | 'defaultChecked' | 'placeholder'> {
5
5
  /**
6
6
  * Placeholder for the 'from' input element.
7
7
  */
@@ -10,10 +10,8 @@ import cx from 'clsx';
10
10
  * The react component for `mezzanine` date range picker trigger.
11
11
  */
12
12
  const RangePickerTrigger = forwardRef(function DateRangePickerTrigger(props, ref) {
13
- const { className, disabled, inputFromPlaceholder, inputFromProps, inputFromRef, inputFromValue, inputToPlaceholder, inputToProps, inputToRef, inputToValue, onIconClick, onInputFromChange, onInputToChange, readOnly, required, ...restTextFieldProps } = props;
14
- return (jsxs(TextField, Object.assign({}, restTextFieldProps, { ref: ref, active: !!inputFromValue || !!inputToValue, className: cx(pickerClasses.host, className), disabled: disabled }, { children: [jsx("input", Object.assign({}, inputFromProps, { ref: inputFromRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onInputFromChange, placeholder: inputFromPlaceholder, readOnly: readOnly, required: required, value: inputFromValue }), void 0),
15
- jsx(Icon, { icon: ArrowRightIcon, className: pickerClasses.arrowIcon }, void 0),
16
- jsx("input", Object.assign({}, inputToProps, { ref: inputToRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onInputToChange, placeholder: inputToPlaceholder, readOnly: readOnly, required: required, value: inputToValue }), void 0)] }), void 0));
13
+ const { className, clearable, disabled, inputFromPlaceholder, inputFromProps, inputFromRef, inputFromValue, inputToPlaceholder, inputToProps, inputToRef, inputToValue, onIconClick, onInputFromChange, onInputToChange, readOnly, required, ...restTextFieldProps } = props;
14
+ return (jsxs(TextField, { ...restTextFieldProps, ref: ref, active: !!inputFromValue || !!inputToValue, className: cx(pickerClasses.host, className), clearable: !readOnly && clearable, disabled: disabled, children: [jsx("input", { ...inputFromProps, ref: inputFromRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onInputFromChange, placeholder: inputFromPlaceholder, readOnly: readOnly, required: required, value: inputFromValue }), jsx(Icon, { icon: ArrowRightIcon, className: pickerClasses.arrowIcon }), jsx("input", { ...inputToProps, ref: inputToRef, "aria-disabled": disabled, "aria-multiline": false, "aria-readonly": readOnly, "aria-required": required, disabled: disabled, onChange: onInputToChange, placeholder: inputToPlaceholder, readOnly: readOnly, required: required, value: inputToValue })] }));
17
15
  });
18
16
  var RangePickerTrigger$1 = RangePickerTrigger;
19
17
 
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { ChangeEventHandler } from 'react';
2
2
  export interface UsePickerInputValueProps {
3
3
  defaultValue?: string;
4
4
  initialValue?: string;
@@ -6,7 +6,7 @@ export interface UsePickerInputValueProps {
6
6
  }
7
7
  export declare function usePickerInputValue(props?: UsePickerInputValueProps): {
8
8
  inputValue: string;
9
- inputChangeHandler: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
9
+ inputChangeHandler: ChangeEventHandler<HTMLInputElement>;
10
10
  onChange: import("react").Dispatch<import("react").SetStateAction<string>>;
11
11
  };
12
12
  export default usePickerInputValue;
@@ -1,6 +1,5 @@
1
- /// <reference types="moment" />
2
1
  import { DateType } from '@mezzanine-ui/core/calendar';
3
- import { RefObject } from 'react';
2
+ import { FocusEventHandler, KeyboardEventHandler, RefObject } from 'react';
4
3
  export declare type UsePickerValueProps = {
5
4
  defaultValue?: DateType;
6
5
  format: string;
@@ -13,9 +12,9 @@ export declare type UsePickerValueProps = {
13
12
  */
14
13
  export declare function usePickerValue({ defaultValue, format, formats, inputRef, value: valueProp, }: UsePickerValueProps): {
15
14
  inputValue: string;
16
- onBlur: (event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
17
- onChange: (val?: import("moment").Moment | undefined) => void;
18
- onInputChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
19
- onKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
20
- value: import("moment").Moment | undefined;
15
+ onBlur: FocusEventHandler<HTMLInputElement>;
16
+ onChange: (val?: string | undefined) => void;
17
+ onInputChange: import("react").ChangeEventHandler<HTMLInputElement>;
18
+ onKeyDown: KeyboardEventHandler<HTMLInputElement>;
19
+ value: string | undefined;
21
20
  };
@@ -1,6 +1,5 @@
1
- /// <reference types="moment" />
2
1
  import { RangePickerPickingValue, RangePickerValue } from '@mezzanine-ui/core/picker';
3
- import { RefObject } from 'react';
2
+ import { ChangeEventHandler, KeyboardEventHandler, RefObject } from 'react';
4
3
  import { UsePickerValueProps } from './usePickerValue';
5
4
  export interface UseRangePickerValueProps extends Pick<UsePickerValueProps, 'format' | 'formats'> {
6
5
  inputFromRef: RefObject<HTMLInputElement>;
@@ -10,12 +9,12 @@ export interface UseRangePickerValueProps extends Pick<UsePickerValueProps, 'for
10
9
  export declare function useRangePickerValue({ format, formats, inputFromRef, inputToRef, value: valueProp, }: UseRangePickerValueProps): {
11
10
  inputFromValue: string;
12
11
  inputToValue: string;
13
- onChange: (target?: undefined[] | [import("moment").Moment, import("moment").Moment] | [import("moment").Moment] | [undefined, import("moment").Moment] | [import("moment").Moment, undefined] | undefined) => RangePickerPickingValue | undefined;
14
- onFromBlur: (event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
15
- onFromKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
16
- onInputFromChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
17
- onInputToChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
18
- onToBlur: (event: import("react").FocusEvent<HTMLInputElement, Element>) => void;
19
- onToKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
20
- value: RangePickerPickingValue;
12
+ onChange: (target?: RangePickerPickingValue<string> | undefined) => RangePickerPickingValue | undefined;
13
+ onFromBlur: import("react").FocusEventHandler<HTMLInputElement>;
14
+ onFromKeyDown: KeyboardEventHandler<HTMLInputElement>;
15
+ onInputFromChange: ChangeEventHandler<HTMLInputElement>;
16
+ onInputToChange: ChangeEventHandler<HTMLInputElement>;
17
+ onToBlur: import("react").FocusEventHandler<HTMLInputElement>;
18
+ onToKeyDown: KeyboardEventHandler<HTMLInputElement>;
19
+ value: RangePickerPickingValue<string>;
21
20
  };
@@ -9,7 +9,7 @@ import cx from 'clsx';
9
9
 
10
10
  const Popconfirm = forwardRef(function Popconfirm(props, ref) {
11
11
  const { className, container, cancelButtonProps, cancelText, confirmButtonProps, confirmText, icon = ExclamationCircleFilledIcon, onCancel, onConfirm, title, ...rest } = props;
12
- return (jsx(Popover, Object.assign({}, rest, { ref: ref, className: cx(popConfirmClasses.host, className), title: (jsxs(Fragment, { children: [jsx(Icon, { className: popConfirmClasses.icon, icon: icon }, void 0), title] }, void 0)) }, { children: jsx(ConfirmActions, { cancelButtonProps: cancelButtonProps, cancelText: cancelText, confirmButtonProps: confirmButtonProps, confirmText: confirmText, onCancel: onCancel, onConfirm: onConfirm, size: "small" }, void 0) }), void 0));
12
+ return (jsx(Popover, { ...rest, ref: ref, className: cx(popConfirmClasses.host, className), title: (jsxs(Fragment, { children: [jsx(Icon, { className: popConfirmClasses.icon, icon: icon }), title] })), children: jsx(ConfirmActions, { cancelButtonProps: cancelButtonProps, cancelText: cancelText, confirmButtonProps: confirmButtonProps, confirmText: confirmText, onCancel: onCancel, onConfirm: onConfirm, size: "small" }) }));
13
13
  });
14
14
  var Popconfirm$1 = Popconfirm;
15
15
 
@@ -35,11 +35,10 @@ const Popover = forwardRef(function Popover(props, ref) {
35
35
  onClose,
36
36
  popoverRef,
37
37
  ]);
38
- return (jsxs(Popper, Object.assign({}, rest, { ref: composedRef, className: cx(popoverClasses.host, className), open: open, options: {
38
+ return (jsxs(Popper, { ...rest, ref: composedRef, className: cx(popoverClasses.host, className), open: open, options: {
39
39
  ...options,
40
40
  modifiers: [offsetModifier, ...modifiers],
41
- } }, { children: [title && jsx("div", Object.assign({ className: popoverClasses.title }, { children: title }), void 0),
42
- children && jsx("div", Object.assign({ className: popoverClasses.content }, { children: children }), void 0)] }), void 0));
41
+ }, children: [title && jsx("div", { className: popoverClasses.title, children: title }), children && jsx("div", { className: popoverClasses.content, children: children })] }));
43
42
  });
44
43
  var Popover$1 = Popover;
45
44
 
package/Popper/Popper.js CHANGED
@@ -21,10 +21,10 @@ const Popper = forwardRef(function Popper(props, ref) {
21
21
  if (!open) {
22
22
  return null;
23
23
  }
24
- return (jsx(Portal, Object.assign({ container: container, disablePortal: disablePortal }, { children: jsx("div", Object.assign({}, rest, { ref: composedRef, style: {
24
+ return (jsx(Portal, { container: container, disablePortal: disablePortal, children: jsx("div", { ...rest, ref: composedRef, style: {
25
25
  ...style,
26
26
  ...styles.popper,
27
- } }, attributes.popper, { children: children }), void 0) }), void 0));
27
+ }, ...attributes.popper, children: children }) }));
28
28
  });
29
29
  var Popper$1 = Popper;
30
30
 
package/Portal/Portal.js CHANGED
@@ -14,7 +14,7 @@ const Portal = (props) => {
14
14
  }
15
15
  }, [container, disablePortal]);
16
16
  if (disablePortal || !portalElement) {
17
- return jsx(Fragment, { children: children }, void 0);
17
+ return jsx(Fragment, { children: children });
18
18
  }
19
19
  return createPortal(children, portalElement);
20
20
  };
@@ -1,8 +1,9 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
2
+ import { forwardRef, useContext } from 'react';
3
3
  import { ProgressStatuses, ProgressTypes, progressClasses } from '@mezzanine-ui/core/progress';
4
4
  import { CheckCircleFilledIcon, CheckIcon, TimesCircleFilledIcon, TimesIcon } from '@mezzanine-ui/icons';
5
5
  import Typography from '../Typography/Typography.js';
6
+ import { MezzanineConfig } from '../Provider/context.js';
6
7
  import Icon from '../Icon/Icon.js';
7
8
  import cx from 'clsx';
8
9
 
@@ -10,23 +11,22 @@ import cx from 'clsx';
10
11
  * The react component for `mezzanine` progress.
11
12
  */
12
13
  const Progress = forwardRef(function Progress(props, ref) {
13
- const { circleProps, className, errorIconProps, percent = 0, percentProps, showInfo = true, size = 'medium', status = percent < 100 ? ProgressStatuses.normal : ProgressStatuses.success, successIconProps, type = ProgressTypes.line, ...rest } = props;
14
+ const { size: globalSize, } = useContext(MezzanineConfig);
15
+ const { circleProps, className, errorIconProps, percent = 0, percentProps, showInfo = true, size = globalSize, status = percent < 100 ? ProgressStatuses.normal : ProgressStatuses.success, successIconProps, type = ProgressTypes.line, ...rest } = props;
14
16
  const percentLimited = Math.max(0, Math.min(100, percent));
15
17
  const defaultSuccessIcon = type === ProgressTypes.line ? CheckCircleFilledIcon : CheckIcon;
16
18
  const defaultErrorIcon = type === ProgressTypes.line ? TimesCircleFilledIcon : TimesIcon;
17
- const renderInfo = (variant) => (jsx("div", Object.assign({ className: progressClasses.info }, { children: status === ProgressStatuses.normal
18
- ? /** percent text */ (jsx(Typography, Object.assign({ className: progressClasses.infoPercent, variant: variant }, percentProps, { children: `${percentLimited}%` }), void 0)) : (jsxs(Fragment, { children: [status === ProgressStatuses.success && (jsx(Icon, Object.assign({ className: progressClasses.infoIcon, icon: defaultSuccessIcon }, successIconProps), void 0)),
19
- status === ProgressStatuses.error && (jsx(Icon, Object.assign({ className: progressClasses.infoIcon, icon: defaultErrorIcon }, errorIconProps), void 0))] }, void 0)) }), void 0));
20
- const renderLine = () => (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: progressClasses.lineBg }, { children: jsx("div", { style: { width: `${percentLimited}%` } }, void 0) }), void 0), showInfo && renderInfo('input3')] }, void 0));
19
+ const renderInfo = (variant) => (jsx("div", { className: progressClasses.info, children: status === ProgressStatuses.normal
20
+ ? /** percent text */ (jsx(Typography, { className: progressClasses.infoPercent, variant: variant, ...percentProps, children: `${percentLimited}%` })) : (jsxs(Fragment, { children: [status === ProgressStatuses.success && (jsx(Icon, { className: progressClasses.infoIcon, icon: defaultSuccessIcon, ...successIconProps })), status === ProgressStatuses.error && (jsx(Icon, { className: progressClasses.infoIcon, icon: defaultErrorIcon, ...errorIconProps }))] })) }));
21
+ const renderLine = () => (jsxs(Fragment, { children: [jsx("div", { className: progressClasses.lineBg, children: jsx("div", { style: { width: `${percentLimited}%` } }) }), showInfo && renderInfo('input3')] }));
21
22
  const renderCircle = () => {
22
23
  const { size: circleSize = 80, strokeWidth = 8, } = circleProps || {};
23
24
  const radius = (circleSize - strokeWidth) / 2;
24
25
  const progressLength = percent > 0 ? percent * radius * Math.PI * 0.02 : 0.00001;
25
26
  const circleXY = circleSize / 2;
26
- return (jsxs(Fragment, { children: [jsxs("svg", Object.assign({ style: { boxSizing: 'border-box' }, height: circleSize, width: circleSize }, { children: [jsx("circle", { className: progressClasses.circleBg, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth }, void 0),
27
- jsx("circle", { className: progressClasses.circleFiller, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth, strokeDasharray: `${progressLength.toString()} 999` }, void 0)] }), void 0), showInfo && renderInfo('button3')] }, void 0));
27
+ return (jsxs(Fragment, { children: [jsxs("svg", { style: { boxSizing: 'border-box' }, height: circleSize, width: circleSize, children: [jsx("circle", { className: progressClasses.circleBg, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth }), jsx("circle", { className: progressClasses.circleFiller, cx: circleXY, cy: circleXY, r: radius, strokeWidth: strokeWidth, strokeDasharray: `${progressLength.toString()} 999` })] }), showInfo && renderInfo('button3')] }));
28
28
  };
29
- return (jsxs("div", Object.assign({ ref: ref, className: cx(progressClasses.host, className, status === ProgressStatuses.success && progressClasses.success, status === ProgressStatuses.error && progressClasses.error, type === ProgressTypes.line && progressClasses.lineVariant, type === ProgressTypes.circle && progressClasses.circleVariant, progressClasses.size(size)) }, rest, { children: [type === ProgressTypes.line && renderLine(), type === ProgressTypes.circle && renderCircle()] }), void 0));
29
+ return (jsxs("div", { ref: ref, className: cx(progressClasses.host, className, status === ProgressStatuses.success && progressClasses.success, status === ProgressStatuses.error && progressClasses.error, type === ProgressTypes.line && progressClasses.lineVariant, type === ProgressTypes.circle && progressClasses.circleVariant, progressClasses.size(size)), ...rest, children: [type === ProgressTypes.line && renderLine(), type === ProgressTypes.circle && renderCircle()] }));
30
30
  });
31
31
  var Progress$1 = Progress;
32
32
 
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { MezzanineConfigContext } from './context';
3
+ export interface ConfigProviderProps {
4
+ children?: ReactNode;
5
+ size?: MezzanineConfigContext['size'];
6
+ }
7
+ declare function ConfigProvider(props: ConfigProviderProps): JSX.Element;
8
+ export default ConfigProvider;
@@ -0,0 +1,13 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { MezzanineConfig } from './context.js';
4
+
5
+ function ConfigProvider(props) {
6
+ const { children, size, } = props;
7
+ const context = useMemo(() => ({
8
+ size: size || 'medium',
9
+ }), [size]);
10
+ return (jsx(MezzanineConfig.Provider, { value: context, children: children }));
11
+ }
12
+
13
+ export { ConfigProvider as default };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Size } from '@mezzanine-ui/system/size';
3
+ export interface MezzanineConfigContext {
4
+ size: Size;
5
+ }
6
+ export declare const MezzanineConfig: import("react").Context<MezzanineConfigContext>;
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+
3
+ const MezzanineConfig = createContext({
4
+ size: 'medium',
5
+ });
6
+
7
+ export { MezzanineConfig };
@@ -0,0 +1,4 @@
1
+ export { default, } from './ConfigProvider';
2
+ export type { ConfigProviderProps, } from './ConfigProvider';
3
+ export { MezzanineConfig, } from './context';
4
+ export type { MezzanineConfigContext, } from './context';
@@ -0,0 +1,2 @@
1
+ export { default } from './ConfigProvider.js';
2
+ export { MezzanineConfig } from './context.js';
package/Radio/Radio.js CHANGED
@@ -3,6 +3,7 @@ import { forwardRef, useContext } from 'react';
3
3
  import { radioClasses } from '@mezzanine-ui/core/radio';
4
4
  import { useRadioControlValue } from '../Form/useRadioControlValue.js';
5
5
  import { RadioGroupContext } from './RadioGroupContext.js';
6
+ import { MezzanineConfig } from '../Provider/context.js';
6
7
  import InputCheck from '../_internal/InputCheck/InputCheck.js';
7
8
  import { FormControlContext } from '../Form/FormControlContext.js';
8
9
  import cx from 'clsx';
@@ -11,10 +12,11 @@ import cx from 'clsx';
11
12
  * The react component for `mezzanine` radio.
12
13
  */
13
14
  const Radio = forwardRef(function Radio(props, ref) {
15
+ const { size: globalSize, } = useContext(MezzanineConfig);
14
16
  const { disabled: disabledFromFormControl, severity, } = useContext(FormControlContext) || {};
15
17
  const radioGroup = useContext(RadioGroupContext);
16
18
  const { disabled: disabledFromGroup, name: nameFromGroup, size: sizeFromGroup, } = radioGroup || {};
17
- const { checked: checkedProp, children, defaultChecked, disabled = (disabledFromGroup !== null && disabledFromGroup !== void 0 ? disabledFromGroup : disabledFromFormControl) || false, error = severity === 'error' || false, inputProps, onChange: onChangeProp, size = sizeFromGroup || 'medium', value, ...rest } = props;
19
+ const { checked: checkedProp, children, defaultChecked, disabled = (disabledFromGroup !== null && disabledFromGroup !== void 0 ? disabledFromGroup : disabledFromFormControl) || false, error = severity === 'error' || false, inputProps, onChange: onChangeProp, size = sizeFromGroup || globalSize, value, ...rest } = props;
18
20
  const { id: inputId, name = nameFromGroup, ...restInputProps } = inputProps || {};
19
21
  const [checked, onChange] = useRadioControlValue({
20
22
  checked: checkedProp,
@@ -23,9 +25,9 @@ const Radio = forwardRef(function Radio(props, ref) {
23
25
  radioGroup,
24
26
  value,
25
27
  });
26
- return (jsx(InputCheck, Object.assign({}, rest, { ref: ref, control: (jsx("span", Object.assign({ className: cx(radioClasses.host, {
28
+ return (jsx(InputCheck, { ...rest, ref: ref, control: (jsx("span", { className: cx(radioClasses.host, {
27
29
  [radioClasses.checked]: checked,
28
- }) }, { children: jsx("input", Object.assign({}, restInputProps, { "aria-checked": checked, "aria-disabled": disabled, checked: checked, disabled: disabled, id: inputId, onChange: onChange, name: name, type: "radio", value: value }), void 0) }), void 0)), disabled: disabled, error: error, htmlFor: inputId, size: size }, { children: children }), void 0));
30
+ }), children: jsx("input", { ...restInputProps, "aria-checked": checked, "aria-disabled": disabled, checked: checked, disabled: disabled, id: inputId, onChange: onChange, name: name, type: "radio", value: value }) })), disabled: disabled, error: error, htmlFor: inputId, size: size, children: children }));
29
31
  });
30
32
  var Radio$1 = Radio;
31
33
 
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
2
+ import { forwardRef, useMemo } from 'react';
3
3
  import { useInputControlValue } from '../Form/useInputControlValue.js';
4
4
  import { RadioGroupContext } from './RadioGroupContext.js';
5
5
  import Radio from './Radio.js';
@@ -15,15 +15,15 @@ const RadioGroup = forwardRef(function RadioGroup(props, ref) {
15
15
  onChange: onChangeProp,
16
16
  value: valueProp,
17
17
  });
18
- const context = {
18
+ const context = useMemo(() => ({
19
19
  disabled,
20
20
  name,
21
21
  onChange,
22
22
  size,
23
23
  value,
24
- };
25
- const children = childrenProp || options.map((option) => (jsx(Radio, Object.assign({ disabled: option.disabled, value: option.value }, { children: option.label }), option.value)));
26
- return (jsx(RadioGroupContext.Provider, Object.assign({ value: context }, { children: jsx(InputCheckGroup, Object.assign({}, rest, { ref: ref, role: "radiogroup" }, { children: children }), void 0) }), void 0));
24
+ }), [disabled, name, onChange, size, value]);
25
+ const children = childrenProp || options.map((option) => (jsx(Radio, { disabled: option.disabled, value: option.value, children: option.label }, option.value)));
26
+ return (jsx(RadioGroupContext.Provider, { value: context, children: jsx(InputCheckGroup, { ...rest, ref: ref, role: "radiogroup", children: children }) }));
27
27
  });
28
28
  var RadioGroup$1 = RadioGroup;
29
29
 
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { SelectInputSize } from '@mezzanine-ui/core/select';
3
+ import { SelectValue } from './typings';
3
4
  import { MenuProps } from '../Menu';
4
5
  import { PopperProps } from '../Popper';
5
6
  import { PickRenameMulti } from '../utils/general';
6
7
  import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
7
- export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | 'clearable' | 'forceHideSuffixActionIcon' | 'mode' | 'onClick' | 'onKeyDown' | 'onChange' | 'renderValue' | 'inputProps' | 'suffixActionIcon' | 'value'>, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
8
+ export interface AutoCompleteBaseProps extends Omit<SelectTriggerProps, 'active' | 'clearable' | 'forceHideSuffixActionIcon' | 'mode' | 'onClick' | 'onKeyDown' | 'onChange' | 'renderValue' | 'inputProps' | 'suffixActionIcon' | 'value'>, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
8
9
  maxHeight: 'menuMaxHeight';
9
10
  role: 'menuRole';
10
11
  size: 'menuSize';
@@ -16,10 +17,6 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
16
17
  * @default false
17
18
  */
18
19
  addable?: boolean;
19
- /**
20
- * The default selection
21
- */
22
- defaultValue?: string;
23
20
  /**
24
21
  * Should the filter rules be disabled (If you need to control options filter by yourself)
25
22
  * @default false
@@ -29,15 +26,11 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
29
26
  * The other native props for input element.
30
27
  */
31
28
  inputProps?: Omit<SelectTriggerInputProps, 'onChange' | 'placeholder' | 'role' | 'value' | `aria-${'controls' | 'expanded' | 'owns'}`>;
32
- /**
33
- * The change event handler of input element.
34
- */
35
- onChange?(text: string): any;
36
29
  /**
37
30
  * insert callback whenever insert icon is clicked
38
31
  * return `true` when insert is successfully
39
32
  */
40
- onInsert?(text: string): boolean;
33
+ onInsert?(text: string): SelectValue;
41
34
  /**
42
35
  * The search event handler
43
36
  */
@@ -45,7 +38,7 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
45
38
  /**
46
39
  * The options that mapped autocomplete options
47
40
  */
48
- options: string[];
41
+ options: SelectValue[];
49
42
  /**
50
43
  * select input placeholder
51
44
  */
@@ -57,15 +50,48 @@ export interface AutoCompleteProps extends Omit<SelectTriggerProps, 'active' | '
57
50
  required?: boolean;
58
51
  /**
59
52
  * The size of input.
60
- * @default 'medium'
61
53
  */
62
54
  size?: SelectInputSize;
55
+ }
56
+ export declare type AutoCompleteMultipleProps = AutoCompleteBaseProps & {
57
+ /**
58
+ * The default selection
59
+ */
60
+ defaultValue?: SelectValue[];
61
+ /**
62
+ * Controls the layout of trigger.
63
+ */
64
+ mode: 'multiple';
65
+ /**
66
+ * The change event handler of input element.
67
+ */
68
+ onChange?(newOptions: SelectValue[]): any;
63
69
  /**
64
70
  * The value of selection.
65
71
  * @default undefined
66
72
  */
67
- value?: string;
68
- }
73
+ value?: SelectValue[];
74
+ };
75
+ export declare type AutoCompleteSingleProps = AutoCompleteBaseProps & {
76
+ /**
77
+ * The default selection
78
+ */
79
+ defaultValue?: SelectValue;
80
+ /**
81
+ * Controls the layout of trigger.
82
+ */
83
+ mode?: 'single';
84
+ /**
85
+ * The change event handler of input element.
86
+ */
87
+ onChange?(newOptions: SelectValue): any;
88
+ /**
89
+ * The value of selection.
90
+ * @default undefined
91
+ */
92
+ value?: SelectValue | null;
93
+ };
94
+ export declare type AutoCompleteProps = AutoCompleteMultipleProps | AutoCompleteSingleProps;
69
95
  /**
70
96
  * The AutoComplete component for react. <br />
71
97
  * Note that if you need search for ONLY given options, not included your typings,