@sproutsocial/racine 22.5.1 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/__flow__/Toast/Toast.flow.js +4 -0
  3. package/commonjs/Avatar/Avatar.js +24 -16
  4. package/commonjs/Badge/Badge.js +20 -13
  5. package/commonjs/Banner/Banner.js +35 -25
  6. package/commonjs/Box/Box.js +7 -2
  7. package/commonjs/Breadcrumb/Breadcrumb.js +36 -23
  8. package/commonjs/Button/Button.js +11 -3
  9. package/commonjs/Card/Card.js +25 -18
  10. package/commonjs/Card/subComponents.js +32 -15
  11. package/commonjs/CharacterCounter/CharacterCounter.js +7 -3
  12. package/commonjs/ChartLegend/ChartLegend.js +10 -3
  13. package/commonjs/ChartLegend/useChartLabels.js +12 -10
  14. package/commonjs/Checkbox/Checkbox.js +55 -45
  15. package/commonjs/Checkbox/styles.js +20 -17
  16. package/commonjs/Collapsible/Collapsible.js +22 -16
  17. package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +26 -16
  18. package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.js +7 -2
  19. package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +24 -14
  20. package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +7 -2
  21. package/commonjs/DatePicker/common.js +8 -6
  22. package/commonjs/Drawer/Drawer.js +160 -113
  23. package/commonjs/EmptyState/EmptyState.js +44 -31
  24. package/commonjs/Fieldset/Fieldset.js +31 -14
  25. package/commonjs/FormField/FormField.js +37 -31
  26. package/commonjs/Icon/Icon.js +35 -30
  27. package/commonjs/Image/Image.js +5 -3
  28. package/commonjs/Indicator/Indicator.js +12 -6
  29. package/commonjs/Input/Input.js +57 -51
  30. package/commonjs/KeyboardKey/KeyboardKey.js +12 -3
  31. package/commonjs/Label/Label.js +15 -9
  32. package/commonjs/Link/Link.js +10 -3
  33. package/commonjs/Listbox/Listbox.js +16 -13
  34. package/commonjs/Loader/Loader.js +9 -3
  35. package/commonjs/LoaderButton/LoaderButton.js +28 -18
  36. package/commonjs/Menu/Menu.js +128 -107
  37. package/commonjs/Menu/utils/descendants.js +6 -6
  38. package/commonjs/Message/Message.js +79 -59
  39. package/commonjs/Modal/Modal.js +54 -31
  40. package/commonjs/Modal/styles.js +8 -4
  41. package/commonjs/Numeral/Numeral.js +27 -11
  42. package/commonjs/PartnerLogo/PartnerLogo.js +22 -12
  43. package/commonjs/Radio/Radio.js +28 -22
  44. package/commonjs/SegmentedControl/SegmentedControl.js +38 -24
  45. package/commonjs/Select/Select.js +32 -25
  46. package/commonjs/SpotIllustration/SpotIllustration.js +13 -5
  47. package/commonjs/Stack/Stack.js +15 -8
  48. package/commonjs/Switch/Switch.js +14 -7
  49. package/commonjs/Table/Table.js +65 -45
  50. package/commonjs/TableCell/TableCell.js +6 -3
  51. package/commonjs/TableHeaderCell/TableHeaderCell.js +20 -12
  52. package/commonjs/TableRowAccordion/TableRowAccordion.js +35 -29
  53. package/commonjs/Tabs/Tabs.js +37 -30
  54. package/commonjs/Text/Text.js +10 -3
  55. package/commonjs/Textarea/Textarea.js +37 -32
  56. package/commonjs/ThemeProvider/index.js +8 -5
  57. package/commonjs/Toast/Toast.js +127 -91
  58. package/commonjs/Toast/index.js +15 -15
  59. package/commonjs/Toast/styles.js +56 -30
  60. package/commonjs/ToggleHint/ToggleHint.js +11 -5
  61. package/commonjs/Token/Token.js +39 -25
  62. package/commonjs/TokenInput/TokenInput.js +55 -47
  63. package/commonjs/TokenInput/TokenScreenReaderStatus.js +5 -3
  64. package/commonjs/Tooltip/Tooltip.js +34 -27
  65. package/dist/types/Drawer/Drawer.d.ts.map +1 -1
  66. package/dist/types/Drawer/DrawerTypes.d.ts +6 -3
  67. package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
  68. package/dist/types/Listbox/ListboxTypes.d.ts +1 -1
  69. package/dist/types/Listbox/ListboxTypes.d.ts.map +1 -1
  70. package/dist/types/Menu/MenuTypes.d.ts +4 -4
  71. package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
  72. package/dist/types/ThemeProvider/index.d.ts +1 -1
  73. package/dist/types/ThemeProvider/index.d.ts.map +1 -1
  74. package/dist/types/Toast/Toast.d.ts +23 -2
  75. package/dist/types/Toast/Toast.d.ts.map +1 -1
  76. package/dist/types/Toast/ToastTypes.d.ts +27 -13
  77. package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
  78. package/dist/types/Toast/index.d.ts +2 -4
  79. package/dist/types/Toast/index.d.ts.map +1 -1
  80. package/dist/types/Toast/styles.d.ts +11 -15
  81. package/dist/types/Toast/styles.d.ts.map +1 -1
  82. package/dist/types/Tooltip/TooltipTypes.d.ts +2 -2
  83. package/dist/types/Tooltip/TooltipTypes.d.ts.map +1 -1
  84. package/dist/types/utils/react-testing-library.d.ts +61 -121
  85. package/dist/types/utils/react-testing-library.d.ts.map +1 -1
  86. package/lib/Avatar/Avatar.js +25 -16
  87. package/lib/Badge/Badge.js +22 -13
  88. package/lib/Banner/Banner.js +37 -25
  89. package/lib/Box/Box.js +8 -2
  90. package/lib/Breadcrumb/Breadcrumb.js +37 -23
  91. package/lib/Button/Button.js +11 -3
  92. package/lib/Card/Card.js +17 -8
  93. package/lib/Card/subComponents.js +35 -15
  94. package/lib/CharacterCounter/CharacterCounter.js +7 -3
  95. package/lib/ChartLegend/ChartLegend.js +11 -3
  96. package/lib/ChartLegend/useChartLabels.js +13 -10
  97. package/lib/Checkbox/Checkbox.js +56 -45
  98. package/lib/Checkbox/styles.js +20 -17
  99. package/lib/Collapsible/Collapsible.js +22 -16
  100. package/lib/DatePicker/DateRangePicker/DateRangePicker.js +29 -16
  101. package/lib/DatePicker/DateRangePicker/StatefulDateRangePicker.js +8 -2
  102. package/lib/DatePicker/SingleDatePicker/SingleDatePicker.js +27 -14
  103. package/lib/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +8 -2
  104. package/lib/DatePicker/common.js +8 -6
  105. package/lib/Drawer/Drawer.js +159 -111
  106. package/lib/EmptyState/EmptyState.js +46 -31
  107. package/lib/Fieldset/Fieldset.js +33 -14
  108. package/lib/FormField/FormField.js +38 -31
  109. package/lib/Icon/Icon.js +36 -30
  110. package/lib/Image/Image.js +5 -3
  111. package/lib/Indicator/Indicator.js +13 -6
  112. package/lib/Input/Input.js +57 -49
  113. package/lib/KeyboardKey/KeyboardKey.js +12 -3
  114. package/lib/Label/Label.js +16 -9
  115. package/lib/Link/Link.js +11 -3
  116. package/lib/Listbox/Listbox.js +17 -13
  117. package/lib/Loader/Loader.js +9 -3
  118. package/lib/LoaderButton/LoaderButton.js +30 -18
  119. package/lib/Menu/Menu.js +128 -104
  120. package/lib/Menu/utils/descendants.js +5 -4
  121. package/lib/Message/Message.js +80 -59
  122. package/lib/Modal/Modal.js +56 -31
  123. package/lib/Modal/styles.js +8 -2
  124. package/lib/Numeral/Numeral.js +30 -11
  125. package/lib/PartnerLogo/PartnerLogo.js +22 -12
  126. package/lib/Radio/Radio.js +29 -22
  127. package/lib/SegmentedControl/SegmentedControl.js +40 -24
  128. package/lib/Select/Select.js +33 -25
  129. package/lib/SpotIllustration/SpotIllustration.js +13 -5
  130. package/lib/Stack/Stack.js +17 -8
  131. package/lib/Switch/Switch.js +15 -7
  132. package/lib/Table/Table.js +65 -43
  133. package/lib/TableCell/TableCell.js +5 -2
  134. package/lib/TableHeaderCell/TableHeaderCell.js +20 -11
  135. package/lib/TableRowAccordion/TableRowAccordion.js +35 -28
  136. package/lib/Tabs/Tabs.js +37 -30
  137. package/lib/Text/Text.js +11 -3
  138. package/lib/Textarea/Textarea.js +37 -30
  139. package/lib/ThemeProvider/index.js +8 -3
  140. package/lib/Toast/Toast.js +130 -90
  141. package/lib/Toast/index.js +3 -5
  142. package/lib/Toast/styles.js +55 -26
  143. package/lib/ToggleHint/ToggleHint.js +12 -5
  144. package/lib/Token/Token.js +42 -25
  145. package/lib/TokenInput/TokenInput.js +56 -47
  146. package/lib/TokenInput/TokenScreenReaderStatus.js +5 -3
  147. package/lib/Tooltip/Tooltip.js +34 -27
  148. package/package.json +37 -33
  149. package/commonjs/Drawer/SlideTransition.js +0 -47
  150. package/commonjs/Popout/Popout.js +0 -313
  151. package/commonjs/Popout/PopoutTypes.js +0 -5
  152. package/commonjs/Popout/index.js +0 -30
  153. package/commonjs/Popout/styles.js +0 -13
  154. package/dist/types/Drawer/SlideTransition.d.ts +0 -15
  155. package/dist/types/Drawer/SlideTransition.d.ts.map +0 -1
  156. package/dist/types/Popout/Popout.d.ts +0 -14
  157. package/dist/types/Popout/Popout.d.ts.map +0 -1
  158. package/dist/types/Popout/PopoutTypes.d.ts +0 -90
  159. package/dist/types/Popout/PopoutTypes.d.ts.map +0 -1
  160. package/dist/types/Popout/index.d.ts +0 -5
  161. package/dist/types/Popout/index.d.ts.map +0 -1
  162. package/dist/types/Popout/styles.d.ts +0 -2
  163. package/dist/types/Popout/styles.d.ts.map +0 -1
  164. package/lib/Drawer/SlideTransition.js +0 -38
  165. package/lib/Popout/Popout.js +0 -303
  166. package/lib/Popout/PopoutTypes.js +0 -1
  167. package/lib/Popout/index.js +0 -4
  168. package/lib/Popout/styles.js +0 -6
