@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,50 +1,63 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1
2
  var _excluded = ["autoFocus", "autocomplete", "disabled", "isInvalid", "hasWarning", "id", "name", "placeholder", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaDescribedby", "ariaLabel", "innerRef", "onAddToken", "onRemoveToken", "onChangeTokens", "onClickToken", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "tokens"];
2
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
5
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
5
10
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
11
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
13
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
17
 
7
18
  import * as React from 'react';
8
- import Container from './styles';
9
- import { asTokenSpec, delimitersAsRegExp } from './util';
10
- import { Accessory } from '../Input/styles';
11
- import Box from '../Box';
12
- import Icon from '../Icon';
13
- import Token from '../Token';
19
+ import Container from "./styles";
20
+ import { asTokenSpec, delimitersAsRegExp } from "./util";
21
+ import { Accessory } from "../Input/styles";
22
+ import Box from "../Box";
23
+ import Icon from "../Icon";
24
+ import Token from "../Token";
14
25
  var DefaultDelimiters = [',', 'Enter'];
15
26
  var ControlledPropNames = ['value', 'hasFocus', 'activeToken'];
16
27
  var TokenInput = /*#__PURE__*/function (_React$Component) {
17
- _inheritsLoose(TokenInput, _React$Component);
28
+ _inherits(TokenInput, _React$Component);
29
+ var _super = _createSuper(TokenInput);
18
30
  function TokenInput(props) {
19
31
  var _this;
20
- _this = _React$Component.call(this, props) || this;
21
- _this.delimiterMatcher = void 0;
22
- _this.handleChangeText = function (e) {
32
+ _classCallCheck(this, TokenInput);
33
+ _this = _super.call(this, props);
34
+ _defineProperty(_assertThisInitialized(_this), "handleChangeText", function (e) {
23
35
  var value = e.currentTarget.value;
24
36
  var onChange = _this.props.onChange;
25
37
  _this.setState({
26
38
  value: value
27
39
  });
28
- onChange == null ? void 0 : onChange(e, value);
29
- };
30
- _this.handleFocus = function (e) {
40
+ onChange === null || onChange === void 0 ? void 0 : onChange(e, value);
41
+ });
42
+ _defineProperty(_assertThisInitialized(_this), "handleFocus", function (e) {
31
43
  var onFocus = _this.props.onFocus;
32
44
  _this.setState({
33
45
  hasFocus: true
34
46
  });
35
- onFocus == null ? void 0 : onFocus(e);
36
- };
37
- _this.handleBlur = function (e) {
47
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
48
+ });
49
+ _defineProperty(_assertThisInitialized(_this), "handleBlur", function (e) {
38
50
  var onBlur = _this.props.onBlur;
39
51
  if (onBlur) onBlur(e);
40
52
  _this.setState({
41
53
  hasFocus: false
42
54
  });
43
- };
44
- _this.handleKeyUp = function (e) {
45
- _this.props.onKeyUp == null ? void 0 : _this.props.onKeyUp(e, e.currentTarget.value);
46
- };
47
- _this.handleKeyDown = function (e) {
55
+ });
56
+ _defineProperty(_assertThisInitialized(_this), "handleKeyUp", function (e) {
57
+ var _this$props$onKeyUp, _this$props;
58
+ (_this$props$onKeyUp = (_this$props = _this.props).onKeyUp) === null || _this$props$onKeyUp === void 0 ? void 0 : _this$props$onKeyUp.call(_this$props, e, e.currentTarget.value);
59
+ });
60
+ _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (e) {
48
61
  var onKeyDown = _this.props.onKeyDown;
49
62
  var key = e.key,
50
63
  currentTarget = e.currentTarget;
@@ -64,8 +77,8 @@ var TokenInput = /*#__PURE__*/function (_React$Component) {
64
77
  _this.deleteToken();
65
78
  }
66
79
  }
67
- };
68
- _this.handlePaste = function (e) {
80
+ });
81
+ _defineProperty(_assertThisInitialized(_this), "handlePaste", function (e) {
69
82
  var text = e.clipboardData.getData('text');
70
83
  var onPaste = _this.props.onPaste;
71
84
  if (onPaste) onPaste(e, text);
@@ -77,16 +90,16 @@ var TokenInput = /*#__PURE__*/function (_React$Component) {
77
90
  _this.spawnNewTokens(texts);
78
91
  e.preventDefault();
79
92
  }
80
- };
81
- _this.handleClickToken = function (e, token) {
82
- var _this$props = _this.props,
83
- onClickToken = _this$props.onClickToken,
84
- disabled = _this$props.disabled;
93
+ });
94
+ _defineProperty(_assertThisInitialized(_this), "handleClickToken", function (e, token) {
95
+ var _this$props2 = _this.props,
96
+ onClickToken = _this$props2.onClickToken,
97
+ disabled = _this$props2.disabled;
85
98
  if (onClickToken) onClickToken(e, token.id);
86
99
  if (!disabled) {
87
100
  _this.deleteToken(token.id);
88
101
  }
89
- };
102
+ });
90
103
  var hasFocus = props.hasFocus,
91
104
  activeToken = props.activeToken,
92
105
  _value = props.value,
@@ -100,175 +113,189 @@ var TokenInput = /*#__PURE__*/function (_React$Component) {
100
113
  };
101
114
  return _this;
102
115
  }
