@sproutsocial/racine 12.22.0 → 12.23.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 (333) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -0
  3. package/__flow__/Avatar/__tests__/features.test.js +98 -0
  4. package/__flow__/Banner/index.js +2 -1
  5. package/__flow__/CharacterCounter/index.test.js +1 -1
  6. package/__flow__/Collapsible/index.js +2 -2
  7. package/__flow__/Drawer/index.js +11 -0
  8. package/__flow__/Drawer/index.stories.js +2 -1
  9. package/__flow__/EmptyState/index.test.js +1 -1
  10. package/__flow__/EnumIllustrationNames.js +1 -1
  11. package/__flow__/Fieldset/index.js +1 -1
  12. package/__flow__/IllustrationViewBoxes.js +1 -1
  13. package/__flow__/Indicator/index.js +1 -1
  14. package/__flow__/Input/index.js +2 -1
  15. package/__flow__/Link/index.js +2 -1
  16. package/__flow__/Link/index.test.js +2 -0
  17. package/__flow__/Listbox/index.stories.js +1 -0
  18. package/__flow__/Loader/index.js +1 -1
  19. package/__flow__/Modal/index.stories.js +1 -1
  20. package/__flow__/Numeral/tests/testNumeral.js +1 -0
  21. package/__flow__/Popout/index.js +1 -1
  22. package/__flow__/Portal/index.stories.js +7 -7
  23. package/__flow__/SegmentedControl/index.js +1 -1
  24. package/__flow__/SpotIllustration/illustrationNames.js +1 -0
  25. package/__flow__/SpotIllustration/spotIllustrations/campaign-tag.svg +6 -0
  26. package/__flow__/SpotIllustration/spotIllustrations/tag.svg +4 -4
  27. package/__flow__/Table/index.js +4 -4
  28. package/__flow__/TableCell/index.js +1 -1
  29. package/__flow__/TableHeaderCell/index.js +1 -1
  30. package/__flow__/Tabs/index.js +1 -1
  31. package/__flow__/Textarea/index.js +1 -1
  32. package/__flow__/Toast/index.js +1 -1
  33. package/__flow__/Toast/styles.js +1 -1
  34. package/__flow__/TokenInput/index.stories.js +4 -4
  35. package/__flow__/TokenInput/tests/default/pasting.test.js +6 -2
  36. package/__flow__/code-guidelines.mdx +244 -0
  37. package/__flow__/setupTests.js +1 -0
  38. package/__flow__/utils/a11yTest.js +1 -0
  39. package/__flow__/utils/system-props.js +1 -0
  40. package/commonjs/Avatar/index.js +19 -10
  41. package/commonjs/Badge/constants.js +3 -1
  42. package/commonjs/Badge/index.js +7 -3
  43. package/commonjs/Badge/styles.js +4 -2
  44. package/commonjs/Banner/index.js +9 -4
  45. package/commonjs/Banner/styles.js +5 -2
  46. package/commonjs/Box/index.js +5 -2
  47. package/commonjs/Box/styles.js +3 -1
  48. package/commonjs/Breadcrumb/index.js +12 -5
  49. package/commonjs/Breadcrumb/styles.js +3 -1
  50. package/commonjs/Button/index.js +7 -3
  51. package/commonjs/Button/styles.js +6 -3
  52. package/commonjs/Card/index.js +7 -3
  53. package/commonjs/Card/styles.js +3 -1
  54. package/commonjs/CharacterCounter/index.js +39 -22
  55. package/commonjs/CharacterCounter/styles.js +5 -2
  56. package/commonjs/ChartLegend/index.js +7 -3
  57. package/commonjs/ChartLegend/styles.js +5 -2
  58. package/commonjs/Checkbox/index.js +117 -97
  59. package/commonjs/Checkbox/styles.js +5 -2
  60. package/commonjs/Collapsible/index.js +27 -12
  61. package/commonjs/Collapsible/styles.js +4 -2
  62. package/commonjs/DatePicker/DateRangePicker.js +7 -3
  63. package/commonjs/DatePicker/SingleDatePicker.js +7 -3
  64. package/commonjs/DatePicker/StatefulDateRangePicker.js +19 -7
  65. package/commonjs/DatePicker/StatefulSingleDatePicker.js +16 -5
  66. package/commonjs/DatePicker/common.js +4 -2
  67. package/commonjs/DatePicker/index.js +15 -3
  68. package/commonjs/DatePicker/styles.js +5 -2
  69. package/commonjs/Drawer/SlideTransition.js +9 -5
  70. package/commonjs/Drawer/index.js +15 -7
  71. package/commonjs/Drawer/styles.js +5 -2
  72. package/commonjs/EmptyState/index.js +7 -3
  73. package/commonjs/Fieldset/index.js +10 -6
  74. package/commonjs/Fieldset/styles.js +5 -2
  75. package/commonjs/FormField/index.js +17 -6
  76. package/commonjs/Icon/deprecatedIcons.js +3 -1
  77. package/commonjs/Icon/index.js +9 -5
  78. package/commonjs/Icon/styles.js +6 -3
  79. package/commonjs/IllustrationViewBoxes.js +2 -1
  80. package/commonjs/Image/index.js +78 -58
  81. package/commonjs/Image/styles.js +5 -2
  82. package/commonjs/Indicator/index.js +40 -23
  83. package/commonjs/Indicator/styles.js +4 -2
  84. package/commonjs/Input/index.js +156 -132
  85. package/commonjs/Input/styles.js +5 -2
  86. package/commonjs/KeyboardKey/index.js +30 -14
  87. package/commonjs/KeyboardKey/styles.js +3 -1
  88. package/commonjs/Label/index.js +32 -16
  89. package/commonjs/Link/constants.js +3 -1
  90. package/commonjs/Link/index.js +9 -4
  91. package/commonjs/Link/styles.js +5 -2
  92. package/commonjs/Listbox/index.js +15 -8
  93. package/commonjs/Loader/index.js +43 -26
  94. package/commonjs/Loader/styles.js +5 -2
  95. package/commonjs/LoaderButton/index.js +7 -3
  96. package/commonjs/Menu/constants.js +3 -1
  97. package/commonjs/Menu/descendants.js +35 -20
  98. package/commonjs/Menu/hooks.js +8 -8
  99. package/commonjs/Menu/index.flow.js +2 -1
  100. package/commonjs/Menu/index.js +44 -27
  101. package/commonjs/Menu/names.js +3 -1
  102. package/commonjs/Menu/styles.js +6 -3
  103. package/commonjs/Message/index.js +7 -3
  104. package/commonjs/Message/styles.js +4 -2
  105. package/commonjs/Modal/index.js +9 -5
  106. package/commonjs/Modal/styles.js +9 -5
  107. package/commonjs/Numeral/constants.js +3 -1
  108. package/commonjs/Numeral/index.js +16 -5
  109. package/commonjs/Numeral/styles.js +3 -1
  110. package/commonjs/Numeral/tests/testNumeral.js +16 -11
  111. package/commonjs/OverflowList/index.flow.js +2 -1
  112. package/commonjs/OverflowList/index.js +6 -3
  113. package/commonjs/OverflowList/styles.js +5 -2
  114. package/commonjs/PartnerLogo/index.js +9 -6
  115. package/commonjs/PartnerLogo/styles.js +5 -2
  116. package/commonjs/Popout/index.js +28 -13
  117. package/commonjs/Popout/styles.js +3 -1
  118. package/commonjs/Portal/index.js +50 -30
  119. package/commonjs/Radio/index.js +73 -56
  120. package/commonjs/Radio/styles.js +5 -2
  121. package/commonjs/SegmentedControl/index.js +21 -9
  122. package/commonjs/SegmentedControl/styles.js +5 -2
  123. package/commonjs/Select/index.js +78 -61
  124. package/commonjs/Select/styles.js +8 -5
  125. package/commonjs/Skeleton/index.js +4 -2
  126. package/commonjs/SpotIllustration/illustrationNames.js +4 -2
  127. package/commonjs/SpotIllustration/index.js +5 -3
  128. package/commonjs/Stack/index.js +7 -3
  129. package/commonjs/Switch/index.js +52 -35
  130. package/commonjs/Switch/styles.js +6 -3
  131. package/commonjs/Table/index.js +14 -10
  132. package/commonjs/Table/styles.js +3 -1
  133. package/commonjs/TableCell/index.js +39 -23
  134. package/commonjs/TableCell/styles.js +3 -1
  135. package/commonjs/TableHeaderCell/index.js +54 -37
  136. package/commonjs/TableHeaderCell/styles.js +5 -2
  137. package/commonjs/TableRowAccordion/index.js +61 -44
  138. package/commonjs/TableRowAccordion/styles.js +5 -2
  139. package/commonjs/Tabs/index.js +116 -90
  140. package/commonjs/Tabs/styles.js +8 -5
  141. package/commonjs/Text/index.js +7 -3
  142. package/commonjs/Text/styles.js +5 -2
  143. package/commonjs/Textarea/index.js +104 -87
  144. package/commonjs/Textarea/styles.js +5 -2
  145. package/commonjs/ThemeProvider/index.js +5 -2
  146. package/commonjs/Toast/index.js +7 -8
  147. package/commonjs/Toast/styles.js +5 -2
  148. package/commonjs/ToggleHint/index.js +43 -26
  149. package/commonjs/ToggleHint/styles.js +6 -3
  150. package/commonjs/Token/index.js +7 -3
  151. package/commonjs/Token/styles.js +5 -2
  152. package/commonjs/TokenInput/index.js +221 -192
  153. package/commonjs/TokenInput/styles.js +5 -2
  154. package/commonjs/TokenInput/util.js +5 -3
  155. package/commonjs/Tooltip/index.js +30 -14
  156. package/commonjs/Tooltip/styles.js +3 -1
  157. package/commonjs/VisuallyHidden/index.js +3 -1
  158. package/commonjs/dataviz/index.js +3 -1
  159. package/commonjs/index.js +451 -84
  160. package/commonjs/systemProps/background.js +3 -1
  161. package/commonjs/systemProps/border.js +3 -1
  162. package/commonjs/systemProps/color.js +3 -1
  163. package/commonjs/systemProps/custom.js +3 -1
  164. package/commonjs/systemProps/flexbox.js +3 -1
  165. package/commonjs/systemProps/grid.js +3 -1
  166. package/commonjs/systemProps/index.js +87 -15
  167. package/commonjs/systemProps/layout.js +3 -1
  168. package/commonjs/systemProps/position.js +3 -1
  169. package/commonjs/systemProps/shadow.js +3 -1
  170. package/commonjs/systemProps/space.js +3 -1
  171. package/commonjs/systemProps/systemProps.js +3 -1
  172. package/commonjs/systemProps/typography.js +3 -1
  173. package/commonjs/systemProps/variant.js +3 -1
  174. package/commonjs/themes/dark/dataviz-palette.js +3 -1
  175. package/commonjs/themes/dark/decorative-palettes.js +3 -1
  176. package/commonjs/themes/dark/theme.js +11 -7
  177. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +9 -5
  178. package/commonjs/themes/extendedThemes/sproutTheme/index.js +15 -4
  179. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +8 -4
  180. package/commonjs/themes/light/dataviz-palette.js +3 -1
  181. package/commonjs/themes/light/decorative-palettes.js +3 -1
  182. package/commonjs/themes/light/literal-colors.js +3 -1
  183. package/commonjs/themes/light/theme.js +17 -13
  184. package/commonjs/utils/a11yTest.js +5 -2
  185. package/commonjs/utils/chartColors.js +3 -1
  186. package/commonjs/utils/constants.js +3 -1
  187. package/commonjs/utils/dataQaLabelQueries.js +26 -16
  188. package/commonjs/utils/hooks.js +39 -26
  189. package/commonjs/utils/index.js +18 -8
  190. package/commonjs/utils/innerText.js +4 -2
  191. package/commonjs/utils/mixins.js +3 -1
  192. package/commonjs/utils/react-testing-library.js +74 -18
  193. package/commonjs/utils/responsiveProps/index.js +16 -8
  194. package/commonjs/utils/system-props.js +6 -2
  195. package/commonjs/utils/useInteractiveColor.js +3 -1
  196. package/dist/illustration.svg +1 -1
  197. package/dist/illustrationList.js +1 -1
  198. package/dist/themes/dark/theme.scss +0 -1
  199. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +0 -1
  200. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +0 -1
  201. package/dist/themes/light/theme.scss +0 -1
  202. package/lib/Avatar/index.js +17 -11
  203. package/lib/Badge/index.js +5 -4
  204. package/lib/Badge/styles.js +3 -3
  205. package/lib/Banner/index.js +7 -5
  206. package/lib/Banner/styles.js +1 -1
  207. package/lib/Box/index.js +1 -1
  208. package/lib/Box/styles.js +1 -1
  209. package/lib/Breadcrumb/index.js +11 -7
  210. package/lib/Button/index.js +3 -2
  211. package/lib/Button/styles.js +4 -4
  212. package/lib/Card/index.js +3 -2
  213. package/lib/Card/styles.js +2 -2
  214. package/lib/CharacterCounter/index.js +36 -21
  215. package/lib/CharacterCounter/styles.js +1 -1
  216. package/lib/ChartLegend/index.js +5 -4
  217. package/lib/ChartLegend/styles.js +1 -1
  218. package/lib/Checkbox/index.js +114 -96
  219. package/lib/Checkbox/styles.js +5 -5
  220. package/lib/Collapsible/index.js +24 -12
  221. package/lib/Collapsible/styles.js +2 -2
  222. package/lib/DatePicker/DateRangePicker.js +4 -3
  223. package/lib/DatePicker/SingleDatePicker.js +4 -3
  224. package/lib/DatePicker/StatefulDateRangePicker.js +15 -6
  225. package/lib/DatePicker/StatefulSingleDatePicker.js +12 -4
  226. package/lib/DatePicker/common.js +3 -3
  227. package/lib/DatePicker/index.js +2 -2
  228. package/lib/DatePicker/styles.js +2 -2
  229. package/lib/Drawer/SlideTransition.js +4 -3
  230. package/lib/Drawer/index.js +17 -12
  231. package/lib/Drawer/styles.js +2 -2
  232. package/lib/EmptyState/index.js +4 -3
  233. package/lib/Fieldset/index.js +8 -7
  234. package/lib/Fieldset/styles.js +1 -1
  235. package/lib/FormField/index.js +17 -9
  236. package/lib/Icon/index.js +8 -7
  237. package/lib/Icon/styles.js +2 -2
  238. package/lib/IllustrationViewBoxes.js +2 -1
  239. package/lib/Image/index.js +75 -57
  240. package/lib/Image/styles.js +1 -1
  241. package/lib/Indicator/index.js +38 -23
  242. package/lib/Indicator/styles.js +3 -3
  243. package/lib/Input/index.js +157 -135
  244. package/lib/Input/styles.js +2 -2
  245. package/lib/KeyboardKey/index.js +28 -14
  246. package/lib/KeyboardKey/styles.js +1 -1
  247. package/lib/Label/index.js +29 -15
  248. package/lib/Link/index.js +5 -3
  249. package/lib/Link/styles.js +3 -3
  250. package/lib/Listbox/index.js +14 -10
  251. package/lib/Loader/index.js +40 -25
  252. package/lib/Loader/styles.js +2 -2
  253. package/lib/LoaderButton/index.js +5 -4
  254. package/lib/Menu/descendants.js +30 -18
  255. package/lib/Menu/hooks.js +7 -9
  256. package/lib/Menu/index.flow.js +4 -4
  257. package/lib/Menu/index.js +54 -40
  258. package/lib/Menu/styles.js +3 -3
  259. package/lib/Message/index.js +6 -5
  260. package/lib/Message/styles.js +4 -4
  261. package/lib/Modal/index.js +9 -8
  262. package/lib/Modal/styles.js +6 -5
  263. package/lib/Numeral/index.js +15 -7
  264. package/lib/Numeral/styles.js +1 -1
  265. package/lib/Numeral/tests/testNumeral.js +15 -11
  266. package/lib/OverflowList/index.js +3 -3
  267. package/lib/OverflowList/styles.js +1 -1
  268. package/lib/PartnerLogo/index.js +8 -7
  269. package/lib/PartnerLogo/styles.js +1 -1
  270. package/lib/Popout/index.js +27 -15
  271. package/lib/Popout/styles.js +1 -1
  272. package/lib/Portal/index.js +47 -29
  273. package/lib/Radio/index.js +70 -55
  274. package/lib/Radio/styles.js +3 -3
  275. package/lib/SegmentedControl/index.js +18 -9
  276. package/lib/SegmentedControl/styles.js +3 -3
  277. package/lib/Select/index.js +76 -61
  278. package/lib/Select/styles.js +5 -5
  279. package/lib/Skeleton/index.js +2 -2
  280. package/lib/SpotIllustration/illustrationNames.js +1 -1
  281. package/lib/SpotIllustration/index.js +3 -3
  282. package/lib/Stack/index.js +4 -3
  283. package/lib/Switch/index.js +51 -36
  284. package/lib/Switch/styles.js +4 -4
  285. package/lib/Table/index.js +12 -11
  286. package/lib/Table/styles.js +1 -1
  287. package/lib/TableCell/index.js +36 -22
  288. package/lib/TableCell/styles.js +1 -1
  289. package/lib/TableHeaderCell/index.js +52 -37
  290. package/lib/TableHeaderCell/styles.js +1 -1
  291. package/lib/TableRowAccordion/index.js +60 -45
  292. package/lib/TableRowAccordion/styles.js +1 -1
  293. package/lib/Tabs/index.js +113 -89
  294. package/lib/Tabs/styles.js +5 -5
  295. package/lib/Text/index.js +3 -2
  296. package/lib/Text/styles.js +1 -1
  297. package/lib/Textarea/index.js +101 -86
  298. package/lib/Textarea/styles.js +2 -2
  299. package/lib/ThemeProvider/index.js +1 -1
  300. package/lib/Toast/index.js +6 -10
  301. package/lib/Toast/styles.js +4 -3
  302. package/lib/ToggleHint/index.js +41 -26
  303. package/lib/ToggleHint/styles.js +3 -3
  304. package/lib/Token/index.js +6 -5
  305. package/lib/Token/styles.js +3 -3
  306. package/lib/TokenInput/index.js +223 -196
  307. package/lib/TokenInput/styles.js +2 -2
  308. package/lib/TokenInput/util.js +2 -2
  309. package/lib/Tooltip/index.js +28 -14
  310. package/lib/Tooltip/styles.js +1 -1
  311. package/lib/VisuallyHidden/index.js +1 -1
  312. package/lib/dataviz/index.js +1 -1
  313. package/lib/index.js +64 -64
  314. package/lib/systemProps/index.js +14 -14
  315. package/lib/systemProps/systemProps.js +12 -12
  316. package/lib/themes/dark/theme.js +11 -9
  317. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +7 -5
  318. package/lib/themes/extendedThemes/sproutTheme/index.js +2 -2
  319. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +6 -4
  320. package/lib/themes/light/theme.js +17 -15
  321. package/lib/types/theme.colors.flow.js +2 -2
  322. package/lib/types/theme.flow.js +2 -2
  323. package/lib/utils/a11yTest.js +3 -1
  324. package/lib/utils/dataQaLabelQueries.js +23 -15
  325. package/lib/utils/hooks.js +37 -26
  326. package/lib/utils/index.js +15 -7
  327. package/lib/utils/innerText.js +1 -1
  328. package/lib/utils/mixins.js +1 -1
  329. package/lib/utils/react-testing-library.js +11 -8
  330. package/lib/utils/responsiveProps/index.js +14 -8
  331. package/lib/utils/system-props.js +1 -0
  332. package/package.json +16 -27
  333. package/__flow__/Avatar/index.test.js +0 -23
