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

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 (52) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/__flow__/Button/index.stories.js +6 -21
  3. package/__flow__/Input/index.js +185 -66
  4. package/__flow__/Input/index.stories.js +65 -0
  5. package/__flow__/Input/index.test.js +230 -1
  6. package/__flow__/Input/styles.js +1 -1
  7. package/__flow__/ThemeProvider/index.js +5 -1
  8. package/__flow__/TokenInput/index.js +1 -1
  9. package/__flow__/index.js +1 -0
  10. package/__flow__/themes/dark/theme.js +3 -0
  11. package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
  12. package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +57 -0
  13. package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +17 -35
  14. package/__flow__/themes/extendedThemes/sproutTheme/index.js +2 -0
  15. package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +53 -0
  16. package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +17 -45
  17. package/__flow__/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +36 -0
  18. package/__flow__/themes/light/theme.js +3 -0
  19. package/__flow__/types/theme.colors.flow.js +3 -0
  20. package/__flow__/types/theme.flow.js +15 -0
  21. package/commonjs/Input/index.js +124 -30
  22. package/commonjs/Input/styles.js +1 -1
  23. package/commonjs/TokenInput/index.js +1 -1
  24. package/commonjs/themes/dark/theme.js +4 -1
  25. package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +15 -0
  26. package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +57 -0
  27. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +14 -33
  28. package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +53 -0
  29. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +14 -43
  30. package/commonjs/themes/extendedThemes/sproutTheme/{dark/colors.js → sproutThemeType.flow.js} +0 -0
  31. package/commonjs/themes/light/theme.js +4 -1
  32. package/dist/themes/dark/dark.scss +4 -1
  33. package/dist/themes/light/light.scss +4 -1
  34. package/lib/Input/index.js +117 -30
  35. package/lib/Input/styles.js +1 -1
  36. package/lib/TokenInput/index.js +1 -1
  37. package/lib/themes/dark/theme.js +4 -1
  38. package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +10 -0
  39. package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +52 -0
  40. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +11 -33
  41. package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +48 -0
  42. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +10 -42
  43. package/{__flow__/themes/extendedThemes/sproutTheme/dark/colors.js → lib/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js} +0 -0
  44. package/lib/themes/light/theme.js +4 -1
  45. package/package.json +1 -1
  46. package/__flow__/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
  47. package/__flow__/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -6
  48. package/commonjs/themes/extendedThemes/sproutTheme/light/colors.js +0 -1
  49. package/commonjs/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -9
  50. package/lib/themes/extendedThemes/sproutTheme/dark/colors.js +0 -0
  51. package/lib/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
  52. package/lib/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -5
@@ -7,6 +7,14 @@ var React = _interopRequireWildcard(require("react"));
7
7
 
8
8
  var _styles = _interopRequireWildcard(require("./styles"));
9
9
 
10
+ var _Button = _interopRequireDefault(require("../Button"));
11
+
12
+ var _Icon = _interopRequireDefault(require("../Icon"));
13
+
14
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
10
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); }
11
19
 
12
20
  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; }
@@ -19,6 +27,67 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
19
27
 
20
28
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
29
 
