@sproutsocial/racine 11.2.4 → 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 (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/__flow__/Button/index.stories.js +21 -6
  3. package/__flow__/Link/index.js +2 -2
  4. package/__flow__/ThemeProvider/index.js +3 -2
  5. package/__flow__/index.js +4 -0
  6. package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
  7. package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +45 -0
  8. package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +25 -0
  9. package/__flow__/themes/extendedThemes/sproutTheme/index.js +2 -0
  10. package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +43 -0
  11. package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +25 -0
  12. package/__flow__/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +36 -0
  13. package/__flow__/types/theme.flow.js +17 -0
  14. package/commonjs/index.js +8 -1
  15. package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +15 -0
  16. package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +48 -0
  17. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +29 -0
  18. package/commonjs/themes/extendedThemes/sproutTheme/index.js +14 -0
  19. package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +46 -0
  20. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +29 -0
  21. package/commonjs/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +1 -0
  22. package/lib/index.js +1 -0
  23. package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +10 -0
  24. package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +43 -0
  25. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +18 -0
  26. package/lib/themes/extendedThemes/sproutTheme/index.js +2 -0
  27. package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +41 -0
  28. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +18 -0
  29. package/lib/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +0 -0
  30. package/package.json +2 -1
  31. package/bin/buildNpm.js +0 -58
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 11.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - a73cdfb: remove weird characters from props descriptions
8
+
3
9
  ## 11.2.4
4
10
 
5
11
  ### Patch Changes
@@ -3,6 +3,11 @@ import { boolean, text, number } from "@storybook/addon-knobs";
3
3
  import Button from "./index";
4
4
  import Icon from "../Icon";
5
5
  import Box from "../Box";
6
+ import ThemeProvider from "../ThemeProvider";
7
+ import {
8
+ sproutLightTheme,
9
+ sproutDarkTheme,
10
+ } from "../themes/extendedThemes/sproutTheme";
6
11
 
7
12
  export default {
8
13
  title: "Button",
@@ -22,12 +27,22 @@ defaultStory.story = {
22
27
  };
23
28
 
24
29
  export const primary = () => (
25
- <Button
26
- appearance={text("appearance", "primary")}
27
- onClick={() => alert("Testing...")}
28
- >
29
- Primary Button
30
- </Button>
30
+ <>
31
+ <Button
32
+ appearance={text("appearance", "primary")}
33
+ onClick={() => alert("Testing...")}
34
+ >
35
+ Primary Button
36
+ </Button>
37
+ <ThemeProvider theme={(theme) => sproutLightTheme(theme)}>
38
+ <Button
39
+ appearance={text("appearance", "primary")}
40
+ onClick={() => alert("Testing...")}
41
+ >
42
+ Primary Button
43
+ </Button>
44
+ </ThemeProvider>
45
+ </>
31
46
  );
32
47
 
33
48
  primary.story = {
@@ -8,11 +8,11 @@ type TypeProps = {
8
8
  /** Optional prop to make the URL open in a new tab */
9
9
  external?: boolean,
10
10
  children: React.Node,
11
- /** Setting this prop will cause the component to be rendered as a link.) */
11
+ /** Setting this prop will cause the component to be rendered as a link */
12
12
  href?: string,
13
13
  /** Disables user action and applies a disabled style to the component */
14
14
  disabled?: boolean,
15
- /** Can be used in addition to an href but still renders as a link. Omitting href will render as button.) */
15
+ /** Can be used in addition to an href but still renders as a link. Omitting href will render as button */
16
16
  onClick?: (e: SyntheticEvent<HTMLButtonElement>) => void,
17
17
  as?: $PropertyType<TypeStyledComponentsCommonProps, "as">,
18
18
  underline?: boolean,
@@ -3,10 +3,11 @@ import * as React from "react";
3
3
  import { ThemeProvider as BaseThemeProvider } from "styled-components";
4
4
  import theme from "../themes/light/theme";
5
5
 
6
- import typeof { default as TypeTheme } from "../themes/light/theme";
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
 
package/__flow__/index.js CHANGED
@@ -6,6 +6,10 @@ export { visuallyHidden, focusRing, disabled } from "./utils/mixins";
6
6
  export { useSelect, useMultiselect, useTextContent } from "./utils/hooks";
7
7
  export { default as theme } from "./themes/light/theme";
8
8
  export { default as darkTheme } from "./themes/dark/theme";
9
+ export {
10
+ sproutLightTheme,
11
+ sproutDarkTheme,
12
+ } from "./themes/extendedThemes/sproutTheme";
9
13
  export { default as Icon } from "./Icon";
10
14
  // DEPRECATED: Alert has been renamed to Banner
11
15
  export { default as Alert } from "./Banner";
@@ -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
+ }
@@ -0,0 +1,25 @@
1
+ // @flow strict-local
2
+ import clone from "just-clone";
3
+ import baseDarkTheme from "../../../dark/theme";
4
+ import { getDarkThemeColors } from "./getDarkThemeColors";
5
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
6
+ import type { TypeTheme } from "../../../../types/theme.flow.js";
7
+
8
+ const darkTheme = (baseDarkTheme: TypeTheme) => {
9
+ // clone base theme. (we don't want to mutate the base theme)
10
+ const themeClone = clone(baseDarkTheme);
11
+
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);
17
+
18
+ return {
19
+ ...themeClone,
20
+ ...nonColorThemeValues,
21
+ ...darkThemeColors,
22
+ };
23
+ };
24
+
25
+ export default darkTheme;
@@ -0,0 +1,2 @@
1
+ export { default as sproutLightTheme } from "./light/theme";
2
+ export { default as sproutDarkTheme } from "./dark/theme";
@@ -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
+ }
@@ -0,0 +1,25 @@
1
+ // @flow strict-local
2
+ import clone from "just-clone";
3
+ import baseLightTheme from "../../../light/theme";
4
+ import { getLightThemeColors } from "./getLightThemeColors";
5
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
6
+ import type { TypeTheme } from "../../../../types/theme.flow.js";
7
+
8
+ const lightTheme = (baseLightTheme: TypeTheme) => {
9
+ // clone base theme. (we don't want to mutate the base theme)
10
+ const themeClone = clone(baseLightTheme);
11
+
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);
17
+
18
+ return {
19
+ ...themeClone,
20
+ ...nonColorThemeValues,
21
+ ...lightThemeColors,
22
+ };
23
+ };
24
+
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
+ };
@@ -14,6 +14,7 @@ import {
14
14
  import type { TypeColors } from "./theme.colors.flow.js";
15
15
  import type { TypeFontFamilyString } from "../themes/light/theme";
16
16
 
17
+ export type TypeThemeMode = "light" | "dark";
17
18
  export type TypeBreakpoint = typeof breakpoints;
18
19
  export type TypeTypography = typeof typography;
19
20
  export type TypeFontWeight = typeof fontWeights;
@@ -28,6 +29,7 @@ export type TypeEasing = typeof easing;
28
29
  export type TypeDuration = typeof duration;
29
30
 
30
31
  export type TypeTheme = {
32
+ mode: TypeThemeMode,
31
33
  breakpoints: TypeBreakpoint,
32
34
  colors: TypeColor,
33
35
  typography: TypeTypography,
@@ -41,3 +43,18 @@ export type TypeTheme = {
41
43
  easing: TypeEasing,
42
44
  duration: TypeDuration,
43
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
+ };
package/commonjs/index.js CHANGED
@@ -61,6 +61,8 @@ var _exportNames = {
61
61
  Menu: true,
62
62
  Listbox: true,
63
63
  OverflowList: true,
64
+ sproutLightTheme: true,
65
+ sproutDarkTheme: true,
64
66
  toast: true,
65
67
  MenuButton: true,
66
68
  MenuButtonContext: true,
@@ -70,7 +72,7 @@ var _exportNames = {
70
72
  DateRangePicker: true,
71
73
  VisuallyHidden: true
72
74
  };
73
- exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.ThemeProvider = exports.Popout = exports.Modal = exports.Tabs = exports.TokenInput = exports.Token = exports.Switch = exports.Link = exports.Button = exports.Select = exports.Input = exports.Label = exports.Box = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.ChartLegend = exports.KeyboardKey = exports.Image = exports.Text = exports.Loader = exports.ToggleHint = exports.Textarea = exports.Radio = exports.Checkbox = exports.CharacterCounter = exports.Card = exports.Indicator = exports.Badge = exports.Banner = exports.Alert = exports.Icon = exports.darkTheme = exports.theme = exports.useTextContent = exports.useMultiselect = exports.useSelect = exports.disabled = exports.focusRing = exports.visuallyHidden = void 0;
75
+ exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.sproutDarkTheme = exports.sproutLightTheme = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.ThemeProvider = exports.Popout = exports.Modal = exports.Tabs = exports.TokenInput = exports.Token = exports.Switch = exports.Link = exports.Button = exports.Select = exports.Input = exports.Label = exports.Box = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.ChartLegend = exports.KeyboardKey = exports.Image = exports.Text = exports.Loader = exports.ToggleHint = exports.Textarea = exports.Radio = exports.Checkbox = exports.CharacterCounter = exports.Card = exports.Indicator = exports.Badge = exports.Banner = exports.Alert = exports.Icon = exports.darkTheme = exports.theme = exports.useTextContent = exports.useMultiselect = exports.useSelect = exports.disabled = exports.focusRing = exports.visuallyHidden = void 0;
74
76
 
75
77
  var _systemProps = require("./systemProps");
76
78
 
@@ -101,6 +103,11 @@ var _theme2 = _interopRequireDefault(require("./themes/dark/theme"));
101
103
 
102
104
  exports.darkTheme = _theme2.default;
103
105
 
106
+ var _sproutTheme = require("./themes/extendedThemes/sproutTheme");
107
+
108
+ exports.sproutLightTheme = _sproutTheme.sproutLightTheme;
109
+ exports.sproutDarkTheme = _sproutTheme.sproutDarkTheme;
110
+
104
111
  var _Icon = _interopRequireDefault(require("./Icon"));
105
112
 
106
113
  exports.Icon = _Icon.default;
@@ -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
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _justClone = _interopRequireDefault(require("just-clone"));
7
+
8
+ var _theme = _interopRequireDefault(require("../../../dark/theme"));
9
+
10
+ var _getDarkThemeColors = require("./getDarkThemeColors");
11
+
12
+ var _NonColorThemeValues = require("../NonColorThemeValues");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
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); }
17
+
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);
26
+ };
27
+
28
+ var _default = darkTheme;
29
+ exports.default = _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.sproutDarkTheme = exports.sproutLightTheme = void 0;
5
+
6
+ var _theme = _interopRequireDefault(require("./light/theme"));
7
+
8
+ exports.sproutLightTheme = _theme.default;
9
+
10
+ var _theme2 = _interopRequireDefault(require("./dark/theme"));
11
+
12
+ exports.sproutDarkTheme = _theme2.default;
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -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
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _justClone = _interopRequireDefault(require("just-clone"));
7
+
8
+ var _theme = _interopRequireDefault(require("../../../light/theme"));
9
+
10
+ var _getLightThemeColors = require("./getLightThemeColors");
11
+
12
+ var _NonColorThemeValues = require("../NonColorThemeValues");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
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); }
17
+
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);
26
+ };
27
+
28
+ var _default = lightTheme;
29
+ exports.default = _default;
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@ export { visuallyHidden, focusRing, disabled } from "./utils/mixins";
3
3
  export { useSelect, useMultiselect, useTextContent } from "./utils/hooks";
