@sproutsocial/racine 11.4.2-input-beta.0 → 11.6.1-input-beta.1
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 +25 -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 +22 -14
- package/__flow__/Input/styles.js +2 -2
- 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/dark/theme.js +3 -3
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +42 -0
- package/__flow__/themes/extendedThemes/sproutTheme/index.js +3 -0
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +42 -0
- package/__flow__/types/theme.colors.flow.js +8 -1
- package/__flow__/types/theme.flow.js +14 -0
- package/commonjs/Button/index.js +1 -0
- package/commonjs/Button/styles.js +1 -0
- package/commonjs/Input/index.js +19 -9
- package/commonjs/Input/styles.js +2 -2
- package/commonjs/Message/styles.js +1 -1
- package/commonjs/index.js +8 -1
- package/commonjs/themes/dark/theme.js +3 -3
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +49 -0
- package/commonjs/themes/extendedThemes/sproutTheme/index.js +14 -0
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +49 -0
- package/commonjs/types/theme.flow.js +3 -1
- package/dist/themes/dark/dark.scss +0 -3
- package/lib/Button/index.js +1 -0
- package/lib/Button/styles.js +1 -0
- package/lib/Input/index.js +19 -9
- package/lib/Input/styles.js +2 -2
- package/lib/Message/styles.js +1 -1
- package/lib/index.js +1 -0
- package/lib/themes/dark/theme.js +3 -3
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +39 -0
- package/lib/themes/extendedThemes/sproutTheme/index.js +2 -0
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +39 -0
- package/lib/types/theme.flow.js +2 -1
- package/package.json +25 -21
- package/__flow__/Button/__snapshots__/index.test.js.snap +0 -511
- package/__flow__/Button/index.test.js +0 -113
package/commonjs/Input/index.js
CHANGED
|
@@ -44,18 +44,18 @@ var ClearButton = function ClearButton() {
|
|
|
44
44
|
onClear = _React$useContext.onClear,
|
|
45
45
|
handleClear = _React$useContext.handleClear,
|
|
46
46
|
clearButtonLabel = _React$useContext.clearButtonLabel,
|
|
47
|
+
isControlled = _React$useContext.isControlled,
|
|
47
48
|
hasValue = _React$useContext.hasValue,
|
|
48
49
|
inputSize = _React$useContext.size; // Hide the button when there is no text to clear.
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
if (!hasValue) {
|
|
52
53
|
return null;
|
|
53
|
-
} //
|
|
54
|
-
//
|
|
54
|
+
} // Hide the button when no onClear callback is provided to a controlled Input.
|
|
55
|
+
// For a controlled component, all the button would do without an onClear is focus the input.
|
|
55
56
|
|
|
56
57
|
|
|
57
|
-
if (!onClear) {
|
|
58
|
-
console.warn("Warning: No onClear prop provided to Input when using Input.ClearButton. Omitting Input.ClearButton.");
|
|
58
|
+
if (isControlled && !onClear) {
|
|
59
59
|
return null;
|
|
60
60
|
} // Warn if clearButtonLabel is not included, so that the unlocalized fallback will not be mistaken for a proper label.
|
|
61
61
|
|
|
@@ -106,10 +106,19 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
_this.handleClear = function (e) {
|
|
109
|
-
var _this$inputRef
|
|
109
|
+
var _this$inputRef$curren;
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
// If the component is uncontrolled, clear its value via ref.
|
|
112
|
+
if (typeof _this.props.value !== "string") {
|
|
113
|
+
if (_this.inputRef.current) {
|
|
114
|
+
_this.inputRef.current.value = "";
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
(_this$inputRef$curren = _this.inputRef.current) == null ? void 0 : _this$inputRef$curren.focus();
|
|
112
119
|
_this.props.onClear == null ? void 0 : _this.props.onClear(e);
|
|
120
|
+
|
|
121
|
+
_this.updateState("");
|
|
113
122
|
};
|
|
114
123
|
|
|
115
124
|
_this.handleChange = function (e) {
|
|
@@ -146,7 +155,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
146
155
|
};
|
|
147
156
|
|
|
148
157
|
_this.state = {
|
|
149
|
-
//
|
|
158
|
+
// Tracking hasValue in state allows us to hide ClearButton when there is no value to clear
|
|
150
159
|
// for both controlled and uncontrolled inputs.
|
|
151
160
|
hasValue: !!props.value
|
|
152
161
|
};
|
|
@@ -203,9 +212,9 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
203
212
|
name: "search",
|
|
204
213
|
ariaHidden: true,
|
|
205
214
|
color: "icon.base"
|
|
206
|
-
}) : elemBefore; // Do not add a ClearButton if
|
|
215
|
+
}) : elemBefore; // Do not add a ClearButton if an elemAfter prop was passed.
|
|
207
216
|
|
|
208
|
-
var elementAfter = type === "search" &&
|
|
217
|
+
var elementAfter = type === "search" && !elemAfter ? /*#__PURE__*/React.createElement(ClearButton, null) : elemAfter;
|
|
209
218
|
return /*#__PURE__*/React.createElement(_styles.default, _extends({
|
|
210
219
|
hasBeforeElement: !!elementBefore,
|
|
211
220
|
hasAfterElement: !!elementAfter,
|
|
@@ -219,6 +228,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
219
228
|
value: {
|
|
220
229
|
handleClear: this.handleClear,
|
|
221
230
|
hasValue: this.state.hasValue,
|
|
231
|
+
isControlled: typeof this.props.value === "string",
|
|
222
232
|
clearButtonLabel: clearButtonLabel,
|
|
223
233
|
onClear: onClear,
|
|
224
234
|
size: size
|
package/commonjs/Input/styles.js
CHANGED
|
@@ -84,9 +84,9 @@ var Accessory = _styledComponents.default.div.withConfig({
|
|
|
84
84
|
})(["position:absolute;top:50%;transform:translateY(-50%);color:", ";display:flex;align-items:center;", ";", ";"], function (props) {
|
|
85
85
|
return props.theme.colors.icon.base;
|
|
86
86
|
}, function (props) {
|
|
87
|
-
return props.before && (0, _styledComponents.css)(["left:", ";"], props.theme.space[
|
|
87
|
+
return props.before && (0, _styledComponents.css)(["left:", ";"], props.theme.space[300]);
|
|
88
88
|
}, function (props) {
|
|
89
|
-
return props.after && (0, _styledComponents.css)(["right:", ";"], props.isClearButton ? 0 : props.theme.space[
|
|
89
|
+
return props.after && (0, _styledComponents.css)(["right:", ";"], props.isClearButton ? 0 : props.theme.space[300]);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
exports.Accessory = Accessory;
|
|
@@ -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;
|
|
@@ -31,9 +31,6 @@ var shadows = {
|
|
|
31
31
|
exports.shadows = shadows;
|
|
32
32
|
|
|
33
33
|
var colors = _extends({}, _theme.default.colors, {
|
|
34
|
-
utils: {
|
|
35
|
-
interact: (0, _interact.default)(MODE)
|
|
36
|
-
},
|
|
37
34
|
app: {
|
|
38
35
|
background: {
|
|
39
36
|
base: _seedsColor.default.COLOR_NEUTRAL_1000
|
|
@@ -237,6 +234,9 @@ var colors = _extends({}, _theme.default.colors, {
|
|
|
237
234
|
}, _datavizPalette.datavizPalette);
|
|
238
235
|
|
|
239
236
|
var darkTheme = _extends({}, _theme.default, {
|
|
237
|
+
utils: {
|
|
238
|
+
interact: (0, _interact.default)(MODE)
|
|
239
|
+
},
|
|
240
240
|
colors: colors,
|
|
241
241
|
shadows: shadows,
|
|
242
242
|
mode: MODE
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.navigation = exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _theme = _interopRequireDefault(require("../../../dark/theme"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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
|
+
|
|
12
|
+
var navigation = {
|
|
13
|
+
main: {
|
|
14
|
+
background: {
|
|
15
|
+
base: _theme.default.colors.neutral[1000],
|
|
16
|
+
overflowGradient: _theme.default.colors.neutral[1100]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
secondary: {
|
|
20
|
+
background: {
|
|
21
|
+
base: _theme.default.colors.neutral[900]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
text: {
|
|
25
|
+
base: _theme.default.colors.neutral[0],
|
|
26
|
+
hover: _theme.default.colors.neutral[0]
|
|
27
|
+
},
|
|
28
|
+
icon: {
|
|
29
|
+
base: _theme.default.colors.neutral[0],
|
|
30
|
+
hover: _theme.default.colors.neutral[0]
|
|
31
|
+
},
|
|
32
|
+
listItem: {
|
|
33
|
+
background: {
|
|
34
|
+
base: _theme.default.colors.neutral[1000],
|
|
35
|
+
hover: _theme.default.colors.neutral[1100],
|
|
36
|
+
selected: _theme.default.colors.neutral[700]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.navigation = navigation;
|
|
41
|
+
|
|
42
|
+
var darkTheme = _extends({}, _theme.default, {
|
|
43
|
+
colors: _extends({}, _theme.default.colors, {
|
|
44
|
+
navigation: navigation
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var _default = darkTheme;
|
|
49
|
+
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,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.navigation = exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _theme = _interopRequireDefault(require("../../../light/theme"));
|
|
7
|
+
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
|
|
10
|
+
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
|
+
|
|
12
|
+
var navigation = {
|
|
13
|
+
main: {
|
|
14
|
+
background: {
|
|
15
|
+
base: _theme.default.colors.neutral[900],
|
|
16
|
+
overflowGradient: _theme.default.colors.neutral[1000]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
secondary: {
|
|
20
|
+
background: {
|
|
21
|
+
base: _theme.default.colors.neutral[800]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
text: {
|
|
25
|
+
base: _theme.default.colors.neutral[0],
|
|
26
|
+
hover: _theme.default.colors.neutral[0]
|
|
27
|
+
},
|
|
28
|
+
icon: {
|
|
29
|
+
base: _theme.default.colors.neutral[0],
|
|
30
|
+
hover: _theme.default.colors.neutral[0]
|
|
31
|
+
},
|
|
32
|
+
listItem: {
|
|
33
|
+
background: {
|
|
34
|
+
base: _theme.default.colors.neutral[800],
|
|
35
|
+
hover: _theme.default.colors.neutral[1000],
|
|
36
|
+
selected: _theme.default.colors.neutral[700]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.navigation = navigation;
|
|
41
|
+
|
|
42
|
+
var lightTheme = _extends({}, _theme.default, {
|
|
43
|
+
colors: _extends({}, _theme.default.colors, {
|
|
44
|
+
navigation: navigation
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var _default = lightTheme;
|
|
49
|
+
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
|
@@ -27,18 +27,18 @@ var ClearButton = function ClearButton() {
|
|
|
27
27
|
onClear = _React$useContext.onClear,
|
|
28
28
|
handleClear = _React$useContext.handleClear,
|
|
29
29
|
clearButtonLabel = _React$useContext.clearButtonLabel,
|
|
30
|
+
isControlled = _React$useContext.isControlled,
|
|
30
31
|
hasValue = _React$useContext.hasValue,
|
|
31
32
|
inputSize = _React$useContext.size; // Hide the button when there is no text to clear.
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
if (!hasValue) {
|
|
35
36
|
return null;
|
|
36
|
-
} //
|
|
37
|
-
//
|
|
37
|
+
} // Hide the button when no onClear callback is provided to a controlled Input.
|
|
38
|
+
// For a controlled component, all the button would do without an onClear is focus the input.
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
if (!onClear) {
|
|
41
|
-
console.warn("Warning: No onClear prop provided to Input when using Input.ClearButton. Omitting Input.ClearButton.");
|
|
41
|
+
if (isControlled && !onClear) {
|
|
42
42
|
return null;
|
|
43
43
|
} // Warn if clearButtonLabel is not included, so that the unlocalized fallback will not be mistaken for a proper label.
|
|
44
44
|
|
|
@@ -89,10 +89,19 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
_this.handleClear = function (e) {
|
|
92
|
-
var _this$inputRef
|
|
92
|
+
var _this$inputRef$curren;
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
// If the component is uncontrolled, clear its value via ref.
|
|
95
|
+
if (typeof _this.props.value !== "string") {
|
|
96
|
+
if (_this.inputRef.current) {
|
|
97
|
+
_this.inputRef.current.value = "";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
(_this$inputRef$curren = _this.inputRef.current) == null ? void 0 : _this$inputRef$curren.focus();
|
|
95
102
|
_this.props.onClear == null ? void 0 : _this.props.onClear(e);
|
|
103
|
+
|
|
104
|
+
_this.updateState("");
|
|
96
105
|
};
|
|
97
106
|
|
|
98
107
|
_this.handleChange = function (e) {
|
|
@@ -129,7 +138,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
129
138
|
};
|
|
130
139
|
|
|
131
140
|
_this.state = {
|
|
132
|
-
//
|
|
141
|
+
// Tracking hasValue in state allows us to hide ClearButton when there is no value to clear
|
|
133
142
|
// for both controlled and uncontrolled inputs.
|
|
134
143
|
hasValue: !!props.value
|
|
135
144
|
};
|
|
@@ -186,9 +195,9 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
186
195
|
name: "search",
|
|
187
196
|
ariaHidden: true,
|
|
188
197
|
color: "icon.base"
|
|
189
|
-
}) : elemBefore; // Do not add a ClearButton if
|
|
198
|
+
}) : elemBefore; // Do not add a ClearButton if an elemAfter prop was passed.
|
|
190
199
|
|
|
191
|
-
var elementAfter = type === "search" &&
|
|
200
|
+
var elementAfter = type === "search" && !elemAfter ? /*#__PURE__*/React.createElement(ClearButton, null) : elemAfter;
|
|
192
201
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
193
202
|
hasBeforeElement: !!elementBefore,
|
|
194
203
|
hasAfterElement: !!elementAfter,
|
|
@@ -202,6 +211,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
202
211
|
value: {
|
|
203
212
|
handleClear: this.handleClear,
|
|
204
213
|
hasValue: this.state.hasValue,
|
|
214
|
+
isControlled: typeof this.props.value === "string",
|
|
205
215
|
clearButtonLabel: clearButtonLabel,
|
|
206
216
|
onClear: onClear,
|
|
207
217
|
size: size
|
package/lib/Input/styles.js
CHANGED
|
@@ -71,9 +71,9 @@ export var Accessory = styled.div.withConfig({
|
|
|
71
71
|
})(["position:absolute;top:50%;transform:translateY(-50%);color:", ";display:flex;align-items:center;", ";", ";"], function (props) {
|
|
72
72
|
return props.theme.colors.icon.base;
|
|
73
73
|
}, function (props) {
|
|
74
|
-
return props.before && css(["left:", ";"], props.theme.space[
|
|
74
|
+
return props.before && css(["left:", ";"], props.theme.space[300]);
|
|
75
75
|
}, function (props) {
|
|
76
|
-
return props.after && css(["right:", ";"], props.isClearButton ? 0 : props.theme.space[
|
|
76
|
+
return props.after && css(["right:", ";"], props.isClearButton ? 0 : props.theme.space[300]);
|
|
77
77
|
});
|
|
78
78
|
Container.displayName = "InputContainer";
|
|
79
79
|
Accessory.displayName = "InputAccessory";
|
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";
|
package/lib/themes/dark/theme.js
CHANGED
|
@@ -15,9 +15,6 @@ export var shadows = {
|
|
|
15
15
|
}; // If you are making changes to the colors in the theme file tag the Design Systems team on your PR! Thank you!!
|
|
16
16
|
|
|
17
17
|
var colors = _extends({}, lightTheme.colors, {
|
|
18
|
-
utils: {
|
|
19
|
-
interact: interact(MODE)
|
|
20
|
-
},
|
|
21
18
|
app: {
|
|
22
19
|
background: {
|
|
23
20
|
base: COLORS.COLOR_NEUTRAL_1000
|
|
@@ -221,6 +218,9 @@ var colors = _extends({}, lightTheme.colors, {
|
|
|
221
218
|
}, datavizPalette);
|
|
222
219
|
|
|
223
220
|
var darkTheme = _extends({}, lightTheme, {
|
|
221
|
+
utils: {
|
|
222
|
+
interact: interact(MODE)
|
|
223
|
+
},
|
|
224
224
|
colors: colors,
|
|
225
225
|
shadows: shadows,
|
|
226
226
|
mode: MODE
|
|
@@ -0,0 +1,39 @@
|
|
|
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 baseDarkTheme from "../../../dark/theme";
|
|
4
|
+
export var navigation = {
|
|
5
|
+
main: {
|
|
6
|
+
background: {
|
|
7
|
+
base: baseDarkTheme.colors.neutral[1000],
|
|
8
|
+
overflowGradient: baseDarkTheme.colors.neutral[1100]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
secondary: {
|
|
12
|
+
background: {
|
|
13
|
+
base: baseDarkTheme.colors.neutral[900]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
text: {
|
|
17
|
+
base: baseDarkTheme.colors.neutral[0],
|
|
18
|
+
hover: baseDarkTheme.colors.neutral[0]
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
base: baseDarkTheme.colors.neutral[0],
|
|
22
|
+
hover: baseDarkTheme.colors.neutral[0]
|
|
23
|
+
},
|
|
24
|
+
listItem: {
|
|
25
|
+
background: {
|
|
26
|
+
base: baseDarkTheme.colors.neutral[1000],
|
|
27
|
+
hover: baseDarkTheme.colors.neutral[1100],
|
|
28
|
+
selected: baseDarkTheme.colors.neutral[700]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var darkTheme = _extends({}, baseDarkTheme, {
|
|
34
|
+
colors: _extends({}, baseDarkTheme.colors, {
|
|
35
|
+
navigation: navigation
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default darkTheme;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 baseLightTheme from "../../../light/theme";
|
|
4
|
+
export var navigation = {
|
|
5
|
+
main: {
|
|
6
|
+
background: {
|
|
7
|
+
base: baseLightTheme.colors.neutral[900],
|
|
8
|
+
overflowGradient: baseLightTheme.colors.neutral[1000]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
secondary: {
|
|
12
|
+
background: {
|
|
13
|
+
base: baseLightTheme.colors.neutral[800]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
text: {
|
|
17
|
+
base: baseLightTheme.colors.neutral[0],
|
|
18
|
+
hover: baseLightTheme.colors.neutral[0]
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
base: baseLightTheme.colors.neutral[0],
|
|
22
|
+
hover: baseLightTheme.colors.neutral[0]
|
|
23
|
+
},
|
|
24
|
+
listItem: {
|
|
25
|
+
background: {
|
|
26
|
+
base: baseLightTheme.colors.neutral[800],
|
|
27
|
+
hover: baseLightTheme.colors.neutral[1000],
|
|
28
|
+
selected: baseLightTheme.colors.neutral[700]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var lightTheme = _extends({}, baseLightTheme, {
|
|
34
|
+
colors: _extends({}, baseLightTheme.colors, {
|
|
35
|
+
navigation: navigation
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default lightTheme;
|
package/lib/types/theme.flow.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import { breakpoints, typography, fontWeights, radii, borders, borderWidths, shadows, space, easing, duration } from "../themes/light/theme";
|
|
1
|
+
import { breakpoints, typography, fontWeights, radii, borders, borderWidths, shadows, space, easing, duration } from "../themes/light/theme";
|
|
2
|
+
import { navigation } from "../themes/extendedThemes/sproutTheme/light/theme";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.1-input-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"__flow__",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"lodash.curry": "^4.1.1",
|
|
70
70
|
"lodash.uniqueid": "^4.0.1",
|
|
71
71
|
"lru-memoize": "^1.1.0",
|
|
72
|
-
"mutationobserver-shim": "^0.3.
|
|
72
|
+
"mutationobserver-shim": "^0.3.7",
|
|
73
73
|
"polished": "^3.4.1",
|
|
74
74
|
"raw-loader": "^3.0.0",
|
|
75
75
|
"react-focus-lock": "^2.0.3",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@babel/cli": "^7.5.5",
|
|
87
|
-
"@babel/core": "^7.
|
|
87
|
+
"@babel/core": "^7.12.9",
|
|
88
88
|
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
|
89
89
|
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
|
90
90
|
"@babel/preset-env": "^7.8.0",
|
|
@@ -99,23 +99,26 @@
|
|
|
99
99
|
"@sproutsocial/seeds-networkcolor": "^2.9.0",
|
|
100
100
|
"@sproutsocial/seeds-space": "^0.4.7",
|
|
101
101
|
"@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/
|
|
102
|
+
"@storybook/addon-a11y": "^6.4.19",
|
|
103
|
+
"@storybook/addon-actions": "^6.4.19",
|
|
104
|
+
"@storybook/addon-controls": "^6.4.19",
|
|
105
|
+
"@storybook/addon-knobs": "^6.4.0",
|
|
106
|
+
"@storybook/addon-storysource": "^6.4.19",
|
|
107
|
+
"@storybook/addon-viewport": "^6.4.19",
|
|
108
|
+
"@storybook/addons": "^6.4.19",
|
|
108
109
|
"@storybook/react": "^6.4.19",
|
|
109
|
-
"@storybook/theming": "^6.
|
|
110
|
+
"@storybook/theming": "^6.4.19",
|
|
111
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
110
112
|
"@testing-library/react": "^11.2.2",
|
|
111
113
|
"@testing-library/user-event": "^13.0.0",
|
|
114
|
+
"axios": "^0.26.1",
|
|
112
115
|
"babel-core": "^7.0.0-bridge",
|
|
113
116
|
"babel-eslint": "10.1.0",
|
|
114
|
-
"babel-jest": "
|
|
115
|
-
"babel-loader": "8.
|
|
117
|
+
"babel-jest": "27.x.x",
|
|
118
|
+
"babel-loader": "8.2.3",
|
|
116
119
|
"babel-plugin-inline-import": "^3.0.0",
|
|
117
120
|
"babel-plugin-polished": "^1.1.0",
|
|
118
|
-
"babel-plugin-styled-components": "^
|
|
121
|
+
"babel-plugin-styled-components": "^2.0.7",
|
|
119
122
|
"babel-polyfill": "^6.26.0",
|
|
120
123
|
"chalk": "^2.3.2",
|
|
121
124
|
"chokidar": "^3.0.2",
|
|
@@ -137,9 +140,8 @@
|
|
|
137
140
|
"identity-obj-proxy": "^3.0.0",
|
|
138
141
|
"inquirer": "^6.4.1",
|
|
139
142
|
"is-glob": "^4.0.1",
|
|
140
|
-
"jest": "
|
|
141
|
-
"jest-axe": "
|
|
142
|
-
"jest-dom": "^3.5.0",
|
|
143
|
+
"jest": "27.x.x",
|
|
144
|
+
"jest-axe": "6.0.0",
|
|
143
145
|
"jest-styled-components": "7.0.0-beta.1",
|
|
144
146
|
"jscodeshift": "^0.6.4",
|
|
145
147
|
"json-to-scss": "^1.6.2",
|
|
@@ -148,15 +150,15 @@
|
|
|
148
150
|
"npm-run-all": "^4.1.2",
|
|
149
151
|
"outdent": "^0.7.0",
|
|
150
152
|
"pify": "^4.0.1",
|
|
151
|
-
"playroom": "^0.
|
|
153
|
+
"playroom": "^0.27.9",
|
|
152
154
|
"prettier": "^2.0.5",
|
|
153
155
|
"prop-types": "^15.6.1",
|
|
154
156
|
"react": "16.12.0",
|
|
155
157
|
"react-dates": "^21.8.0",
|
|
156
158
|
"react-dom": "16.12.0",
|
|
157
159
|
"rimraf": "^2.6.3",
|
|
158
|
-
"storybook-dark-mode": "^1.0.
|
|
159
|
-
"styled-components": "5.
|
|
160
|
+
"storybook-dark-mode": "^1.0.9",
|
|
161
|
+
"styled-components": "^5.2.3",
|
|
160
162
|
"stylelint": "^13.8.0",
|
|
161
163
|
"stylelint-config-recommended": "^2.2.0",
|
|
162
164
|
"stylelint-config-styled-components": "^0.1.1",
|
|
@@ -164,7 +166,7 @@
|
|
|
164
166
|
"svgo": "^1.3.0",
|
|
165
167
|
"svgstore": "^2.0.3",
|
|
166
168
|
"webpack": "^4.20.0",
|
|
167
|
-
"webpack-dev-server": "^
|
|
169
|
+
"webpack-dev-server": "^4.9.0"
|
|
168
170
|
},
|
|
169
171
|
"peerDependencies": {
|
|
170
172
|
"@sproutsocial/seeds-border": ">=0.3.0",
|
|
@@ -178,13 +180,15 @@
|
|
|
178
180
|
"prop-types": "^15.0.0",
|
|
179
181
|
"react": "^16.2.0",
|
|
180
182
|
"react-dates": "^21.8.0",
|
|
181
|
-
"
|
|
183
|
+
"react-virtualized": "9.18.5",
|
|
184
|
+
"styled-components": "^5.2.3"
|
|
182
185
|
},
|
|
183
186
|
"resolutions": {
|
|
184
187
|
"lodash": "^4.17.21",
|
|
185
188
|
"react-popper/create-react-context": "^0.3.0"
|
|
186
189
|
},
|
|
187
190
|
"jest": {
|
|
191
|
+
"testEnvironment": "jsdom",
|
|
188
192
|
"setupFilesAfterEnv": [
|
|
189
193
|
"<rootDir>/src/setupTests.js"
|
|
190
194
|
],
|