@sproutsocial/racine 11.0.2 → 11.1.2-badge-update.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 (274) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/__flow__/Badge/constants.js +48 -0
  3. package/__flow__/Badge/index.js +58 -32
  4. package/__flow__/Badge/index.stories.js +29 -42
  5. package/__flow__/Badge/index.test.js +34 -32
  6. package/__flow__/Badge/styles.js +22 -42
  7. package/__flow__/EnumIconNames.js +1 -1
  8. package/__flow__/IconViewBoxes.js +1 -1
  9. package/__flow__/index.js +1 -0
  10. package/__flow__/systemProps/background.js +28 -0
  11. package/__flow__/systemProps/border.js +76 -0
  12. package/__flow__/systemProps/color.js +25 -0
  13. package/__flow__/systemProps/custom.js +23 -0
  14. package/__flow__/systemProps/flexbox.js +42 -0
  15. package/__flow__/systemProps/grid.js +43 -0
  16. package/__flow__/systemProps/index.js +17 -0
  17. package/__flow__/systemProps/layout.js +43 -0
  18. package/__flow__/systemProps/position.js +29 -0
  19. package/__flow__/systemProps/shadow.js +18 -0
  20. package/__flow__/systemProps/space.js +83 -0
  21. package/__flow__/systemProps/systemProps.js +55 -0
  22. package/__flow__/systemProps/tests/__snapshots__/background.test.js.snap +96 -0
  23. package/__flow__/systemProps/tests/__snapshots__/border.test.js.snap +469 -0
  24. package/__flow__/systemProps/tests/__snapshots__/color.test.js.snap +55 -0
  25. package/__flow__/systemProps/tests/__snapshots__/custom.test.js.snap +36 -0
  26. package/__flow__/systemProps/tests/__snapshots__/flexbox.test.js.snap +239 -0
  27. package/__flow__/systemProps/tests/__snapshots__/grid.test.js.snap +166 -0
  28. package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +218 -0
  29. package/__flow__/systemProps/tests/__snapshots__/position.test.js.snap +115 -0
  30. package/__flow__/systemProps/tests/__snapshots__/shadow.test.js.snap +25 -0
  31. package/__flow__/systemProps/tests/__snapshots__/space.test.js.snap +39 -0
  32. package/__flow__/systemProps/tests/__snapshots__/typography.test.js.snap +166 -0
  33. package/__flow__/systemProps/tests/__snapshots__/variant.test.js.snap +17 -0
  34. package/__flow__/systemProps/tests/background.test.js +90 -0
  35. package/__flow__/systemProps/tests/border.test.js +299 -0
  36. package/__flow__/systemProps/tests/color.test.js +49 -0
  37. package/__flow__/systemProps/tests/custom.test.js +38 -0
  38. package/__flow__/systemProps/tests/flexbox.test.js +150 -0
  39. package/__flow__/systemProps/tests/grid.test.js +123 -0
  40. package/__flow__/systemProps/tests/layout.test.js +135 -0
  41. package/__flow__/systemProps/tests/position.test.js +78 -0
  42. package/__flow__/systemProps/tests/shadow.test.js +30 -0
  43. package/__flow__/systemProps/tests/space.test.js +32 -0
  44. package/__flow__/systemProps/tests/types.flow.js +55 -0
  45. package/__flow__/systemProps/tests/typography.test.js +93 -0
  46. package/__flow__/systemProps/tests/variant.test.js +25 -0
  47. package/__flow__/systemProps/types.flow.js +20 -0
  48. package/__flow__/systemProps/typography.js +34 -0
  49. package/__flow__/systemProps/variant.js +18 -0
  50. package/__flow__/themes/dark/theme.js +1 -0
  51. package/__flow__/themes/light/literal-colors.js +2 -0
  52. package/__flow__/themes/light/theme.js +1 -0
  53. package/__flow__/types/theme.colors.flow.js +27 -0
  54. package/bin/buildNpm.js +58 -0
  55. package/commonjs/Avatar/index.js +7 -4
  56. package/commonjs/Badge/constants.js +43 -0
  57. package/commonjs/Badge/index.js +42 -38
  58. package/commonjs/Badge/styles.js +16 -32
  59. package/commonjs/Banner/index.js +3 -1
  60. package/commonjs/Banner/styles.js +1 -1
  61. package/commonjs/Box/styles.js +1 -1
  62. package/commonjs/Breadcrumb/index.js +5 -2
  63. package/commonjs/Button/index.js +3 -1
  64. package/commonjs/Card/index.js +3 -1
  65. package/commonjs/Card/styles.js +3 -3
  66. package/commonjs/CharacterCounter/index.js +3 -1
  67. package/commonjs/CharacterCounter/styles.js +1 -1
  68. package/commonjs/ChartLegend/index.js +3 -1
  69. package/commonjs/ChartLegend/styles.js +3 -3
  70. package/commonjs/Checkbox/index.js +3 -1
  71. package/commonjs/Checkbox/styles.js +1 -1
  72. package/commonjs/Collapsible/index.js +5 -2
  73. package/commonjs/DatePicker/DateRangePicker.js +3 -1
  74. package/commonjs/DatePicker/SingleDatePicker.js +3 -1
  75. package/commonjs/DatePicker/StatefulDateRangePicker.js +3 -1
  76. package/commonjs/DatePicker/StatefulSingleDatePicker.js +3 -1
  77. package/commonjs/DatePicker/common.js +1 -1
  78. package/commonjs/DatePicker/styles.js +2 -6
  79. package/commonjs/Drawer/SlideTransition.js +3 -1
  80. package/commonjs/Drawer/index.js +9 -4
  81. package/commonjs/Drawer/styles.js +2 -2
  82. package/commonjs/EmptyState/index.js +3 -1
  83. package/commonjs/Fieldset/index.js +7 -3
  84. package/commonjs/FormField/index.js +3 -1
  85. package/commonjs/Icon/index.js +5 -2
  86. package/commonjs/Icon/styles.js +1 -1
  87. package/commonjs/IconViewBoxes.js +1 -0
  88. package/commonjs/Image/index.js +3 -1
  89. package/commonjs/Image/styles.js +1 -1
  90. package/commonjs/Indicator/index.js +3 -1
  91. package/commonjs/Input/index.js +3 -1
  92. package/commonjs/Input/styles.js +2 -2
  93. package/commonjs/KeyboardKey/index.js +3 -1
  94. package/commonjs/Label/index.js +4 -2
  95. package/commonjs/Link/index.js +3 -1
  96. package/commonjs/Link/styles.js +1 -1
  97. package/commonjs/Listbox/index.js +7 -4
  98. package/commonjs/Loader/index.js +3 -1
  99. package/commonjs/Loader/styles.js +2 -2
  100. package/commonjs/LoaderButton/index.js +3 -1
  101. package/commonjs/Menu/constants.js +1 -1
  102. package/commonjs/Menu/descendants.js +10 -7
  103. package/commonjs/Menu/hooks.js +1 -1
  104. package/commonjs/Menu/index.js +22 -16
  105. package/commonjs/Menu/styles.js +2 -2
  106. package/commonjs/Message/index.js +3 -1
  107. package/commonjs/Message/styles.js +1 -1
  108. package/commonjs/Modal/index.js +7 -3
  109. package/commonjs/Modal/styles.js +4 -6
  110. package/commonjs/Numeral/constants.js +1 -1
  111. package/commonjs/Numeral/index.js +3 -1
  112. package/commonjs/Numeral/styles.js +3 -3
  113. package/commonjs/OverflowList/styles.js +1 -1
  114. package/commonjs/Popout/index.js +7 -3
  115. package/commonjs/Popout/styles.js +1 -1
  116. package/commonjs/Radio/index.js +3 -1
  117. package/commonjs/Radio/styles.js +4 -4
  118. package/commonjs/SegmentedControl/index.js +5 -2
  119. package/commonjs/Select/index.js +3 -1
  120. package/commonjs/Stack/index.js +3 -1
  121. package/commonjs/Switch/index.js +3 -1
  122. package/commonjs/Switch/styles.js +1 -1
  123. package/commonjs/Table/index.js +10 -5
  124. package/commonjs/TableCell/index.js +3 -1
  125. package/commonjs/TableHeaderCell/index.js +3 -1
  126. package/commonjs/TableRowAccordion/index.js +3 -1
  127. package/commonjs/Tabs/index.js +5 -2
  128. package/commonjs/Tabs/styles.js +4 -4
  129. package/commonjs/Text/index.js +3 -1
  130. package/commonjs/Text/styles.js +1 -1
  131. package/commonjs/Textarea/index.js +3 -1
  132. package/commonjs/Toast/index.js +15 -15
  133. package/commonjs/Toast/styles.js +4 -7
  134. package/commonjs/ToggleHint/index.js +3 -1
  135. package/commonjs/Token/index.js +3 -1
  136. package/commonjs/Token/styles.js +1 -1
  137. package/commonjs/TokenInput/index.js +3 -1
  138. package/commonjs/Tooltip/index.js +5 -2
  139. package/commonjs/Tooltip/styles.js +1 -1
  140. package/commonjs/VisuallyHidden/index.js +1 -1
  141. package/commonjs/include-icons.js +1 -1
  142. package/commonjs/index.js +79 -1
  143. package/commonjs/systemProps/background.js +9 -0
  144. package/commonjs/systemProps/border.js +9 -0
  145. package/commonjs/systemProps/color.js +9 -0
  146. package/commonjs/systemProps/custom.js +12 -0
  147. package/commonjs/systemProps/flexbox.js +9 -0
  148. package/commonjs/systemProps/grid.js +9 -0
  149. package/commonjs/systemProps/index.js +115 -0
  150. package/commonjs/systemProps/layout.js +9 -0
  151. package/commonjs/systemProps/position.js +9 -0
  152. package/commonjs/systemProps/shadow.js +9 -0
  153. package/commonjs/systemProps/space.js +10 -0
  154. package/commonjs/systemProps/systemProps.js +33 -0
  155. package/commonjs/systemProps/tests/types.flow.js +46 -0
  156. package/commonjs/systemProps/types.flow.js +1 -0
  157. package/commonjs/systemProps/typography.js +9 -0
  158. package/commonjs/systemProps/variant.js +12 -0
  159. package/commonjs/themes/dark/decorative-palettes.js +1 -1
  160. package/commonjs/themes/dark/theme.js +1 -1
  161. package/commonjs/themes/light/decorative-palettes.js +1 -1
  162. package/commonjs/themes/light/literal-colors.js +4 -2
  163. package/commonjs/themes/light/theme.js +1 -1
  164. package/commonjs/types/theme.colors.flow.js +2 -0
  165. package/commonjs/utils/hooks.js +3 -2
  166. package/commonjs/utils/mixins.js +1 -1
  167. package/commonjs/utils/system-props.js +1 -1
  168. package/dist/iconList.js +1 -1
  169. package/dist/icons.svg +1 -1
  170. package/dist/themes/dark/dark.scss +9 -7
  171. package/dist/themes/light/light.scss +99 -97
  172. package/icons/power-up-outline.svg +3 -0
  173. package/includeIcons.js +1 -1
  174. package/lib/Avatar/index.js +7 -4
  175. package/lib/Badge/constants.js +38 -0
  176. package/lib/Badge/index.js +39 -38
  177. package/lib/Badge/styles.js +13 -28
  178. package/lib/Banner/index.js +3 -1
  179. package/lib/Banner/styles.js +1 -1
  180. package/lib/Box/styles.js +1 -1
  181. package/lib/Breadcrumb/index.js +5 -2
  182. package/lib/Button/index.js +3 -1
  183. package/lib/Card/index.js +3 -1
  184. package/lib/Card/styles.js +2 -2
  185. package/lib/CharacterCounter/index.js +3 -1
  186. package/lib/CharacterCounter/styles.js +1 -1
  187. package/lib/ChartLegend/index.js +3 -1
  188. package/lib/ChartLegend/styles.js +3 -3
  189. package/lib/Checkbox/index.js +3 -1
  190. package/lib/Collapsible/index.js +5 -2
  191. package/lib/DatePicker/DateRangePicker.js +3 -1
  192. package/lib/DatePicker/SingleDatePicker.js +3 -1
  193. package/lib/DatePicker/StatefulDateRangePicker.js +3 -1
  194. package/lib/DatePicker/StatefulSingleDatePicker.js +3 -1
  195. package/lib/DatePicker/styles.js +2 -6
  196. package/lib/Drawer/SlideTransition.js +3 -1
  197. package/lib/Drawer/index.js +9 -4
  198. package/lib/Drawer/styles.js +2 -2
  199. package/lib/EmptyState/index.js +3 -1
  200. package/lib/Fieldset/index.js +7 -3
  201. package/lib/FormField/index.js +3 -1
  202. package/lib/Icon/index.js +5 -2
  203. package/lib/Icon/styles.js +1 -1
  204. package/lib/IconViewBoxes.js +1 -0
  205. package/lib/Image/index.js +3 -1
  206. package/lib/Image/styles.js +1 -1
  207. package/lib/Indicator/index.js +3 -1
  208. package/lib/Input/index.js +3 -1
  209. package/lib/Input/styles.js +2 -2
  210. package/lib/KeyboardKey/index.js +3 -1
  211. package/lib/Label/index.js +4 -2
  212. package/lib/Link/index.js +3 -1
  213. package/lib/Link/styles.js +1 -1
  214. package/lib/Listbox/index.js +6 -3
  215. package/lib/Loader/index.js +3 -1
  216. package/lib/Loader/styles.js +2 -2
  217. package/lib/LoaderButton/index.js +3 -1
  218. package/lib/Menu/descendants.js +5 -2
  219. package/lib/Menu/index.js +20 -16
  220. package/lib/Menu/styles.js +2 -2
  221. package/lib/Message/index.js +3 -1
  222. package/lib/Modal/index.js +7 -3
  223. package/lib/Modal/styles.js +3 -5
  224. package/lib/Numeral/index.js +3 -1
  225. package/lib/Numeral/styles.js +2 -2
  226. package/lib/OverflowList/styles.js +1 -1
  227. package/lib/Popout/index.js +7 -3
  228. package/lib/Popout/styles.js +1 -1
  229. package/lib/Radio/index.js +3 -1
  230. package/lib/Radio/styles.js +4 -4
  231. package/lib/SegmentedControl/index.js +5 -2
  232. package/lib/Select/index.js +3 -1
  233. package/lib/Stack/index.js +3 -1
  234. package/lib/Switch/index.js +3 -1
  235. package/lib/Switch/styles.js +1 -1
  236. package/lib/Table/index.js +9 -4
  237. package/lib/TableCell/index.js +3 -1
  238. package/lib/TableHeaderCell/index.js +3 -1
  239. package/lib/TableRowAccordion/index.js +3 -1
  240. package/lib/Tabs/index.js +5 -2
  241. package/lib/Tabs/styles.js +3 -3
  242. package/lib/Text/index.js +3 -1
  243. package/lib/Text/styles.js +1 -1
  244. package/lib/Textarea/index.js +3 -1
  245. package/lib/Toast/index.js +14 -14
  246. package/lib/Toast/styles.js +3 -7
  247. package/lib/ToggleHint/index.js +3 -1
  248. package/lib/Token/index.js +3 -1
  249. package/lib/Token/styles.js +1 -1
  250. package/lib/TokenInput/index.js +3 -1
  251. package/lib/Tooltip/index.js +5 -2
  252. package/lib/Tooltip/styles.js +1 -1
  253. package/lib/VisuallyHidden/index.js +1 -1
  254. package/lib/include-icons.js +1 -1
  255. package/lib/index.js +1 -0
  256. package/lib/systemProps/background.js +2 -0
  257. package/lib/systemProps/border.js +2 -0
  258. package/lib/systemProps/color.js +2 -0
  259. package/lib/systemProps/custom.js +5 -0
  260. package/lib/systemProps/flexbox.js +2 -0
  261. package/lib/systemProps/grid.js +2 -0
  262. package/lib/systemProps/index.js +14 -0
  263. package/lib/systemProps/layout.js +2 -0
  264. package/lib/systemProps/position.js +2 -0
  265. package/lib/systemProps/shadow.js +2 -0
  266. package/lib/systemProps/space.js +3 -0
  267. package/lib/systemProps/systemProps.js +14 -0
  268. package/lib/systemProps/tests/types.flow.js +44 -0
  269. package/lib/systemProps/types.flow.js +0 -0
  270. package/lib/systemProps/typography.js +2 -0
  271. package/lib/systemProps/variant.js +5 -0
  272. package/lib/themes/light/literal-colors.js +4 -2
  273. package/lib/types/theme.colors.flow.js +2 -1
  274. package/package.json +15 -3
