@sproutsocial/racine 12.21.2 → 12.22.1

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 (324) hide show
  1. package/CHANGELOG.md +20 -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 +3 -3
  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__/Fieldset/index.js +1 -1
  11. package/__flow__/Indicator/index.js +1 -1
  12. package/__flow__/Input/index.js +2 -1
  13. package/__flow__/Input/styles.js +1 -1
  14. package/__flow__/Link/index.js +2 -1
  15. package/__flow__/Link/index.test.js +2 -0
  16. package/__flow__/Listbox/index.stories.js +1 -0
  17. package/__flow__/Loader/index.js +1 -1
  18. package/__flow__/Modal/index.stories.js +1 -1
  19. package/__flow__/Numeral/tests/testNumeral.js +1 -0
  20. package/__flow__/Popout/index.js +1 -1
  21. package/__flow__/Portal/index.stories.js +7 -7
  22. package/__flow__/SegmentedControl/index.js +1 -1
  23. package/__flow__/Table/index.js +4 -4
  24. package/__flow__/TableCell/index.js +1 -1
  25. package/__flow__/TableHeaderCell/index.js +1 -1
  26. package/__flow__/Tabs/index.js +1 -1
  27. package/__flow__/Textarea/index.js +1 -1
  28. package/__flow__/Toast/index.js +1 -1
  29. package/__flow__/Toast/styles.js +1 -1
  30. package/__flow__/TokenInput/index.stories.js +4 -4
  31. package/__flow__/TokenInput/tests/default/pasting.test.js +6 -2
  32. package/__flow__/code-guidelines.mdx +244 -0
  33. package/__flow__/setupTests.js +1 -0
  34. package/__flow__/utils/a11yTest.js +1 -0
  35. package/__flow__/utils/system-props.js +1 -0
  36. package/commonjs/Avatar/index.js +19 -10
  37. package/commonjs/Badge/constants.js +3 -1
  38. package/commonjs/Badge/index.js +7 -3
  39. package/commonjs/Badge/styles.js +4 -2
  40. package/commonjs/Banner/index.js +9 -4
  41. package/commonjs/Banner/styles.js +5 -2
  42. package/commonjs/Box/index.js +5 -2
  43. package/commonjs/Box/styles.js +3 -1
  44. package/commonjs/Breadcrumb/index.js +12 -5
  45. package/commonjs/Breadcrumb/styles.js +3 -1
  46. package/commonjs/Button/index.js +7 -3
  47. package/commonjs/Button/styles.js +6 -3
  48. package/commonjs/Card/index.js +7 -3
  49. package/commonjs/Card/styles.js +3 -1
  50. package/commonjs/CharacterCounter/index.js +39 -22
  51. package/commonjs/CharacterCounter/styles.js +5 -2
  52. package/commonjs/ChartLegend/index.js +7 -3
  53. package/commonjs/ChartLegend/styles.js +5 -2
  54. package/commonjs/Checkbox/index.js +117 -97
  55. package/commonjs/Checkbox/styles.js +5 -2
  56. package/commonjs/Collapsible/index.js +28 -13
  57. package/commonjs/Collapsible/styles.js +4 -2
  58. package/commonjs/DatePicker/DateRangePicker.js +7 -3
  59. package/commonjs/DatePicker/SingleDatePicker.js +7 -3
  60. package/commonjs/DatePicker/StatefulDateRangePicker.js +19 -7
  61. package/commonjs/DatePicker/StatefulSingleDatePicker.js +16 -5
  62. package/commonjs/DatePicker/common.js +4 -2
  63. package/commonjs/DatePicker/index.js +15 -3
  64. package/commonjs/DatePicker/styles.js +5 -2
  65. package/commonjs/Drawer/SlideTransition.js +9 -5
  66. package/commonjs/Drawer/index.js +15 -7
  67. package/commonjs/Drawer/styles.js +5 -2
  68. package/commonjs/EmptyState/index.js +7 -3
  69. package/commonjs/Fieldset/index.js +10 -6
  70. package/commonjs/Fieldset/styles.js +5 -2
  71. package/commonjs/FormField/index.js +17 -6
  72. package/commonjs/Icon/deprecatedIcons.js +3 -1
  73. package/commonjs/Icon/index.js +9 -5
  74. package/commonjs/Icon/styles.js +6 -3
  75. package/commonjs/Image/index.js +78 -58
  76. package/commonjs/Image/styles.js +5 -2
  77. package/commonjs/Indicator/index.js +40 -23
  78. package/commonjs/Indicator/styles.js +4 -2
  79. package/commonjs/Input/index.js +156 -132
  80. package/commonjs/Input/styles.js +6 -3
  81. package/commonjs/KeyboardKey/index.js +30 -14
  82. package/commonjs/KeyboardKey/styles.js +3 -1
  83. package/commonjs/Label/index.js +32 -16
  84. package/commonjs/Link/constants.js +3 -1
  85. package/commonjs/Link/index.js +9 -4
  86. package/commonjs/Link/styles.js +5 -2
  87. package/commonjs/Listbox/index.js +15 -8
  88. package/commonjs/Loader/index.js +43 -26
  89. package/commonjs/Loader/styles.js +5 -2
  90. package/commonjs/LoaderButton/index.js +7 -3
  91. package/commonjs/Menu/constants.js +3 -1
  92. package/commonjs/Menu/descendants.js +35 -20
  93. package/commonjs/Menu/hooks.js +8 -8
  94. package/commonjs/Menu/index.flow.js +2 -1
  95. package/commonjs/Menu/index.js +44 -27
  96. package/commonjs/Menu/names.js +3 -1
  97. package/commonjs/Menu/styles.js +6 -3
  98. package/commonjs/Message/index.js +7 -3
  99. package/commonjs/Message/styles.js +4 -2
  100. package/commonjs/Modal/index.js +9 -5
  101. package/commonjs/Modal/styles.js +9 -5
  102. package/commonjs/Numeral/constants.js +3 -1
  103. package/commonjs/Numeral/index.js +16 -5
  104. package/commonjs/Numeral/styles.js +3 -1
  105. package/commonjs/Numeral/tests/testNumeral.js +16 -11
  106. package/commonjs/OverflowList/index.flow.js +2 -1
  107. package/commonjs/OverflowList/index.js +6 -3
  108. package/commonjs/OverflowList/styles.js +5 -2
  109. package/commonjs/PartnerLogo/index.js +9 -6
  110. package/commonjs/PartnerLogo/styles.js +5 -2
  111. package/commonjs/Popout/index.js +28 -13
  112. package/commonjs/Popout/styles.js +3 -1
  113. package/commonjs/Portal/index.js +50 -30
  114. package/commonjs/Radio/index.js +75 -57
  115. package/commonjs/Radio/styles.js +5 -2
  116. package/commonjs/SegmentedControl/index.js +21 -9
  117. package/commonjs/SegmentedControl/styles.js +5 -2
  118. package/commonjs/Select/index.js +78 -61
  119. package/commonjs/Select/styles.js +8 -5
  120. package/commonjs/Skeleton/index.js +4 -2
  121. package/commonjs/SpotIllustration/illustrationNames.js +3 -1
  122. package/commonjs/SpotIllustration/index.js +5 -3
  123. package/commonjs/Stack/index.js +7 -3
  124. package/commonjs/Switch/index.js +54 -36
  125. package/commonjs/Switch/styles.js +6 -3
  126. package/commonjs/Table/index.js +14 -10
  127. package/commonjs/Table/styles.js +3 -1
  128. package/commonjs/TableCell/index.js +41 -24
  129. package/commonjs/TableCell/styles.js +3 -1
  130. package/commonjs/TableHeaderCell/index.js +56 -38
  131. package/commonjs/TableHeaderCell/styles.js +5 -2
  132. package/commonjs/TableRowAccordion/index.js +63 -45
  133. package/commonjs/TableRowAccordion/styles.js +5 -2
  134. package/commonjs/Tabs/index.js +118 -91
  135. package/commonjs/Tabs/styles.js +8 -5
  136. package/commonjs/Text/index.js +7 -3
  137. package/commonjs/Text/styles.js +5 -2
  138. package/commonjs/Textarea/index.js +104 -87
  139. package/commonjs/Textarea/styles.js +5 -2
  140. package/commonjs/ThemeProvider/index.js +5 -2
  141. package/commonjs/Toast/index.js +7 -8
  142. package/commonjs/Toast/styles.js +5 -2
  143. package/commonjs/ToggleHint/index.js +45 -27
  144. package/commonjs/ToggleHint/styles.js +6 -3
  145. package/commonjs/Token/index.js +7 -3
  146. package/commonjs/Token/styles.js +5 -2
  147. package/commonjs/TokenInput/index.js +221 -192
  148. package/commonjs/TokenInput/styles.js +5 -2
  149. package/commonjs/TokenInput/util.js +5 -3
  150. package/commonjs/Tooltip/index.js +30 -14
  151. package/commonjs/Tooltip/styles.js +3 -1
  152. package/commonjs/VisuallyHidden/index.js +3 -1
  153. package/commonjs/dataviz/index.js +3 -1
  154. package/commonjs/index.js +451 -84
  155. package/commonjs/systemProps/background.js +3 -1
  156. package/commonjs/systemProps/border.js +3 -1
  157. package/commonjs/systemProps/color.js +3 -1
  158. package/commonjs/systemProps/custom.js +3 -1
  159. package/commonjs/systemProps/flexbox.js +3 -1
  160. package/commonjs/systemProps/grid.js +3 -1
  161. package/commonjs/systemProps/index.js +87 -15
  162. package/commonjs/systemProps/layout.js +3 -1
  163. package/commonjs/systemProps/position.js +3 -1
  164. package/commonjs/systemProps/shadow.js +3 -1
  165. package/commonjs/systemProps/space.js +3 -1
  166. package/commonjs/systemProps/systemProps.js +3 -1
  167. package/commonjs/systemProps/typography.js +3 -1
  168. package/commonjs/systemProps/variant.js +3 -1
  169. package/commonjs/themes/dark/dataviz-palette.js +3 -1
  170. package/commonjs/themes/dark/decorative-palettes.js +3 -1
  171. package/commonjs/themes/dark/theme.js +11 -7
  172. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +9 -5
  173. package/commonjs/themes/extendedThemes/sproutTheme/index.js +15 -4
  174. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +8 -4
  175. package/commonjs/themes/light/dataviz-palette.js +3 -1
  176. package/commonjs/themes/light/decorative-palettes.js +3 -1
  177. package/commonjs/themes/light/literal-colors.js +3 -1
  178. package/commonjs/themes/light/theme.js +17 -13
  179. package/commonjs/utils/a11yTest.js +5 -2
  180. package/commonjs/utils/chartColors.js +3 -1
  181. package/commonjs/utils/constants.js +3 -1
  182. package/commonjs/utils/dataQaLabelQueries.js +26 -16
  183. package/commonjs/utils/hooks.js +39 -26
  184. package/commonjs/utils/index.js +18 -8
  185. package/commonjs/utils/innerText.js +4 -2
  186. package/commonjs/utils/mixins.js +3 -1
  187. package/commonjs/utils/react-testing-library.js +74 -18
  188. package/commonjs/utils/responsiveProps/index.js +16 -8
  189. package/commonjs/utils/system-props.js +6 -2
  190. package/commonjs/utils/useInteractiveColor.js +3 -1
  191. package/dist/themes/dark/theme.scss +0 -1
  192. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +0 -1
  193. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +0 -1
  194. package/dist/themes/light/theme.scss +0 -1
  195. package/lib/Avatar/index.js +17 -11
  196. package/lib/Badge/index.js +5 -4
  197. package/lib/Badge/styles.js +3 -3
  198. package/lib/Banner/index.js +7 -5
  199. package/lib/Banner/styles.js +1 -1
  200. package/lib/Box/index.js +1 -1
  201. package/lib/Box/styles.js +1 -1
  202. package/lib/Breadcrumb/index.js +11 -7
  203. package/lib/Button/index.js +3 -2
  204. package/lib/Button/styles.js +4 -4
  205. package/lib/Card/index.js +3 -2
  206. package/lib/Card/styles.js +2 -2
  207. package/lib/CharacterCounter/index.js +36 -21
  208. package/lib/CharacterCounter/styles.js +1 -1
  209. package/lib/ChartLegend/index.js +5 -4
  210. package/lib/ChartLegend/styles.js +1 -1
  211. package/lib/Checkbox/index.js +114 -96
  212. package/lib/Checkbox/styles.js +5 -5
  213. package/lib/Collapsible/index.js +25 -13
  214. package/lib/Collapsible/styles.js +2 -2
  215. package/lib/DatePicker/DateRangePicker.js +4 -3
  216. package/lib/DatePicker/SingleDatePicker.js +4 -3
  217. package/lib/DatePicker/StatefulDateRangePicker.js +15 -6
  218. package/lib/DatePicker/StatefulSingleDatePicker.js +12 -4
  219. package/lib/DatePicker/common.js +3 -3
  220. package/lib/DatePicker/index.js +2 -2
  221. package/lib/DatePicker/styles.js +2 -2
  222. package/lib/Drawer/SlideTransition.js +4 -3
  223. package/lib/Drawer/index.js +17 -12
  224. package/lib/Drawer/styles.js +2 -2
  225. package/lib/EmptyState/index.js +4 -3
  226. package/lib/Fieldset/index.js +8 -7
  227. package/lib/Fieldset/styles.js +1 -1
  228. package/lib/FormField/index.js +17 -9
  229. package/lib/Icon/index.js +8 -7
  230. package/lib/Icon/styles.js +2 -2
  231. package/lib/Image/index.js +75 -57
  232. package/lib/Image/styles.js +1 -1
  233. package/lib/Indicator/index.js +38 -23
  234. package/lib/Indicator/styles.js +3 -3
  235. package/lib/Input/index.js +157 -135
  236. package/lib/Input/styles.js +3 -3
  237. package/lib/KeyboardKey/index.js +28 -14
  238. package/lib/KeyboardKey/styles.js +1 -1
  239. package/lib/Label/index.js +29 -15
  240. package/lib/Link/index.js +5 -3
  241. package/lib/Link/styles.js +3 -3
  242. package/lib/Listbox/index.js +14 -10
  243. package/lib/Loader/index.js +40 -25
  244. package/lib/Loader/styles.js +2 -2
  245. package/lib/LoaderButton/index.js +5 -4
  246. package/lib/Menu/descendants.js +30 -18
  247. package/lib/Menu/hooks.js +7 -9
  248. package/lib/Menu/index.flow.js +4 -4
  249. package/lib/Menu/index.js +54 -40
  250. package/lib/Menu/styles.js +3 -3
  251. package/lib/Message/index.js +6 -5
  252. package/lib/Message/styles.js +4 -4
  253. package/lib/Modal/index.js +9 -8
  254. package/lib/Modal/styles.js +6 -5
  255. package/lib/Numeral/index.js +15 -7
  256. package/lib/Numeral/styles.js +1 -1
  257. package/lib/Numeral/tests/testNumeral.js +15 -11
  258. package/lib/OverflowList/index.js +3 -3
  259. package/lib/OverflowList/styles.js +1 -1
  260. package/lib/PartnerLogo/index.js +8 -7
  261. package/lib/PartnerLogo/styles.js +1 -1
  262. package/lib/Popout/index.js +27 -15
  263. package/lib/Popout/styles.js +1 -1
  264. package/lib/Portal/index.js +47 -29
  265. package/lib/Radio/index.js +72 -56
  266. package/lib/Radio/styles.js +3 -3
  267. package/lib/SegmentedControl/index.js +18 -9
  268. package/lib/SegmentedControl/styles.js +3 -3
  269. package/lib/Select/index.js +76 -61
  270. package/lib/Select/styles.js +5 -5
  271. package/lib/Skeleton/index.js +2 -2
  272. package/lib/SpotIllustration/index.js +3 -3
  273. package/lib/Stack/index.js +4 -3
  274. package/lib/Switch/index.js +53 -37
  275. package/lib/Switch/styles.js +4 -4
  276. package/lib/Table/index.js +12 -11
  277. package/lib/Table/styles.js +1 -1
  278. package/lib/TableCell/index.js +38 -23
  279. package/lib/TableCell/styles.js +1 -1
  280. package/lib/TableHeaderCell/index.js +54 -38
  281. package/lib/TableHeaderCell/styles.js +1 -1
  282. package/lib/TableRowAccordion/index.js +62 -46
  283. package/lib/TableRowAccordion/styles.js +1 -1
  284. package/lib/Tabs/index.js +115 -90
  285. package/lib/Tabs/styles.js +5 -5
  286. package/lib/Text/index.js +3 -2
  287. package/lib/Text/styles.js +1 -1
  288. package/lib/Textarea/index.js +101 -86
  289. package/lib/Textarea/styles.js +2 -2
  290. package/lib/ThemeProvider/index.js +1 -1
  291. package/lib/Toast/index.js +6 -10
  292. package/lib/Toast/styles.js +4 -3
  293. package/lib/ToggleHint/index.js +43 -27
  294. package/lib/ToggleHint/styles.js +3 -3
  295. package/lib/Token/index.js +6 -5
  296. package/lib/Token/styles.js +3 -3
  297. package/lib/TokenInput/index.js +223 -196
  298. package/lib/TokenInput/styles.js +2 -2
  299. package/lib/TokenInput/util.js +2 -2
  300. package/lib/Tooltip/index.js +28 -14
  301. package/lib/Tooltip/styles.js +1 -1
  302. package/lib/VisuallyHidden/index.js +1 -1
  303. package/lib/dataviz/index.js +1 -1
  304. package/lib/index.js +64 -64
  305. package/lib/systemProps/index.js +14 -14
  306. package/lib/systemProps/systemProps.js +12 -12
  307. package/lib/themes/dark/theme.js +11 -9
  308. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +7 -5
  309. package/lib/themes/extendedThemes/sproutTheme/index.js +2 -2
  310. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +6 -4
  311. package/lib/themes/light/theme.js +17 -15
  312. package/lib/types/theme.colors.flow.js +2 -2
  313. package/lib/types/theme.flow.js +2 -2
  314. package/lib/utils/a11yTest.js +3 -1
  315. package/lib/utils/dataQaLabelQueries.js +23 -15
  316. package/lib/utils/hooks.js +37 -26
  317. package/lib/utils/index.js +15 -7
  318. package/lib/utils/innerText.js +1 -1
  319. package/lib/utils/mixins.js +1 -1
  320. package/lib/utils/react-testing-library.js +11 -8
  321. package/lib/utils/responsiveProps/index.js +14 -8
  322. package/lib/utils/system-props.js +1 -0
  323. package/package.json +21 -35
  324. package/__flow__/Avatar/index.test.js +0 -23
