@sproutsocial/racine 11.2.5-sproutTheme-beta.1 → 11.2.5-sproutTheme-beta.2

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 (28) hide show
  1. package/__flow__/ThemeProvider/index.js +2 -1
  2. package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
  3. package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +45 -0
  4. package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +16 -34
  5. package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +43 -0
  6. package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +16 -44
  7. package/__flow__/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +36 -0
  8. package/__flow__/types/theme.flow.js +15 -0
  9. package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +15 -0
  10. package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +48 -0
  11. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +14 -33
  12. package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +46 -0
  13. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +14 -43
  14. package/commonjs/themes/extendedThemes/sproutTheme/{dark/colors.js → sproutThemeType.flow.js} +0 -0
  15. package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +10 -0
  16. package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +43 -0
  17. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +11 -33
  18. package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +41 -0
  19. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +10 -42
  20. package/{__flow__/themes/extendedThemes/sproutTheme/dark/colors.js → lib/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js} +0 -0
  21. package/package.json +1 -1
  22. package/__flow__/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
  23. package/__flow__/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -6
  24. package/commonjs/themes/extendedThemes/sproutTheme/light/colors.js +0 -1
  25. package/commonjs/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -9
  26. package/lib/themes/extendedThemes/sproutTheme/dark/colors.js +0 -0
  27. package/lib/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
  28. package/lib/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -5
@@ -4,9 +4,10 @@ import { ThemeProvider as BaseThemeProvider } from "styled-components";
4
4
  import theme from "../themes/light/theme";
5
5
 
6
6
  import type { TypeTheme } from "../types/theme.flow";
7
+ import type { TypeSproutTheme } from "../themes/extendedThemes/sproutTheme/sproutThemeType.flow";
7
8
 
8
9
  type TypeProps = $ReadOnly<{|
9
- theme?: TypeTheme,
10
+ theme?: TypeTheme | TypeSproutTheme,
10
11
  children: React.Node,
11
12
  |}>;
12
13
 
@@ -0,0 +1,17 @@
1
+ // @flow strict-local
2
+ import type {
3
+ TypeNonColorThemeValues,
4
+ TypeTheme,
5
+ } from "../../../../types/theme.flow.js";
6
+
7
+ export function getNonColorThemeValues(
8
+ theme: TypeTheme
9
+ ): TypeNonColorThemeValues {
10
+ const { colors, ...otherThemeValues } = theme;
11
+ return {
12
+ ...otherThemeValues,
13
+ /**
14
+ * You can add your own theme values or over rides here.
15
+ */
16
+ };
17
+ }
@@ -0,0 +1,45 @@
1
+ // @flow strict-local
2
+ import type { TypeColors } from "../../../../types/theme.colors.flow.js";
3
+
4
+ export function getDarkThemeColors(themeColors: TypeColors) {
5
+ return {
6
+ ...themeColors,
7
+ navigation: {
8
+ main: {
9
+ background: {
10
+ base: themeColors.neutral[1000],
11
+ gradient: themeColors.neutral[1100],
12
+ },
13
+ },
14
+ secondary: {
15
+ background: {
16
+ base: themeColors.neutral[900],
17
+ },
18
+ },
19
+ text: {
20
+ base: themeColors.neutral[0],
21
+ hover: themeColors.neutral[0],
22
+ },
23
+ icon: {
24
+ base: themeColors.neutral[0],
25
+ hover: themeColors.neutral[0],
26
+ },
27
+ listItem: {
28
+ background: {
29
+ base: themeColors.neutral[1000],
30
+ hover: themeColors.neutral[1100],
31
+ active: themeColors.neutral[700],
32
+ },
33
+ },
34
+ },
35
+ icon: {
36
+ // FIX: These need to be changed to have dark mode colors
37
+ // For now we've copied the light mode values here as well.
38
+ sentiment: {
39
+ positive_sentiment: themeColors.blue[500],
40
+ negative_sentiment: themeColors.red[500],
41
+ neutral_sentiment: themeColors.neutral[300],
42
+ },
43
+ },
44
+ };
45
+ }
@@ -1,43 +1,25 @@
1
1
  // @flow strict-local