30
+ var InputContext = /*#__PURE__*/React.createContext({});
31
+ var StyledButton = (0, _styledComponents.default)(_Button.default).withConfig({
32
+ displayName: "Input__StyledButton",
33
+ componentId: "sc-1ck1dnm-0"
34
+ })(["&:hover,&:active{color:", ";}"], function (props) {
35
+ return props.theme.utils.interact(props.theme.colors.icon.base);
36
+ });
37
+
38
+ var ClearButton = function ClearButton() {
39
+ var _React$useContext = React.useContext(InputContext),
40
+ onClear = _React$useContext.onClear,
41
+ handleClear = _React$useContext.handleClear,
42
+ clearButtonLabel = _React$useContext.clearButtonLabel,
43
+ hasValue = _React$useContext.hasValue,
44
+ inputSize = _React$useContext.size; // Hide the button when there is no text to clear.
45
+
46
+
47
+ if (!hasValue) {
48
+ return null;
49
+ } // Log a warning and hide the button when no onClear callback is provided.
50
+ // If we called handleClear with no onClear prop, all the button would do is focus the Input.
51
+
52
+
53
+ if (!onClear) {
54
+ console.warn("Warning: No onClear prop provided to Input when using Input.ClearButton. Omitting Input.ClearButton.");
55
+ return null;
56
+ } // Warn if clearButtonLabel is not included, so that the unlocalized fallback will not be mistaken for a proper label.
57
+
58
+
59
+ if (!clearButtonLabel) {
60
+ console.warn("Warning: clearButtonLabel prop is required when using Input.ClearButton. Please pass a localized clearButtonLabel to Input.");
61
+ } // Reduce Button padding for size small Inputs so that the Button won't go outside the bounds of the Input.
62
+ // This adjustment is handled automatically for default and large Inputs via Button's size. There is no "small" Button.
63
+
64
+
65
+ var py = inputSize === "small" ? 100 : undefined;
66
+ var px = inputSize === "small" ? 200 : undefined;
67
+ var buttonSize = inputSize === "small" ? "default" : inputSize;
68
+ return /*#__PURE__*/React.createElement(StyledButton, {
69
+ onClick: handleClear,
70
+ size: buttonSize,
71
+ py: py,
72
+ px: px,
73
+ title: clearButtonLabel || "Clear",
74
+ ariaLabel: clearButtonLabel || "Clear",
75
+ color: "icon.base"
76
+ }, /*#__PURE__*/React.createElement(_Icon.default, {
77
+ name: "circlex"
78
+ }));
79
+ }; // Used for positioning elementAfter. This logic will detect if the element is a ClearButton,
80
+ // regardless of whether it was manually passed as elemAfter or automatically added to a search Input.
81
+
82
+
83
+ var isClearButton = function isClearButton(elem) {
84
+ if (elem != null && elem.type) {
85
+ return elem.type.displayName === "Input.ClearButton";
86
+ }
87
+
88
+ return false;
89
+ };
90
+
22
91
  var Input = /*#__PURE__*/function (_React$Component) {
23
92
  _inheritsLoose(Input, _React$Component);
24
93
 
@@ -32,39 +101,38 @@ var Input = /*#__PURE__*/function (_React$Component) {
32
101
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
33
102
 
34
103
  _this.handleBlur = function (e) {
35
- if (_this.props.onBlur) {
36
- _this.props.onBlur(e);
104
+ return _this.props.onBlur == null ? void 0 : _this.props.onBlur(e);
105
+ };
106
+
107
+ _this.handleClear = function (e) {
108
+ // Only attempt to focus the input if the ref is an object. It won't work for refs that are functions.
109
+ if (typeof _this.props.innerRef === "object") {
110
+ var _this$props$innerRef$;
111
+
112
+ (_this$props$innerRef$ = _this.props.innerRef.current) == null ? void 0 : _this$props$innerRef$.focus();
37
113
  }
114
+
115
+ _this.props.onClear == null ? void 0 : _this.props.onClear(e);
38
116
  };
39
117
 
40
118
  _this.handleChange = function (e) {
41
- if (_this.props.onChange) {
42
- _this.props.onChange(e, e.currentTarget.value);
43
- }
119
+ return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
44
120
  };
45
121
 
46
122
  _this.handleFocus = function (e) {
47
- if (_this.props.onFocus) {
48
- _this.props.onFocus(e);
49
- }
123
+ return _this.props.onFocus == null ? void 0 : _this.props.onFocus(e);
50
124
  };
51
125
 
52
126
  _this.handleKeyDown = function (e) {
53
- if (_this.props.onKeyDown) {
54
- _this.props.onKeyDown(e, e.currentTarget.value);
55
- }
127
+ return _this.props.onKeyDown == null ? void 0 : _this.props.onKeyDown(e, e.currentTarget.value);
56
128
  };
57
129
 
58
130
  _this.handleKeyUp = function (e) {
59
- if (_this.props.onKeyUp) {
60
- _this.props.onKeyUp(e, e.currentTarget.value);
61
- }
131
+ return _this.props.onKeyUp == null ? void 0 : _this.props.onKeyUp(e, e.currentTarget.value);
62
132
  };
63
133
 
64
134
  _this.handlePaste = function (e) {
65
- if (_this.props.onPaste) {
66
- _this.props.onPaste(e, e.currentTarget.value);
67
- }
135
+ return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
68
136
  };
69
137
 
70
138
  return _this;
@@ -91,9 +159,11 @@ var Input = /*#__PURE__*/function (_React$Component) {
91
159
  maxLength = _this$props.maxLength,
92
160
  ariaLabel = _this$props.ariaLabel,
93
161
  ariaDescribedby = _this$props.ariaDescribedby,
162
+ clearButtonLabel = _this$props.clearButtonLabel,
94
163
  innerRef = _this$props.innerRef,
95
164
  onBlur = _this$props.onBlur,
96
165
  onChange = _this$props.onChange,
166
+ onClear = _this$props.onClear,
97
167
  onFocus = _this$props.onFocus,
98
168
  onKeyDown = _this$props.onKeyDown,
99
169
  onKeyUp = _this$props.onKeyUp,
@@ -103,25 +173,44 @@ var Input = /*#__PURE__*/function (_React$Component) {
103
173
  _this$props$qa = _this$props.qa,
104
174
  qa = _this$props$qa === void 0 ? {} : _this$props$qa,
105
175
  appearance = _this$props.appearance,
106
- rest = _objectWithoutPropertiesLoose(_this$props, ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "innerRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance"]);
176
+ size = _this$props.size,
177
+ rest = _objectWithoutPropertiesLoose(_this$props, ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "clearButtonLabel", "innerRef", "onBlur", "onChange", "onClear", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance", "size"]); // Convert autoComplete from a boolean prop to a string value.
178
+
107
179
 
108
180
  var autoCompleteValue = undefined;
109
181
 
110
182
  if (autoComplete !== undefined) {
111
183
  autoCompleteValue = autoComplete ? "on" : "off";
112
- }
184
+ } // Add default elemBefore and elemAfter elements if type is search.
185
+
113
186
 
187
+ var elementBefore = type === "search" && !elemBefore ? /*#__PURE__*/React.createElement(_Icon.default, {
188
+ name: "search",
189
+ ariaHidden: true,
190
+ color: "icon.base"
191
+ }) : elemBefore; // Do not add a ClearButton if no onClear callback is provided or if an elemAfter prop was passed.
192
+
193
+ var elementAfter = type === "search" && onClear && !elemAfter ? /*#__PURE__*/React.createElement(ClearButton, null) : elemAfter;
114
194
  return /*#__PURE__*/React.createElement(_styles.default, _extends({
115
- hasBeforeElement: !!elemBefore,
116
- hasAfterElement: !!elemAfter,
195
+ hasBeforeElement: !!elementBefore,
196
+ hasAfterElement: !!elementAfter,
117
197
  disabled: disabled,
118
198
  invalid: !!isInvalid,
119
199
  warning: hasWarning,
120
- appearance: appearance // $FlowIssue - upgrade v0.112.0
200
+ appearance: appearance,
201
+ size: size // $FlowIssue - upgrade v0.112.0
121
202
 
122
- }, rest), elemBefore && /*#__PURE__*/React.createElement(_styles.Accessory, {
203
+ }, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
204
+ value: {
205
+ handleClear: this.handleClear,
206
+ hasValue: !!value,
207
+ clearButtonLabel: clearButtonLabel,
208
+ onClear: onClear,
209
+ size: size
210
+ }
211
+ }, elementBefore && /*#__PURE__*/React.createElement(_styles.Accessory, {
123
212
  before: true
124
- }, elemBefore), /*#__PURE__*/React.createElement("input", _extends({
213
+ }, elementBefore), /*#__PURE__*/React.createElement("input", _extends({
125
214
  "aria-invalid": !!isInvalid,
126
215
  "aria-label": ariaLabel,
127
216
  "aria-describedby": ariaDescribedby,
@@ -146,19 +235,24 @@ var Input = /*#__PURE__*/function (_React$Component) {
146
235
  "data-qa-input": name || "",
147
236
  "data-qa-input-isdisabled": disabled === true,
148
237
  "data-qa-input-isrequired": required === true
149
- }, qa, inputProps)), elemAfter && /*#__PURE__*/React.createElement(_styles.Accessory, {
150
- after: true
151
- }, elemAfter));
238
+ }, qa, inputProps)), elementAfter && /*#__PURE__*/React.createElement(_styles.Accessory, {
239
+ after: true,
240
+ isClearButton: isClearButton(elementAfter)
241
+ }, elementAfter)));
152
242
  };