@@ -0,0 +1,93 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import {
7
+ typographySystemProps,
8
+ type TypeTypographySystemProps,
9
+ } from "../typography";
10
+
11
+ describe("typography system props", () => {
12
+ const Component = styled<TypeTypographySystemProps, TypeTheme, "div">("div")`
13
+ ${typographySystemProps}
14
+ `;
15
+
16
+ test("fontFamily", () => {
17
+ const { container } = render(
18
+ <>
19
+ <Component fontFamily="string" />
20
+ </>
21
+ );
22
+ expect(container).toMatchSnapshot();
23
+ });
24
+
25
+ test("fontSize", () => {
26
+ const { container } = render(
27
+ <>
28
+ <Component fontSize="string" />
29
+ <Component fontSize={100} />
30
+ </>
31
+ );
32
+ expect(container).toMatchSnapshot();
33
+ });
34
+
35
+ test("fontStyle", () => {
36
+ const { container } = render(
37
+ <>
38
+ <Component fontStyle="string" />
39
+ </>
40
+ );
41
+ expect(container).toMatchSnapshot();
42
+ });
43
+
44
+ test("fontWeight", () => {
45
+ const { container } = render(
46
+ <>
47
+ <Component fontWeight="normal" />
48
+ <Component fontWeight="semibold" />
49
+ <Component fontWeight="bold" />
50
+ <Component fontWeight="extrabold" />
51
+ <Component fontWeight={100} />
52
+ <Component
53
+ // $FlowExpectedError
54
+ fontWeight="string"
55
+ />
56
+ </>
57
+ );
58
+ expect(container).toMatchSnapshot();
59
+ });
60
+
61
+ test("letterSpacing", () => {
62
+ const { container } = render(
63
+ <>
64
+ <Component letterSpacing="string" />
65
+ <Component letterSpacing={1} />
66
+ </>
67
+ );
68
+ expect(container).toMatchSnapshot();
69
+ });
70
+
71
+ test("lineHeight", () => {
72
+ const { container } = render(
73
+ <>
74
+ <Component lineHeight="string" />
75
+ <Component lineHeight={1} />
76
+ </>
77
+ );
78
+ expect(container).toMatchSnapshot();
79
+ });
80
+
81
+ test("textAlign", () => {
82
+ const { container } = render(
83
+ <>
84
+ <Component textAlign="center" />
85
+ <Component
86
+ // $FlowExpectedError
87
+ textAlign="string"
88
+ />
89
+ </>
90
+ );
91
+ expect(container).toMatchSnapshot();
92
+ });
93
+ });
@@ -0,0 +1,25 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { variantSystemProps, type TypeVariantSystemProps } from "../variant";
7
+
8
+ describe("variant system props", () => {
9
+ const Component = styled<TypeVariantSystemProps, TypeTheme, "div">("div")`
10
+ ${variantSystemProps}
11
+ `;
12
+
13
+ test("typeScale", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component typeScale="100" />
17
+ <Component
18
+ // $FlowExpectedError
19
+ typeScale={100}
20
+ />
21
+ </>
22
+ );
23
+ expect(container).toMatchSnapshot();
24
+ });
25
+ });
@@ -0,0 +1,20 @@
1
+ // @flow strict
2
+
3
+ export type TypeResponsiveSystemProp<T> =
4
+ | T
5
+ | [T]
6
+ | [T, T]
7
+ | [T, T, T]
8
+ | [T, T, T, T]
9
+ | [T, T, T, T, T];
10
+ export type TypeBaseSystemProp<T> = ?T | boolean;
11
+ // eslint-disable-next-line prettier/prettier
12
+ export type TypeResponsiveBaseSystemProp<T> = TypeResponsiveSystemProp<TypeBaseSystemProp<T>>;
13
+
14
+ export interface StyledSystemStyleFn {
15
+ (...args: mixed[]): mixed;
16
+
17
+ config?: { ... } | void;
18
+ propNames?: string[] | void;
19
+ cache?: { ... } | void;
20
+ }
@@ -0,0 +1,34 @@
1
+ // @flow strict-local
2
+
3
+ import { typography } from "styled-system";
4
+ import type {
5
+ FontFamilyProperty,
6
+ FontSizeProperty,
7
+ FontStyleProperty,
8
+ FontWeightProperty,
9
+ LetterSpacingProperty,
10
+ LineHeightProperty,
11
+ TextAlignProperty,
12
+ } from "csstype";
13
+
14
+ import typeof { fontWeights as TypeofFontWeights } from "../themes/light/theme";
15
+ import type {
16
+ StyledSystemStyleFn,
17
+ TypeResponsiveBaseSystemProp,
18
+ } from "./types.flow.js";
19
+
20
+ // https://styled-system.com/table#typography
21
+
22
+ export type TypeTypographySystemProps = $ReadOnly<{|
23
+ fontFamily?: TypeResponsiveBaseSystemProp<FontFamilyProperty>,
24
+ fontSize?: TypeResponsiveBaseSystemProp<FontSizeProperty<number>>,
25
+ fontStyle?: TypeResponsiveBaseSystemProp<FontStyleProperty>,
26
+ // eslint-disable-next-line prettier/prettier
27
+ fontWeight?: TypeResponsiveBaseSystemProp<FontWeightProperty | $Keys<TypeofFontWeights>>,
28
+ // eslint-disable-next-line prettier/prettier
29
+ letterSpacing?: TypeResponsiveBaseSystemProp<LetterSpacingProperty<string | number>>,
30
+ lineHeight?: TypeResponsiveBaseSystemProp<LineHeightProperty<void>>,
31
+ textAlign?: TypeResponsiveBaseSystemProp<TextAlignProperty>,
32
+ |}>;
33
+
34
+ export const typographySystemProps: StyledSystemStyleFn = typography;
@@ -0,0 +1,18 @@
1
+ // @flow strict-local
2
+ import { compose, variant } from "styled-system";
3
+ import type { TypeTypography } from "../types/theme.flow";
4
+
5
+ import type { TypeResponsiveBaseSystemProp } from "./types.flow.js";
6
+
7
+ // https://styled-system.com/variants
8
+
9
+ export type TypeVariantSystemProps = $ReadOnly<{|
10
+ typeScale?: TypeResponsiveBaseSystemProp<$Keys<TypeTypography>>,
11
+ |}>;
12
+
13
+ export const variantSystemProps = compose(
14
+ variant({
15
+ key: "typography",
16
+ prop: "typeScale",
17
+ })
18
+ );
@@ -229,6 +229,7 @@ const colors = {
229
229
  map: datavizPalette.DATAVIZ_COLORS_MAP,
230
230
  list: datavizPalette.DATAVIZ_COLORS_LIST,
231
231
  },