2
2
  import clone from "just-clone";
3
+ import baseDarkTheme from "../../../dark/theme";
4
+ import { getDarkThemeColors } from "./getDarkThemeColors";
5
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
3
6
  import type { TypeTheme } from "../../../../types/theme.flow.js";
4
7
 
5
- const darkTheme = (theme: TypeTheme) => {
6
- const sproutDarkTheme = clone(theme);
8
+ const darkTheme = (baseDarkTheme: TypeTheme) => {
9
+ // clone base theme. (we don't want to mutate the base theme)
10
+ const themeClone = clone(baseDarkTheme);
7
11
 
8
- sproutDarkTheme.colors = {
9
- ...sproutDarkTheme.colors,
10
- navigation: {
11
- main: {
12
- background: {
13
- base: theme.colors.neutral[1000],
14
- gradient: theme.colors.neutral[1100],
15
- },
16
- },
17
- secondary: {
18
- background: {
19
- base: theme.colors.neutral[900],
20
- },
21
- },
22
- text: {
23
- base: theme.colors.neutral[0],
24
- hover: theme.colors.neutral[0],
25
- },
26
- icon: {
27
- base: theme.colors.neutral[0],
28
- hover: theme.colors.neutral[0],
29
- },
30
- item: {
31
- background: {
32
- base: theme.colors.neutral[1000],
33
- hover: theme.colors.neutral[1100],
34
- active: theme.colors.neutral[700],
35
- },
36
- },
37
- },
38
- };
12
+ // get non color theme values
13
+ const nonColorThemeValues = getNonColorThemeValues(themeClone);
14
+
15
+ // get sprout specific dark theme colors
16
+ const darkThemeColors = getDarkThemeColors(themeClone.colors);
39
17
 
40
- return sproutDarkTheme;
18
+ return {
19
+ ...themeClone,
20
+ ...nonColorThemeValues,
21
+ ...darkThemeColors,
22
+ };
41
23
  };
42
24
 
43
25
  export default darkTheme;
@@ -0,0 +1,43 @@
1
+ // @flow strict-local
2
+ import type { TypeColors } from "../../../../types/theme.colors.flow.js";
3
+
4
+ export function getLightThemeColors(themeColors: TypeColors) {
5
+ return {
6
+ ...themeColors,
7
+ navigation: {
8
+ main: {
9
+ background: {
10
+ base: themeColors.neutral[900],
11
+ overflowGradient: themeColors.neutral[1000],
12
+ },
13
+ },
14
+ secondary: {
15
+ background: {
16
+ base: themeColors.neutral[800],
17
+ },
18
+ },
19
+ text: {
20
+ base: themeColors.neutral[0],
21
+ hover: themeColors.neutral[0],
22
+ },
23
+ icon: {
24
+ base: themeColors.neutral[0],
25
+ hover: themeColors.neutral[0],
26
+ },
27
+ listItem: {
28
+ background: {
29
+ base: themeColors.neutral[800],
30
+ hover: themeColors.neutral[1000],
31
+ selected: themeColors.neutral[700],
32
+ },
33
+ },
34
+ },
35
+ icon: {
36
+ sentiment: {
37
+ positive_sentiment: themeColors.blue[500],
38
+ negative_sentiment: themeColors.red[500],
39
+ neutral_sentiment: themeColors.neutral[300],
40
+ },
41
+ },
42
+ };
43
+ }
@@ -1,53 +1,25 @@
1
1
  // @flow strict-local
2
2
  import clone from "just-clone";
3
+ import baseLightTheme from "../../../light/theme";
4
+ import { getLightThemeColors } from "./getLightThemeColors";
5
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
3
6
  import type { TypeTheme } from "../../../../types/theme.flow.js";
4
7
 
5
- const lightTheme = (theme: TypeTheme) => {
6
- const sproutLightTheme = clone(theme);
7
- // copy theme that's passed in
8
- // get all non color theme values
9
- // get light theme changes
8
+ const lightTheme = (baseLightTheme: TypeTheme) => {
9
+ // clone base theme. (we don't want to mutate the base theme)
10
+ const themeClone = clone(baseLightTheme);
10
11
 
11
- sproutLightTheme.colors = {
12
- ...sproutLightTheme.colors,
13
- navigation: {
14
- main: {
15
- background: {
16
- base: theme.colors.neutral[900],
17
- overflowGradient: theme.colors.neutral[1000],
18
- },
19
- },
20
- secondary: {
21
- background: {
22
- base: theme.colors.neutral[800],
23
- },
24
- },
25
- text: {
26
- base: theme.colors.neutral[0],
27
- hover: theme.colors.neutral[0],
28
- },
29
- icon: {
30
- base: theme.colors.neutral[0],
31
- hover: theme.colors.neutral[0],
32
- },
33
- listItem: {
34
- background: {
35
- base: theme.colors.neutral[800],
36
- hover: theme.colors.neutral[1000],
37
- selected: theme.colors.neutral[700],
38
- },
39
- },
40
- },
41
- icon: {
42
- sentiment: {
43
- positive_sentiment: theme.colors.blue[500],
44
- negative_sentiment: theme.colors.red[500],
45
- neutral_sentiment: theme.colors.neutral[300],
46
- },
47
- },
48
- };
12
+ // get non color theme values
13
+ const nonColorThemeValues = getNonColorThemeValues(themeClone);
14
+
15
+ // get sprout specific light theme colors
16
+ const lightThemeColors = getLightThemeColors(themeClone.colors);
49
17
 
50
- return sproutLightTheme;
18
+ return {
19
+ ...themeClone,
20
+ ...nonColorThemeValues,
21
+ ...lightThemeColors,
22
+ };
51
23
  };
52
24
 
53
25
  export default lightTheme;
@@ -0,0 +1,36 @@
1
+ // @flow strict-local
2
+ import type { TypeTheme } from "../../../types/theme.flow";
3
+
4
+ export type TypeSproutTheme = {
5
+ ...$Exact<TypeTheme>,
6
+ colors: {|
7
+ navigation: {|
8
+ main: {|
9
+ background: {|
10
+ base: string,
11
+ gradient: string,
12
+ |},
13
+ |},
14
+ secondary: {|
15
+ background: {|
16
+ base: string,
17
+ |},
18
+ |},
19
+ text: {|
20
+ base: string,
21
+ hover: string,
22
+ |},
23
+ icon: {|
24
+ base: string,
25
+ hover: string,
26
+ |},
27
+ listItem: {|
28
+ background: {|
29
+ base: string,
30
+ hover: string,
31
+ active: string,
32
+ |},
33
+ |},
34
+ |},
35
+ |},
36
+ };
@@ -43,3 +43,18 @@ export type TypeTheme = {
43
43
  easing: TypeEasing,
44
44
  duration: TypeDuration,
45
45
  };
46
+
47
+ export type TypeNonColorThemeValues = {
48
+ mode: TypeThemeMode,
49
+ breakpoints: TypeBreakpoint,
50
+ typography: TypeTypography,
51
+ fontWeights: TypeFontWeight,
52
+ fontFamily: TypeFontFamily,
53
+ space: TypeSpace,
54
+ radii: TypeRadii,
55
+ borders: TypeBorder,
56
+ borderWidths: TypeBorderWidth,
57
+ shadows: TypeShadow,
58
+ easing: TypeEasing,
59
+ duration: TypeDuration,
60
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getNonColorThemeValues = getNonColorThemeValues;
5
+
6
+ function _extends() { _extends = Object.assign || 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); }
7
+
8
+ 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; }
9
+
10
+ function getNonColorThemeValues(theme) {
11
+ var colors = theme.colors,
12
+ otherThemeValues = _objectWithoutPropertiesLoose(theme, ["colors"]);
13
+
14
+ return _extends({}, otherThemeValues);
15
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getDarkThemeColors = getDarkThemeColors;
5
+
6
+ function _extends() { _extends = Object.assign || 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); }
7
+
8
+ function getDarkThemeColors(themeColors) {
9
+ return _extends({}, themeColors, {
10
+ navigation: {
11
+ main: {
12
+ background: {
13
+ base: themeColors.neutral[1000],
14
+ gradient: themeColors.neutral[1100]
15
+ }
16
+ },
17
+ secondary: {
18
+ background: {
19
+ base: themeColors.neutral[900]
20
+ }
21
+ },
22
+ text: {
23
+ base: themeColors.neutral[0],
24
+ hover: themeColors.neutral[0]
25
+ },
26
+ icon: {
27
+ base: themeColors.neutral[0],
28
+ hover: themeColors.neutral[0]
29
+ },
30
+ listItem: {
31
+ background: {
32
+ base: themeColors.neutral[1000],
33
+ hover: themeColors.neutral[1100],
34
+ active: themeColors.neutral[700]
35
+ }
36
+ }
37
+ },
38
+ icon: {
39
+ // FIX: These need to be changed to have dark mode colors
40
+ // For now we've copied the light mode values here as well.
41
+ sentiment: {
42
+ positive_sentiment: themeColors.blue[500],
43
+ negative_sentiment: themeColors.red[500],
44
+ neutral_sentiment: themeColors.neutral[300]
45
+ }
46
+ }
47
+ });
48
+ }
@@ -5,43 +5,24 @@ exports.default = void 0;
5
5
 
6
6
  var _justClone = _interopRequireDefault(require("just-clone"));
7
7
 
8
+ var _theme = _interopRequireDefault(require("../../../dark/theme"));
9
+
10
+ var _getDarkThemeColors = require("./getDarkThemeColors");
11
+
12
+ var _NonColorThemeValues = require("../NonColorThemeValues");
13
+
8
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
15
 
10
16
  function _extends() { _extends = Object.assign || 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); }
11
17
 
12
- var darkTheme = function darkTheme(theme) {
13
- var sproutDarkTheme = (0, _justClone.default)(theme);
14
- sproutDarkTheme.colors = _extends({}, sproutDarkTheme.colors, {
15
- navigation: {
16
- main: {
17
- background: {
18
- base: theme.colors.neutral[1000],
19
- gradient: theme.colors.neutral[1100]
20
- }
21
- },
22
- secondary: {
23
- background: {
24
- base: theme.colors.neutral[900]
25
- }
26
- },
27
- text: {
28
- base: theme.colors.neutral[0],
29
- hover: theme.colors.neutral[0]
30
- },
31
- icon: {
32
- base: theme.colors.neutral[0],
33
- hover: theme.colors.neutral[0]
34
- },
35
- item: {
36
- background: {
37
- base: theme.colors.neutral[1000],
38
- hover: theme.colors.neutral[1100],
39
- active: theme.colors.neutral[700]
40
- }
41
- }
42
- }
43
- });
44
- return sproutDarkTheme;
18
+ var darkTheme = function darkTheme(baseDarkTheme) {
19
+ // clone base theme. (we don't want to mutate the base theme)
20
+ var themeClone = (0, _justClone.default)(baseDarkTheme); // get non color theme values
21
+
22
+ var nonColorThemeValues = (0, _NonColorThemeValues.getNonColorThemeValues)(themeClone); // get sprout specific dark theme colors
23
+
24
+ var darkThemeColors = (0, _getDarkThemeColors.getDarkThemeColors)(themeClone.colors);
25
+ return _extends({}, themeClone, nonColorThemeValues, darkThemeColors);
45
26
  };
46
27
 
47
28
  var _default = darkTheme;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getLightThemeColors = getLightThemeColors;
5
+
6
+ function _extends() { _extends = Object.assign || 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); }
7
+
8
+ function getLightThemeColors(themeColors) {
9
+ return _extends({}, themeColors, {
10
+ navigation: {
11
+ main: {
12
+ background: {
13
+ base: themeColors.neutral[900],
14
+ overflowGradient: themeColors.neutral[1000]
15
+ }
16
+ },
17
+ secondary: {
18
+ background: {
19
+ base: themeColors.neutral[800]
20
+ }
21
+ },
22
+ text: {
23
+ base: themeColors.neutral[0],
24
+ hover: themeColors.neutral[0]
25
+ },
26
+ icon: {
27
+ base: themeColors.neutral[0],
28
+ hover: themeColors.neutral[0]
29
+ },
30
+ listItem: {
31
+ background: {
32
+ base: themeColors.neutral[800],
33
+ hover: themeColors.neutral[1000],
34
+ selected: themeColors.neutral[700]
35
+ }
36
+ }
37
+ },
38
+ icon: {
39
+ sentiment: {
40
+ positive_sentiment: themeColors.blue[500],
41
+ negative_sentiment: themeColors.red[500],
42
+ neutral_sentiment: themeColors.neutral[300]
43
+ }
44
+ }
45
+ });
46
+ }
@@ -5,53 +5,24 @@ exports.default = void 0;
5
5
 
