@sproutsocial/racine 11.9.0-typescript.0 → 12.0.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 (49) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/__flow__/Button/{index.tsx → index.js} +21 -20
  3. package/__flow__/Button/{styles.ts → styles.js} +1 -1
  4. package/__flow__/Checkbox/styles.js +75 -75
  5. package/__flow__/Collapsible/index.js +2 -3
  6. package/__flow__/Image/index.js +2 -10
  7. package/__flow__/Input/index.js +2 -2
  8. package/__flow__/SegmentedControl/index.js +2 -3
  9. package/__flow__/TableCell/index.js +2 -9
  10. package/__flow__/ToggleHint/index.js +2 -9
  11. package/__flow__/Token/styles.js +13 -12
  12. package/__flow__/index.js +1 -0
  13. package/__flow__/systemProps/color.js +2 -1
  14. package/__flow__/themes/dark/theme.js +0 -5
  15. package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +9 -0
  16. package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +9 -0
  17. package/__flow__/themes/light/theme.js +0 -5
  18. package/__flow__/types/theme.flow.js +2 -2
  19. package/__flow__/utils/responsiveProps/index.test.js +2 -10
  20. package/__flow__/utils/useInteractiveColor.js +32 -0
  21. package/commonjs/Button/index.js +70 -0
  22. package/commonjs/Button/styles.js +66 -0
  23. package/commonjs/Input/index.js +3 -1
  24. package/commonjs/Token/styles.js +9 -7
  25. package/commonjs/index.js +6 -1
  26. package/commonjs/themes/dark/theme.js +0 -5
  27. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +11 -2
  28. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +11 -2
  29. package/commonjs/themes/light/theme.js +0 -5
  30. package/commonjs/utils/useInteractiveColor.js +33 -0
  31. package/dist/themes/dark/theme.scss +0 -3
  32. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +14 -3
  33. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +14 -3
  34. package/dist/themes/light/theme.scss +0 -3
  35. package/lib/Button/index.js +57 -0
  36. package/lib/Button/styles.js +48 -0
  37. package/lib/Input/index.js +2 -1
  38. package/lib/Token/styles.js +8 -7
  39. package/lib/index.js +1 -0
  40. package/lib/themes/dark/theme.js +0 -4
  41. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +9 -1
  42. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +9 -1
  43. package/lib/themes/light/theme.js +0 -4
  44. package/lib/types/theme.flow.js +1 -1
  45. package/lib/utils/useInteractiveColor.js +27 -0
  46. package/package.json +1 -6
  47. package/__flow__/themes/utils/interact.js +0 -12
  48. package/commonjs/themes/utils/interact.js +0 -19
  49. package/lib/themes/utils/interact.js +0 -13
@@ -6,7 +6,6 @@ import lightTheme from "../light/theme";
6
6
  import { datavizPalette } from "./dataviz-palette";
7
7
  import { green, blue, purple, yellow, orange, red, neutral } from "./decorative-palettes";
8
8
  import { transparentize } from "polished";
9
- import interact from "../utils/interact";
10
9
  var MODE = "dark";
11
10
  export var shadows = {
12
11
  low: DEPTH.ELEVATION_LEVEL_100 + " " + COLORS.COLOR_NEUTRAL_1100 + "FF",
@@ -218,9 +217,6 @@ var colors = _extends({}, lightTheme.colors, {
218
217
  }, datavizPalette);
219
218
 
220
219
  var darkTheme = _extends({}, lightTheme, {
221
- utils: {
222
- interact: interact(MODE)
223
- },
224
220
  colors: colors,
225
221
  shadows: shadows,
226
222
  mode: MODE
@@ -39,11 +39,19 @@ export var datePicker = {
39
39
  }
40
40
  }
41
41
  };
42
+ export var analytics = {
43
+ trend: {
44
+ positive: baseDarkTheme.colors.teal[500],
45
+ neutral: baseDarkTheme.colors.neutral[100],
46
+ negative: baseDarkTheme.colors.neutral[100]
47
+ }
48
+ };
42
49
 
43
50
  var darkTheme = _extends({}, baseDarkTheme, {
44
51
  colors: _extends({}, baseDarkTheme.colors, {
45
52
  navigation: navigation,
46
- datePicker: datePicker
53
+ datePicker: datePicker,
54
+ analytics: analytics
47
55
  })
48
56
  });
49
57
 
@@ -39,11 +39,19 @@ export var datePicker = {
39
39
  }
40
40
  }
41
41
  };
42
+ export var analytics = {
43
+ trend: {
44
+ positive: baseLightTheme.colors.teal[800],
45
+ neutral: baseLightTheme.colors.neutral[800],
46
+ negative: baseLightTheme.colors.neutral[800]
47
+ }
48
+ };
42
49
 