@@ -1,12 +1,21 @@
1
1
  'no babel-plugin-flow-react-proptypes';
2
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); }
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; }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ 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."); }
8
+ 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); }
9
+ 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; }
10
+ 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; }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4
12
  import { useState, useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
5
- import { canUseDOM } from '../utils';
13
+ import { canUseDOM } from "../utils";
6
14
  export function useTextContent(initial) {
7
15
  var _useState = useState(initial),
8
- textContent = _useState[0],
9
- setTextContent = _useState[1];
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ textContent = _useState2[0],
18
+ setTextContent = _useState2[1];
10
19
  var ref = useCallback(function (node) {
11
20
  if (node !== null) {
12
21
  setTextContent(node.textContent);
@@ -18,17 +27,16 @@ export function useTextContent(initial) {
18
27
  var defaultCallback = function defaultCallback(mutationList) {
19
28
  return mutationList;
20
29
  };
21
- export function useMutationObserver(targetNode, config, callback) {
22
- if (callback === void 0) {
23
- callback = defaultCallback;
24
- }
30
+ export function useMutationObserver(targetNode, config) {
31
+ var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultCallback;
25
32
  if (!canUseDOM()) {
26
33
  return;
27
34
  }
28
35
  /* eslint-disable-next-line */
29
- var _useState2 = useState(undefined),
30
- value = _useState2[0],
31
- setValue = _useState2[1];
36
+ var _useState3 = useState(undefined),
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ value = _useState4[0],
39
+ setValue = _useState4[1];
32
40
  /* eslint-disable-next-line */
33
41
  var observer = useMemo(function () {
34
42
  return new MutationObserver(function (mutationList, observer) {
@@ -48,9 +56,10 @@ export function useMutationObserver(targetNode, config, callback) {
48
56
  return value;
49
57
  }
50
58
  export function useMutationObserverOnce(targetNode, config, callback) {
51
- var _useState3 = useState(true),
52
- isObserving = _useState3[0],
53
- setObserving = _useState3[1];
59
+ var _useState5 = useState(true),
60
+ _useState6 = _slicedToArray(_useState5, 2),
61
+ isObserving = _useState6[0],
62
+ setObserving = _useState6[1];
54
63
  var node = isObserving ? targetNode : null;
55
64
  var value = useMutationObserver(node, config, callback);
56
65
  if (value !== undefined && isObserving) {
@@ -58,18 +67,19 @@ export function useMutationObserverOnce(targetNode, config, callback) {
58
67
  }
59
68
  return value;
60
69
  }
61
- export var useSelect = function useSelect(_temp) {
62
- var _ref = _temp === void 0 ? {
70
+ export var useSelect = function useSelect() {
71
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
63
72
  initialValue: '',
64
73
  onChange: function onChange() {}
65
- } : _temp,
74
+ },
66
75
  _ref$initialValue = _ref.initialValue,
67
76
  initialValue = _ref$initialValue === void 0 ? '' : _ref$initialValue,
68
77
  _ref$onChange = _ref.onChange,
69
78
  userOnChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
70
- var _useState4 = useState(initialValue),
71
- value = _useState4[0],
72
- setValue = _useState4[1];
79
+ var _useState7 = useState(initialValue),
80
+ _useState8 = _slicedToArray(_useState7, 2),
81
+ value = _useState8[0],
82
+ setValue = _useState8[1];
73
83
  var onChange = useCallback(function (newValue) {
74
84
  if (newValue !== value) {
75
85
  setValue(newValue);
@@ -100,18 +110,19 @@ var valueReducer = function valueReducer(state, action) {
100
110
  }
101
111
  }
102
112
  };
103
- export var useMultiselect = function useMultiselect(_temp2) {
104
- var _ref2 = _temp2 === void 0 ? {
113
+ export var useMultiselect = function useMultiselect() {
114
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
105
115
  initialValue: [],
106
116
  onChange: function onChange() {}
107
- } : _temp2,
117
+ },
108
118
  _ref2$initialValue = _ref2.initialValue,
109
119
  initialValue = _ref2$initialValue === void 0 ? [] : _ref2$initialValue,
110
120
  _ref2$onChange = _ref2.onChange,
111
121
  userOnChange = _ref2$onChange === void 0 ? function () {} : _ref2$onChange;
112
122
  var _useReducer = useReducer(valueReducer, new Set(initialValue)),
113
- value = _useReducer[0],
114
- dispatch = _useReducer[1];
123
+ _useReducer2 = _slicedToArray(_useReducer, 2),
124
+ value = _useReducer2[0],
125
+ dispatch = _useReducer2[1];
115
126
  var getArrayValue = function getArrayValue(value) {
116
127
  return Array.from(value);
117
128
  };
@@ -147,7 +158,7 @@ export function useWhyDidYouUpdate(name, props) {
147
158
  useEffect(function () {
148
159
  if (previousProps.current) {
149
160
  // Get all keys from previous and current props
150
- var allKeys = Object.keys(_extends({}, previousProps.current, props));
161
+ var allKeys = Object.keys(_objectSpread(_objectSpread({}, previousProps.current), props));
151
162
  // Use this object to keep track of changed props
152
163
  var changesObj = {};
153
164
  // Iterate through keys
@@ -1,4 +1,4 @@
1
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
2
  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); }
3
3
  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; }
4
4
 
@@ -12,13 +12,21 @@ export var mergeRefs = function mergeRefs(refs) {
12
12
  if (!filteredRefs.length) return null;
13
13
  if (filteredRefs.length === 0) return filteredRefs[0];
14
14
  return function (inst) {
15
- for (var _iterator = _createForOfIteratorHelperLoose(filteredRefs), _step; !(_step = _iterator()).done;) {
16
- var ref = _step.value;
17
- if (typeof ref === 'function') {
18
- ref(inst);
19
- } else if (ref) {
20
- ref.current = inst;
15
+ var _iterator = _createForOfIteratorHelper(filteredRefs),
16
+ _step;
17
+ try {
18
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
19
+ var ref = _step.value;
20
+ if (typeof ref === 'function') {
21
+ ref(inst);
22
+ } else if (ref) {
23
+ ref.current = inst;
24
+ }
21
25
  }
26
+ } catch (err) {
27
+ _iterator.e(err);
28
+ } finally {
29
+ _iterator.f();
22
30
  }
23
31
  };
24
32
  };
@@ -12,7 +12,7 @@ var hasProps = function hasProps(node) {
12
12
  return hasOwnProperty(node, 'props');
13
13
  };
14
14
  var reduceNodeToString = function reduceNodeToString(previous, current) {
15
- return previous.length ? previous + " " + innerText(current) : innerText(current);
15
+ return previous.length ? "".concat(previous, " ").concat(innerText(current)) : innerText(current);
16
16
  };
17
17
  var innerText = function innerText(node) {
18
18
  if (node === null || typeof node === 'undefined' || typeof node === 'boolean') {
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { css } from 'styled-components';
3
- import theme from '../themes/light/theme';
3
+ import theme from "../themes/light/theme";
4
4
  import { transparentize } from 'polished';
5
5
  export var svgToDataURL = function svgToDataURL(svgStr) {
6
6
  var encoded = encodeURIComponent(svgStr).replace(/'/g, '%27').replace(/"/g, '%22');
@@ -1,16 +1,19 @@
1
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
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); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
2
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
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); }
5
+ 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; }
6
+ 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; }
7
+ 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
8
  import * as React from 'react';
6
9
  import { act, cleanup, createEvent, fireEvent, queries, render, screen, wait, waitFor, waitForElement, waitForElementToBeRemoved, within } from '@testing-library/react';
7
10
  import userEvent from '@testing-library/user-event';
8
- import { a11yCheck } from './a11yTest';
9
- import { dataQaLabelQueries } from './dataQaLabelQueries';
10
- import ThemeProvider from '../ThemeProvider';
11
- var sproutQueries = _extends({}, queries, dataQaLabelQueries);
11
+ import { a11yCheck } from "./a11yTest";
12
+ import { dataQaLabelQueries } from "./dataQaLabelQueries";
13
+ import ThemeProvider from "../ThemeProvider";
14
+ var sproutQueries = _objectSpread(_objectSpread({}, queries), dataQaLabelQueries);
12
15
  var customRender = function customRender(node, options) {
13
- var api = render(node, _extends({}, options, {
16
+ var api = render(node, _objectSpread(_objectSpread({}, options), {}, {
14
17
  queries: sproutQueries,
15
18
  wrapper: ThemeProvider
16
19
  }));
@@ -33,7 +36,7 @@ var customRender = function customRender(node, options) {
33
36
  return _ref.apply(this, arguments);
34
37
  };
35
38
  }();
36
- return _extends({}, api, {
39
+ return _objectSpread(_objectSpread({}, api), {}, {
37
40
  runA11yCheck: runA11yCheck
38
41
  });
39
42
  };
@@ -1,9 +1,15 @@
1
-
2
- import theme from '../../themes/light/theme';
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ 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); }
8
+ import theme from "../../themes/light/theme";
3
9
  var breakpoints = theme.breakpoints;
4
10
  var LENGTH = breakpoints.length + 1;
5
11
  export var normalizeResponsiveProp = function normalizeResponsiveProp(value) {
6
- if (['string', 'number'].includes(typeof value)) {
12
+ if (['string', 'number'].includes(_typeof(value))) {
7
13
  return Array(LENGTH).fill(value);
8
14
  }
9
15
  if (value.length) {
@@ -11,17 +17,17 @@ export var normalizeResponsiveProp = function normalizeResponsiveProp(value) {
11
17
  case 1:
12
18
  return Array(LENGTH).fill(value[0]);
13
19
  case 2:
14
- return [value[0]].concat(Array(LENGTH - 1).fill(value[1]));
20
+ return [value[0]].concat(_toConsumableArray(Array(LENGTH - 1).fill(value[1])));
15
21
  case 3:
16
- return [value[0], value[1]].concat(Array(LENGTH - 2).fill(value[2]));
22
+ return [value[0], value[1]].concat(_toConsumableArray(Array(LENGTH - 2).fill(value[2])));
17
23
  case 4:
18
- return [value[0], value[1], value[2]].concat(Array(LENGTH - 3).fill(value[3]));
24
+ return [value[0], value[1], value[2]].concat(_toConsumableArray(Array(LENGTH - 3).fill(value[3])));
19
25
  case 5:
20
26
  return value;
21
27
  default:
22
- throw new Error("Invalid responsive prop length: " + JSON.stringify(value));
28
+ throw new Error("Invalid responsive prop length: ".concat(JSON.stringify(value)));
23
29
  }
24
30
  } else {
25
- throw new Error("Invalid responsive prop type: " + JSON.stringify(value));
31
+ throw new Error("Invalid responsive prop type: ".concat(JSON.stringify(value)));
26
32
  }
27
33
  };
@@ -1,4 +1,5 @@
1
1
 
2
+ // eslint-disable-next-line no-restricted-syntax
2
3
  import * as styles from 'styled-system';
3
4
  var typeScale = styles.variant({
4
5
  key: 'typography',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "12.21.2",
3
+ "version": "12.22.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -44,9 +44,7 @@
44
44
  "storybook": "rm -rf node_modules/.cache/storybook && start-storybook -c .storybook -p 9999",
45
45
  "build-storybook": "build-storybook --quiet -c .storybook -o .storybook-dist",
46
46
  "build-chromatic": "yarn build-icons && build-storybook --quiet -c .storybook -o .storybook-dist",
47
- "icon-lint": "node bin/icon-lint/cli",
48
- "playroom:start": "playroom start",
49
- "playroom:build": "playroom build"
47
+ "icon-lint": "node bin/icon-lint/cli"
50
48
  },
51
49
  "lint-staged": {
52
50
  "**/*": [
@@ -83,12 +81,12 @@
83
81
  },
84
82
  "devDependencies": {
85
83
  "@babel/cli": "^7.5.5",
86
- "@babel/core": "^7.12.9",
87
- "@babel/plugin-proposal-class-properties": "^7.4.4",
88
- "@babel/plugin-syntax-dynamic-import": "^7.0.0",
89
- "@babel/preset-env": "^7.8.0",
84
+ "@babel/core": "^7.20.2",
85
+ "@babel/eslint-parser": "^7.19.1",
86
+ "@babel/preset-env": "^7.20.2",
90
87
  "@babel/preset-flow": "^7.0.0",
91
88
  "@babel/preset-react": "^7.0.0",
89
+ "@babel/preset-typescript": "^7.18.6",
92
90
  "@changesets/cli": "^2.12.0",
93
91
  "@reach/component-component": "^0.1.3",
94
92
  "@sproutsocial/seeds-border": "^1.1.0",
@@ -110,30 +108,32 @@
110
108
  "@testing-library/jest-dom": "^5.16.4",
111
109
  "@testing-library/react": "^11.2.2",
112
110
  "@testing-library/user-event": "^13.0.0",
113
- "axios": "^0.26.1",
114
- "babel-core": "^7.0.0-bridge",
115
- "babel-eslint": "10.1.0",
116
- "babel-jest": "27.x.x",
111
+ "@typescript-eslint/eslint-plugin": "^5.43.0",
112
+ "@typescript-eslint/parser": "^5.43.0",
113
+ "babel-eslint": "^10.1.0",
114
+ "babel-jest": "29.x.x",
117
115
  "babel-loader": "8.2.3",
118
116
  "babel-plugin-inline-import": "^3.0.0",
117
+ "babel-plugin-module-resolver": "^4.1.0",
119
118
  "babel-plugin-polished": "^1.1.0",
120
119
  "babel-plugin-styled-components": "^2.0.7",
121
120
  "babel-polyfill": "^6.26.0",
122
121
  "chalk": "^2.3.2",
123
- "chokidar": "^3.0.2",
124
122
  "csstype": "^2.6.9",
125
- "eslint": "^7.5.0",
123
+ "eslint": "7.27.0",
126
124
  "eslint-config-prettier": "^6.11.0",
127
125
  "eslint-config-react-app": "^5.2.1",
126
+ "eslint-import-resolver-babel-module": "^5.3.1",
127
+ "eslint-import-resolver-typescript": "^3.5.2",
128
128
  "eslint-plugin-babel": "^5.3.1",
129
- "eslint-plugin-flowtype": "^2.50.3",
130
- "eslint-plugin-import": "^2.18.0",
129
+ "eslint-plugin-flowtype": "^5.7.2",
130
+ "eslint-plugin-import": "^2.26.0",
131
+ "eslint-plugin-jest": "^27.1.5",
131
132
  "eslint-plugin-jsx-a11y": "^6.3.1",
132
133
  "eslint-plugin-prettier": "^3.1.4",
133
- "eslint-plugin-react": "^7.20.3",
134
- "eslint-plugin-react-hooks": "^4.0.8",
134
+ "eslint-plugin-react": "^7.31.10",
135
+ "eslint-plugin-react-hooks": "^4.6.0",
135
136
  "flow-bin": "0.120.1",
136
- "fs-extra": "^5.0.0",
137
137
  "glob": "^7.1.6",
138
138
  "husky": "^0.14.3",
139
139
  "identity-obj-proxy": "^3.0.0",
@@ -144,12 +144,11 @@
144
144
  "jest-styled-components": "7.0.0-beta.1",
145
145
  "jscodeshift": "^0.6.4",
146
146
  "json-to-scss": "^1.6.2",
147
- "lint-staged": "^10.2.11",
147
+ "lint-staged": "^13.0.3",
148
148
  "moment": "^2.29.4",
149
149
  "npm-run-all": "^4.1.2",
150
150
  "outdent": "^0.7.0",
151
151
  "pify": "^4.0.1",
152
- "playroom": "^0.27.9",
153
152
  "prettier": "^2.7.1",
154
153
  "prop-types": "^15.6.1",
155
154
  "react": "16.12.0",
@@ -177,7 +176,7 @@
177
176
  "@sproutsocial/seeds-typography": ">=2.0.0",
178
177
  "moment": "^2.29.4",
179
178
  "prop-types": "^15.0.0",
180
- "react": "^16.2.0",
179
+ "react": ">=16.8.0",
181
180
  "react-dates": "^21.8.0",
182
181
  "react-virtualized": "9.18.5",
183
182
  "styled-components": "^5.2.3"
@@ -188,18 +187,5 @@
188
187
  "glob-parent": "^5.1.2",
189
188
  "trim": "^0.0.3",
190
189
  "trim-newlines": "^3.0.1"
191
- },
192
- "jest": {
193
- "testEnvironment": "jsdom",
194
- "setupFilesAfterEnv": [
195
- "<rootDir>/src/setupTests.js"
196
- ],
197
- "testPathIgnorePatterns": [
198
- "<rootDir>/docs/src/.components",
199
- "__flow__"
200
- ],
201
- "moduleNameMapper": {
202
- "\\.(css|scss|sass)$": "identity-obj-proxy"
203
- }
204
190
  }
205
191
  }
@@ -1,23 +0,0 @@
1
- // @flow
2
- import React from 'react';
3
- import {render} from '../utils/react-testing-library';
4
- import 'jest-styled-components';
5
- import Avatar from './';
6
-
7
- describe('Avatar', () => {
8
- it('should render properly', async () => {
9
- const {container, runA11yCheck} = render(<Avatar />);
10
- expect(container).toBeTruthy();
11
- await runA11yCheck();
12
- });
13
-
14
- it('should use the correct initials', () => {
15
- const {container} = render(<Avatar name="Test User" />);
16
- expect(container.textContent).toEqual('TU');
17
- });
18
-
19
- it('should set the correct font size', () => {
20
- const {getByText} = render(<Avatar name="Test User" />);
21
- expect(getByText('TU')).toHaveStyleRule('font-size', '16px');
22
- });
23
- });