6
6
  var _justClone = _interopRequireDefault(require("just-clone"));
7
7
 
8
+ var _theme = _interopRequireDefault(require("../../../light/theme"));
9
+
10
+ var _getLightThemeColors = require("./getLightThemeColors");
11
+
12
+ var _NonColorThemeValues = require("../NonColorThemeValues");
13
+
8
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
15
 
10
16
  function _extends() { _extends = Object.assign || 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); }
11
17
 
12
- var lightTheme = function lightTheme(theme) {
13
- var sproutLightTheme = (0, _justClone.default)(theme); // copy theme that's passed in
14
- // get all non color theme values
15
- // get light theme changes
16
-
17
- sproutLightTheme.colors = _extends({}, sproutLightTheme.colors, {
18
- navigation: {
19
- main: {
20
- background: {
21
- base: theme.colors.neutral[900],
22
- overflowGradient: theme.colors.neutral[1000]
23
- }
24
- },
25
- secondary: {
26
- background: {
27
- base: theme.colors.neutral[800]
28
- }
29
- },
30
- text: {
31
- base: theme.colors.neutral[0],
32
- hover: theme.colors.neutral[0]
33
- },
34
- icon: {
35
- base: theme.colors.neutral[0],
36
- hover: theme.colors.neutral[0]
37
- },
38
- listItem: {
39
- background: {
40
- base: theme.colors.neutral[800],
41
- hover: theme.colors.neutral[1000],
42
- selected: theme.colors.neutral[700]
43
- }
44
- }
45
- },
46
- icon: {
47
- sentiment: {
48
- positive_sentiment: theme.colors.blue[500],
49
- negative_sentiment: theme.colors.red[500],
50
- neutral_sentiment: theme.colors.neutral[300]
51
- }
52
- }
53
- });
54
- return sproutLightTheme;
18
+ var lightTheme = function lightTheme(baseLightTheme) {
19
+ // clone base theme. (we don't want to mutate the base theme)
20
+ var themeClone = (0, _justClone.default)(baseLightTheme); // get non color theme values
21
+
22
+ var nonColorThemeValues = (0, _NonColorThemeValues.getNonColorThemeValues)(themeClone); // get sprout specific light theme colors
23
+
24
+ var lightThemeColors = (0, _getLightThemeColors.getLightThemeColors)(themeClone.colors);
25
+ return _extends({}, themeClone, nonColorThemeValues, lightThemeColors);
55
26
  };
56
27
 
57
28
  var _default = lightTheme;
@@ -0,0 +1,10 @@
1
+ function _extends() { _extends = Object.assign || 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); }
2
+
3
+ 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
+
5
+ export function getNonColorThemeValues(theme) {
6
+ var colors = theme.colors,
7
+ otherThemeValues = _objectWithoutPropertiesLoose(theme, ["colors"]);
8
+
9
+ return _extends({}, otherThemeValues);
10
+ }
@@ -0,0 +1,43 @@
1
+ function _extends() { _extends = Object.assign || 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); }
2
+
3
+ export function getDarkThemeColors(themeColors) {
4
+ return _extends({}, themeColors, {
5
+ navigation: {
6
+ main: {
7
+ background: {
8
+ base: themeColors.neutral[1000],
9
+ gradient: themeColors.neutral[1100]
10
+ }
11
+ },
12
+ secondary: {
13
+ background: {
14
+ base: themeColors.neutral[900]
15
+ }
16
+ },
17
+ text: {
18
+ base: themeColors.neutral[0],
19
+ hover: themeColors.neutral[0]
20
+ },
21
+ icon: {
22
+ base: themeColors.neutral[0],
23
+ hover: themeColors.neutral[0]
24
+ },
25
+ listItem: {
26
+ background: {
27
+ base: themeColors.neutral[1000],
28
+ hover: themeColors.neutral[1100],
29
+ active: themeColors.neutral[700]
30
+ }
31
+ }
32
+ },
33
+ icon: {
34
+ // FIX: These need to be changed to have dark mode colors
35
+ // For now we've copied the light mode values here as well.
36
+ sentiment: {
37
+ positive_sentiment: themeColors.blue[500],
38
+ negative_sentiment: themeColors.red[500],
39
+ neutral_sentiment: themeColors.neutral[300]
40
+ }
41
+ }
42
+ });
43
+ }
@@ -1,40 +1,18 @@
1
1
  function _extends() { _extends = Object.assign || 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); }
