@sproutsocial/racine 14.3.0 → 15.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/__flow__/Card/Card.flow.js +1 -17
  3. package/__flow__/Card/CardTypes.flow.js +66 -0
  4. package/__flow__/Card/index.flow.js +2 -1
  5. package/__flow__/EnumIconNames.flow.js +1 -1
  6. package/__flow__/IconViewBoxes.js +2 -0
  7. package/__flow__/index.flow.js +1 -1
  8. package/__flow__/systemProps/{background.js → background.flow.js} +1 -1
  9. package/__flow__/systemProps/{border.js → border.flow.js} +1 -1
  10. package/__flow__/systemProps/{color.js → color.flow.js} +2 -2
  11. package/__flow__/systemProps/{custom.js → custom.flow.js} +1 -1
  12. package/__flow__/systemProps/{flexbox.js → flexbox.flow.js} +1 -1
  13. package/__flow__/systemProps/{grid.js → grid.flow.js} +1 -1
  14. package/__flow__/systemProps/index.flow.js +16 -0
  15. package/__flow__/systemProps/{layout.js → layout.flow.js} +1 -1
  16. package/__flow__/systemProps/{position.js → position.flow.js} +1 -1
  17. package/__flow__/systemProps/{shadow.js → shadow.flow.js} +1 -1
  18. package/__flow__/systemProps/{space.js → space.flow.js} +1 -1
  19. package/__flow__/systemProps/{systemProps.js → systemProps.flow.js} +13 -13
  20. package/__flow__/systemProps/{typography.js → typography.flow.js} +1 -1
  21. package/__flow__/systemProps/{variant.js → variant.flow.js} +1 -1
  22. package/__flow__/types/shared.flow.js +5 -1
  23. package/commonjs/Card/Card.js +71 -26
  24. package/commonjs/Card/CardTypes.flow.js +6 -0
  25. package/commonjs/Card/index.flow.js +11 -0
  26. package/commonjs/Card/index.js +23 -1
  27. package/commonjs/Card/styles.js +102 -22
  28. package/commonjs/Card/subComponents.js +48 -0
  29. package/commonjs/Card/utils.js +56 -0
  30. package/commonjs/Icon/Icon.js +1 -0
  31. package/commonjs/IconViewBoxes.js +2 -0
  32. package/commonjs/Loader/styles.js +17 -12
  33. package/commonjs/index.flow.js +125 -125
  34. package/commonjs/systemProps/index.flow.js +159 -0
  35. package/commonjs/systemProps/{systemProps.js → systemProps.flow.js} +12 -12
  36. package/commonjs/types/shared.flow.js +6 -1
  37. package/commonjs/utils/index.js +15 -0
  38. package/dist/icon.svg +1 -1
  39. package/dist/iconList.js +1 -1
  40. package/dist/types/Avatar/Avatar.d.ts +2 -2
  41. package/dist/types/Avatar/Avatar.d.ts.map +1 -1
  42. package/dist/types/Badge/Badge.d.ts +2 -1
  43. package/dist/types/Badge/Badge.d.ts.map +1 -1
  44. package/dist/types/Banner/Banner.d.ts +2 -1
  45. package/dist/types/Banner/Banner.d.ts.map +1 -1
  46. package/dist/types/Banner/styles.d.ts +3 -2
  47. package/dist/types/Banner/styles.d.ts.map +1 -1
  48. package/dist/types/Box/Box.d.ts +1 -1
  49. package/dist/types/Box/Box.d.ts.map +1 -1
  50. package/dist/types/Breadcrumb/Breadcrumb.d.ts +3 -2
  51. package/dist/types/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  52. package/dist/types/Button/Button.d.ts +2 -1
  53. package/dist/types/Button/Button.d.ts.map +1 -1
  54. package/dist/types/Card/Card.d.ts +16 -2
  55. package/dist/types/Card/Card.d.ts.map +1 -1
  56. package/dist/types/Card/CardTypes.d.ts +48 -11
  57. package/dist/types/Card/CardTypes.d.ts.map +1 -1
  58. package/dist/types/Card/__tests__/CardTypes.d.ts +2 -0
  59. package/dist/types/Card/__tests__/CardTypes.d.ts.map +1 -0
  60. package/dist/types/Card/index.d.ts +1 -0
  61. package/dist/types/Card/index.d.ts.map +1 -1
  62. package/dist/types/Card/styles.d.ts +13 -6
  63. package/dist/types/Card/styles.d.ts.map +1 -1
  64. package/dist/types/Card/subComponents.d.ts +17 -0
  65. package/dist/types/Card/subComponents.d.ts.map +1 -0
  66. package/dist/types/Card/utils.d.ts +16 -0
  67. package/dist/types/Card/utils.d.ts.map +1 -0
  68. package/dist/types/CharacterCounter/CharacterCounter.d.ts +1 -1
  69. package/dist/types/ChartLegend/ChartLegend.d.ts +2 -1
  70. package/dist/types/ChartLegend/ChartLegend.d.ts.map +1 -1
  71. package/dist/types/Checkbox/Checkbox.d.ts +1 -1
  72. package/dist/types/Checkbox/styles.d.ts +4 -4
  73. package/dist/types/Checkbox/styles.d.ts.map +1 -1
  74. package/dist/types/Collapsible/Collapsible.d.ts +4 -3
  75. package/dist/types/Collapsible/Collapsible.d.ts.map +1 -1
  76. package/dist/types/Collapsible/styles.d.ts +1 -1
  77. package/dist/types/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -1
  78. package/dist/types/DatePicker/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  79. package/dist/types/DatePicker/DateRangePicker/StatefulDateRangePicker.d.ts +2 -1
  80. package/dist/types/DatePicker/DateRangePicker/StatefulDateRangePicker.d.ts.map +1 -1
  81. package/dist/types/DatePicker/SingleDatePicker/StatefulSingleDatePicker.d.ts +2 -1
  82. package/dist/types/DatePicker/SingleDatePicker/StatefulSingleDatePicker.d.ts.map +1 -1
  83. package/dist/types/DatePicker/common.d.ts +2 -1
  84. package/dist/types/DatePicker/common.d.ts.map +1 -1
  85. package/dist/types/DatePicker/styles.d.ts +1 -1
  86. package/dist/types/Drawer/Drawer.d.ts +2 -2
  87. package/dist/types/Drawer/SlideTransition.d.ts +1 -1
  88. package/dist/types/Drawer/SlideTransition.d.ts.map +1 -1
  89. package/dist/types/Drawer/styles.d.ts +1 -1
  90. package/dist/types/Drawer/styles.d.ts.map +1 -1
  91. package/dist/types/EmptyState/EmptyState.d.ts +2 -1
  92. package/dist/types/EmptyState/EmptyState.d.ts.map +1 -1
  93. package/dist/types/EnumIconNames.d.ts +1 -1
  94. package/dist/types/EnumIconNames.d.ts.map +1 -1
  95. package/dist/types/Fieldset/Fieldset.d.ts +4 -3
  96. package/dist/types/Fieldset/Fieldset.d.ts.map +1 -1
  97. package/dist/types/Fieldset/styles.d.ts +1 -1
  98. package/dist/types/Fieldset/styles.d.ts.map +1 -1
  99. package/dist/types/FormField/FormField.d.ts +2 -1
  100. package/dist/types/FormField/FormField.d.ts.map +1 -1
  101. package/dist/types/Icon/Icon.d.ts +4 -2
  102. package/dist/types/Icon/Icon.d.ts.map +1 -1
  103. package/dist/types/Image/Image.d.ts +1 -1
  104. package/dist/types/Indicator/Indicator.d.ts +1 -1
  105. package/dist/types/Input/Input.d.ts +2 -2
  106. package/dist/types/KeyboardKey/KeyboardKey.d.ts +1 -1
  107. package/dist/types/Label/Label.d.ts +1 -1
  108. package/dist/types/Link/Link.d.ts +2 -1
  109. package/dist/types/Link/Link.d.ts.map +1 -1
  110. package/dist/types/Link/styles.d.ts +2 -1
  111. package/dist/types/Link/styles.d.ts.map +1 -1
  112. package/dist/types/Listbox/Listbox.d.ts +11 -10
  113. package/dist/types/Listbox/Listbox.d.ts.map +1 -1
  114. package/dist/types/Listbox/ListboxTypes.d.ts +1 -1
  115. package/dist/types/Listbox/ListboxTypes.d.ts.map +1 -1
  116. package/dist/types/Loader/Loader.d.ts +1 -1
  117. package/dist/types/Loader/styles.d.ts.map +1 -1
  118. package/dist/types/LoaderButton/LoaderButton.d.ts +2 -1
  119. package/dist/types/LoaderButton/LoaderButton.d.ts.map +1 -1
  120. package/dist/types/Menu/Menu.d.ts +14 -13
  121. package/dist/types/Menu/Menu.d.ts.map +1 -1
  122. package/dist/types/Menu/MenuTypes.d.ts +1 -1
  123. package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
  124. package/dist/types/Menu/styles.d.ts +2 -2
  125. package/dist/types/Menu/styles.d.ts.map +1 -1
  126. package/dist/types/Menu/utils/descendants.d.ts +1 -1
  127. package/dist/types/Menu/utils/descendants.d.ts.map +1 -1
  128. package/dist/types/Message/Message.d.ts +8 -8
  129. package/dist/types/Message/styles.d.ts +5 -5
  130. package/dist/types/Message/styles.d.ts.map +1 -1
  131. package/dist/types/Modal/Modal.d.ts +5 -5
  132. package/dist/types/Modal/styles.d.ts +5 -5
  133. package/dist/types/Modal/styles.d.ts.map +1 -1
  134. package/dist/types/Numeral/Numeral.d.ts +2 -1
  135. package/dist/types/Numeral/Numeral.d.ts.map +1 -1
  136. package/dist/types/Numeral/styles.d.ts +3 -2
  137. package/dist/types/Numeral/styles.d.ts.map +1 -1
  138. package/dist/types/OverflowList/OverflowList.d.ts +2 -1
  139. package/dist/types/OverflowList/OverflowList.d.ts.map +1 -1
  140. package/dist/types/OverflowList/styles.d.ts +2 -1
  141. package/dist/types/OverflowList/styles.d.ts.map +1 -1
  142. package/dist/types/PartnerLogo/PartnerLogo.d.ts +2 -1
  143. package/dist/types/PartnerLogo/PartnerLogo.d.ts.map +1 -1
  144. package/dist/types/Popout/Popout.d.ts +3 -2
  145. package/dist/types/Popout/Popout.d.ts.map +1 -1
  146. package/dist/types/Popout/PopoutTypes.d.ts +1 -1
  147. package/dist/types/Popout/PopoutTypes.d.ts.map +1 -1
  148. package/dist/types/Radio/Radio.d.ts +1 -1
  149. package/dist/types/Radio/styles.d.ts +2 -1
  150. package/dist/types/Radio/styles.d.ts.map +1 -1
  151. package/dist/types/SegmentedControl/SegmentedControl.d.ts +3 -2
  152. package/dist/types/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  153. package/dist/types/SegmentedControl/styles.d.ts +3 -3
  154. package/dist/types/SegmentedControl/styles.d.ts.map +1 -1
  155. package/dist/types/Select/Select.d.ts +1 -1
  156. package/dist/types/Skeleton/Skeleton.d.ts +1 -1
  157. package/dist/types/Skeleton/Skeleton.d.ts.map +1 -1
  158. package/dist/types/SpotIllustration/SpotIllustration.d.ts +2 -1
  159. package/dist/types/SpotIllustration/SpotIllustration.d.ts.map +1 -1
  160. package/dist/types/Stack/Stack.d.ts +2 -1
  161. package/dist/types/Stack/Stack.d.ts.map +1 -1
  162. package/dist/types/Switch/Switch.d.ts +1 -1
  163. package/dist/types/Table/Table.d.ts +8 -7
  164. package/dist/types/Table/Table.d.ts.map +1 -1
  165. package/dist/types/TableCell/TableCell.d.ts +1 -1
  166. package/dist/types/TableCell/TableCellTypes.d.ts +1 -1
  167. package/dist/types/TableCell/TableCellTypes.d.ts.map +1 -1
  168. package/dist/types/TableHeaderCell/TableHeaderCell.d.ts +2 -2
  169. package/dist/types/TableHeaderCell/TableHeaderCell.d.ts.map +1 -1
  170. package/dist/types/TableRowAccordion/TableRowAccordion.d.ts +1 -1
  171. package/dist/types/Tabs/Tabs.d.ts +2 -2
  172. package/dist/types/Tabs/styles.d.ts +2 -1
  173. package/dist/types/Tabs/styles.d.ts.map +1 -1
  174. package/dist/types/Text/Text.d.ts +2 -1
  175. package/dist/types/Text/Text.d.ts.map +1 -1
  176. package/dist/types/Textarea/Textarea.d.ts +1 -1
  177. package/dist/types/ThemeProvider/index.d.ts +1 -1
  178. package/dist/types/ThemeProvider/index.d.ts.map +1 -1
  179. package/dist/types/Toast/Toast.d.ts +2 -1
  180. package/dist/types/Toast/Toast.d.ts.map +1 -1
  181. package/dist/types/Toast/styles.d.ts +3 -3
  182. package/dist/types/Toast/styles.d.ts.map +1 -1
  183. package/dist/types/ToggleHint/ToggleHint.d.ts +2 -2
  184. package/dist/types/ToggleHint/ToggleHint.d.ts.map +1 -1
  185. package/dist/types/Token/Token.d.ts +2 -1
  186. package/dist/types/Token/Token.d.ts.map +1 -1
  187. package/dist/types/TokenInput/TokenInput.d.ts +1 -1
  188. package/dist/types/Tooltip/Tooltip.d.ts +2 -1
  189. package/dist/types/Tooltip/Tooltip.d.ts.map +1 -1
  190. package/dist/types/Tooltip/TooltipTypes.d.ts +1 -1
  191. package/dist/types/Tooltip/TooltipTypes.d.ts.map +1 -1
  192. package/dist/types/Tooltip/styles.d.ts +1 -1
  193. package/dist/types/Tooltip/styles.d.ts.map +1 -1
  194. package/dist/types/systemProps/index.d.ts +3 -79
  195. package/dist/types/systemProps/index.d.ts.map +1 -1
  196. package/dist/types/types/styled-components.d.ts +3 -3
  197. package/dist/types/types/styled-components.d.ts.map +1 -1
  198. package/dist/types/utils/index.d.ts +2 -0
  199. package/dist/types/utils/index.d.ts.map +1 -1
  200. package/dist/types/utils/innerText.d.ts.map +1 -1
  201. package/icons/hand-sparkle-outline.svg +6 -0
  202. package/icons/hand-sparkle.svg +3 -0
  203. package/lib/Card/Card.js +73 -28
  204. package/lib/Card/CardTypes.flow.js +1 -0
  205. package/lib/Card/index.flow.js +2 -1
  206. package/lib/Card/index.js +1 -0
  207. package/lib/Card/styles.js +96 -20
  208. package/lib/Card/subComponents.js +37 -0
  209. package/lib/Card/utils.js +46 -0
  210. package/lib/Icon/Icon.js +1 -0
  211. package/lib/IconViewBoxes.js +2 -0
  212. package/lib/Loader/styles.js +17 -12
  213. package/lib/index.flow.js +1 -1
  214. package/lib/systemProps/index.flow.js +14 -0
  215. package/lib/systemProps/index.js +1 -45
  216. package/lib/systemProps/systemProps.flow.js +14 -0
  217. package/lib/types/shared.flow.js +1 -0
  218. package/lib/utils/index.js +13 -0
  219. package/package.json +14 -11
  220. package/__flow__/systemProps/index.js +0 -16
  221. package/lib/systemProps/systemProps.js +0 -14
  222. /package/commonjs/systemProps/{background.js → background.flow.js} +0 -0
  223. /package/commonjs/systemProps/{border.js → border.flow.js} +0 -0
  224. /package/commonjs/systemProps/{color.js → color.flow.js} +0 -0
  225. /package/commonjs/systemProps/{custom.js → custom.flow.js} +0 -0
  226. /package/commonjs/systemProps/{flexbox.js → flexbox.flow.js} +0 -0
  227. /package/commonjs/systemProps/{grid.js → grid.flow.js} +0 -0
  228. /package/commonjs/systemProps/{layout.js → layout.flow.js} +0 -0
  229. /package/commonjs/systemProps/{position.js → position.flow.js} +0 -0
  230. /package/commonjs/systemProps/{shadow.js → shadow.flow.js} +0 -0
  231. /package/commonjs/systemProps/{space.js → space.flow.js} +0 -0
  232. /package/commonjs/systemProps/{typography.js → typography.flow.js} +0 -0
  233. /package/commonjs/systemProps/{variant.js → variant.flow.js} +0 -0
  234. /package/lib/systemProps/{background.js → background.flow.js} +0 -0
  235. /package/lib/systemProps/{border.js → border.flow.js} +0 -0
  236. /package/lib/systemProps/{color.js → color.flow.js} +0 -0
  237. /package/lib/systemProps/{custom.js → custom.flow.js} +0 -0
  238. /package/lib/systemProps/{flexbox.js → flexbox.flow.js} +0 -0
  239. /package/lib/systemProps/{grid.js → grid.flow.js} +0 -0
  240. /package/lib/systemProps/{layout.js → layout.flow.js} +0 -0
  241. /package/lib/systemProps/{position.js → position.flow.js} +0 -0
  242. /package/lib/systemProps/{shadow.js → shadow.flow.js} +0 -0
  243. /package/lib/systemProps/{space.js → space.flow.js} +0 -0
  244. /package/lib/systemProps/{typography.js → typography.flow.js} +0 -0
  245. /package/lib/systemProps/{variant.js → variant.flow.js} +0 -0