@@ -1,18 +1,22 @@
1
1
  var _excluded = ["role", "children"],
2
2
  _excluded2 = ["children"];
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
6
  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); }
7
+ 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
8
  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
9
  import * as React from 'react';
6
10
  import styled, { css } from 'styled-components';
7
- import Menu, { MenuButton } from '../Menu';
8
- import { Arrow } from '../Select/styles';
9
- import Icon from '../Icon';
10
- import { MENU_ROLES } from '../Menu/constants';
11
+ import Menu, { MenuButton } from "../Menu";
12
+ import { Arrow } from "../Select/styles";
13
+ import Icon from "../Icon";
14
+ import { MENU_ROLES } from "../Menu/constants";
11
15
  export var Listbox = function Listbox(_ref) {
12
16
  var _ref$role = _ref.role,
13
17
  role = _ref$role === void 0 ? MENU_ROLES.LISTBOX : _ref$role,
14
18
  children = _ref.children,
15
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
19
+ rest = _objectWithoutProperties(_ref, _excluded);
16
20
  return /*#__PURE__*/React.createElement(Menu, _extends({}, rest, {
17
21
  role: role
18
22
  }), children);
@@ -50,12 +54,12 @@ export var ListboxButtonContainer = styled(MenuButton).withConfig({
50
54
  }, function (props) {
51
55
  switch (props.size) {
52
56
  case 'large':
53
- return props.theme.space[400] + " " + props.theme.space[600] + " " + props.theme.space[400] + " " + props.theme.space[400];
57
+ return "".concat(props.theme.space[400], " ").concat(props.theme.space[600], " ").concat(props.theme.space[400], " ").concat(props.theme.space[400]);
54
58
  case 'small':
55
- return props.theme.space[200] + " " + props.theme.space[500] + " " + props.theme.space[200] + " " + props.theme.space[200];
59
+ return "".concat(props.theme.space[200], " ").concat(props.theme.space[500], " ").concat(props.theme.space[200], " ").concat(props.theme.space[200]);
56
60
  case 'default':
57
61
  default:
58
- return props.theme.space[300] + " " + props.theme.space[500] + " " + props.theme.space[300] + " " + props.theme.space[300];
62
+ return "".concat(props.theme.space[300], " ").concat(props.theme.space[500], " ").concat(props.theme.space[300], " ").concat(props.theme.space[300]);
59
63
  }
60
64
  }, function (props) {
61
65
  switch (props.size) {
@@ -75,9 +79,9 @@ export var ListboxButtonContainer = styled(MenuButton).withConfig({
75
79
  });
76
80
  export var ListboxButton = function ListboxButton(_ref2) {
77
81
  var children = _ref2.children,
78
- restProps = _objectWithoutPropertiesLoose(_ref2, _excluded2);
82
+ restProps = _objectWithoutProperties(_ref2, _excluded2);
79
83
  return /*#__PURE__*/React.createElement(ListboxButtonContainer, _extends({}, restProps, {
80
- popoutProps: _extends({
84
+ popoutProps: _objectSpread({
81
85
  placement: 'bottom-start'
82
86
  }, restProps.popoutProps || {})
83
87
  }), children, /*#__PURE__*/React.createElement(Arrow, {
@@ -1,40 +1,55 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  var _excluded = ["text", "size", "delay", "color", "qa"];
2
3
  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); }
4
+ 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; }
3
5
  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; }
4
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
5
10
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
11
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
13
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
17
  import * as React from 'react';
7
- import Container, { Text } from './styles';
18
+ import Container, { Text } from "./styles";
8
19
  var Loader = /*#__PURE__*/function (_React$Component) {
9
- _inheritsLoose(Loader, _React$Component);
20
+ _inherits(Loader, _React$Component);
21
+ var _super = _createSuper(Loader);
10
22
  function Loader() {
11
- return _React$Component.apply(this, arguments) || this;
23
+ _classCallCheck(this, Loader);
24
+ return _super.apply(this, arguments);
12
25
  }
13
- var _proto = Loader.prototype;
14
- _proto.render = function render() {
15
- var _this$props = this.props,
16
- text = _this$props.text,
17
- size = _this$props.size,
18
- delay = _this$props.delay,
19
- color = _this$props.color,
20
- qa = _this$props.qa,
21
- rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
22
- return /*#__PURE__*/React.createElement(Container, _extends({
23
- small: size === 'small',
24
- dark: color === 'dark',
25
- delay: delay,
26
- "data-qa-loader": ''
27
- }, qa, rest), /*#__PURE__*/React.createElement(Text, {
28
- as: "div",
29
- fontSize: 200
30
- }, text || 'Loading'));
31
- };
26
+ _createClass(Loader, [{
27
+ key: "render",
28
+ value: function render() {
29
+ var _this$props = this.props,
30
+ text = _this$props.text,
31
+ size = _this$props.size,
32
+ delay = _this$props.delay,
33
+ color = _this$props.color,
34
+ qa = _this$props.qa,
35
+ rest = _objectWithoutProperties(_this$props, _excluded);
36
+ return /*#__PURE__*/React.createElement(Container, _extends({
37
+ small: size === 'small',
38
+ dark: color === 'dark',
39
+ delay: delay,
40
+ "data-qa-loader": ""
41
+ }, qa, rest), /*#__PURE__*/React.createElement(Text, {
42
+ as: "div",
43
+ fontSize: 200
44
+ }, text || 'Loading'));
45
+ }
46
+ }]);
32
47
  return Loader;
33
48
  }(React.Component);
34
- Loader.defaultProps = {
49
+ _defineProperty(Loader, "defaultProps", {
35
50
  size: 'large',
36
51
  text: '',
37
52
  delay: true,
38
53
  color: 'dark'
39
- };
54
+ });
40
55
  export { Loader as default };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import styled, { css, keyframes } from 'styled-components';
3
- import { COMMON } from '../utils/system-props';
4
- import { visuallyHidden } from '../utils/mixins';
3
+ import { COMMON } from "../utils/system-props";
4
+ import { visuallyHidden } from "../utils/mixins";
5
5
  import { rgba } from 'polished';
6
6
  var getSize = function getSize(size) {
7
7
  var spinnerSize = Math.ceil(size * 0.9);
@@ -1,11 +1,12 @@
1
1
  var _excluded = ["appearance", "isLoading", "disabled", "loaderLabel", "children"];
2
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 _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; }
3
4
  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; }
4
5
  import * as React from 'react';
5
6
  import styled, { css } from 'styled-components';
6
- import Box from '../Box';
7
- import Button from '../Button';
8
- import Loader from '../Loader';
7
+ import Box from "../Box";
8
+ import Button from "../Button";
9
+ import Loader from "../Loader";
9
10
  import { useTheme } from 'styled-components';
10
11
  import { rgba } from 'polished';
11
12
  import { COLOR_NEUTRAL_0, COLOR_NEUTRAL_1000 } from '@sproutsocial/seeds-color';
@@ -52,7 +53,7 @@ export var LoaderButton = function LoaderButton(_ref) {
52
53
  disabled = _ref.disabled,
53
54
  loaderLabel = _ref.loaderLabel,
54
55
  children = _ref.children,
55
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
56
+ rest = _objectWithoutProperties(_ref, _excluded);
56
57
  var isLoading = Boolean(_isLoading);
57
58
  var _useTheme = useTheme(),
58
59
  themeColorMode = _useTheme.mode;
@@ -1,7 +1,20 @@
1
1
  var _excluded = ["context", "element"],
2
2
  _excluded2 = ["element"];
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ 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."); }
9
+ 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); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ 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; }
3
14
  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; }
4
- 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); }
15
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
18
  /* eslint-disable */
6
19
  import * as React from 'react';
7
20
  import { createContext, useState, useLayoutEffect, useEffect, useContext, useCallback, useMemo, useRef } from 'react';
@@ -52,11 +65,9 @@ export function createNamedContext(name, defaultValue) {
52
65
  Ctx.displayName = name;
53
66
  return Ctx;
54
67
  }
55
- export function createDescendantContext(name, initialValue) {
56
- if (initialValue === void 0) {
57
- initialValue = {};
58
- }
59
- return createNamedContext(name, _extends({
68
+ export function createDescendantContext(name) {
69
+ var initialValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
70
+ return createNamedContext(name, _objectSpread({
60
71
  descendants: [],
61
72
  registerDescendant: noop,
62
73
  unregisterDescendant: noop
@@ -89,9 +100,10 @@ export function createDescendantContext(name, initialValue) {
89
100
  export function useDescendant(_ref, indexProp) {
90
101
  var context = _ref.context,
91
102
  element = _ref.element,
92
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
103
+ rest = _objectWithoutProperties(_ref, _excluded);
93
104
  var _useState = useState(),
94
- forceUpdate = _useState[1];
105
+ _useState2 = _slicedToArray(_useState, 2),
106
+ forceUpdate = _useState2[1];
95
107
  var _useContext = useContext(context),
96
108
  registerDescendant = _useContext.registerDescendant,
97
109
  unregisterDescendant = _useContext.unregisterDescendant,
@@ -100,13 +112,13 @@ export function useDescendant(_ref, indexProp) {
100
112
  // Prevent any flashing
101
113
  useIsomorphicLayoutEffect(function () {
102
114
  if (!element) forceUpdate({});
103
- registerDescendant(_extends({
115
+ registerDescendant(_objectSpread({
104
116
  element: element
105
117
  }, rest));
106
118
  return function () {
107
119
  return unregisterDescendant(element);
108
120
  };
109
- }, [element].concat(Object.values(rest)));
121
+ }, [element].concat(_toConsumableArray(Object.values(rest))));
110
122
  return indexProp ? indexProp : descendants.findIndex(function (item) {
111
123
  return item.element === element;
112
124
  });
@@ -121,7 +133,7 @@ export function DescendantProvider(_ref2) {
121
133
  set = _ref2.set;
122
134
  var registerDescendant = useCallback(function (_ref3) {
123
135
  var element = _ref3.element,
124
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded2);
136
+ rest = _objectWithoutProperties(_ref3, _excluded2);
125
137
  if (!element) {
126
138
  return;
127
139
  }
@@ -130,11 +142,11 @@ export function DescendantProvider(_ref2) {
130
142
  var newItems;
131
143
  // If there are no items, register at index 0 and bail.
132
144
  if (items.length === 0) {
133
- newItem = _extends({
145
+ newItem = _objectSpread({
134
146
  element: element,
135
147
  index: 0
136
148
  }, rest);
137
- newItems = [].concat(items, [newItem]);
149
+ newItems = [].concat(_toConsumableArray(items), [newItem]);
138
150
  } else if (items.find(function (item) {
139
151
  return item.element === element;
140
152
  })) {
@@ -163,20 +175,20 @@ export function DescendantProvider(_ref2) {
163
175
  // element.
164
176
  return Boolean(item.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING);
165
177
  });
166
- newItem = _extends({
178
+ newItem = _objectSpread({
167
179
  element: element,
168
180
  index: index
169
181
  }, rest);
170
182
 
171
183
  // If an index is not found we will push the element to the end.
172
184
  if (index === -1) {
173
- newItems = [].concat(items, [newItem]);
185
+ newItems = [].concat(_toConsumableArray(items), [newItem]);
174
186
  } else {
175
- newItems = [].concat(items.slice(0, index), [newItem], items.slice(index));
187
+ newItems = [].concat(_toConsumableArray(items.slice(0, index)), [newItem], _toConsumableArray(items.slice(index)));
176
188
  }
177
189
  }
178
190
  return newItems.map(function (item, index) {
179
- return _extends({}, item, {
191
+ return _objectSpread(_objectSpread({}, item), {}, {
180
192
  index: index
181
193
  });
182
194
  });
@@ -195,7 +207,7 @@ export function DescendantProvider(_ref2) {
195
207
  return items.filter(function (item) {
196
208
  return element !== item.element;
197
209
  }).map(function (item, index) {
198
- return _extends({}, item, {
210
+ return _objectSpread(_objectSpread({}, item), {}, {
199
211
  index: index
200
212
  });
201
213
  });
package/lib/Menu/hooks.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  import { createContext, useContext, useEffect } from 'react';
3
3
  import scrollIntoViewIfNeeded from 'scroll-into-view-if-needed';
4
- import { MENU_ROLES } from './constants';
5
- import { createDescendantContext, useDescendantKeyDown, usePrevious, wrapEvent } from './descendants';
4
+ import { MENU_ROLES } from "./constants";
5
+ import { createDescendantContext, useDescendantKeyDown, usePrevious, wrapEvent } from "./descendants";
6
6
  export var MenuContext = /*#__PURE__*/createContext({
7
7
  role: MENU_ROLES.MENU,
8
8
  menuRef: {
@@ -33,17 +33,15 @@ export var MenuDescendantContext = createDescendantContext('MenuDescendantContex
33
33
  * expected that the matching menu item is selected. This is our matching
34
34
  * function.
35
35
  */
36
- function filterItemsFromTypeahead(items, string) {
37
- if (string === void 0) {
38
- string = '';
39
- }
36
+ function filterItemsFromTypeahead(items) {
37
+ var string = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
40
38
  if (!string) {
41
39
  return null;
42
40
  }
43
41
  return items.filter(function (_ref) {
44
42
  var value = _ref.value,
45
43
  label = _ref.label;
46
- return (value == null ? void 0 : value.toLowerCase().includes(string.toLocaleLowerCase())) || (label == null ? void 0 : label.toLowerCase().includes(string.toLocaleLowerCase()));
44
+ return (value === null || value === void 0 ? void 0 : value.toLowerCase().includes(string.toLocaleLowerCase())) || (label === null || label === void 0 ? void 0 : label.toLowerCase().includes(string.toLocaleLowerCase()));
47
45
  }).map(function (_ref2) {
48
46
  var index = _ref2.index;
49
47
  return index;
@@ -94,7 +92,7 @@ export function useMenuKeyDown() {
94
92
  }, [setState, items, prevMenuItemsLength, prevSelected, prevSelectionIndex, selectionIndex]);
95
93
  useEffect(function () {
96
94
  var newFilteredItems = filterItemsFromTypeahead(items, filterQuery);
97
- if (filterQuery && newFilteredItems && (filteredItems == null ? void 0 : filteredItems.length) !== (newFilteredItems == null ? void 0 : newFilteredItems.length)) {
95
+ if (filterQuery && newFilteredItems && (filteredItems === null || filteredItems === void 0 ? void 0 : filteredItems.length) !== (newFilteredItems === null || newFilteredItems === void 0 ? void 0 : newFilteredItems.length)) {
98
96
  setState({
99
97
  filteredItems: newFilteredItems,
100
98
  selectionIndex: newFilteredItems[0]
@@ -125,7 +123,7 @@ export function useMenuKeyDown() {
125
123
  if (selected) {
126
124
  event.preventDefault();
127
125
  var func = selectCallbacks.current[selected.index];
128
- (func == null ? void 0 : func.call) && func();
126
+ (func === null || func === void 0 ? void 0 : func.call) && func();
129
127
  onChange && selected.value && onChange(selected.value);
130
128
  shouldClosePopout && closePopout && closePopout();
131
129
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  import * as React from 'react';
3
- import Box from '../Box';
4
- import Button from '../Button';
5
- import Popout from '../Popout';
6
- import { MENU_ITEM_ROLES, MENU_ROLES } from './constants';
3
+ import Box from "../Box";
4
+ import Button from "../Button";
5
+ import Popout from "../Popout";
6
+ import { MENU_ITEM_ROLES, MENU_ROLES } from "./constants";
package/lib/Menu/index.js CHANGED
@@ -4,27 +4,37 @@ var _excluded = ["id", "index", "as", "children", "role", "elemBefore", "elemAft
4
4
  _excluded3 = ["children", "role", "multiselect", "innerRef"],
5
5
  _excluded4 = ["role", "children", "onChange", "value", "multiselect", "innerRef"],
6
6
  _excluded5 = ["content", "popoutProps", "children", "onClick", "closeOnItemClick", "id", "placement"];
7
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
10
  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); }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ 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."); }
13
+ 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); }
14
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+ 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; }
8
18
  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; }
9
19
  import * as React from 'react';
10
20
  import styled from 'styled-components';
11
21
  import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
12
22
  import uniqueId from 'lodash.uniqueid';
13
- import { MenuItemContainer, MenuItemsContainer } from './styles';
14
- import { MENU_ITEM_ROLES, MENU_ROLES } from './constants';
15
- import Box from '../Box';
16
- import Button from '../Button';
17
- import Checkbox from '../Checkbox';
18
- import Icon from '../Icon';
19
- import Input from '../Input';
20
- import Popout from '../Popout';
21
- import Radio from '../Radio';
22
- import Text from '../Text';
23
- import { disabled } from '../utils/mixins';
24
- import innerText from '../utils/innerText';
25
- import { useTextContent } from '../utils/hooks';
26
- import { DescendantProvider, useDescendant, useDescendants } from './descendants';
27
- import { MenuButtonContext, MenuContext, MenuDescendantContext, useMenuKeyDown } from './hooks';
23
+ import { MenuItemContainer, MenuItemsContainer } from "./styles";
24
+ import { MENU_ITEM_ROLES, MENU_ROLES } from "./constants";
25
+ import Box from "../Box";
26
+ import Button from "../Button";
27
+ import Checkbox from "../Checkbox";
28
+ import Icon from "../Icon";
29
+ import Input from "../Input";
30
+ import Popout from "../Popout";
31
+ import Radio from "../Radio";
32
+ import Text from "../Text";
33
+ import { disabled } from "../utils/mixins";
34
+ import innerText from "../utils/innerText";
35
+ import { useTextContent } from "../utils/hooks";
36
+ import { DescendantProvider, useDescendant, useDescendants } from "./descendants";
37
+ import { MenuButtonContext, MenuContext, MenuDescendantContext, useMenuKeyDown } from "./hooks";
28
38
  var noop = function noop() {};
29
39
  var getMenuItemRole = function getMenuItemRole(menuRole) {
30
40
  switch (menuRole) {
@@ -61,7 +71,7 @@ export var MenuItem = function MenuItem(_ref) {
61
71
  disabled = _ref.disabled,
62
72
  indeterminate = _ref.indeterminate,
63
73
  labelProp = _ref.label,
64
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
74
+ props = _objectWithoutProperties(_ref, _excluded);
65
75
  var _useContext = useContext(MenuContext),
66
76
  menuRole = _useContext.role,
67
77
  onChange = _useContext.onChange,
@@ -96,8 +106,9 @@ export var MenuItem = function MenuItem(_ref) {
96
106
  var isFocused = index === selectionIndex;
97
107
  selectCallbacks.current[index] = onClick;
98
108
  var _useState = useState(false),
99
- keyPressed = _useState[0],
100
- setKeyPressed = _useState[1];
109
+ _useState2 = _slicedToArray(_useState, 2),
110
+ keyPressed = _useState2[0],
111
+ setKeyPressed = _useState2[1];
101
112
  var isCheckboxOrRadio = [MENU_ITEM_ROLES.CHECKBOX, MENU_ITEM_ROLES.RADIO].includes(itemRole);
102
113
  var interactive = onClick || onKeyPress || [MENU_ITEM_ROLES.OPTION, MENU_ITEM_ROLES.MENUITEM, MENU_ITEM_ROLES.CHECKBOX, MENU_ITEM_ROLES.RADIO].includes(itemRole);
103
114
 
@@ -123,7 +134,7 @@ export var MenuItem = function MenuItem(_ref) {
123
134
  }, [selectionIndex, filteredItems]);
124
135
  var handleClick = useCallback(function (e) {
125
136
  var _menuRef$current;
126
- (_menuRef$current = menuRef.current) == null ? void 0 : _menuRef$current.focus();
137
+ (_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 ? void 0 : _menuRef$current.focus();
127
138
  if (onChange && itemRole !== MENU_ITEM_ROLES.LISTITEM) {
128
139
  onChange(valueProp || label);
129
140
  }
@@ -134,7 +145,7 @@ export var MenuItem = function MenuItem(_ref) {
134
145
  if (elemBefore) return elemBefore;
135
146
  if (itemRole === MENU_ITEM_ROLES.CHECKBOX) {
136
147
  return /*#__PURE__*/React.createElement(Checkbox, {
137
- id: "Checkbox-" + id,
148
+ id: "Checkbox-".concat(id),
138
149
  checked: isSelected,
139
150
  "aria-hidden": "true",
140
151
  onChange: noop,
@@ -143,8 +154,8 @@ export var MenuItem = function MenuItem(_ref) {
143
154
  });
144
155
  } else if (itemRole === MENU_ITEM_ROLES.RADIO) {
145
156
  return /*#__PURE__*/React.createElement(Radio, {
146
- id: "Radio-" + id,
147
- name: "Radio-" + id,
157
+ id: "Radio-".concat(id),
158
+ name: "Radio-".concat(id),
148
159
  checked: isSelected,
149
160
  "aria-hidden": "true",
150
161
  onChange: noop,
@@ -215,7 +226,7 @@ export var MenuGroup = function MenuGroup(_ref2) {
215
226
  titleAs = _ref2.titleAs,
216
227
  _ref2$disabled = _ref2.disabled,
217
228
  isDisabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
218
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
229
+ props = _objectWithoutProperties(_ref2, _excluded2);
219
230
  return /*#__PURE__*/React.createElement(React.Fragment, null, title && /*#__PURE__*/React.createElement(Box, {
220
231
  pl: 400,
221
232
  borderTop: "1px solid",
@@ -278,7 +289,7 @@ var MenuItems = function MenuItems(_ref3) {
278
289
  role = _ref3.role,
279
290
  multiselect = _ref3.multiselect,
280
291
  innerRef = _ref3.innerRef,
281
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
292
+ props = _objectWithoutProperties(_ref3, _excluded3);
282
293
  var _useMenuKeyDown = useMenuKeyDown(),
283
294
  handleKeyDown = _useMenuKeyDown.handleKeyDown,
284
295
  activeDescendent = _useMenuKeyDown.activeDescendent;
@@ -286,7 +297,7 @@ var MenuItems = function MenuItems(_ref3) {
286
297
  forwardedAs: "ul",
287
298
  ref: innerRef,
288
299
  role: role,
289
- "aria-activedescendant": activeDescendent == null ? void 0 : activeDescendent.id,
300
+ "aria-activedescendant": activeDescendent === null || activeDescendent === void 0 ? void 0 : activeDescendent.id,
290
301
  "aria-multiselectable": multiselect ? true : undefined,
291
302
  tabIndex: 0,
292
303
  onKeyDown: handleKeyDown,
@@ -303,22 +314,24 @@ export var Menu = function Menu(_ref4) {
303
314
  value = _ref4.value,
304
315
  multiselect = _ref4.multiselect,
305
316
  innerRef = _ref4.innerRef,
306
- props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
317
+ props = _objectWithoutProperties(_ref4, _excluded4);
307
318
  var _useDescendants = useDescendants(),
308
- descendants = _useDescendants[0],
309
- setDescendants = _useDescendants[1];
310
- var _useState2 = useState({
319
+ _useDescendants2 = _slicedToArray(_useDescendants, 2),
320
+ descendants = _useDescendants2[0],
321
+ setDescendants = _useDescendants2[1];
322
+ var _useState3 = useState({
311
323
  selectionIndex: 0,
312
324
  filterQuery: '',
313
325
  filteredItems: null,
314
326
  isFilterInputFocused: false
315
327
  }),
316
- state = _useState2[0],
317
- setState = _useState2[1];
328
+ _useState4 = _slicedToArray(_useState3, 2),
329
+ state = _useState4[0],
330
+ setState = _useState4[1];
318
331
  var selectCallbacks = useRef([]);
319
332
  var menuRef = useRef(null);
320
333
  var setContextState = useCallback(function (newState) {
321
- setState(_extends({}, state, newState));
334
+ setState(_objectSpread(_objectSpread({}, state), newState));
322
335
  }, [state]);
323
336
  return (
324
337
  /*#__PURE__*/
@@ -373,15 +386,16 @@ export var MenuButton = function MenuButton(_ref5) {
373
386
  id = _ref5$id === void 0 ? uniqueId('MenuButton-') : _ref5$id,
374
387
  _ref5$placement = _ref5.placement,
375
388
  placement = _ref5$placement === void 0 ? 'bottom' : _ref5$placement,
376
- props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
377
- var _useState3 = useState(false),
378
- isOpen = _useState3[0],
379
- setIsOpen = _useState3[1];
389
+ props = _objectWithoutProperties(_ref5, _excluded5);
390
+ var _useState5 = useState(false),
391
+ _useState6 = _slicedToArray(_useState5, 2),
392
+ isOpen = _useState6[0],
393
+ setIsOpen = _useState6[1];
380
394
  var closePopout = useCallback(function () {
381
395
  return setIsOpen(false);
382
396
  }, [setIsOpen]);
383
- var ariaLabelledBy = props['aria-labelledby'] ? props['aria-labelledby'] + " " + id : undefined;
384
- var ariaLabel = props['aria-label'] ? props['aria-label'] + " " + innerText(children) : undefined;
397
+ var ariaLabelledBy = props['aria-labelledby'] ? "".concat(props['aria-labelledby'], " ").concat(id) : undefined;
398
+ var ariaLabel = props['aria-label'] ? "".concat(props['aria-label'], " ").concat(innerText(children)) : undefined;
385
399
  return /*#__PURE__*/React.createElement(MenuButtonContext.Provider, {
386
400
  value: {
387
401
  closePopout: closePopout,
@@ -397,8 +411,8 @@ export var MenuButton = function MenuButton(_ref5) {
397
411
  width: props.width
398
412
  }), /*#__PURE__*/React.createElement(Button, _extends({}, props, {
399
413
  id: id,
400
- "aria-labelledby": ariaLabelledBy == null ? void 0 : ariaLabelledBy.trim(),
401
- "aria-label": ariaLabel == null ? void 0 : ariaLabel.trim(),
414
+ "aria-labelledby": ariaLabelledBy === null || ariaLabelledBy === void 0 ? void 0 : ariaLabelledBy.trim(),
415
+ "aria-label": ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim(),
402
416
  active: isOpen,
403
417
  onKeyDown: function onKeyDown(e) {
404
418
  if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
@@ -1,7 +1,7 @@
1
1
 
2
2
  import styled, { css } from 'styled-components';
3
- import Box from '../Box';
4
- import { disabled, focusRing } from '../utils/mixins';
3
+ import Box from "../Box";
4
+ import { disabled, focusRing } from "../utils/mixins";
5
5
  export var MenuItemContainer = styled(Box).withConfig({
6
6
  displayName: "styles__MenuItemContainer",
7
7
  componentId: "sc-fjvae4-0"
@@ -18,7 +18,7 @@ export var MenuItemContainer = styled(Box).withConfig({
18
18
  }, function (props) {
19
19
  return props.theme.fontWeights.normal;
20
20
  }, function (props) {
21
- return "6px " + props.theme.space[300];
21
+ return "6px ".concat(props.theme.space[300]);
22
22
  }, function (props) {
23
23
  return css(["", ";"], props.theme.typography[200]);
24
24
  }, function (props) {
@@ -1,11 +1,12 @@
1
1
  var _excluded = ["children", "density", "borderColor", "bg", "indentContent", "innerRef", "qa"];
2
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 _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; }
3
4
  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; }
4
5
  import * as React from 'react';
5
- import Container, { MessageBody, MessageFooter, MessageHeader, MessageMeta } from './styles';
6
- import Checkbox from '../Checkbox';
7
- import Button from '../Button';
8
- import Avatar from '../Avatar';
6
+ import Container, { MessageBody, MessageFooter, MessageHeader, MessageMeta } from "./styles";
7
+ import Checkbox from "../Checkbox";
8
+ import Button from "../Button";
9
+ import Avatar from "../Avatar";
9
10
  var MESSAGE_DENSITIES = {
10
11
  COMPACT: 'compact',
11
12
  // Compact is deprecated. New applications should use condensed instead.
@@ -45,7 +46,7 @@ var Message = function Message(_ref) {
45
46
  indentContent = _ref$indentContent === void 0 ? true : _ref$indentContent,
46
47
  innerRef = _ref.innerRef,
47
48
  qa = _ref.qa,
48
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
49
+ rest = _objectWithoutProperties(_ref, _excluded);
49
50
  return /*#__PURE__*/React.createElement(MessageContext.Provider, {
50
51
  value: {
51
52
  density: density,