43
50
  var lightTheme = _extends({}, baseLightTheme, {
44
51
  colors: _extends({}, baseLightTheme.colors, {
45
52
  navigation: navigation,
46
- datePicker: datePicker
53
+ datePicker: datePicker,
54
+ analytics: analytics
47
55
  })
48
56
  });
49
57
 
@@ -11,7 +11,6 @@ import DEPTH from "@sproutsocial/seeds-depth";
11
11
  import MOTION from "@sproutsocial/seeds-motion";
12
12
  import BORDER from "@sproutsocial/seeds-border";
13
13
  import { transparentize } from "polished";
14
- import interact from "../utils/interact";
15
14
  export var breakpoints = ["900px", "1200px", "1500px", "1800px"];
16
15
  var MODE = "light"; // If you are making changes to the colors in the theme file tag the Design Systems team on your PR! Thank you!!
17
16
 
@@ -308,9 +307,6 @@ export var duration = {
308
307
  slow: MOTION.MOTION_DURATION_SLOW
309
308
  };
310
309
  var theme = {
311
- utils: {
312
- interact: interact(MODE)
313
- },
314
310
  breakpoints: breakpoints,
315
311
  colors: colors,
316
312
  typography: _extends({}, typography, {
@@ -1,2 +1,2 @@
1
1
  import { breakpoints, typography, fontWeights, radii, borders, borderWidths, shadows, space, easing, duration } from "../themes/light/theme";
2
- import { datePicker, navigation } from "../themes/extendedThemes/sproutTheme/light/theme";
2
+ import { datePicker, navigation, analytics } from "../themes/extendedThemes/sproutTheme/light/theme";
@@ -0,0 +1,27 @@
1
+ import { darken, lighten } from "polished";
2
+ import { useTheme } from "styled-components";
3
+
4
+ /**
5
+ * The useInteractiveColor hook has context of theme mode (light or dark)
6
+ * and can be used to lighten or darken a color dynamically
7
+ *
8
+ * note: colors are limited to our theme colors
9
+ */
10
+ var useInteractiveColor = function useInteractiveColor(themeColor) {
11
+ // Throw error if used outside of a ThemeProvider (styled-components)
12
+ if (!useTheme()) {
13
+ throw new Error("useInteractiveColor() must be used within a Styled Components ThemeProvider");
14
+ } // Get the current theme mode ie. 'light' or 'dark'
15
+
16
+
17
+ var themeMode = useTheme().mode; // If the theme mode is dark, return a lightened version of the themeValue
18
+
19
+ if (themeMode === "dark") {
20
+ return lighten(0.2, themeColor);
21
+ } else {
22
+ // If the theme mode is light, return a darkened version of the themeValue
23
+ return darken(0.2, themeColor);
24
+ }
25
+ };
26
+
27
+ export { useInteractiveColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.9.0-typescript.0",
3
+ "version": "12.0.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -66,10 +66,6 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@styled-system/theme-get": "^5.1.2",
69
- "@types/jest": "^27.5.1",
70
- "@types/node": "^17.0.38",
71
- "@types/react": "^18.0.10",
72
- "@types/react-dom": "^18.0.5",
73
69
  "classnames": "^2.2.6",
74
70
  "lodash.curry": "^4.1.1",
75
71
  "lodash.uniqueid": "^4.0.1",
@@ -85,7 +81,6 @@
85
81
  "react-virtualized": "9.18.5",
86
82
  "scroll-into-view-if-needed": "1.1.0",
87
83
  "styled-system": "^5.1.5",
88
- "typescript": "^4.7.2",
89
84
  "use-measure": "^0.2.2"
90
85
  },
91
86
  "devDependencies": {
@@ -1,12 +0,0 @@
1
- //@flow strict-local
2
- import { darken, lighten } from "polished";
3
-
4
- const interact = (mode: string) => (themeValue: string) => {
5
- if (mode === "dark") {
6
- return lighten(0.2, themeValue);
7
- } else {
8
- return darken(0.2, themeValue);
9
- }
10
- };
11
-
12
- export default interact;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.default = void 0;
5
-
6
- var _polished = require("polished");
7
-
8
- var interact = function interact(mode) {
9
- return function (themeValue) {
10
- if (mode === "dark") {
11
- return (0, _polished.lighten)(0.2, themeValue);
12
- } else {
13
- return (0, _polished.darken)(0.2, themeValue);
14
- }
15
- };
16
- };
17
-
18
- var _default = interact;
19
- exports.default = _default;
@@ -1,13 +0,0 @@
1
- import { darken, lighten } from "polished";
2
-
3
- var interact = function interact(mode) {
4
- return function (themeValue) {
5
- if (mode === "dark") {
6
- return lighten(0.2, themeValue);
7
- } else {
8
- return darken(0.2, themeValue);
9
- }
10
- };
11
- };
12
-
13
- export default interact;