@@ -0,0 +1,37 @@
1
+ var _excluded = ["children"],
2
+ _excluded2 = ["children"],
3
+ _excluded3 = ["children"];
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; }
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; }
6
+ import React from 'react';
7
+ import { useChildContext } from "./utils";
8
+ import { StyledCardContent, StyledCardHeader, StyledCardFooter, StyledSelectedIcon, SelectedIconWrapper } from "./styles";
9
+ export var CardContent = function CardContent(_ref) {
10
+ var children = _ref.children,
11
+ rest = _objectWithoutProperties(_ref, _excluded);
12
+ // TODO: It could be cool to possibly adjust the context to include an array of names of child components.
13
+ // Then, if CardHeader or CardFooter aren't used with CardContent throw an error.
14
+ useChildContext();
15
+ return /*#__PURE__*/React.createElement(StyledCardContent, rest, children);
16
+ };
17
+ export var CardHeader = function CardHeader(_ref2) {
18
+ var children = _ref2.children,
19
+ rest = _objectWithoutProperties(_ref2, _excluded2);
20
+ useChildContext();
21
+ return /*#__PURE__*/React.createElement(StyledCardHeader, rest, children);
22
+ };
23
+ export var CardFooter = function CardFooter(_ref3) {
24
+ var children = _ref3.children,
25
+ rest = _objectWithoutProperties(_ref3, _excluded3);
26
+ useChildContext();
27
+ return /*#__PURE__*/React.createElement(StyledCardFooter, rest, children);
28
+ };
29
+ export var SelectedIcon = function SelectedIcon(_ref4) {
30
+ var $selected = _ref4.$selected;
31
+ return /*#__PURE__*/React.createElement(SelectedIconWrapper, null, /*#__PURE__*/React.createElement(StyledSelectedIcon, {
32
+ "aria-hidden": true,
33
+ color: "icon.base",
34
+ name: "circle-check",
35
+ $selected: $selected
36
+ }));
37
+ };
@@ -0,0 +1,46 @@
1
+ import { createContext, useContext } from 'react';
2
+ import { assertIsElement } from "../utils";
3
+ export var SubComponentContext = /*#__PURE__*/createContext(
4
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
5
+ function () {});
6
+ export function useChildContext() {
7
+ var setHasSubComponent = useContext(SubComponentContext);
8
+ setHasSubComponent(true);
9
+ }
10
+ export var navigateTo = function navigateTo(_ref) {
11
+ var _ref$current, _window$open;
12
+ var e = _ref.e,
13
+ href = _ref.href,
14
+ ref = _ref.ref;
15
+ var target = e.target;
16
+
17
+ // asserts that target is an element so `contains` accepts it
18
+ assertIsElement(target);
19
+ if ((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(target)) {
20
+ if (target.getAttribute('onclick') !== null || target.getAttribute('href') !== null) {
21
+ e.stopPropagation();
22
+ return;
23
+ }
24
+ }
25
+ (_window$open = window.open(href, '_blank')) === null || _window$open === void 0 ? void 0 : _window$open.focus();
26
+ };
27
+ export var onKeyDown = function onKeyDown(_ref2) {
28
+ var e = _ref2.e,
29
+ href = _ref2.href,
30
+ onClick = _ref2.onClick,
31
+ ref = _ref2.ref,
32
+ role = _ref2.role;
33
+ if ((e === null || e === void 0 ? void 0 : e.key) === 'Enter') {
34
+ if (role === 'link') {
35
+ return navigateTo({
36
+ e: e,
37
+ href: href,
38
+ ref: ref
39
+ });
40
+ }
41
+ if (role === 'presentation') {
42
+ return;
43
+ }
44
+ return onClick === null || onClick === void 0 ? void 0 : onClick(e);
45
+ }
46
+ };
package/lib/Icon/Icon.js CHANGED
@@ -103,6 +103,7 @@ IconToggle.displayName = 'Icon.Toggle';
103
103
  /**
104
104
  * **Accessibility note:** It is best practice to wrap `<Icon.Toggle />` in a button. The button must include `aria-label` and `aria-pressed` in order for a screen reader to properly communicate the icon's state. See example below.
105
105
  *
106
+ * @link https://www.w3.org/TR/wai-aria-practices-1.1/#button
106
107
  * @example
107
108
  * const [toggleState, setToggleState] = useState(false);
108
109
  * <Button // Wrap Icon.Toggle with Button
@@ -174,6 +174,8 @@ module.exports = {
174
174
  "h3": "0 0 16 16",
175
175
  "h4": "0 0 16 16",
176
176
  "hamburger": "0 0 16 18",
177
+ "hand-sparkle-outline": "0 0 18 18",
178
+ "hand-sparkle": "0 0 18 18",
177
179
  "hashtag": "0 0 16 16",
178
180
  "headset": "0 0 16 16",
179
181
  "heart-outline": "0 0 16 16",
@@ -1,28 +1,33 @@
1
- import { rgba } from 'polished';
2
1
  import styled, { css, keyframes } from 'styled-components';
3
2
  import { visuallyHidden } from "../utils/mixins";
4
3
  import { COMMON } from "../utils/system-props";
5
4
  var getSize = function getSize(size) {
6
- var spinnerSize = Math.ceil(size * 0.9);
7
- var borderWidth = Math.ceil(size * 0.1);
8
- return css(["width:", "px;height:", "px;&:after{width:", "px;height:", "px;box-sizing:border-box;border-width:", "px;}.no-cssanimations &::after{background-size:", "px;}"], size, size, spinnerSize, spinnerSize, borderWidth, spinnerSize);
9
- };
10
- var getColor = function getColor(color) {
11
- return css(["&:after{border-color:", " ", " ", " ", ";}"], rgba(color, 0.3), rgba(color, 0.3), rgba(color, 0.7), rgba(color, 0.7));
5
+ var spinnerSize = Math.round(size * 1);
6
+ var borderWidth = Math.round(size * 0.1);
7
+ return css(["width:", "px;height:", "px;&:after{width:", "px;height:", "px;box-sizing:border-box;border-width:", "px;box-shadow:", ";}.no-cssanimations &::after{background-size:", "px;}"], size, size, spinnerSize, spinnerSize, borderWidth, function (_ref) {
8
+ var theme = _ref.theme;
9
+ return "inset 0 0 0 2px ".concat(theme.colors.neutral[600]);
10
+ }, spinnerSize);
12
11
  };
13
12
  var spin = keyframes(["from{transform:translate(-50%,-50%) rotate(0deg);}to{transform:translate(-50%,-50%) rotate(360deg);}"]);
14
- var delay = keyframes(["0%{opacity:0;}80%{opacity:0;}100%{opacity:1;}"]);
13
+ var delayAnimation = keyframes(["0%{opacity:0;}80%{opacity:0;}100%{opacity:1;}"]);
15
14
  var Container = styled.div.attrs({
16
15
  className: 'Loader'
17
16
  }).withConfig({
18
17
  displayName: "styles__Container",
19
18
  componentId: "sc-1edimrk-0"
20
- })(["position:relative;margin:0 auto;overflow:hidden;&:after{position:absolute;top:50%;left:50%;border-style:solid;border-radius:50%;content:'';transition:opacity 250ms;animation:", ";}", " ", " ", ""], function (props) {
21
- return props.delay ? css(["", " 2.25s infinite linear,", " 2s 1"], spin, delay) : css(["", " 2.25s infinite linear"], spin);
19
+ })(["position:relative;margin:0 auto;padding:0;overflow:hidden;border-radius:100%;box-shadow:", ";animation:", ";&:after{position:absolute;top:50%;left:50%;background:transparent;border-style:solid;border-radius:100%;content:'';transition:opacity 250ms;border-color:", ";animation:", ";}", " ", ""], function (_ref2) {
20
+ var theme = _ref2.theme;
21
+ return "0 0 0 2px ".concat(theme.colors.neutral[600]);
22
22
  }, function (props) {
23
- return props.small ? getSize(20) : getSize(40);
23
+ return props.delay ? css(["", " 2s 1;"], delayAnimation) : 'none';
24
+ }, function (_ref3) {
25
+ var theme = _ref3.theme;
26
+ return "".concat(theme.colors.neutral[0], " ").concat(theme.colors.neutral[0], " ").concat(theme.colors.neutral[600], " ").concat(theme.colors.neutral[600]);
24
27
  }, function (props) {
25
- return props.dark ? getColor(props.theme.colors.neutral[400]) : getColor(props.theme.colors.neutral[0]);
28
+ return props.delay ? css(["", " 2.25s infinite linear,", " 2s 1"], spin, delayAnimation) : css(["", " 2.25s infinite linear"], spin);
29
+ }, function (props) {
30
+ return props.small ? getSize(20) : getSize(40);
26
31
  }, COMMON);
27
32
  export var Text = styled.div.withConfig({
28
33
  displayName: "styles__Text",
package/lib/index.flow.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* Asset types */
2
2
  /* Theme and related types */
3
- export * from "./systemProps";
3
+ export * from "./systemProps/index.flow";
4
4
  export { default as theme } from "./themes/light/theme.flow";
5
5
  export { default as darkTheme } from "./themes/dark/theme.flow";
6
6
  export { sproutLightTheme, sproutDarkTheme } from "./themes/extendedThemes/sproutTheme/index.flow";
@@ -0,0 +1,14 @@
1
+ export * from "./types.flow";
2
+ export * from "./background.flow";
3
+ export * from "./border.flow";
4
+ export * from "./color.flow";
5
+ export * from "./custom.flow";
6
+ export * from "./flexbox.flow";
7
+ export * from "./grid.flow";
8
+ export * from "./layout.flow";
9
+ export * from "./position.flow";
10
+ export * from "./shadow.flow";
11
+ export * from "./space.flow";
12
+ export * from "./systemProps.flow";
13
+ export * from "./typography.flow";
14
+ export * from "./variant.flow";
@@ -17,48 +17,4 @@ export var variantSystemProps = compose(variant({
17
17
  export var systemProps = compose(customSystemProps, variantSystemProps, background, border, color, flexbox, grid, layout, position, shadow, space, typography);
18
18
 
19
19
  // including deprecated support for old type names in case they are needed for the intial TS release
20
- export {
21
- /**
22
- @deprecated: Use BackgroundProps from styled-system instead.
23
- */
24
-
25
- /**
26
- @deprecated: Use background from styled-system instead.
27
- */
28
- background as backgroundSystemProps,
29
- /**
30
- @deprecated: Use border from styled-system instead.
31
- */
32
- border as borderSystemProps,
33
- /**
34
- @deprecated: Use color from styled-system instead.
35
- */
36
- color as colorSystemProps,
37
- /**
38
- @deprecated: Use flexbox from styled-system instead.
39
- */
40
- flexbox as flexboxSystemProps,
41
- /**
42
- @deprecated: Use grid from styled-system instead.
43
- */
44
- grid as gridSystemProps,
45
- /**
46
- @deprecated: Use layout from styled-system instead.
47
- */
48
- layout as layoutSystemProps,
49
- /**
50
- @deprecated: Use position from styled-system instead.
51
- */
52
- position as positionSystemProps,
53
- /**
54
- @deprecated: Use shadow from styled-system instead.
55
- */
56
- shadow as shadowSystemProps,
57
- /**
58
- @deprecated: Use space from styled-system instead.
59
- */
60
- space as spaceSystemProps,
61
- /**
62
- @deprecated: Use typography from styled-system instead.
63
- */
64
- typography as typographySystemProps };
20
+ export { background as backgroundSystemProps, border as borderSystemProps, color as colorSystemProps, flexbox as flexboxSystemProps, grid as gridSystemProps, layout as layoutSystemProps, position as positionSystemProps, shadow as shadowSystemProps, space as spaceSystemProps, typography as typographySystemProps };
@@ -0,0 +1,14 @@
1
+ import { compose } from 'styled-system';
2
+ import { backgroundSystemProps } from "./background.flow";
3
+ import { borderSystemProps } from "./border.flow";
4
+ import { colorSystemProps } from "./color.flow";
5
+ import { customSystemProps } from "./custom.flow";
6
+ import { flexboxSystemProps } from "./flexbox.flow";
7
+ import { gridSystemProps } from "./grid.flow";
8
+ import { layoutSystemProps } from "./layout.flow";
9
+ import { positionSystemProps } from "./position.flow";
10
+ import { shadowSystemProps } from "./shadow.flow";
11
+ import { spaceSystemProps } from "./space.flow";
12
+ import { typographySystemProps } from "./typography.flow";
13
+ import { variantSystemProps } from "./variant.flow";
14
+ export var systemProps = compose(customSystemProps, variantSystemProps, backgroundSystemProps, borderSystemProps, colorSystemProps, flexboxSystemProps, gridSystemProps, layoutSystemProps, positionSystemProps, shadowSystemProps, spaceSystemProps, typographySystemProps);
@@ -0,0 +1 @@
1
+ import * as React from 'react';
@@ -37,4 +37,17 @@ export var mergeRefs = function mergeRefs(refs) {
37
37
  */
38
38
  export function includes(coll, el) {
39
39
  return coll.includes(el);
40
+ }
41
+
42
+ // https://stackoverflow.com/questions/71193818/react-onclick-argument-of-type-eventtarget-is-not-assignable-to-parameter-of-t
43
+ export function assertIsNode(e) {
44
+ if (!e || !('nodeType' in e)) {
45
+ throw new Error("Node expected");
46
+ }
47
+ }
48
+ export function assertIsElement(e) {
49
+ assertIsNode(e);
50
+ if (e.nodeType !== 1) {
51
+ throw new Error("Element expected");
52
+ }
40
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "14.3.0",
3
+ "version": "15.0.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -33,7 +33,7 @@
33
33
  "build:typescript": "tsc --noEmit",
34
34
  "watch-app": "BABEL_ENV=es node ./bin/buildApp.js --watch",
35
35
  "start-package-only": "npm-run-all install-deps clean -p build-icons watch-package",
36
- "start": "npm-run-all install-deps clean -p build-icons watch-package watch-app",
36
+ "start": "npm-run-all clean -p build-icons watch-package watch-app",
37
37
  "build": "npm-run-all -s clean build-icons build:typescript build:ts-declarations build-package build-app",
38
38
  "build:sync-icons": "npm-run-all -s clean build-icons build:typescript build:ts-declarations build-package",
39
39
  "lint-js": "eslint --max-warnings=0 --fix .",
@@ -43,7 +43,7 @@
43
43
  "jest:watch": "jest --watch",
44
44
  "test:flow": "flow check --max-warnings 0",
45
45
  "test:ts": "tsc --noEmit",
46
- "test:types": "yarn build-icons && yarn test:flow && yarn test:ts",
46
+ "test:types": "yarn test:flow && yarn test:ts",
47
47
  "test": "npm-run-all test:types lint-js lint-css lint-icons jest",
48
48
  "backstop-test": "yarn backstop test --config='backstop.config.js' --docker",
49
49
  "backstop-reference": "yarn backstop reference --config='backstop.config.js' --docker",
@@ -73,6 +73,7 @@
73
73
  "dependencies": {
74
74
  "@styled-system/theme-get": "^5.1.2",
75
75
  "classnames": "^2.2.6",
76
+ "flowgen": "^1.21.0",
76
77
  "lodash.curry": "^4.1.1",
77
78
  "lodash.uniqueid": "^4.0.1",
78
79
  "lru-memoize": "~1.0.2",
@@ -120,12 +121,12 @@
120
121
  "@testing-library/jest-dom": "^5.16.4",
121
122
  "@testing-library/react": "^12.0.0",
122
123
  "@testing-library/user-event": "^13.0.0",
123
- "@types/jest": "^29.2.3",
124
+ "@types/jest": "^27.0.0",
124
125
  "@types/jest-axe": "^3.5.5",
125
- "@types/node": "^17.0.38",
126
- "@types/react": "^18.0.10",
126
+ "@types/node": "^16.15.0",
127
+ "@types/react": "^16.0.0",
127
128
  "@types/react-dates": "^21.8.3",
128
- "@types/react-dom": "^18.0.5",
129
+ "@types/react-dom": "^16.0.0",
129
130
  "@types/react-modal": "^3.13.1",
130
131
  "@types/react-virtualized": "9.18.*",
131
132
  "@types/styled-components": "^5.1.26",
@@ -165,8 +166,8 @@
165
166
  "identity-obj-proxy": "^3.0.0",
166
167
  "inquirer": "^6.4.1",
167
168
  "is-glob": "^4.0.1",
168
- "jest": "27.x.x",
169
- "jest-axe": "6.0.0",
169
+ "jest": "^27.0.0",
170
+ "jest-axe": "^6.0.0",
170
171
  "jest-styled-components": "7.0.0-beta.1",
171
172
  "jscodeshift": "^0.13.0",
172
173
  "json-to-scss": "^1.6.2",
@@ -177,9 +178,9 @@
177
178
  "pify": "^4.0.1",
178
179
  "prettier": "^2.7.1",
179
180
  "prop-types": "^15.6.1",
180
- "react": "16.12.0",
181
+ "react": "^16.12.0",
181
182
  "react-dates": "^21.8.0",
182
- "react-dom": "16.12.0",
183
+ "react-dom": "^16.12.0",
183
184
  "rimraf": "^2.6.3",
184
185
  "storybook-dark-mode": "^1.0.9",
185
186
  "styled-components": "^5.2.3",
@@ -210,6 +211,8 @@
210
211
  "styled-components": "^5.2.3"
211
212
  },
212
213
  "resolutions": {
214
+ "@types/react": "^16.0.0",
215
+ "@types/react-dom": "^16.0.0",
213
216
  "lodash": "^4.17.21",
214
217
  "react-popper/create-react-context": "^0.3.0",
215
218
  "glob-parent": "^5.1.2",
@@ -1,16 +0,0 @@
1
- // @flow strict-local
2
-
3
- export * from "./types.flow.js";
4
- export * from "./background";
5
- export * from "./border";
6
- export * from "./color";
7
- export * from "./custom";
8
- export * from "./flexbox";
9
- export * from "./grid";
10
- export * from "./layout";
11
- export * from "./position";
12
- export * from "./shadow";
13
- export * from "./space";
14
- export * from "./systemProps";
15
- export * from "./typography";
16
- export * from "./variant";
@@ -1,14 +0,0 @@
1
- import { compose } from 'styled-system';
2
- import { backgroundSystemProps } from "./background";
3
- import { borderSystemProps } from "./border";
4
- import { colorSystemProps } from "./color";
5
- import { customSystemProps } from "./custom";
6
- import { flexboxSystemProps } from "./flexbox";
7
- import { gridSystemProps } from "./grid";
8
- import { layoutSystemProps } from "./layout";
9
- import { positionSystemProps } from "./position";
10
- import { shadowSystemProps } from "./shadow";
11
- import { spaceSystemProps } from "./space";
12
- import { typographySystemProps } from "./typography";
13
- import { variantSystemProps } from "./variant";
14
- export var systemProps = compose(customSystemProps, variantSystemProps, backgroundSystemProps, borderSystemProps, colorSystemProps, flexboxSystemProps, gridSystemProps, layoutSystemProps, positionSystemProps, shadowSystemProps, spaceSystemProps, typographySystemProps);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes