@sproutsocial/racine 11.4.2-input-beta.0 → 11.6.1-theme-type.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/__flow__/Button/index.js +2 -0
- package/__flow__/Button/index.stories.js +51 -67
- package/__flow__/Button/styles.js +1 -1
- package/__flow__/EmptyState/index.test.js +1 -1
- package/__flow__/Input/index.js +3 -27
- package/__flow__/Input/index.stories.js +0 -14
- package/__flow__/Input/index.test.js +0 -18
- package/__flow__/Menu/__snapshots__/index.test.js.snap +2 -2
- package/__flow__/ThemeProvider/index.js +5 -2
- package/__flow__/index.js +5 -1
- package/__flow__/setupTests.js +1 -1
- package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +0 -14
- package/__flow__/systemProps/tests/layout.test.js +0 -9
- package/__flow__/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +17 -0
- package/__flow__/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +36 -0
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +23 -0
- package/__flow__/themes/extendedThemes/sproutTheme/index.js +3 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +36 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +23 -0
- package/__flow__/types/theme.flow.js +53 -0
- package/commonjs/Button/index.js +1 -0
- package/commonjs/Button/styles.js +1 -0
- package/commonjs/Input/index.js +8 -22
- package/commonjs/Message/styles.js +1 -1
- package/commonjs/index.js +8 -1
- package/commonjs/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +16 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +39 -0
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +28 -0
- package/commonjs/themes/extendedThemes/sproutTheme/index.js +14 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +39 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +28 -0
- package/lib/Button/index.js +1 -0
- package/lib/Button/styles.js +1 -0
- package/lib/Input/index.js +8 -22
- package/lib/Message/styles.js +1 -1
- package/lib/index.js +1 -0
- package/lib/themes/extendedThemes/sproutTheme/NonColorThemeValues/index.js +12 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/getDarkThemeColors.js +34 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +16 -0
- package/lib/themes/extendedThemes/sproutTheme/index.js +2 -0
- package/lib/themes/extendedThemes/sproutTheme/light/getLightThemeColors.js +34 -0
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +16 -0
- package/package.json +25 -20
- package/__flow__/Button/__snapshots__/index.test.js.snap +0 -511
- package/__flow__/Button/index.test.js +0 -113
package/commonjs/Button/index.js
CHANGED
|
@@ -60,6 +60,7 @@ var Container = _styledComponents.default.button.withConfig({
|
|
|
60
60
|
return props.appearance === "pill" && (0, _styledComponents.css)(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "dark" ? "screen" : "multiply", _mixins.pill);
|
|
61
61
|
}, _styles.default, _systemProps.LAYOUT, _systemProps.COMMON);
|
|
62
62
|
|
|
63
|
+
Container.displayName = "Button-Container";
|
|
63
64
|
var _default = Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
|
|
64
65
|
|
|
65
66
|
exports.default = _default;
|
package/commonjs/Input/index.js
CHANGED
|
@@ -95,10 +95,14 @@ var isClearButton = function isClearButton(elem) {
|
|
|
95
95
|
var Input = /*#__PURE__*/function (_React$Component) {
|
|
96
96
|
_inheritsLoose(Input, _React$Component);
|
|
97
97
|
|
|
98
|
-
function Input(
|
|
98
|
+
function Input() {
|
|
99
99
|
var _this;
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
102
|
+
args[_key] = arguments[_key];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
102
106
|
_this.inputRef = /*#__PURE__*/React.createRef();
|
|
103
107
|
|
|
104
108
|
_this.handleBlur = function (e) {
|
|
@@ -113,9 +117,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
113
117
|
};
|
|
114
118
|
|
|
115
119
|
_this.handleChange = function (e) {
|
|
116
|
-
_this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
|
|
117
|
-
|
|
118
|
-
_this.updateState(e.currentTarget.value);
|
|
120
|
+
return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
_this.handleFocus = function (e) {
|
|
@@ -134,22 +136,6 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
134
136
|
return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
|
|
135
137
|
};
|
|
136
138
|
|
|
137
|
-
_this.updateState = function (value) {
|
|
138
|
-
var hasValue = value !== "";
|
|
139
|
-
var hadValue = _this.state.hasValue; // Only update state if the value has changed to avoid unnecessary renders.
|
|
140
|
-
|
|
141
|
-
if (hasValue !== hadValue) {
|
|
142
|
-
_this.setState({
|
|
143
|
-
hasValue: hasValue
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
_this.state = {
|
|
149
|
-
// tracking hasValue in state allows us to hide ClearButton when there is no value to clear
|
|
150
|
-
// for both controlled and uncontrolled inputs.
|
|
151
|
-
hasValue: !!props.value
|
|
152
|
-
};
|
|
153
139
|
return _this;
|
|
154
140
|
}
|
|
155
141
|
|
|
@@ -218,7 +204,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
218
204
|
}, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
|
|
219
205
|
value: {
|
|
220
206
|
handleClear: this.handleClear,
|
|
221
|
-
hasValue:
|
|
207
|
+
hasValue: !!value,
|
|
222
208
|
clearButtonLabel: clearButtonLabel,
|
|
223
209
|
onClear: onClear,
|
|
224
210
|
size: size
|
|
@@ -105,7 +105,7 @@ exports.MessageBody = MessageBody;
|
|
|
105
105
|
var MessageFooter = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
106
106
|
displayName: "styles__MessageFooter",
|
|
107
107
|
componentId: "sc-1ju6d1v-3"
|
|
108
|
-
})(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", "
|
|
108
|
+
})(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", ";> :first-child{margin-left:-", ";}"], function (props) {
|
|
109
109
|
return props.density === _Message.default.DENSITIES.CONDENSED ? 0 : props.theme.space[300];
|
|
110
110
|
}, function (props) {
|
|
111
111
|
return getContentPadding(props);
|
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.useTextContent = exports.useSelect = exports.useMultiselect = exports.toast = exports.theme = exports.focusRing = exports.disabled = exports.darkTheme = exports.VisuallyHidden = exports.Tooltip = exports.TokenInput = exports.Token = exports.ToggleHint = exports.ToastContainer = exports.ThemeProvider = exports.Textarea = exports.Text = exports.Tabs = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.Switch = exports.Stack = exports.Skeleton = exports.SingleDatePicker = exports.Select = exports.SegmentedControl = exports.Radio = exports.Popout = exports.OverflowList = exports.Numeral = exports.Modal = exports.Message = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.Menu = exports.LoaderButton = exports.Loader = exports.ListboxButton = exports.Listbox = exports.Link = exports.Label = exports.KeyboardKey = exports.Input = exports.Indicator = exports.Image = exports.Icon = exports.FormField = exports.Fieldset = exports.EmptyState = exports.Drawer = exports.DateRangePicker = exports.Collapsible = exports.Checkbox = exports.ChartLegend = exports.CharacterCounter = exports.Card = exports.Button = exports.Breadcrumb = exports.Box = exports.Banner = exports.Badge = exports.Avatar = exports.Alert = void 0;
|
|
75
|
+
exports.visuallyHidden = exports.useTextContent = exports.useSelect = exports.useMultiselect = exports.toast = exports.theme = exports.sproutLightTheme = exports.sproutDarkTheme = exports.focusRing = exports.disabled = exports.darkTheme = exports.VisuallyHidden = exports.Tooltip = exports.TokenInput = exports.Token = exports.ToggleHint = exports.ToastContainer = exports.ThemeProvider = exports.Textarea = exports.Text = exports.Tabs = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.Switch = exports.Stack = exports.Skeleton = exports.SingleDatePicker = exports.Select = exports.SegmentedControl = exports.Radio = exports.Popout = exports.OverflowList = exports.Numeral = exports.Modal = exports.Message = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.Menu = exports.LoaderButton = exports.Loader = exports.ListboxButton = exports.Listbox = exports.Link = exports.Label = exports.KeyboardKey = exports.Input = exports.Indicator = exports.Image = exports.Icon = exports.FormField = exports.Fieldset = exports.EmptyState = exports.Drawer = exports.DateRangePicker = exports.Collapsible = exports.Checkbox = exports.ChartLegend = exports.CharacterCounter = exports.Card = exports.Button = exports.Breadcrumb = exports.Box = exports.Banner = exports.Badge = exports.Avatar = exports.Alert = 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,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getNonColorThemeValues = getNonColorThemeValues;
|
|
5
|
+
var _excluded = ["colors"];
|
|
6
|
+
|
|
7
|
+
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); }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function getNonColorThemeValues(theme) {
|
|
12
|
+
var colors = theme.colors,
|
|
13
|
+
otherThemeValues = _objectWithoutPropertiesLoose(theme, _excluded);
|
|
14
|
+
|
|
15
|
+
return _extends({}, otherThemeValues);
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
// clone base theme. (we don't want to mutate the base theme)
|
|
19
|
+
var themeClone = (0, _justClone.default)(_theme.default); // get non color theme values
|
|
20
|
+
|
|
21
|
+
var nonColorThemeValues = (0, _NonColorThemeValues.getNonColorThemeValues)(themeClone); // get sprout specific dark theme colors
|
|
22
|
+
|
|
23
|
+
var darkThemeColors = (0, _getDarkThemeColors.getDarkThemeColors)(themeClone.colors);
|
|
24
|
+
|
|
25
|
+
var darkTheme = _extends({}, themeClone, nonColorThemeValues, darkThemeColors);
|
|
26
|
+
|
|
27
|
+
var _default = darkTheme;
|
|
28
|
+
exports.default = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.sproutLightTheme = exports.sproutDarkTheme = 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,39 @@
|
|
|
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
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
// clone base theme. (we don't want to mutate the base theme)
|
|
19
|
+
var themeClone = (0, _justClone.default)(_theme.default); // get non color theme values
|
|
20
|
+
|
|
21
|
+
var nonColorThemeValues = (0, _NonColorThemeValues.getNonColorThemeValues)(themeClone); // get sprout specific light theme colors
|
|
22
|
+
|
|
23
|
+
var lightThemeColors = (0, _getLightThemeColors.getLightThemeColors)(themeClone.colors);
|
|
24
|
+
|
|
25
|
+
var lightTheme = _extends({}, themeClone, nonColorThemeValues, lightThemeColors);
|
|
26
|
+
|
|
27
|
+
var _default = lightTheme;
|
|
28
|
+
exports.default = _default;
|
package/lib/Button/index.js
CHANGED
package/lib/Button/styles.js
CHANGED
|
@@ -44,4 +44,5 @@ var Container = styled.button.withConfig({
|
|
|
44
44
|
}, function (props) {
|
|
45
45
|
return props.appearance === "pill" && css(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "dark" ? "screen" : "multiply", pill);
|
|
46
46
|
}, Icon, LAYOUT, COMMON);
|
|
47
|
+
Container.displayName = "Button-Container";
|
|
47
48
|
export default Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
|
package/lib/Input/index.js
CHANGED
|
@@ -78,10 +78,14 @@ var isClearButton = function isClearButton(elem) {
|
|
|
78
78
|
var Input = /*#__PURE__*/function (_React$Component) {
|
|
79
79
|
_inheritsLoose(Input, _React$Component);
|
|
80
80
|
|
|
81
|
-
function Input(
|
|
81
|
+
function Input() {
|
|
82
82
|
var _this;
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85
|
+
args[_key] = arguments[_key];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
85
89
|
_this.inputRef = /*#__PURE__*/React.createRef();
|
|
86
90
|
|
|
87
91
|
_this.handleBlur = function (e) {
|
|
@@ -96,9 +100,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
96
100
|
};
|
|
97
101
|
|
|
98
102
|
_this.handleChange = function (e) {
|
|
99
|
-
_this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
|
|
100
|
-
|
|
101
|
-
_this.updateState(e.currentTarget.value);
|
|
103
|
+
return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
|
|
102
104
|
};
|
|
103
105
|
|
|
104
106
|
_this.handleFocus = function (e) {
|
|
@@ -117,22 +119,6 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
117
119
|
return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
|
|
118
120
|
};
|
|
119
121
|
|
|
120
|
-
_this.updateState = function (value) {
|
|
121
|
-
var hasValue = value !== "";
|
|
122
|
-
var hadValue = _this.state.hasValue; // Only update state if the value has changed to avoid unnecessary renders.
|
|
123
|
-
|
|
124
|
-
if (hasValue !== hadValue) {
|
|
125
|
-
_this.setState({
|
|
126
|
-
hasValue: hasValue
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
_this.state = {
|
|
132
|
-
// tracking hasValue in state allows us to hide ClearButton when there is no value to clear
|
|
133
|
-
// for both controlled and uncontrolled inputs.
|
|
134
|
-
hasValue: !!props.value
|
|
135
|
-
};
|
|
136
122
|
return _this;
|
|
137
123
|
}
|
|
138
124
|
|
|
@@ -201,7 +187,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
201
187
|
}, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
|
|
202
188
|
value: {
|
|
203
189
|
handleClear: this.handleClear,
|
|
204
|
-
hasValue:
|
|
190
|
+
hasValue: !!value,
|
|
205
191
|
clearButtonLabel: clearButtonLabel,
|
|
206
192
|
onClear: onClear,
|
|
207
193
|
size: size
|
package/lib/Message/styles.js
CHANGED
|
@@ -91,7 +91,7 @@ export var MessageBody = styled(Box).withConfig({
|
|
|
91
91
|
export var MessageFooter = styled(Box).withConfig({
|
|
92
92
|
displayName: "styles__MessageFooter",
|
|
93
93
|
componentId: "sc-1ju6d1v-3"
|
|
94
|
-
})(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", "
|
|
94
|
+
})(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", ";> :first-child{margin-left:-", ";}"], function (props) {
|
|
95
95
|
return props.density === Message.DENSITIES.CONDENSED ? 0 : props.theme.space[300];
|
|
96
96
|
}, function (props) {
|
|
97
97
|
return getContentPadding(props);
|
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,12 @@
|
|
|
1
|
+
var _excluded = ["colors"];
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
export function getNonColorThemeValues(theme) {
|
|
8
|
+
var colors = theme.colors,
|
|
9
|
+
otherThemeValues = _objectWithoutPropertiesLoose(theme, _excluded);
|
|
10
|
+
|
|
11
|
+
return _extends({}, otherThemeValues);
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
// clone base theme. (we don't want to mutate the base theme)
|
|
8
|
+
var themeClone = clone(baseDarkTheme); // get non color theme values
|
|
9
|
+
|
|
10
|
+
var nonColorThemeValues = getNonColorThemeValues(themeClone); // get sprout specific dark theme colors
|
|
11
|
+
|
|
12
|
+
var darkThemeColors = getDarkThemeColors(themeClone.colors);
|
|
13
|
+
|
|
14
|
+
var darkTheme = _extends({}, themeClone, nonColorThemeValues, darkThemeColors);
|
|
15
|
+
|
|
16
|
+
export default darkTheme;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
// clone base theme. (we don't want to mutate the base theme)
|
|
8
|
+
var themeClone = clone(baseLightTheme); // get non color theme values
|
|
9
|
+
|
|
10
|
+
var nonColorThemeValues = getNonColorThemeValues(themeClone); // get sprout specific light theme colors
|
|
11
|
+
|
|
12
|
+
var lightThemeColors = getLightThemeColors(themeClone.colors);
|
|
13
|
+
|
|
14
|
+
var lightTheme = _extends({}, themeClone, nonColorThemeValues, lightThemeColors);
|
|
15
|
+
|
|
16
|
+
export default lightTheme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.1-theme-type.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"__flow__",
|
|
@@ -66,10 +66,11 @@
|
|
|
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",
|
|
72
|
-
"mutationobserver-shim": "^0.3.
|
|
73
|
+
"mutationobserver-shim": "^0.3.7",
|
|
73
74
|
"polished": "^3.4.1",
|
|
74
75
|
"raw-loader": "^3.0.0",
|
|
75
76
|
"react-focus-lock": "^2.0.3",
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
87
|
"@babel/cli": "^7.5.5",
|
|
87
|
-
"@babel/core": "^7.
|
|
88
|
+
"@babel/core": "^7.12.9",
|
|
88
89
|
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
|
89
90
|
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
|
90
91
|
"@babel/preset-env": "^7.8.0",
|
|
@@ -99,23 +100,26 @@
|
|
|
99
100
|
"@sproutsocial/seeds-networkcolor": "^2.9.0",
|
|
100
101
|
"@sproutsocial/seeds-space": "^0.4.7",
|
|
101
102
|
"@sproutsocial/seeds-typography": "^3.0.1",
|
|
102
|
-
"@storybook/addon-a11y": "^6.
|
|
103
|
-
"@storybook/addon-actions": "^6.
|
|
104
|
-
"@storybook/addon-
|
|
105
|
-
"@storybook/addon-
|
|
106
|
-
"@storybook/addon-
|
|
107
|
-
"@storybook/
|
|
103
|
+
"@storybook/addon-a11y": "^6.4.19",
|
|
104
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
105
|
+
"@storybook/addon-controls": "^6.4.19",
|
|
106
|
+
"@storybook/addon-knobs": "^6.4.0",
|
|
107
|
+
"@storybook/addon-storysource": "^6.4.19",
|
|
108
|
+
"@storybook/addon-viewport": "^6.4.19",
|
|
109
|
+
"@storybook/addons": "^6.4.19",
|
|
108
110
|
"@storybook/react": "^6.4.19",
|
|
109
|
-
"@storybook/theming": "^6.
|
|
111
|
+
"@storybook/theming": "^6.4.19",
|
|
112
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
110
113
|
"@testing-library/react": "^11.2.2",
|
|
111
114
|
"@testing-library/user-event": "^13.0.0",
|
|
115
|
+
"axios": "^0.26.1",
|
|
112
116
|
"babel-core": "^7.0.0-bridge",
|
|
113
117
|
"babel-eslint": "10.1.0",
|
|
114
|
-
"babel-jest": "
|
|
115
|
-
"babel-loader": "8.
|
|
118
|
+
"babel-jest": "27.x.x",
|
|
119
|
+
"babel-loader": "8.2.3",
|
|
116
120
|
"babel-plugin-inline-import": "^3.0.0",
|
|
117
121
|
"babel-plugin-polished": "^1.1.0",
|
|
118
|
-
"babel-plugin-styled-components": "^
|
|
122
|
+
"babel-plugin-styled-components": "^2.0.7",
|
|
119
123
|
"babel-polyfill": "^6.26.0",
|
|
120
124
|
"chalk": "^2.3.2",
|
|
121
125
|
"chokidar": "^3.0.2",
|
|
@@ -137,9 +141,8 @@
|
|
|
137
141
|
"identity-obj-proxy": "^3.0.0",
|
|
138
142
|
"inquirer": "^6.4.1",
|
|
139
143
|
"is-glob": "^4.0.1",
|
|
140
|
-
"jest": "
|
|
141
|
-
"jest-axe": "
|
|
142
|
-
"jest-dom": "^3.5.0",
|
|
144
|
+
"jest": "27.x.x",
|
|
145
|
+
"jest-axe": "6.0.0",
|
|
143
146
|
"jest-styled-components": "7.0.0-beta.1",
|
|
144
147
|
"jscodeshift": "^0.6.4",
|
|
145
148
|
"json-to-scss": "^1.6.2",
|
|
@@ -148,15 +151,15 @@
|
|
|
148
151
|
"npm-run-all": "^4.1.2",
|
|
149
152
|
"outdent": "^0.7.0",
|
|
150
153
|
"pify": "^4.0.1",
|
|
151
|
-
"playroom": "^0.
|
|
154
|
+
"playroom": "^0.27.9",
|
|
152
155
|
"prettier": "^2.0.5",
|
|
153
156
|
"prop-types": "^15.6.1",
|
|
154
157
|
"react": "16.12.0",
|
|
155
158
|
"react-dates": "^21.8.0",
|
|
156
159
|
"react-dom": "16.12.0",
|
|
157
160
|
"rimraf": "^2.6.3",
|
|
158
|
-
"storybook-dark-mode": "^1.0.
|
|
159
|
-
"styled-components": "5.
|
|
161
|
+
"storybook-dark-mode": "^1.0.9",
|
|
162
|
+
"styled-components": "^5.2.3",
|
|
160
163
|
"stylelint": "^13.8.0",
|
|
161
164
|
"stylelint-config-recommended": "^2.2.0",
|
|
162
165
|
"stylelint-config-styled-components": "^0.1.1",
|
|
@@ -178,13 +181,15 @@
|
|
|
178
181
|
"prop-types": "^15.0.0",
|
|
179
182
|
"react": "^16.2.0",
|
|
180
183
|
"react-dates": "^21.8.0",
|
|
181
|
-
"
|
|
184
|
+
"react-virtualized": "9.18.5",
|
|
185
|
+
"styled-components": "^5.2.3"
|
|
182
186
|
},
|
|
183
187
|
"resolutions": {
|
|
184
188
|
"lodash": "^4.17.21",
|
|
185
189
|
"react-popper/create-react-context": "^0.3.0"
|
|
186
190
|
},
|
|
187
191
|
"jest": {
|
|
192
|
+
"testEnvironment": "jsdom",
|
|
188
193
|
"setupFilesAfterEnv": [
|
|
189
194
|
"<rootDir>/src/setupTests.js"
|
|
190
195
|
],
|