2
2
 
3
3
  import clone from "just-clone";
4
+ import baseDarkTheme from "../../../dark/theme";
5
+ import { getDarkThemeColors } from "./getDarkThemeColors";
6
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
4
7
 
5
- var darkTheme = function darkTheme(theme) {
6
- var sproutDarkTheme = clone(theme);
7
- sproutDarkTheme.colors = _extends({}, sproutDarkTheme.colors, {
8
- navigation: {
9
- main: {
10
- background: {
11
- base: theme.colors.neutral[1000],
12
- gradient: theme.colors.neutral[1100]
13
- }
14
- },
15
- secondary: {
16
- background: {
17
- base: theme.colors.neutral[900]
18
- }
19
- },
20
- text: {
21
- base: theme.colors.neutral[0],
22
- hover: theme.colors.neutral[0]
23
- },
24
- icon: {
25
- base: theme.colors.neutral[0],
26
- hover: theme.colors.neutral[0]
27
- },
28
- item: {
29
- background: {
30
- base: theme.colors.neutral[1000],
31
- hover: theme.colors.neutral[1100],
32
- active: theme.colors.neutral[700]
33
- }
34
- }
35
- }
36
- });
37
- return sproutDarkTheme;
8
+ var darkTheme = function darkTheme(baseDarkTheme) {
9
+ // clone base theme. (we don't want to mutate the base theme)
10
+ var themeClone = clone(baseDarkTheme); // get non color theme values
11
+
12
+ var nonColorThemeValues = getNonColorThemeValues(themeClone); // get sprout specific dark theme colors
13
+
14
+ var darkThemeColors = getDarkThemeColors(themeClone.colors);
15
+ return _extends({}, themeClone, nonColorThemeValues, darkThemeColors);
38
16
  };
39
17
 
40
18
  export default darkTheme;
@@ -0,0 +1,41 @@
1
+ function _extends() { _extends = Object.assign || 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); }
2
+
3
+ export function getLightThemeColors(themeColors) {
4
+ return _extends({}, themeColors, {
5
+ navigation: {
6
+ main: {
7
+ background: {
8
+ base: themeColors.neutral[900],
9
+ overflowGradient: themeColors.neutral[1000]
10
+ }
11
+ },
12
+ secondary: {
13
+ background: {
14
+ base: themeColors.neutral[800]
15
+ }
16
+ },
17
+ text: {
18
+ base: themeColors.neutral[0],
19
+ hover: themeColors.neutral[0]
20
+ },
21
+ icon: {
22
+ base: themeColors.neutral[0],
23
+ hover: themeColors.neutral[0]
24
+ },
25
+ listItem: {
26
+ background: {
27
+ base: themeColors.neutral[800],
28
+ hover: themeColors.neutral[1000],
29
+ selected: themeColors.neutral[700]
30
+ }
31
+ }
32
+ },
33
+ icon: {
34
+ sentiment: {
35
+ positive_sentiment: themeColors.blue[500],
36
+ negative_sentiment: themeColors.red[500],
37
+ neutral_sentiment: themeColors.neutral[300]
38
+ }
39
+ }
40
+ });
41
+ }
@@ -1,50 +1,18 @@
1
1
  function _extends() { _extends = Object.assign || 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); }
