@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,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, 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; }
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.22.0",
3
+ "version": "12.23.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -82,11 +82,11 @@
82
82
  "devDependencies": {
83
83
  "@babel/cli": "^7.5.5",
84
84
  "@babel/core": "^7.20.2",
85
- "@babel/plugin-proposal-class-properties": "^7.4.4",
86
- "@babel/plugin-syntax-dynamic-import": "^7.0.0",
87
- "@babel/preset-env": "^7.8.0",
85
+ "@babel/eslint-parser": "^7.19.1",
86
+ "@babel/preset-env": "^7.20.2",
88
87
  "@babel/preset-flow": "^7.0.0",
89
88
  "@babel/preset-react": "^7.0.0",
89
+ "@babel/preset-typescript": "^7.18.6",
90
90
  "@changesets/cli": "^2.12.0",
91
91
  "@reach/component-component": "^0.1.3",
92
92
  "@sproutsocial/seeds-border": "^1.1.0",
@@ -108,30 +108,32 @@
108
108
  "@testing-library/jest-dom": "^5.16.4",
109
109
  "@testing-library/react": "^11.2.2",
110
110
  "@testing-library/user-event": "^13.0.0",
111
- "axios": "^0.26.1",
112
- "babel-core": "^7.0.0-bridge",
113
- "babel-eslint": "10.1.0",
111
+ "@typescript-eslint/eslint-plugin": "^5.43.0",
112
+ "@typescript-eslint/parser": "^5.43.0",
113
+ "babel-eslint": "^10.1.0",
114
114
  "babel-jest": "29.x.x",
115
115
  "babel-loader": "8.2.3",
116
116
  "babel-plugin-inline-import": "^3.0.0",
117
+ "babel-plugin-module-resolver": "^4.1.0",
117
118
  "babel-plugin-polished": "^1.1.0",
118
119
  "babel-plugin-styled-components": "^2.0.7",
119
120
  "babel-polyfill": "^6.26.0",
120
121
  "chalk": "^2.3.2",
121
- "chokidar": "^3.0.2",
122
122
  "csstype": "^2.6.9",
123
- "eslint": "^7.5.0",
123
+ "eslint": "7.27.0",
124
124
  "eslint-config-prettier": "^6.11.0",
125
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",
126
128
  "eslint-plugin-babel": "^5.3.1",
127
- "eslint-plugin-flowtype": "^2.50.3",
128
- "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",
129
132
  "eslint-plugin-jsx-a11y": "^6.3.1",
130
133
  "eslint-plugin-prettier": "^3.1.4",
131
- "eslint-plugin-react": "^7.20.3",
132
- "eslint-plugin-react-hooks": "^4.0.8",
134
+ "eslint-plugin-react": "^7.31.10",
135
+ "eslint-plugin-react-hooks": "^4.6.0",
133
136
  "flow-bin": "0.120.1",
134
- "fs-extra": "^5.0.0",
135
137
  "glob": "^7.1.6",
136
138
  "husky": "^0.14.3",
137
139
  "identity-obj-proxy": "^3.0.0",
@@ -185,18 +187,5 @@
185
187
  "glob-parent": "^5.1.2",
186
188
  "trim": "^0.0.3",
187
189
  "trim-newlines": "^3.0.1"
188
- },
189
- "jest": {
190
- "testEnvironment": "jsdom",
191
- "setupFilesAfterEnv": [
192
- "<rootDir>/src/setupTests.js"
193
- ],
194
- "testPathIgnorePatterns": [
195
- "<rootDir>/docs/src/.components",
196
- "__flow__"
197
- ],
198
- "moduleNameMapper": {
199
- "\\.(css|scss|sass)$": "identity-obj-proxy"
200
- }
201
190
  }
202
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
- });