@@ -1,5 +1,10 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
2
  var _excluded = ["isLoading", "disabled", "loaderLabel", "children", "appearance"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
3
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
10
  import * as React from "react";
@@ -7,6 +12,8 @@ import styled from "styled-components";
7
12
  import Box from "../Box";
8
13
  import Button from "../Button";
9
14
  import Loader from "../Loader";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
17
  var StyledLoaderButton = styled(Button).withConfig({
11
18
  displayName: "LoaderButton__StyledLoaderButton",
12
19
  componentId: "sc-taipe0-0"
@@ -33,25 +40,30 @@ export var LoaderButton = function LoaderButton(_ref3) {
33
40
  _ref3$appearance = _ref3.appearance,
34
41
  appearance = _ref3$appearance === void 0 ? "unstyled" : _ref3$appearance,
35
42
  rest = _objectWithoutProperties(_ref3, _excluded);
36
- return /*#__PURE__*/React.createElement(StyledLoaderButton, _extends({
43
+ return /*#__PURE__*/_jsx(StyledLoaderButton, _objectSpread(_objectSpread({
37
44
  disabled: disabled || isLoading,
38
45
  appearance: appearance,
39
46
  "data-qa-button-isloading": isLoading === true
40
- }, rest), /*#__PURE__*/React.createElement(Box, {
41
- position: "relative"
42
- }, /*#__PURE__*/React.createElement(Box, {
43
- opacity: isLoading ? 0 : 1,
44
- "aria-hidden": isLoading
45
- }, children), isLoading && /*#__PURE__*/React.createElement(Box, {
46
- position: "absolute",
47
- top: -2,
48
- left: 0,
49
- right: 0,
50
- bottom: 0
51
- }, /*#__PURE__*/React.createElement(Loader, {
52
- text: loaderLabel,
53
- size: "small",
54
- delay: false
55
- }))));
47
+ }, rest), {}, {
48
+ children: /*#__PURE__*/_jsxs(Box, {
49
+ position: "relative",
50
+ children: [/*#__PURE__*/_jsx(Box, {
51
+ opacity: isLoading ? 0 : 1,
52
+ "aria-hidden": isLoading,
53
+ children: children
54
+ }), isLoading && /*#__PURE__*/_jsx(Box, {
55
+ position: "absolute",
56
+ top: -2,
57
+ left: 0,
58
+ right: 0,
59
+ bottom: 0,
60
+ children: /*#__PURE__*/_jsx(Loader, {
61
+ text: loaderLabel,
62
+ size: "small",
63
+ delay: false
64
+ })
65
+ })]
66
+ })
67
+ }));
56
68
  };
57
69
  export default LoaderButton;
package/lib/Menu/Menu.js CHANGED
@@ -12,7 +12,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
12
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
14
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
15
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
16
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
17
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -33,7 +32,7 @@ import Button from "../Button";
33
32
  import Checkbox from "@sproutsocial/seeds-react-checkbox";
34
33
  import Icon from "../Icon";
35
34
  import Input from "../Input";
36
- import Popout from "../Popout";
35
+ import Popout from "@sproutsocial/seeds-react-popout";
37
36
  import Radio from "../Radio";
38
37
  import Switch from "../Switch";
39
38
  import Text from "../Text";
@@ -41,6 +40,9 @@ import { MENU_ITEM_ROLES, MENU_ROLES, DescendantProvider, useDescendant, useDesc
41
40
  import { MenuItemContainer, MenuItemsContainer } from "./styles";
42
41
 
43
42
  // eslint-disable-next-line @typescript-eslint/no-empty-function
43
+ import { jsx as _jsx } from "react/jsx-runtime";
44
+ import { jsxs as _jsxs } from "react/jsx-runtime";
45
+ import { Fragment as _Fragment } from "react/jsx-runtime";
44
46
  var noop = function noop() {};
45
47
  var getMenuItemRole = function getMenuItemRole(menuRole) {
46
48
  switch (menuRole) {
@@ -161,7 +163,7 @@ export var MenuItem = function MenuItem(_ref) {
161
163
  var before = useMemo(function () {
162
164
  if (elemBefore) return elemBefore;
163
165
  if (itemRole === MENU_ITEM_ROLES.CHECKBOX) {
164
- return /*#__PURE__*/React.createElement(Checkbox, {
166
+ return /*#__PURE__*/_jsx(Checkbox, {
165
167
  id: "Checkbox-".concat(id),
166
168
  checked: isSelected,
167
169
  "aria-hidden": "true",
@@ -170,7 +172,7 @@ export var MenuItem = function MenuItem(_ref) {
170
172
  mr: 300
171
173
  });
172
174
  } else if (itemRole === MENU_ITEM_ROLES.RADIO) {
173
- return /*#__PURE__*/React.createElement(Radio, {
175
+ return /*#__PURE__*/_jsx(Radio, {
174
176
  id: "Radio-".concat(id),
175
177
  name: "Radio-".concat(id),
176
178
  checked: isSelected,
@@ -183,7 +185,7 @@ export var MenuItem = function MenuItem(_ref) {
183
185
  var after = useMemo(function () {
184
186
  if (elemAfter) return elemAfter;
185
187
  if (isSelected && !isCheckboxOrRadio) {
186
- return /*#__PURE__*/React.createElement(Icon, {
188
+ return /*#__PURE__*/_jsx(Icon, {
187
189
  name: "check-solid",
188
190
  "aria-hidden": true,
189
191
  size: "small",
@@ -191,9 +193,9 @@ export var MenuItem = function MenuItem(_ref) {
191
193
  });
192
194
  }
193
195
  }, [elemAfter, isCheckboxOrRadio, isSelected]);
194
- return /*#__PURE__*/React.createElement(MenuItemContainer, _extends({
196
+ return /*#__PURE__*/_jsx(MenuItemContainer, _objectSpread(_objectSpread({
195
197
  "data-qa-menu-item": label
196
- }, props, {
198
+ }, props), {}, {
197
199
  active: isActive,
198
200
  "data-qa-is-active": isActive,
199
201
  id: id,
@@ -215,33 +217,36 @@ export var MenuItem = function MenuItem(_ref) {
215
217
  onClick: !disabled ? handleClick : undefined,
216
218
  role: itemRole,
217
219
  selected: isSelected,
218
- tabIndex: itemRole !== MENU_ITEM_ROLES.LISTITEM && !disabled ? -1 : undefined
219
- }), /*#__PURE__*/React.createElement("div", {
220
- ref: ref,
221
- style: {
222
- display: "flex",
223
- alignItems: props.alignItems || "center",
224
- justifyContent: "space-between"
225
- }
226
- }, before, /*#__PURE__*/React.createElement("div", {
227
- style: {
228
- flexGrow: 1,
229
- wordBreak: "break-word",
230
- minWidth: 0
231
- }
232
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
233
- //@ts-ignore some legacy ref type mismatch between divs
234
- ,
235
- ref: textContent
236
- }, children), after));
220
+ tabIndex: itemRole !== MENU_ITEM_ROLES.LISTITEM && !disabled ? -1 : undefined,
221
+ children: /*#__PURE__*/_jsxs("div", {
222
+ ref: ref,
223
+ style: {
224
+ display: "flex",
225
+ alignItems: props.alignItems || "center",
226
+ justifyContent: "space-between"
227
+ },
228
+ children: [before, /*#__PURE__*/_jsx("div", {
229
+ style: {
230
+ flexGrow: 1,
231
+ wordBreak: "break-word",
232
+ minWidth: 0
233
+ }
234
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
235
+ //@ts-ignore some legacy ref type mismatch between divs
236
+ ,
237
+ ref: textContent,
238
+ children: children
239
+ }), after]
240
+ })
241
+ }));
237
242
  };
238
243
  export var MenuCheckbox = function MenuCheckbox(props) {
239
- return /*#__PURE__*/React.createElement(MenuItem, _extends({
244
+ return /*#__PURE__*/_jsx(MenuItem, _objectSpread({
240
245
  role: MENU_ITEM_ROLES.CHECKBOX
241
246
  }, props));
242
247
  };
243
248
  export var MenuRadio = function MenuRadio(props) {
244
- return /*#__PURE__*/React.createElement(MenuItem, _extends({
249
+ return /*#__PURE__*/_jsx(MenuItem, _objectSpread({
245
250
  role: MENU_ITEM_ROLES.RADIO
246
251
  }, props));
247
252
  };
@@ -261,7 +266,7 @@ export var MenuSwitch = function MenuSwitch(props) {
261
266
  return id || uniqueId("MenuItem-");
262
267
  }, [id]);
263
268
  var labelId = "".concat(menuItemId, "-label");
264
- var switchElement = /*#__PURE__*/React.createElement(Switch, _extends({
269
+ var switchElement = /*#__PURE__*/_jsx(Switch, _objectSpread(_objectSpread(_objectSpread({
265
270
  id: "".concat(menuItemId, "-switch"),
266
271
  checked: props.selected || isValueSelected(menuValue, props.value),
267
272
  "aria-hidden": "true",
@@ -271,7 +276,7 @@ export var MenuSwitch = function MenuSwitch(props) {
271
276
  mr: 300
272
277
  } : {
273
278
  ml: 300
274
- }, switchProps, {
279
+ }), switchProps), {}, {
275
280
  // This prop is passed after switchProps to disallow overrides.
276
281
  onClick: noop
277
282
  }));
@@ -280,15 +285,17 @@ export var MenuSwitch = function MenuSwitch(props) {
280
285
  label: label,
281
286
  elemBefore: placement === "before" ? switchElement : undefined,
282
287
  // Empty fragment prevents a check icon in elemAfter when the switch is checked. Can be overridden.
283
- elemAfter: placement === "before" ? /*#__PURE__*/React.createElement(React.Fragment, null) : switchElement
288
+ elemAfter: placement === "before" ? /*#__PURE__*/_jsx(_Fragment, {}) : switchElement
284
289
  }, rest);
285
- return /*#__PURE__*/React.createElement(MenuItem, menuItemProps, /*#__PURE__*/React.createElement(Text, _extends({
286
- id: labelId
287
- }, labelProps, {
288
- // This prop is passed after labelProps to disallow overrides.
289
- // Fall back to the label prop if children is falsy.
290
- children: children || label
291
- })));
290
+ return /*#__PURE__*/_jsx(MenuItem, _objectSpread(_objectSpread({}, menuItemProps), {}, {
291
+ children: /*#__PURE__*/_jsx(Text, _objectSpread(_objectSpread({
292
+ id: labelId
293
+ }, labelProps), {}, {
294
+ // This prop is passed after labelProps to disallow overrides.
295
+ // Fall back to the label prop if children is falsy.
296
+ children: children || label
297
+ }))
298
+ }));
292
299
  };
293
300
  var MenuTitle = styled(Text).withConfig({
294
301
  displayName: "Menu__MenuTitle",
@@ -322,22 +329,27 @@ export var MenuGroup = function MenuGroup(_ref6) {
322
329
  var menuTitleId = useMemo(function () {
323
330
  return uniqueId("menu-title-");
324
331
  }, []);
325
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, _extends({
326
- p: 300,
327
- role: "group",
328
- "aria-labelledby": title ? menuTitleId : undefined,
329
- borderTop: "1px solid",
330
- borderColor: "container.border.base"
331
- }, props), title && /*#__PURE__*/React.createElement(_StyledMenuTitle, {
332
- id: menuTitleId,
333
- role: "presentation",
334
- fontSize: 200,
335
- forwardedAs: titleAs || "li",
336
- $_css: isDisabled ? disabled : undefined
337
- }, title), children));
332
+ return /*#__PURE__*/_jsx(_Fragment, {
333
+ children: /*#__PURE__*/_jsxs(Box, _objectSpread(_objectSpread({
334
+ p: 300,
335
+ role: "group",
336
+ "aria-labelledby": title ? menuTitleId : undefined,
337
+ borderTop: "1px solid",
338
+ borderColor: "container.border.base"
339
+ }, props), {}, {
340
+ children: [title && /*#__PURE__*/_jsx(_StyledMenuTitle, {
341
+ id: menuTitleId,
342
+ role: "presentation",
343
+ fontSize: 200,
344
+ forwardedAs: titleAs || "li",
345
+ $_css: isDisabled ? disabled : undefined,
346
+ children: title
347
+ }), children]
348
+ }))
349
+ });
338
350
  };
339
351
  export var MenuDivider = function MenuDivider(props) {
340
- return /*#__PURE__*/React.createElement(Box, _extends({
352
+ return /*#__PURE__*/_jsx(Box, _objectSpread({
341
353
  as: "li",
342
354
  role: "separator",
343
355
  borderTop: "1px solid",
@@ -372,7 +384,7 @@ var MenuFilterInput = function MenuFilterInput(_ref7) {
372
384
  isFilterInputFocused: false
373
385
  });
374
386
  }, [setState, onBlur]);
375
- return /*#__PURE__*/React.createElement(Input, _extends({}, props, {
387
+ return /*#__PURE__*/_jsx(Input, _objectSpread(_objectSpread({}, props), {}, {
376
388
  type: type,
377
389
  value: state.filterQuery,
378
390
  onChange: handleOnChange,
@@ -389,7 +401,7 @@ var MenuItems = function MenuItems(_ref8) {
389
401
  var _useMenuKeyDown = useMenuKeyDown(),
390
402
  handleKeyDown = _useMenuKeyDown.handleKeyDown,
391
403
  activeDescendent = _useMenuKeyDown.activeDescendent;
392
- return /*#__PURE__*/React.createElement(MenuItemsContainer, _extends({}, props, {
404
+ return /*#__PURE__*/_jsx(MenuItemsContainer, _objectSpread(_objectSpread({}, props), {}, {
393
405
  forwardedAs: "ul",
394
406
  ref: innerRef,
395
407
  role: role
@@ -402,8 +414,9 @@ var MenuItems = function MenuItems(_ref8) {
402
414
  onKeyDown: handleKeyDown,
403
415
  margin: 0,
404
416
  padding: 0,
405
- overflow: "hidden"
406
- }), children);
417
+ overflow: "hidden",
418
+ children: children
419
+ }));
407
420
  };
408
421
  var MenuFooter = function MenuFooter(_ref9) {
409
422
  var children = _ref9.children;
@@ -419,10 +432,11 @@ var MenuFooter = function MenuFooter(_ref9) {
419
432
  isFooterFocused: true
420
433
  });
421
434
  }, [setState]);
422
- return /*#__PURE__*/React.createElement(Box, {
435
+ return /*#__PURE__*/_jsx(Box, {
423
436
  onBlur: handleOnBlur,
424
- onFocus: handleOnFocus
425
- }, children);
437
+ onFocus: handleOnFocus,
438
+ children: children
439
+ });
426
440
  };
427
441
  export var Menu = function Menu(_ref10) {
428
442
  var _ref10$role = _ref10.role,
@@ -453,28 +467,33 @@ export var Menu = function Menu(_ref10) {
453
467
  var setContextState = useCallback(function (newState) {
454
468
  setState(_objectSpread(_objectSpread({}, state), newState));
455
469
  }, [state]);
456
- return /*#__PURE__*/React.createElement(DescendantProvider, {
470
+ return /*#__PURE__*/_jsx(DescendantProvider, {
457
471
  context: MenuDescendantContext,
458
472
  items: descendants,
459
- set: setDescendants
460
- }, /*#__PURE__*/React.createElement(MenuContext.Provider, {
461
- value: {
462
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
463
- // @ts-ignore
464
- menuRef: innerRef || menuRef,
465
- role: role,
466
- onChange: onChange,
467
- value: value,
468
- multiselect: multiselect,
469
- state: state,
470
- setState: setContextState,
471
- selectCallbacks: selectCallbacks
472
- }
473
- }, /*#__PURE__*/React.createElement(MenuItems, _extends({}, props, {
474
- role: role,
475
- multiselect: multiselect,
476
- innerRef: menuRef
477
- }), children), footerContent ? /*#__PURE__*/React.createElement(MenuFooter, null, footerContent) : null));
473
+ set: setDescendants,
474
+ children: /*#__PURE__*/_jsxs(MenuContext.Provider, {
475
+ value: {
476
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
477
+ // @ts-ignore
478
+ menuRef: innerRef || menuRef,
479
+ role: role,
480
+ onChange: onChange,
481
+ value: value,
482
+ multiselect: multiselect,
483
+ state: state,
484
+ setState: setContextState,
485
+ selectCallbacks: selectCallbacks
486
+ },
487
+ children: [/*#__PURE__*/_jsx(MenuItems, _objectSpread(_objectSpread({}, props), {}, {
488
+ role: role,
489
+ multiselect: multiselect,
490
+ innerRef: menuRef,
491
+ children: children
492
+ })), footerContent ? /*#__PURE__*/_jsx(MenuFooter, {
493
+ children: footerContent
494
+ }) : null]
495
+ })
496
+ });
478
497
  };
479
498
  MenuGroup.displayName = "Menu.Group";
480
499
  MenuItem.displayName = "Menu.Item";
@@ -525,34 +544,39 @@ export var MenuButton = function MenuButton(_ref11) {
525
544
  }, [setIsShown]);
526
545
  var ariaLabelledBy = props["aria-labelledby"] ? "".concat(props["aria-labelledby"], " ").concat(id) : undefined;
527
546
  var ariaLabel = props["aria-label"] ? "".concat(props["aria-label"], " ").concat(innerText(children)) : undefined;
528
- return /*#__PURE__*/React.createElement(MenuButtonContext.Provider, {
547
+ return /*#__PURE__*/_jsx(MenuButtonContext.Provider, {
529
548
  value: {
530
549
  closePopout: closePopout,
531
550
  closeOnItemClick: closeOnItemClick
532
- }
533
- }, /*#__PURE__*/React.createElement(Popout, _extends({
534
- isOpen: isShown,
535
- setIsOpen: setIsShown,
536
- content: /*#__PURE__*/React.createElement(CustomPopoutContent, null, content),
537
- placement: placement
538
- }, popoutProps, {
539
- width: props.width
540
- }), /*#__PURE__*/React.createElement(Button, _extends({}, props, {
541
- id: id,
542
- "aria-labelledby": ariaLabelledBy === null || ariaLabelledBy === void 0 ? void 0 : ariaLabelledBy.trim(),
543
- "aria-label": ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim(),
544
- active: isShown,
545
- onKeyDown: function onKeyDown(e) {
546
- if (e.key === "ArrowUp" || e.key === "ArrowDown") {
547
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
548
- _onClick && _onClick(e); // @ts-notes unfortunately we're passing in a keyboard event here and not the mouse event it expects, so no way to coerce it
549
- setIsShown(true);
550
- }
551
551
  },
552
- onClick: function onClick(e) {
553
- _onClick && _onClick(e);
554
- setIsShown(!isShown);
555
- }
556
- }), children)));
552
+ children: /*#__PURE__*/_jsx(Popout, _objectSpread(_objectSpread({
553
+ isOpen: isShown,
554
+ setIsOpen: setIsShown,
555
+ content: /*#__PURE__*/_jsx(CustomPopoutContent, {
556
+ children: content
557
+ }),
558
+ placement: placement
559
+ }, popoutProps), {}, {
560
+ width: props.width,
561
+ children: /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, props), {}, {
562
+ id: id,
563
+ "aria-labelledby": ariaLabelledBy === null || ariaLabelledBy === void 0 ? void 0 : ariaLabelledBy.trim(),
564
+ "aria-label": ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim(),
565
+ active: isShown,
566
+ onKeyDown: function onKeyDown(e) {
567
+ if (e.key === "ArrowUp" || e.key === "ArrowDown") {
568
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
569
+ _onClick && _onClick(e); // @ts-notes unfortunately we're passing in a keyboard event here and not the mouse event it expects, so no way to coerce it
570
+ setIsShown(true);
571
+ }
572
+ },
573
+ onClick: function onClick(e) {
574
+ _onClick && _onClick(e);
575
+ setIsShown(!isShown);
576
+ },
577
+ children: children
578
+ }))
579
+ }))
580
+ });
557
581
  };
558
582
  export default Menu;
@@ -27,7 +27,7 @@ import { createContext, useState, useLayoutEffect, useEffect, useContext, useCal
27
27
  * pre-release and unstable, so instead of importing it, we copied it here and changed the types from TypeScript to
28
28
  * Flow. If the package ever stabilizes, we can import these functions from there and remove this file.
29
29
  */
30
-
30
+ import { jsx as _jsx } from "react/jsx-runtime";
31
31
  var noop = function noop() {};
32
32
 
33
33
  /**
@@ -229,9 +229,10 @@ export function DescendantProvider(_ref2) {
229
229
  unregisterDescendant: unregisterDescendant
230
230
  };
231
231
  }, [items, registerDescendant, unregisterDescendant]);
232
- return /*#__PURE__*/React.createElement(Ctx.Provider, {
233
- value: value
234
- }, children);
232
+ return /*#__PURE__*/_jsx(Ctx.Provider, {
233
+ value: value,
234
+ children: children
235
+ });
235
236
  }
236
237
  export function useDescendantKeyDown(context, options) {
237
238
  var _useContext2 = useContext(context),