153
243
 
154
244
  return Input;
155
245
  }(React.Component);
156
246
 
157
- exports.default = Input;
158
247
  Input.defaultProps = {
159
248
  autoFocus: false,
160
249
  disabled: false,
161
250
  type: "text",
162
251
  size: "default",
163
- appearance: "primary"
164
- };
252
+ appearance: "primary",
253
+ innerRef: /*#__PURE__*/React.createRef()
254
+ };
255
+ Input.ClearButton = ClearButton;
256
+ Input.ClearButton.displayName = "Input.ClearButton";
257
+ var _default = Input;
258
+ exports.default = _default;
@@ -86,7 +86,7 @@ var Accessory = _styledComponents.default.div.withConfig({
86
86
  }, function (props) {
87
87
  return props.before && (0, _styledComponents.css)(["left:", ";"], props.theme.space[350]);
88
88
  }, function (props) {
89
- return props.after && (0, _styledComponents.css)(["right:", ";"], props.theme.space[350]);
89
+ return props.after && (0, _styledComponents.css)(["right:", ";"], props.isClearButton ? 0 : props.theme.space[350]);
90
90
  });
91
91
 
92
92
  exports.Accessory = Accessory;
@@ -300,7 +300,7 @@ var TokenInput = /*#__PURE__*/function (_React$Component) {
300
300
  "aria-invalid": !!isInvalid,
301
301
  "aria-label": ariaLabel,
302
302
  autoFocus: autoFocus,
303
- autocomplete: autocomplete,
303
+ autoComplete: autocomplete,
304
304
  disabled: disabled,
305
305
  id: id,
306
306
  name: name,
@@ -175,7 +175,10 @@ var colors = _extends({}, _theme.default.colors, {
175
175
  subtext: _seedsColor.default.COLOR_NEUTRAL_300,
176
176
  body: _seedsColor.default.COLOR_NEUTRAL_100,
177
177
  inverse: _seedsColor.default.COLOR_NEUTRAL_900,
178
- error: _seedsColor.default.COLOR_RED_400
178
+ error: _seedsColor.default.COLOR_RED_400,
179
+ background: {
180
+ highlight: _seedsColor.default.COLOR_YELLOW_900
181
+ }
179
182
  },
180
183
  icon: {
181
184
  base: _seedsColor.default.COLOR_NEUTRAL_100,
@@ -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,57 @@
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
+ container: _extends({}, themeColors.container, {
39
+ background: _extends({}, themeColors.container.background, {
40
+ // FIX: These need to be changed to have dark mode colors
41
+ // For now we've copied the light mode values here as well.
42
+ positive_sentiment: themeColors.blue[500],
43
+ negative_sentiment: themeColors.red[500],
44
+ neutral_sentiment: themeColors.neutral[300]
45
+ })
46
+ }),
47
+ icon: _extends({}, themeColors.icon, {
48
+ // FIX: These need to be changed to have dark mode colors
49
+ // For now we've copied the light mode values here as well.
50
+ sentiment: {
51
+ positive_sentiment: themeColors.blue[500],
52
+ negative_sentiment: themeColors.red[500],
53
+ neutral_sentiment: themeColors.neutral[300]
54
+ }
55
+ })
56
+ });
57
+ }
@@ -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() {
19
+ // clone base theme. (we don't want to mutate the base theme)
20
+ var themeClone = (0, _justClone.default)(_theme.default); // 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,53 @@
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
+ container: _extends({}, themeColors.container, {
39
+ background: _extends({}, themeColors.container.background, {
40
+ positive_sentiment: themeColors.blue[500],
41
+ negative_sentiment: themeColors.red[500],
42
+ neutral_sentiment: themeColors.neutral[300]
43
+ })
44
+ }),
45
+ icon: _extends({}, themeColors.icon, {
46
+ sentiment: {
47
+ positive_sentiment: themeColors.blue[500],
48
+ negative_sentiment: themeColors.red[500],
49
+ neutral_sentiment: themeColors.neutral[300]
50
+ }
51
+ })
52
+ });
53
+ }
@@ -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() {
19
+ // clone base theme. (we don't want to mutate the base theme)
20
+ var themeClone = (0, _justClone.default)(_theme.default); // 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;
@@ -177,7 +177,10 @@ var colors = _extends({
177
177
  subtext: _seedsColor.default.COLOR_NEUTRAL_700,
178
178
  body: _seedsColor.default.COLOR_NEUTRAL_800,
179
179
  inverse: _seedsColor.default.COLOR_NEUTRAL_0,
180
- error: _seedsColor.default.COLOR_RED_800
180
+ error: _seedsColor.default.COLOR_RED_800,
181
+ background: {
182
+ highlight: _seedsColor.default.COLOR_YELLOW_200
183
+ }
181
184
  },
182
185
  icon: {
183
186
  base: _seedsColor.default.COLOR_NEUTRAL_800,
@@ -152,7 +152,10 @@ $dark: (
152
152
  subtext: #c8cccc,
153
153
  body: #f3f4f4,
154
154
  inverse: #273333,
155
- error: #ff7f6e
155
+ error: #ff7f6e,
156
+ background: (
157
+ highlight: #944c0c
158
+ )
156
159
  ),
157
160
  icon: (
158
161
  base: #f3f4f4,
@@ -246,7 +246,10 @@ $light: (
246
246
  subtext: #515e5f,
247
247
  body: #364141,
248
248
  inverse: #FFFFFF,
249
- error: #c63434
249
+ error: #c63434,
250
+ background: (
251
+ highlight: #ffe99a
252
+ )
250
253
  ),
251
254
  icon: (
252
255
  base: #364141,