232
+ // Remove this in a future version in favor of the above object
232
233
  ...datavizPalette,
233
234
  };
234
235
 
@@ -15,6 +15,7 @@ const literalColors = {
15
15
  "800": COLORS.COLOR_NEUTRAL_800,
16
16
  "900": COLORS.COLOR_NEUTRAL_900,
17
17
  "1000": COLORS.COLOR_NEUTRAL_1000,
18
+ "1100": COLORS.COLOR_NEUTRAL_1100,
18
19
  },
19
20
  green: {
20
21
  "0": COLORS.COLOR_GREEN_0,
@@ -42,6 +43,7 @@ const literalColors = {
42
43
  "800": COLORS.COLOR_RED_800,
43
44
  "900": COLORS.COLOR_RED_900,
44
45
  "1000": COLORS.COLOR_RED_1000,
46
+ "1100": COLORS.COLOR_RED_1100,
45
47
  },
46
48
  blue: {
47
49
  "0": COLORS.COLOR_BLUE_0,
@@ -256,6 +256,7 @@ const colors = {
256
256
  list: datavizPalette.DATAVIZ_COLORS_LIST,
257
257
  },
258
258
  ...literalColors,
259
+ // Remove this in a future version in favor of the above object
259
260
  ...datavizPalette,
260
261
  };
261
262
 
@@ -1,6 +1,7 @@
1
1
  // @flow strict-local
2
2
 
3
3
  import literalColors from "../themes/light/literal-colors";
4
+ import { datavizPalette } from "../themes/light/dataviz-palette";
4
5
 
5
6
  type TypeAppColors = {|
6
7
  app: {
@@ -170,6 +171,7 @@ type TypeIconColors = {|
170
171
  danger: string,
171
172
  info: string,
172
173
  opportunity: string,
174
+ applied: string,
173
175
  positive_sentiment: string,
174
176
  negative_sentiment: string,
175
177
  neutral_sentiment: string,
@@ -204,6 +206,28 @@ type TypeListItemColors = {|
204
206
  },
205
207
  |};
206
208
 
209
+ type TypeOverlayColors = {|
210
+ overlay: {
211
+ background: {
212
+ base: string,
213
+ },
214
+ text: {
215
+ base: string,
216
+ },
217
+ icon: {
218
+ base: string,
219
+ },
220
+ },
221
+ |};
222
+
223
+ type TypeElevationColors = {|
224
+ elevation: {
225
+ base: string,
226
+ },
227
+ |};
228
+
229
+ type TypeDatavizColors = typeof datavizPalette;
230
+
207
231
  type TypeNetworkColors = {|
208
232
  network: {
209
233
  twitter: string,
@@ -245,6 +269,9 @@ export type TypeColors = {
245
269
  ...TypeIconColors,
246
270
  ...TypeFormColors,
247
271
  ...TypeListItemColors,
272
+ ...TypeOverlayColors,
273
+ ...TypeElevationColors,
274
+ ...TypeDatavizColors,
248
275
  ...TypeNetworkColors,
249
276
  ...TypeLiteralColors,
250
277
  };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * This file handles the generation of an .npmrc with Jfrog credentials during the CI process.
3
+ * It replicates the local configuration requirements of a developer running `yarn` on their machine
4
+ * If run locally please do not commit your auth credentials
5
+ */
6
+ const fs = require("fs");
7
+ const https = require("https");
8
+ const { exit } = require("process");
9
+
10
+ const { ARTIFACTORY_KEY, CI } = process.env;
11
+
12
+ // Check if we're in CI context, otherwise skip the process
13
+ if (!CI) {
14
+ exit();
15
+ }
16
+
17
+ const options = {
18
+ hostname: "sproutsocial.jfrog.io",
19
+ path: "/artifactory/api/npm/auth",
20
+ method: "GET",
21
+ headers: {
22
+ "X-JFrog-Art-Api": ARTIFACTORY_KEY,
23
+ },
24
+ };
25
+
26
+ const req = https.request(options, (res) => {
27
+ console.log(`statusCode: ${res.statusCode}`);
28
+
29
+ // Call our auth endpoint with environment credentials
30
+ res.on("data", (data) => {
31
+ // Writes out an .npmrc file with the response
32
+ fs.writeFile(".npmrc", data, (err) => {
33
+ if (err) console.log(err);
34
+ else {
35
+ console.log(".npmrc generated successfully!");
36
+ }
37
+ });
38
+
39
+ // Once the file is created we append the registry info
40
+ fs.appendFile(
41
+ ".npmrc",
42
+ "registry=https://sproutsocial.jfrog.io/artifactory/api/npm/npm_virtual",
43
+ function (err) {
44
+ if (err) throw err;
45
+ console.log("Registry Config Added!");
46
+ }
47
+ );
48
+
49
+ // Finally, we set permissions for the file so that netlify recognizes it
50
+ fs.chmodSync(".npmrc", "0600");
51
+ });
52
+ });
53
+
54
+ req.on("error", (error) => {
55
+ console.error(error);
56
+ });
57
+
58
+ req.end();
@@ -15,6 +15,9 @@ var _Image = _interopRequireDefault(require("../Image"));
15
15
 
16
16
  var _Text = _interopRequireDefault(require("../Text"));
17
17
 
18
+ var _excluded = ["fontSize"],
19
+ _excluded2 = ["appearance", "name", "src", "variant", "type", "size", "bg", "color"];
20
+
18
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
22
 
20
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -27,12 +30,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
27
30
 
28
31
  var AvatarText = (0, _styledComponents.default)(function (_ref) {
29
32
  var fontSize = _ref.fontSize,
30
- rest = _objectWithoutPropertiesLoose(_ref, ["fontSize"]);
33
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
31
34
 
32
35
  return /*#__PURE__*/React.createElement(_Text.default, rest);
33
36
  }).withConfig({
34
37
  displayName: "Avatar__AvatarText",
35
- componentId: "yx873f-0"
38
+ componentId: "sc-yx873f-0"
36
39
  })(["font-size:", "px;color:", "px;"], function (props) {
37
40
  return props.fontSize;
38
41
  }, function (props) {
@@ -40,7 +43,7 @@ var AvatarText = (0, _styledComponents.default)(function (_ref) {
40
43
  });
41
44
  var Container = (0, _styledComponents.default)(_Box.default).withConfig({
42
45
  displayName: "Avatar__Container",
43
- componentId: "yx873f-1"
46
+ componentId: "sc-yx873f-1"
44
47
  })(["", ""], function (_ref2) {
45
48
  var theme = _ref2.theme,
46
49
  type = _ref2.type,
@@ -75,7 +78,7 @@ var Avatar = function Avatar(_ref3) {
75
78
  size = _ref3$size === void 0 ? "40px" : _ref3$size,
76
79
  bg = _ref3.bg,
77
80
  color = _ref3.color,
78
- rest = _objectWithoutPropertiesLoose(_ref3, ["appearance", "name", "src", "variant", "type", "size", "bg", "color"]);
81
+ rest = _objectWithoutPropertiesLoose(_ref3, _excluded2);
79
82
 
80
83
  var _useState = (0, React.useState)(false),
81
84
  imageFailedLoading = _useState[0],
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.legacyBadgeColors = void 0;
5
+ var defaultPurple = {
6
+ color: "colors.text.body",
7
+ background: "colors.container.background.decorative.purple"
8
+ };
9
+ var suggestion = {
10
+ color: "colors.text.body",
11
+ background: "colors.container.background.decorative.blue"
12
+ };
13
+ var passive = {
14
+ color: "colors.text.body",
15
+ background: "colors.container.background.decorative.neutral"
16
+ };
17
+ var primary = {
18
+ color: "colors.text.body",
19
+ background: "colors.container.background.decorative.blue"
20
+ };
21
+ var secondary = {
22
+ color: "colors.text.body",
23
+ background: "colors.container.background.decorative.yellow"
24
+ };
25
+ var common = {
26
+ color: "colors.text.inverse",
27
+ background: "colors.aqua.600"
28
+ };
29
+ var approval = {
30
+ color: "colors.text.body",
31
+ background: "colors.container.background.decorative.orange"
32
+ }; //Deprecated former "types"
33
+
34
+ var legacyBadgeColors = {
35
+ primary: primary,
36
+ secondary: secondary,
37
+ passive: passive,
38
+ common: common,
39
+ approval: approval,
40
+ default: defaultPurple,
41
+ suggestion: suggestion
42
+ };
43
+ exports.legacyBadgeColors = legacyBadgeColors;
@@ -5,8 +5,14 @@ exports.default = void 0;
5
5
 
6
6
  var React = _interopRequireWildcard(require("react"));
7
7
 
8
+ var _Icon = _interopRequireDefault(require("../Icon"));
9
+
8
10
  var _styles = _interopRequireDefault(require("./styles"));
9
11
 
12
+ var _Box = _interopRequireDefault(require("../Box"));
13
+
14
+ var _excluded = ["children", "text", "iconName", "type", "tip", "size", "badgeColor"];
15
+
10
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
17
 
12
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -17,43 +23,41 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
17
23
 
18
24
  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; }
19
25
 
20
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
21
-
22
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
-
24
- var Badge = /*#__PURE__*/function (_React$Component) {
25
- _inheritsLoose(Badge, _React$Component);
26
-
27
- function Badge() {
28
- return _React$Component.apply(this, arguments) || this;
26
+ var Badge = function Badge(_ref) {
27
+ var children = _ref.children,
28
+ text = _ref.text,
29
+ iconName = _ref.iconName,
30
+ type = _ref.type,
31
+ tip = _ref.tip,
32
+ _ref$size = _ref.size,
33
+ size = _ref$size === void 0 ? "small" : _ref$size,
34
+ _ref$badgeColor = _ref.badgeColor,
35
+ badgeColor = _ref$badgeColor === void 0 ? "blue" : _ref$badgeColor,
36
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
37
+
38
+ if (children && text) {
39
+ throw new Error("can't use both `children` and `text` props. Text is deprecated, consider using children.");
29
40
  }
30
41
 
31
- var _proto = Badge.prototype;
32
-
33
- _proto.render = function render() {
34
- var _this$props = this.props,
35
- size = _this$props.size,
36
- type = _this$props.type,
37
- tip = _this$props.tip,
38
- text = _this$props.text,
39
- rest = _objectWithoutPropertiesLoose(_this$props, ["size", "type", "tip", "text"]);
40
-
41
- return /*#__PURE__*/React.createElement(_styles.default, _extends({
42
- type: type,
43
- small: size === "small",
44
- "data-tip": tip,
45
- "data-qa-badge": text || "",
46
- "data-qa-badge-type": type,
47
- "data-qa-badge-tip": tip || "" // $FlowIssue - upgrade v0.112.0
48
-
49
- }, rest), text);
50
- };
51
-
52
- return Badge;
53
- }(React.Component);
54
-
55
- exports.default = Badge;
56
- Badge.defaultProps = {
57
- type: "primary",
58
- size: "default"
59
- };
42
+ return /*#__PURE__*/React.createElement(_styles.default, _extends({}, rest, {
43
+ // size previously included default, which currently maps to small. Once consumers have updated this can be simplified.
44
+ size: size === "default" ? "large" : size,
45
+ badgeColor: badgeColor,
46
+ "data-tip": tip,
47
+ "data-qa-badge": text || "",
48
+ "data-qa-badge-type": type,
49
+ "data-qa-badge-tip": tip || "",
50
+ type: type && type
51
+ }), /*#__PURE__*/React.createElement(_Box.default, {
52
+ display: "flex",
53
+ alignItems: "center",
54
+ JustifyContent: "center"
55
+ }, iconName ? /*#__PURE__*/React.createElement(_Icon.default, {
56
+ mr: 200,
57
+ name: iconName,
58
+ size: size === "small" ? "mini" : "default"
59
+ }) : null, children || text));
60
+ };
61
+
62
+ var _default = Badge;
63
+ exports.default = _default;
@@ -3,46 +3,30 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
6
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
7
7
 
8
8
  var _systemProps = require("../utils/system-props");
9
9
 
10
10
  var _themeGet = require("@styled-system/theme-get");
11
11
 
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
- var colors = {
17
- primary: "colors.neutral.0",
18
- secondary: "colors.neutral.800",
19
- passive: "colors.neutral.800",
20
- common: "colors.neutral.0",
21
- approval: "colors.neutral.800",
22
- default: "colors.neutral.0",
23
- suggestion: "colors.neutral.900"
24
- };
25
- var backgroundColors = {
26
- primary: "colors.blue.700",
27
- secondary: "colors.yellow.500",
28
- passive: "colors.neutral.200",
29
- common: "colors.aqua.600",
30
- approval: "colors.orange.300",
31
- default: "colors.purple.700",
32
- suggestion: "colors.blue.300"
33
- }; // eslint-disable-next-line prettier/prettier
12
+ var _constants = require("./constants");
34
13
 
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ // eslint-disable-next-line prettier/prettier
35
17
  var Container = _styledComponents.default.span.withConfig({
36
18
  displayName: "styles__Container",
37
- componentId: "g1g76b-0"
38
- })(["display:inline-block;text-align:center;border-radius:50px;font-family:", ";padding:", ";", " ", " ", ""], function (props) {
39
- return props.theme.fontFamily;
40
- }, function (props) {
41
- return props.small ? props.theme.space[200] + " " + props.theme.space[300] : props.theme.space[300] + " " + props.theme.space[350];
42
- }, function (props) {
43
- return props.small ? props.theme.typography[100] : props.theme.typography[200];
44
- }, function (props) {
45
- return (0, _styledComponents.css)(["color:", ";background:", ";"], (0, _themeGet.themeGet)(colors[props.type])(props), (0, _themeGet.themeGet)(backgroundColors[props.type])(props));
19
+ componentId: "sc-g1g76b-0"
20
+ })(["font-family:", ";", ";border-radius:9999px;line-height:16px;display:inline-block;color:", ";background:", ";padding:", ";", ";"], function (p) {
21
+ return p.theme.fontFamily;
22
+ }, function (p) {
23
+ return p.size === "small" ? p.theme.typography[100] : p.theme.typography[200];
24
+ }, function (p) {
25
+ return p.type ? (0, _themeGet.themeGet)(_constants.legacyBadgeColors[p.type].color) : p.theme.colors.text.body;
26
+ }, function (p) {
27
+ return p.type ? (0, _themeGet.themeGet)(_constants.legacyBadgeColors[p.type].background) : p.theme.colors.container.background.decorative[p.badgeColor];
28
+ }, function (p) {
29
+ return p.size === "small" ? p.theme.space[0] + " " + p.theme.space[200] : "" + p.theme.space[300];
46
30
  }, _systemProps.COMMON);
47
31
 
48
32
  var _default = Container;
@@ -11,6 +11,8 @@ var _styles = _interopRequireDefault(require("./styles"));
11
11
 
12
12
  var _Box = _interopRequireDefault(require("../Box"));
13
13
 
14
+ var _excluded = ["type", "text"];
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -81,7 +83,7 @@ var Banner = /*#__PURE__*/function (_React$Component) {
81
83
  var _this$props = this.props,
82
84
  type = _this$props.type,
83
85
  text = _this$props.text,
84
- rest = _objectWithoutPropertiesLoose(_this$props, ["type", "text"]);
86
+ rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
85
87
 
86
88
  return /*#__PURE__*/React.createElement(_styles.default // danger needs to be properly deprecated and removed DS-1094
87
89
  , _extends({
@@ -13,7 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
13
13
 
14
14
  var Container = _styledComponents.default.div.withConfig({
15
15
  displayName: "styles__Container",
16
- componentId: "q43dr4-0"
16
+ componentId: "sc-q43dr4-0"
17
17
  })(function (props) {
18
18
  return (0, _styledComponents.css)(["display:flex;overflow:hidden;align-items:center;justify-content:space-between;color:", ";border-radius:", ";font-family:", ";", " padding:", ";border:1px solid ", ";background-color:", ";.Icon{align-self:flex-start;margin-top:3px;margin-right:", ";min-width:16px;color:", ";}a,button{font-weight:", ";color:", ";font-size:inherit;&:hover{color:", ";text-decoration:underline;}}> span:not(.Icon){display:block;}", " ", ""], props.theme.colors.text.body, props.theme.radii.outer, props.theme.fontFamily, props.theme.typography[200], props.theme.space[300], props.theme.colors.container.border[props.type], props.theme.colors.container.background[props.type], props.theme.space[400], props.theme.colors.icon[props.type], props.theme.fontWeights.semibold, props.theme.colors.text.body, props.theme.colors.text.body, _systemProps.COMMON, _systemProps.LAYOUT);
19
19
  });
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
 
12
12
  var Container = _styledComponents.default.div.withConfig({
13
13
  displayName: "styles__Container",
14
- componentId: "ma8yo6-0"
14
+ componentId: "sc-ma8yo6-0"
15
15
  })(["box-sizing:border-box;font-family:", ";", " ", " ", " ", " ", " ", ""], function (_ref) {
16
16
  var theme = _ref.theme;
17
17
  return theme.fontFamily;
@@ -13,6 +13,9 @@ var _Menu = require("../Menu");
13
13
 
14
14
  var _styles = _interopRequireDefault(require("./styles"));
15
15
 
16
+ var _excluded = ["children", "href"],
17
+ _excluded2 = ["ariaLabel", "overflow", "children"];
18
+
16
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
20
 
18
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -26,7 +29,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
26
29
  var BreadcrumbItem = function BreadcrumbItem(_ref) {
27
30
  var children = _ref.children,
28
31
  href = _ref.href,
29
- rest = _objectWithoutPropertiesLoose(_ref, ["children", "href"]);
32
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
30
33
 
31
34
  return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(_Link.default, _extends({
32
35
  href: href // $FlowIssue - upgrade v0.112.0
@@ -38,7 +41,7 @@ var Breadcrumb = function Breadcrumb(_ref2) {
38
41
  var ariaLabel = _ref2.ariaLabel,
39
42
  overflow = _ref2.overflow,
40
43
  children = _ref2.children,
41
- rest = _objectWithoutPropertiesLoose(_ref2, ["ariaLabel", "overflow", "children"]);
44
+ rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
42
45
 
43
46
  var listItems = React.Children.toArray(children);
44
47
  var lastItem = listItems[listItems.length - 1];