4
4
  export { default as theme } from "./themes/light/theme";
5
5
  export { default as darkTheme } from "./themes/dark/theme";
6
+ export { sproutLightTheme, sproutDarkTheme } from "./themes/extendedThemes/sproutTheme";
6
7
  export { default as Icon } from "./Icon"; // DEPRECATED: Alert has been renamed to Banner
7
8
 
8
9
  export { default as Alert } from "./Banner";
@@ -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
+ }
@@ -0,0 +1,18 @@
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
+ import clone from "just-clone";
4
+ import baseDarkTheme from "../../../dark/theme";
5
+ import { getDarkThemeColors } from "./getDarkThemeColors";
6
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
7
+
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);
16
+ };
17
+
18
+ export default darkTheme;
@@ -0,0 +1,2 @@
1
+ export { default as sproutLightTheme } from "./light/theme";
2
+ export { default as sproutDarkTheme } from "./dark/theme";
@@ -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
+ }
@@ -0,0 +1,18 @@
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
+ import clone from "just-clone";
4
+ import baseLightTheme from "../../../light/theme";
5
+ import { getLightThemeColors } from "./getLightThemeColors";
6
+ import { getNonColorThemeValues } from "../NonColorThemeValues";
7
+
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
11
+
12
+ var nonColorThemeValues = getNonColorThemeValues(themeClone); // get sprout specific light theme colors
13
+
14
+ var lightThemeColors = getLightThemeColors(themeClone.colors);
15
+ return _extends({}, themeClone, nonColorThemeValues, lightThemeColors);
16
+ };
17
+
18
+ export default lightTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.2.4",
3
+ "version": "11.2.5-sproutTheme-beta.2",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -66,6 +66,7 @@
66
66
  "dependencies": {
67
67
  "@styled-system/theme-get": "^5.1.2",
68
68
  "classnames": "^2.2.6",
69
+ "just-clone": "^5.0.1",
69
70
  "lodash.curry": "^4.1.1",
70
71
  "lodash.uniqueid": "^4.0.1",
71
72
  "lru-memoize": "^1.1.0",
package/bin/buildNpm.js DELETED
@@ -1,58 +0,0 @@
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();