103
- TokenInput.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
104
- var prevProps = state.prevProps;
105
- var modifiedState = {};
106
- ControlledPropNames.forEach(function (propName) {
107
- var currentProp = props[propName];
108
- if (currentProp !== prevProps[propName]) {
109
- modifiedState[propName] = currentProp;
116
+ _createClass(TokenInput, [{
117
+ key: "isDelimiter",
118
+ value: function isDelimiter(keyName) {
119
+ var _this$props$delimiter = this.props.delimiters,
120
+ delimiters = _this$props$delimiter === void 0 ? DefaultDelimiters : _this$props$delimiter;
121
+ return delimiters.includes(keyName);
122
+ }
123
+ }, {
124
+ key: "spawnNewTokens",
125
+ value: function spawnNewTokens(texts) {
126
+ var _this$props3 = this.props,
127
+ onAddToken = _this$props3.onAddToken,
128
+ onChangeTokens = _this$props3.onChangeTokens,
129
+ _this$props3$tokenMax = _this$props3.tokenMaxLength,
130
+ max = _this$props3$tokenMax === void 0 ? Infinity : _this$props3$tokenMax,
131
+ _this$props3$tokens = _this$props3.tokens,
132
+ tokens = _this$props3$tokens === void 0 ? [] : _this$props3$tokens;
133
+ var tokenSpecs = texts.map(function (text) {
134
+ return asTokenSpec(text.slice(0, max));
135
+ });
136
+ if (onAddToken) {
137
+ tokenSpecs.forEach(onAddToken);
138
+ } else if (onChangeTokens) {
139
+ onChangeTokens(tokens.concat(tokenSpecs));
110
140
  }
111
- });
112
- modifiedState.prevProps = props;
113
- return modifiedState;
114
- };
115
- var _proto = TokenInput.prototype;
116
- _proto.isDelimiter = function isDelimiter(keyName) {
117
- var _this$props$delimiter = this.props.delimiters,
118
- delimiters = _this$props$delimiter === void 0 ? DefaultDelimiters : _this$props$delimiter;
119
- return delimiters.includes(keyName);
120
- };
121
- _proto.spawnNewTokens = function spawnNewTokens(texts) {
122
- var _this$props2 = this.props,
123
- onAddToken = _this$props2.onAddToken,
124
- onChangeTokens = _this$props2.onChangeTokens,
125
- _this$props2$tokenMax = _this$props2.tokenMaxLength,
126
- max = _this$props2$tokenMax === void 0 ? Infinity : _this$props2$tokenMax,
127
- _this$props2$tokens = _this$props2.tokens,
128
- tokens = _this$props2$tokens === void 0 ? [] : _this$props2$tokens;
129
- var tokenSpecs = texts.map(function (text) {
130
- return asTokenSpec(text.slice(0, max));
131
- });
132
- if (onAddToken) {
133
- tokenSpecs.forEach(onAddToken);
134
- } else if (onChangeTokens) {
135
- onChangeTokens(tokens.concat(tokenSpecs));
141
+ this.setState({
142
+ value: ''
143
+ });
136
144
  }
137
- this.setState({
138
- value: ''
139
- });
140
- };
141
- _proto.deleteToken = function deleteToken(tokenId) {
142
- var _this$props3 = this.props,
143
- onRemoveToken = _this$props3.onRemoveToken,
144
- onChangeTokens = _this$props3.onChangeTokens,
145
- _this$props3$tokens = _this$props3.tokens,
146
- tokens = _this$props3$tokens === void 0 ? [] : _this$props3$tokens;
147
- var count = tokens.length;
148
- if (count === 0) return;
149
- var id = tokenId != null ? tokenId : tokens[count - 1].id;
150
- if (onRemoveToken) {
151
- onRemoveToken(id);
152
- } else if (onChangeTokens) {
153
- onChangeTokens(tokens.filter(function (tokenSpec) {
154
- return tokenSpec.id !== id;
155
- }));
145
+ }, {
146
+ key: "deleteToken",
147
+ value: function deleteToken(tokenId) {
148
+ var _this$props4 = this.props,
149
+ onRemoveToken = _this$props4.onRemoveToken,
150
+ onChangeTokens = _this$props4.onChangeTokens,
151
+ _this$props4$tokens = _this$props4.tokens,
152
+ tokens = _this$props4$tokens === void 0 ? [] : _this$props4$tokens;
153
+ var count = tokens.length;
154
+ if (count === 0) return;
155
+ var id = tokenId !== null && tokenId !== void 0 ? tokenId : tokens[count - 1].id;
156
+ if (onRemoveToken) {
157
+ onRemoveToken(id);
158
+ } else if (onChangeTokens) {
159
+ onChangeTokens(tokens.filter(function (tokenSpec) {
160
+ return tokenSpec.id !== id;
161
+ }));
162
+ }
163
+ this.setState({
164
+ value: ''
165
+ });
156
166
  }
157
- this.setState({
158
- value: ''
159
- });
160
- };
161
- _proto.renderToken = function renderToken(token) {
162
- var _this2 = this;
163
- var _this$props4 = this.props,
164
- defaultIconName = _this$props4.iconName,
165
- disabled = _this$props4.disabled;
166
- var activeId = this.state.activeToken;
167
- var id = token.id,
168
- tokenIconName = token.iconName,
169
- value = token.value,
170
- valid = token.valid;
171
- var iconName = tokenIconName || defaultIconName;
172
- var isActive = activeId === id;
173
- return /*#__PURE__*/React.createElement(Token, {
174
- id: id,
175
- onClick: function onClick(e) {
176
- return _this2.handleClickToken(e, token);
177
- },
178
- valid: valid,
179
- active: isActive,
180
- disabled: disabled
181
- }, /*#__PURE__*/React.createElement(Box, {
182
- display: "flex",
183
- alignItems: "center"
184
- }, iconName && /*#__PURE__*/React.createElement(Icon, {
185
- name: iconName,
186
- size: "mini",
187
- pr: 300
188
- }), value));
189
- };
190
- _proto.renderTokens = function renderTokens(tokens) {
191
- var _this3 = this;
192
- return tokens.map(function (token) {
193
- return /*#__PURE__*/React.createElement("div", {
194
- key: token.id,
195
- className: "TokenInput-token"
196
- }, _this3.renderToken(token));
197
- });
198
- };
199
- _proto.render = function render() {
200
- var _this$props5 = this.props,
201
- autoFocus = _this$props5.autoFocus,
202
- autocomplete = _this$props5.autocomplete,
203
- disabled = _this$props5.disabled,
204
- isInvalid = _this$props5.isInvalid,
205
- hasWarning = _this$props5.hasWarning,
206
- id = _this$props5.id,
207
- name = _this$props5.name,
208
- placeholder = _this$props5.placeholder,
209
- required = _this$props5.required,
210
- value = _this$props5.value,
211
- elemBefore = _this$props5.elemBefore,
212
- elemAfter = _this$props5.elemAfter,
213
- maxLength = _this$props5.maxLength,
214
- ariaDescribedby = _this$props5.ariaDescribedby,
215
- ariaLabel = _this$props5.ariaLabel,
216
- innerRef = _this$props5.innerRef,
217
- onAddToken = _this$props5.onAddToken,
218
- onRemoveToken = _this$props5.onRemoveToken,
219
- onChangeTokens = _this$props5.onChangeTokens,
220
- onClickToken = _this$props5.onClickToken,
221
- onBlur = _this$props5.onBlur,
222
- onChange = _this$props5.onChange,
223
- onFocus = _this$props5.onFocus,
224
- onKeyDown = _this$props5.onKeyDown,
225
- onKeyUp = _this$props5.onKeyUp,
226
- onPaste = _this$props5.onPaste,
227
- _this$props5$inputPro = _this$props5.inputProps,
228
- inputProps = _this$props5$inputPro === void 0 ? {} : _this$props5$inputPro,
229
- _this$props5$qa = _this$props5.qa,
230
- qa = _this$props5$qa === void 0 ? {} : _this$props5$qa,
231
- tokens = _this$props5.tokens,
232
- rest = _objectWithoutPropertiesLoose(_this$props5, _excluded);
233
- var state = this.state;
234
- return /*#__PURE__*/React.createElement(Container, _extends({
235
- hasBeforeElement: !!elemBefore,
236
- hasAfterElement: !!elemAfter,
237
- disabled: disabled,
238
- invalid: !!isInvalid,
239
- warning: hasWarning,
240
- focused: state.hasFocus
241
- // $FlowIssue - upgrade v0.112.0
242
- }, rest), elemBefore && /*#__PURE__*/React.createElement(Accessory, {
243
- before: true
244
- }, elemBefore), tokens && this.renderTokens(tokens), /*#__PURE__*/React.createElement("input", _extends({
245
- "aria-describedby": ariaDescribedby,
246
- "aria-invalid": !!isInvalid,
247
- "aria-label": ariaLabel,
248
- autoFocus: autoFocus,
249
- autoComplete: autocomplete,
250
- disabled: disabled,
251
- id: id,
252
- name: name,
253
- placeholder: placeholder,
254
- type: "text",
255
- required: required,
256
- value: state.value,
257
- maxLength: maxLength,
258
- onBlur: this.handleBlur,
259
- onChange: this.handleChangeText,
260
- onFocus: this.handleFocus,
261
- onKeyDown: this.handleKeyDown,
262
- onKeyUp: this.handleKeyUp,
263
- onPaste: this.handlePaste,
264
- ref: innerRef,
265
- "data-qa-input": name || '',
266
- "data-qa-input-isdisabled": !!disabled,
267
- "data-qa-input-isrequired": !!required
268
- }, qa, inputProps)), elemAfter && /*#__PURE__*/React.createElement(Accessory, {
269
- after: true
270
- }, elemAfter));
271
- };
167
+ }, {
168
+ key: "renderToken",
169
+ value: function renderToken(token) {
170
+ var _this2 = this;
171
+ var _this$props5 = this.props,
172
+ defaultIconName = _this$props5.iconName,
173
+ disabled = _this$props5.disabled;
174
+ var activeId = this.state.activeToken;
175
+ var id = token.id,
176
+ tokenIconName = token.iconName,
177
+ value = token.value,
178
+ valid = token.valid;
179
+ var iconName = tokenIconName || defaultIconName;
180
+ var isActive = activeId === id;
181
+ return /*#__PURE__*/React.createElement(Token, {
182
+ id: id,
183
+ onClick: function onClick(e) {
184
+ return _this2.handleClickToken(e, token);
185
+ },
186
+ valid: valid,
187
+ active: isActive,
188
+ disabled: disabled
189
+ }, /*#__PURE__*/React.createElement(Box, {
190
+ display: "flex",
191
+ alignItems: "center"
192
+ }, iconName && /*#__PURE__*/React.createElement(Icon, {
193
+ name: iconName,
194
+ size: "mini",
195
+ pr: 300
196
+ }), value));
197
+ }
198
+ }, {
199
+ key: "renderTokens",
200
+ value: function renderTokens(tokens) {
201
+ var _this3 = this;
202
+ return tokens.map(function (token) {
203
+ return /*#__PURE__*/React.createElement("div", {
204
+ key: token.id,
205
+ className: "TokenInput-token"
206
+ }, _this3.renderToken(token));
207
+ });
208
+ }
209
+ }, {
210
+ key: "render",
211
+ value: function render() {
212
+ var _this$props6 = this.props,
213
+ autoFocus = _this$props6.autoFocus,
214
+ autocomplete = _this$props6.autocomplete,
215
+ disabled = _this$props6.disabled,
216
+ isInvalid = _this$props6.isInvalid,
217
+ hasWarning = _this$props6.hasWarning,
218
+ id = _this$props6.id,
219
+ name = _this$props6.name,
220
+ placeholder = _this$props6.placeholder,
221
+ required = _this$props6.required,
222
+ value = _this$props6.value,
223
+ elemBefore = _this$props6.elemBefore,
224
+ elemAfter = _this$props6.elemAfter,
225
+ maxLength = _this$props6.maxLength,
226
+ ariaDescribedby = _this$props6.ariaDescribedby,
227
+ ariaLabel = _this$props6.ariaLabel,
228
+ innerRef = _this$props6.innerRef,
229
+ onAddToken = _this$props6.onAddToken,
230
+ onRemoveToken = _this$props6.onRemoveToken,
231
+ onChangeTokens = _this$props6.onChangeTokens,
232
+ onClickToken = _this$props6.onClickToken,
233
+ onBlur = _this$props6.onBlur,
234
+ onChange = _this$props6.onChange,
235
+ onFocus = _this$props6.onFocus,
236
+ onKeyDown = _this$props6.onKeyDown,
237
+ onKeyUp = _this$props6.onKeyUp,
238
+ onPaste = _this$props6.onPaste,
239
+ _this$props6$inputPro = _this$props6.inputProps,
240
+ inputProps = _this$props6$inputPro === void 0 ? {} : _this$props6$inputPro,
241
+ _this$props6$qa = _this$props6.qa,
242
+ qa = _this$props6$qa === void 0 ? {} : _this$props6$qa,
243
+ tokens = _this$props6.tokens,
244
+ rest = _objectWithoutProperties(_this$props6, _excluded);
245
+ var state = this.state;
246
+ return /*#__PURE__*/React.createElement(Container, _extends({
247
+ hasBeforeElement: !!elemBefore,
248
+ hasAfterElement: !!elemAfter,
249
+ disabled: disabled,
250
+ invalid: !!isInvalid,
251
+ warning: hasWarning,
252
+ focused: state.hasFocus
253
+ // $FlowIssue - upgrade v0.112.0
254
+ }, rest), elemBefore && /*#__PURE__*/React.createElement(Accessory, {
255
+ before: true
256
+ }, elemBefore), tokens && this.renderTokens(tokens), /*#__PURE__*/React.createElement("input", _extends({
257
+ "aria-describedby": ariaDescribedby,
258
+ "aria-invalid": !!isInvalid,
259
+ "aria-label": ariaLabel,
260
+ autoFocus: autoFocus,
261
+ autoComplete: autocomplete,
262
+ disabled: disabled,
263
+ id: id,
264
+ name: name,
265
+ placeholder: placeholder,
266
+ type: "text",
267
+ required: required,
268
+ value: state.value,
269
+ maxLength: maxLength,
270
+ onBlur: this.handleBlur,
271
+ onChange: this.handleChangeText,
272
+ onFocus: this.handleFocus,
273
+ onKeyDown: this.handleKeyDown,
274
+ onKeyUp: this.handleKeyUp,
275
+ onPaste: this.handlePaste,
276
+ ref: innerRef,
277
+ "data-qa-input": name || '',
278
+ "data-qa-input-isdisabled": !!disabled,
279
+ "data-qa-input-isrequired": !!required
280
+ }, qa, inputProps)), elemAfter && /*#__PURE__*/React.createElement(Accessory, {
281
+ after: true
282
+ }, elemAfter));
283
+ }
284
+ }], [{
285
+ key: "getDerivedStateFromProps",
286
+ value: function getDerivedStateFromProps(props, state) {
287
+ var prevProps = state.prevProps;
288
+ var modifiedState = {};
289
+ ControlledPropNames.forEach(function (propName) {
290
+ var currentProp = props[propName];
291
+ if (currentProp !== prevProps[propName]) {
292
+ modifiedState[propName] = currentProp;
293
+ }
294
+ });
295
+ modifiedState.prevProps = props;
296
+ return modifiedState;
297
+ }
298
+ }]);
272
299
  return TokenInput;
273
300
  }(React.Component);
274
301
  export { TokenInput as default };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import styled, { css } from 'styled-components';
3
- import { COMMON } from '../utils/system-props';
4
- import { focusRing } from '../utils/mixins';
3
+ import { COMMON } from "../utils/system-props";
4
+ import { focusRing } from "../utils/mixins";
5
5
  var Container = styled.div.withConfig({
6
6
  displayName: "styles__Container",
7
7
  componentId: "sc-19um4n4-0"
@@ -3,7 +3,7 @@
3
3
  import uniqueId from 'lodash.uniqueid';
4
4
  export var asTokenSpec = function asTokenSpec(text) {
5
5
  return {
6
- id: uniqueId(text + "-"),
6
+ id: uniqueId("".concat(text, "-")),
7
7
  value: text.trim()
8
8
  };
9
9
  };
@@ -15,5 +15,5 @@ export var delimitersAsRegExp = function delimitersAsRegExp(delimiters) {
15
15
  var chars = delimiters.map(function (key) {
16
16
  return KeyNameToRegExpChar[key] || key;
17
17
  }).join('');
18
- return RegExp("[" + chars + "]");
18
+ return RegExp("[".concat(chars, "]"));
19
19
  };
@@ -1,11 +1,22 @@
1
1
  var _excluded = ["content", "children", "enterDelay", "placement", "appearance", "zIndex", "qa", "popoutProps", "truncated"],
2
2
  _excluded2 = ["appearance", "children"];
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ 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); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
3
14
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
4
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
16
  import * as React from 'react';
6
17
  import { useState, useEffect } from 'react';
7
- import { TooltipContent } from './styles';
8
- import Popout from '../Popout';
18
+ import { TooltipContent } from "./styles";
19
+ import Popout from "../Popout";
9
20
  import MOTION from '@sproutsocial/seeds-motion/dist/seeds-motion-unitless';
10
21
  var idCounter = 0;
11
22
  var wrapContent = function wrapContent(content, show, hide, Wrapper, appearance, ariaProps, wrapperStyles) {
@@ -32,15 +43,18 @@ var Tooltip = function Tooltip(_ref) {
32
43
  popoutProps = _ref.popoutProps,
33
44
  _ref$truncated = _ref.truncated,
34
45
  truncated = _ref$truncated === void 0 ? false : _ref$truncated,
35
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
46
+ rest = _objectWithoutProperties(_ref, _excluded);
36
47
  var _useState = useState(false),
37
- shouldShow = _useState[0],
38
- setShouldShow = _useState[1];
39
- var _useState2 = useState(false),
40
- isOpen = _useState2[0],
41
- setIsOpen = _useState2[1];
42
- var _useState3 = useState("Racine-tooltip-" + idCounter++),
43
- id = _useState3[0];
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ shouldShow = _useState2[0],
50
+ setShouldShow = _useState2[1];
51
+ var _useState3 = useState(false),
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ isOpen = _useState4[0],
54
+ setIsOpen = _useState4[1];
55
+ var _useState5 = useState("Racine-tooltip-".concat(idCounter++)),
56
+ _useState6 = _slicedToArray(_useState5, 1),
57
+ id = _useState6[0];
44
58
  var isInvalidContent = content === null || content === undefined;
45
59
  var show = function show() {
46
60
  return setShouldShow(true);
@@ -49,7 +63,7 @@ var Tooltip = function Tooltip(_ref) {
49
63
  return setShouldShow(false);
50
64
  };
51
65
  var exitDelay = MOTION.MOTION_DURATION_FAST * 1000;
52
- var defaultAppearance = appearance || (typeof content === 'object' ? 'box' : 'pill');
66
+ var defaultAppearance = appearance || (_typeof(content) === 'object' ? 'box' : 'pill');
53
67
  var shouldTooltipContentsBeInteractive = defaultAppearance === 'box';
54
68
  useEffect(function () {
55
69
  var timeout;
@@ -68,7 +82,7 @@ var Tooltip = function Tooltip(_ref) {
68
82
  }, [isOpen, shouldShow, enterDelay, exitDelay]);
69
83
  var wrappedContent = wrapContent(
70
84
  // $FlowIssue - https://github.com/facebook/flow/issues/6392
71
- content, shouldTooltipContentsBeInteractive ? show : undefined, shouldTooltipContentsBeInteractive ? hide : undefined, Content, defaultAppearance, _extends({
85
+ content, shouldTooltipContentsBeInteractive ? show : undefined, shouldTooltipContentsBeInteractive ? hide : undefined, Content, defaultAppearance, _objectSpread({
72
86
  id: id
73
87
  }, rest), {});
74
88
  var ariaPropsForWrappedChildren = isOpen ? {
@@ -86,7 +100,7 @@ var Tooltip = function Tooltip(_ref) {
86
100
  content: !isInvalidContent ? wrappedContent : undefined,
87
101
  isOpen: isOpen,
88
102
  placement: placement,
89
- qa: _extends({
103
+ qa: _objectSpread({
90
104
  'data-qa-tooltip': id
91
105
  }, qa),
92
106
  focusOnContent: false,
@@ -98,7 +112,7 @@ var Content = function Content(_ref2) {
98
112
  var _ref2$appearance = _ref2.appearance,
99
113
  appearance = _ref2$appearance === void 0 ? 'pill' : _ref2$appearance,
100
114
  children = _ref2.children,
101
- rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
115
+ rest = _objectWithoutProperties(_ref2, _excluded2);
102
116
  return /*#__PURE__*/React.createElement(TooltipContent, _extends({
103
117
  appearance: appearance,
104
118
  borderRadius: appearance === 'box' ? 500 : '5000em',
@@ -1,6 +1,6 @@
1
1
 
2
2
  import styled from 'styled-components';
3
- import Box from '../Box';
3
+ import Box from "../Box";
4
4
  export var TooltipContent = styled(Box).withConfig({
5
5
  displayName: "styles__TooltipContent",
6
6
  componentId: "sc-t1xjnk-0"
@@ -1,5 +1,5 @@
1
1
 
2
- import { visuallyHidden } from '../utils/mixins';
2
+ import { visuallyHidden } from "../utils/mixins";
3
3
  import styled from 'styled-components';
4
4
  export var VisuallyHidden = styled.span.withConfig({
5
5
  displayName: "VisuallyHidden",
@@ -1,6 +1,6 @@
1
1
 
2
2
  import React from 'react';
3
- import Box from '../Box';
3
+ import Box from "../Box";
4
4
  import { withTheme } from 'styled-components';
5
5
  export var DataVizRotation = withTheme(function (p) {
6
6
  return p.theme.colors.DATAVIZ_COLORS_LIST.map(function (color, i) {