2
2
 
3
3
  import clone from "just-clone";
4
+ import baseLightTheme from "../../../light/theme";
5
+ import { getLightThemeColors } from "./getLightThemeColors";
6
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
4
7
 
5
- var lightTheme = function lightTheme(theme) {
6
- var sproutLightTheme = clone(theme); // copy theme that's passed in
7
- // get all non color theme values
8
- // get light theme changes
8
+ var lightTheme = function lightTheme(baseLightTheme) {
9
+ // clone base theme. (we don't want to mutate the base theme)
10
+ var themeClone = clone(baseLightTheme); // get non color theme values
9
11
 
10
- sproutLightTheme.colors = _extends({}, sproutLightTheme.colors, {
11
- navigation: {
12
- main: {
13
- background: {
14
- base: theme.colors.neutral[900],
15
- overflowGradient: theme.colors.neutral[1000]
16
- }
17
- },
18
- secondary: {
19
- background: {
20
- base: theme.colors.neutral[800]
21
- }
22
- },
23
- text: {
24
- base: theme.colors.neutral[0],
25
- hover: theme.colors.neutral[0]
26
- },
27
- icon: {
28
- base: theme.colors.neutral[0],
29
- hover: theme.colors.neutral[0]
30
- },
31
- listItem: {
32
- background: {
33
- base: theme.colors.neutral[800],
34
- hover: theme.colors.neutral[1000],
35
- selected: theme.colors.neutral[700]
36
- }
37
- }
38
- },
39
- icon: {
40
- sentiment: {
41
- positive_sentiment: theme.colors.blue[500],
42
- negative_sentiment: theme.colors.red[500],
43
- neutral_sentiment: theme.colors.neutral[300]
44
- }
45
- }
46
- });
47
- return sproutLightTheme;
12
+ var nonColorThemeValues = getNonColorThemeValues(themeClone); // get sprout specific light theme colors
13
+
14
+ var lightThemeColors = getLightThemeColors(themeClone.colors);
15
+ return _extends({}, themeClone, nonColorThemeValues, lightThemeColors);
48
16
  };
49
17
 
50
18
  export default lightTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.2.5-sproutTheme-beta.1",
3
+ "version": "11.2.5-sproutTheme-beta.2",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -1,6 +0,0 @@
1
- // @flow strict-local
2
- import clone from 'just-clone';
3
-
4
- const nonColorThemeValues = (theme) => {
5
- const sproutTheme = clone(theme);
6
- }
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- var _justClone = _interopRequireDefault(require("just-clone"));
4
-
5
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
- var nonColorThemeValues = function nonColorThemeValues(theme) {
8
- var sproutTheme = (0, _justClone.default)(theme);
9
- };
@@ -1,5 +0,0 @@
1
- import clone from 'just-clone';
2
-
3
- var nonColorThemeValues = function nonColorThemeValues(theme) {
4
- var sproutTheme = clone(theme);
5
- };