@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.
- package/CHANGELOG.md +22 -0
- package/__flow__/Button/index.stories.js +6 -21
- package/__flow__/Input/index.js +185 -66
- package/__flow__/Input/index.stories.js +65 -0
- package/__flow__/Input/index.test.js +230 -1
- package/__flow__/Input/styles.js +1 -1
- package/__flow__/ThemeProvider/index.js +5 -1
- package/__flow__/TokenInput/index.js +1 -1
- package/__flow__/index.js +1 -0
- package/__flow__/themes/dark/theme.js +3 -0
- package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
- package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +57 -0
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +17 -35
- package/__flow__/themes/extendedThemes/sproutTheme/index.js +2 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +53 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +17 -45
- package/__flow__/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js +36 -0
- package/__flow__/themes/light/theme.js +3 -0
- package/__flow__/types/theme.colors.flow.js +3 -0
- package/__flow__/types/theme.flow.js +15 -0
- package/commonjs/Input/index.js +124 -30
- package/commonjs/Input/styles.js +1 -1
- package/commonjs/TokenInput/index.js +1 -1
- package/commonjs/themes/dark/theme.js +4 -1
- package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +15 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +57 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +14 -33
- package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +53 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +14 -43
- package/commonjs/themes/extendedThemes/sproutTheme/{dark/colors.js → sproutThemeType.flow.js} +0 -0
- package/commonjs/themes/light/theme.js +4 -1
- package/dist/themes/dark/dark.scss +4 -1
- package/dist/themes/light/light.scss +4 -1
- package/lib/Input/index.js +117 -30
- package/lib/Input/styles.js +1 -1
- package/lib/TokenInput/index.js +1 -1
- package/lib/themes/dark/theme.js +4 -1
- package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +10 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +52 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +11 -33
- package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +48 -0
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +10 -42
- package/{__flow__/themes/extendedThemes/sproutTheme/dark/colors.js → lib/themes/extendedThemes/sproutTheme/sproutThemeType.flow.js} +0 -0
- package/lib/themes/light/theme.js +4 -1
- package/package.json +1 -1
- package/__flow__/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
- package/__flow__/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -6
- package/commonjs/themes/extendedThemes/sproutTheme/light/colors.js +0 -1
- package/commonjs/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -9
- package/lib/themes/extendedThemes/sproutTheme/dark/colors.js +0 -0
- package/lib/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
- package/lib/themes/extendedThemes/sproutTheme/otherVals/theme.js +0 -5
package/commonjs/Input/index.js
CHANGED
|
@@ -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
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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: !!
|
|
116
|
-
hasAfterElement: !!
|
|
195
|
+
hasBeforeElement: !!elementBefore,
|
|
196
|
+
hasAfterElement: !!elementAfter,
|
|
117
197
|
disabled: disabled,
|
|
118
198
|
invalid: !!isInvalid,
|
|
119
199
|
warning: hasWarning,
|
|
120
|
-
appearance: appearance
|
|
200
|
+
appearance: appearance,
|
|
201
|
+
size: size // $FlowIssue - upgrade v0.112.0
|
|
121
202
|
|
|
122
|
-
}, rest),
|
|
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
|
-
},
|
|
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)),
|
|
150
|
-
after: true
|
|
151
|
-
|
|
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;
|
package/commonjs/Input/styles.js
CHANGED
|
@@ -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
|
-
|
|
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(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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(
|
|
13
|
-
|
|
14
|
-
// get
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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;
|
package/commonjs/themes/extendedThemes/sproutTheme/{dark/colors.js → sproutThemeType.flow.js}
RENAMED
|
File without changes
|
|
@@ -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,
|