@sproutsocial/racine 9.0.0 → 9.0.3
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 +20 -0
- package/__flow__/Button/styles.js +3 -1
- package/__flow__/Checkbox/styles.js +3 -1
- package/__flow__/Listbox/__snapshots__/index.test.js.snap +40 -34
- package/__flow__/Menu/__snapshots__/index.test.js.snap +15 -12
- package/__flow__/Menu/index.js +3 -7
- package/__flow__/Menu/styles.js +1 -18
- package/__flow__/Modal/index.test.js +0 -16
- package/__flow__/Token/index.js +4 -1
- package/__flow__/Token/index.stories.js +11 -0
- package/__flow__/Token/styles.js +43 -33
- package/__flow__/themes/dark/theme.js +14 -1
- package/__flow__/themes/default/theme.js +14 -0
- package/__flow__/themes/utils/interact.js +12 -0
- package/__flow__/types/theme.colors.flow.js +6 -0
- package/commonjs/Button/styles.js +1 -1
- package/commonjs/Checkbox/styles.js +1 -1
- package/commonjs/Menu/index.js +3 -1
- package/commonjs/Menu/styles.js +3 -16
- package/commonjs/Token/index.js +5 -2
- package/commonjs/Token/styles.js +19 -50
- package/commonjs/themes/dark/theme.js +15 -3
- package/commonjs/themes/default/theme.js +16 -3
- package/commonjs/themes/utils/interact.js +19 -0
- package/dist/themes/dark.scss +15 -3
- package/dist/themes/default.scss +13 -3
- package/lib/Button/styles.js +1 -1
- package/lib/Checkbox/styles.js +1 -1
- package/lib/Menu/index.js +4 -2
- package/lib/Menu/styles.js +2 -13
- package/lib/Token/index.js +5 -2
- package/lib/Token/styles.js +19 -50
- package/lib/themes/dark/theme.js +14 -3
- package/lib/themes/default/theme.js +15 -3
- package/lib/themes/utils/interact.js +13 -0
- package/package.json +2 -2
- package/__flow__/Modal/__snapshots__/index.test.js.snap +0 -80
|
@@ -19,8 +19,12 @@ import DEPTH from "@sproutsocial/seeds-depth";
|
|
|
19
19
|
import MOTION from "@sproutsocial/seeds-motion";
|
|
20
20
|
import BORDER from "@sproutsocial/seeds-border";
|
|
21
21
|
|
|
22
|
+
import interact from "../utils/interact";
|
|
23
|
+
|
|
22
24
|
export const breakpoints = ["900px", "1200px", "1500px", "1800px"];
|
|
23
25
|
|
|
26
|
+
const MODE = "default-light";
|
|
27
|
+
|
|
24
28
|
const colors = {
|
|
25
29
|
app: {
|
|
26
30
|
background: {
|
|
@@ -46,6 +50,9 @@ const colors = {
|
|
|
46
50
|
neutral: neutral.background,
|
|
47
51
|
},
|
|
48
52
|
selected: COLORS.COLOR_NEUTRAL_800,
|
|
53
|
+
positive_sentiment: COLORS.COLOR_BLUE_500,
|
|
54
|
+
negative_sentiment: COLORS.COLOR_RED_500,
|
|
55
|
+
neutral_sentiment: COLORS.COLOR_NEUTRAL_300,
|
|
49
56
|
},
|
|
50
57
|
border: {
|
|
51
58
|
base: COLORS.COLOR_NEUTRAL_200,
|
|
@@ -171,6 +178,9 @@ const colors = {
|
|
|
171
178
|
danger: red.foreground,
|
|
172
179
|
info: blue.foreground,
|
|
173
180
|
opportunity: purple.foreground,
|
|
181
|
+
positive_sentiment: COLORS.COLOR_BLUE_700,
|
|
182
|
+
negative_sentiment: COLORS.COLOR_RED_600,
|
|
183
|
+
neutral_sentiment: COLORS.COLOR_NEUTRAL_600,
|
|
174
184
|
},
|
|
175
185
|
form: {
|
|
176
186
|
background: {
|
|
@@ -321,6 +331,9 @@ export const duration = {
|
|
|
321
331
|
};
|
|
322
332
|
|
|
323
333
|
const theme = {
|
|
334
|
+
utils: {
|
|
335
|
+
interact: interact(MODE),
|
|
336
|
+
},
|
|
324
337
|
breakpoints,
|
|
325
338
|
colors,
|
|
326
339
|
typography: {
|
|
@@ -347,6 +360,7 @@ const theme = {
|
|
|
347
360
|
shadows,
|
|
348
361
|
easing,
|
|
349
362
|
duration,
|
|
363
|
+
mode: MODE,
|
|
350
364
|
};
|
|
351
365
|
|
|
352
366
|
export default theme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//@flow strict-local
|
|
2
|
+
import { darken, lighten } from "polished";
|
|
3
|
+
|
|
4
|
+
const interact = (mode: string) => (themeValue: string) => {
|
|
5
|
+
if (mode === "default-dark") {
|
|
6
|
+
return lighten(0.2, themeValue);
|
|
7
|
+
} else {
|
|
8
|
+
return darken(0.2, themeValue);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default interact;
|
|
@@ -30,6 +30,9 @@ type TypeContainerColors = {|
|
|
|
30
30
|
neutral: string,
|
|
31
31
|
},
|
|
32
32
|
selected: string,
|
|
33
|
+
positive_sentiment: string,
|
|
34
|
+
negative_sentiment: string,
|
|
35
|
+
neutral_sentiment: string,
|
|
33
36
|
},
|
|
34
37
|
border: {
|
|
35
38
|
base: string,
|
|
@@ -167,6 +170,9 @@ type TypeIconColors = {|
|
|
|
167
170
|
danger: string,
|
|
168
171
|
info: string,
|
|
169
172
|
opportunity: string,
|
|
173
|
+
positive_sentiment: string,
|
|
174
|
+
negative_sentiment: string,
|
|
175
|
+
neutral_sentiment: string,
|
|
170
176
|
},
|
|
171
177
|
|};
|
|
172
178
|
|
|
@@ -57,7 +57,7 @@ var Container = _styledComponents.default.button.withConfig({
|
|
|
57
57
|
}, function (props) {
|
|
58
58
|
return props.disabled && _mixins.disabled;
|
|
59
59
|
}, function (props) {
|
|
60
|
-
return props.appearance === "pill" && (0, _styledComponents.css)(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode ? "screen" : "multiply", _mixins.pill);
|
|
60
|
+
return props.appearance === "pill" && (0, _styledComponents.css)(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "default-dark" ? "screen" : "multiply", _mixins.pill);
|
|
61
61
|
}, _styles.default, _systemProps.LAYOUT, _systemProps.COMMON);
|
|
62
62
|
|
|
63
63
|
var _default = Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
|
|
@@ -40,7 +40,7 @@ var InputWrapper = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
|
40
40
|
return props.theme.duration.fast;
|
|
41
41
|
}, function (props) {
|
|
42
42
|
return props.theme.easing.ease_inout;
|
|
43
|
-
}, props.theme.mode ? "screen" : "multiply", _mixins.pill, props.theme.colors.app.background.base, PillInput, _mixins.pill);
|
|
43
|
+
}, props.theme.mode === "default-dark" ? "screen" : "multiply", _mixins.pill, props.theme.colors.app.background.base, PillInput, _mixins.pill);
|
|
44
44
|
});
|
|
45
45
|
exports.InputWrapper = InputWrapper;
|
|
46
46
|
InputWrapper.displayName = "InputWrapper";
|
package/commonjs/Menu/index.js
CHANGED
|
@@ -277,7 +277,9 @@ var MenuGroup = function MenuGroup(_ref2) {
|
|
|
277
277
|
mt: 350,
|
|
278
278
|
color: "text.headline",
|
|
279
279
|
_css: isDisabled && _mixins.disabled
|
|
280
|
-
}, title)), /*#__PURE__*/React.createElement(
|
|
280
|
+
}, title)), /*#__PURE__*/React.createElement(_Box.default, _extends({}, props, {
|
|
281
|
+
m: 300,
|
|
282
|
+
p: 300,
|
|
281
283
|
role: "group"
|
|
282
284
|
}), children));
|
|
283
285
|
};
|
package/commonjs/Menu/styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.MenuItemsContainer = exports.MenuItemContainer = void 0;
|
|
5
5
|
|
|
6
6
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
7
7
|
|
|
@@ -56,21 +56,8 @@ var MenuItemContainer = (0, _styledComponents.default)(_Box.default).withConfig(
|
|
|
56
56
|
return props.disabled && _mixins.disabled;
|
|
57
57
|
});
|
|
58
58
|
exports.MenuItemContainer = MenuItemContainer;
|
|
59
|
-
var MenuGroupContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
60
|
-
displayName: "styles__MenuGroupContainer",
|
|
61
|
-
componentId: "fjvae4-1"
|
|
62
|
-
})(["", ";"], function (props) {
|
|
63
|
-
return props.appearance === "flush" ? (0, _styledComponents.css)(["margin:0 -", ";"], function (props) {
|
|
64
|
-
return props.theme.space[300];
|
|
65
|
-
}) : (0, _styledComponents.css)(["padding:", ";"], function (props) {
|
|
66
|
-
return props.theme.space[300];
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
exports.MenuGroupContainer = MenuGroupContainer;
|
|
70
59
|
var MenuItemsContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
71
60
|
displayName: "styles__MenuItemsContainer",
|
|
72
|
-
componentId: "fjvae4-
|
|
61
|
+
componentId: "fjvae4-1"
|
|
73
62
|
})(["list-style-type:none;outline:0;"]);
|
|
74
|
-
exports.MenuItemsContainer = MenuItemsContainer;
|
|
75
|
-
var _default = MenuGroupContainer;
|
|
76
|
-
exports.default = _default;
|
|
63
|
+
exports.MenuItemsContainer = MenuItemsContainer;
|
package/commonjs/Token/index.js
CHANGED
|
@@ -33,14 +33,17 @@ var Token = function Token(_ref) {
|
|
|
33
33
|
valid = _ref$valid === void 0 ? true : _ref$valid,
|
|
34
34
|
_ref$disabled = _ref.disabled,
|
|
35
35
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
36
|
-
|
|
36
|
+
_ref$palette = _ref.palette,
|
|
37
|
+
palette = _ref$palette === void 0 ? "neutral" : _ref$palette,
|
|
38
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["children", "closeable", "onClick", "qa", "valid", "disabled", "palette"]);
|
|
37
39
|
|
|
38
40
|
var textContainer = (0, _hooks.useTextContent)("");
|
|
39
41
|
return /*#__PURE__*/React.createElement(_styles.default, _extends({
|
|
40
42
|
ref: textContainer,
|
|
41
43
|
valid: valid,
|
|
42
|
-
|
|
44
|
+
palette: palette,
|
|
43
45
|
type: closeable || onClick ? "button" : undefined,
|
|
46
|
+
as: closeable || onClick ? "button" : "div",
|
|
44
47
|
closeable: closeable || onClick,
|
|
45
48
|
disabled: disabled,
|
|
46
49
|
onClick: onClick,
|
package/commonjs/Token/styles.js
CHANGED
|
@@ -16,56 +16,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
var Container = _styledComponents.default.button.withConfig({
|
|
17
17
|
displayName: "styles__Container",
|
|
18
18
|
componentId: "nyn5zy-0"
|
|
19
|
-
})(["
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
return props.theme.duration.fast;
|
|
39
|
-
}, function (props) {
|
|
40
|
-
return props.theme.easing.ease_inout;
|
|
41
|
-
}, _mixins.focusRing, function (props) {
|
|
42
|
-
return props.closeable && (0, _styledComponents.css)(["cursor:pointer;&:hover,&:active{color:", ";border:1px solid ", ";background-color:", ";}"], function (props) {
|
|
43
|
-
return props.theme.colors.text.body;
|
|
44
|
-
}, function (props) {
|
|
45
|
-
return props.theme.colors.container.border.decorative.neutral;
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.theme.colors.container.background.decorative.neutral;
|
|
48
|
-
});
|
|
49
|
-
}, function (props) {
|
|
50
|
-
return props.disabled && (0, _styledComponents.css)(["opacity:0.4;cursor:not-allowed;&:hover,&:active{background:", ";border:1px solid ", ";}"], function (props) {
|
|
51
|
-
return props.theme.colors.container.background.base;
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.theme.colors.container.border.base;
|
|
54
|
-
});
|
|
55
|
-
}, function (props) {
|
|
56
|
-
return !props.valid && (0, _styledComponents.css)(["color:", ";border-color:", ";background:", ";&:hover{color:", ";border:1px solid ", ";background-color:", ";}"], function (props) {
|
|
57
|
-
return props.theme.colors.text.body;
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return props.theme.colors.container.border.error;
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return props.theme.colors.container.background.error;
|
|
62
|
-
}, function (props) {
|
|
63
|
-
return props.theme.colors.text.body;
|
|
64
|
-
}, function (props) {
|
|
65
|
-
return props.theme.colors.container.border.error;
|
|
66
|
-
}, function (props) {
|
|
67
|
-
return props.theme.colors.container.background.error;
|
|
68
|
-
});
|
|
19
|
+
})(["position:relative;display:inline-block;margin:0;line-height:1;vertical-align:middle;outline:none;", " &:focus{", "}", " ", " ", " ", " ", ""], function (_ref) {
|
|
20
|
+
var theme = _ref.theme;
|
|
21
|
+
return (0, _styledComponents.css)(["", " font-family:", ";font-weight:", ";border:1px solid ", ";border-radius:", ";color:", ";background:", ";padding:", " ", ";transition:all ", " ", ";"], theme.typography[200], theme.fontFamily, theme.fontWeights.normal, theme.colors.container.border.base, theme.radii[500], theme.colors.text.body, theme.colors.container.background.base, theme.space[200], theme.space[300], theme.duration.fast, theme.easing.ease_inout);
|
|
22
|
+
}, _mixins.focusRing, function (_ref2) {
|
|
23
|
+
var theme = _ref2.theme,
|
|
24
|
+
palette = _ref2.palette;
|
|
25
|
+
return palette === "blue" && (0, _styledComponents.css)(["color:", ";background:", ";border:1px solid ", ";&:hover,&:active{cursor:pointer;box-shadow:", ";border:1px solid ", ";}"], theme.colors.text.body, theme.colors.container.background.decorative.blue, theme.colors.container.border.decorative.blue, theme.shadows.low, theme.utils.interact(theme.colors.container.border.decorative.blue));
|
|
26
|
+
}, function (_ref3) {
|
|
27
|
+
var closeable = _ref3.closeable,
|
|
28
|
+
theme = _ref3.theme;
|
|
29
|
+
return closeable && (0, _styledComponents.css)(["cursor:pointer;&:hover,&:active{box-shadow:", ";border:1px solid ", ";}"], theme.shadows.low, theme.utils.interact(theme.colors.container.border.base));
|
|
30
|
+
}, function (_ref4) {
|
|
31
|
+
var disabled = _ref4.disabled,
|
|
32
|
+
theme = _ref4.theme;
|
|
33
|
+
return disabled && (0, _styledComponents.css)(["opacity:0.4;cursor:not-allowed;&:hover,&:active{box-shadow:none;border:1px solid ", ";}"], theme.colors.container.border.base);
|
|
34
|
+
}, function (_ref5) {
|
|
35
|
+
var valid = _ref5.valid,
|
|
36
|
+
theme = _ref5.theme;
|
|
37
|
+
return !valid && (0, _styledComponents.css)(["color:", ";background:", ";border:1px solid ", ";&:hover{box-shadow:", ";border:1px solid ", ";}"], theme.colors.text.error, theme.colors.container.background.error, theme.colors.container.border.error, theme.shadows.low, theme.utils.interact(theme.colors.container.border.error));
|
|
69
38
|
}, _systemProps.COMMON);
|
|
70
39
|
|
|
71
40
|
var _default = Container;
|
|
@@ -13,10 +13,13 @@ var _datavizPalette = require("./dataviz-palette");
|
|
|
13
13
|
|
|
14
14
|
var _decorativePalettes = require("./decorative-palettes");
|
|
15
15
|
|
|
16
|
+
var _interact = _interopRequireDefault(require("../utils/interact"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
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); }
|
|
19
21
|
|
|
22
|
+
var MODE = "default-dark";
|
|
20
23
|
var shadows = {
|
|
21
24
|
low: _seedsDepth.default.ELEVATION_LEVEL_100 + " " + _seedsColor.default.COLOR_NEUTRAL_1100 + "FF",
|
|
22
25
|
medium: _seedsDepth.default.ELEVATION_LEVEL_300 + " " + _seedsColor.default.COLOR_NEUTRAL_1100 + "FF",
|
|
@@ -25,6 +28,9 @@ var shadows = {
|
|
|
25
28
|
exports.shadows = shadows;
|
|
26
29
|
|
|
27
30
|
var colors = _extends({}, _theme.default.colors, {
|
|
31
|
+
utils: {
|
|
32
|
+
interact: (0, _interact.default)(MODE)
|
|
33
|
+
},
|
|
28
34
|
app: {
|
|
29
35
|
background: {
|
|
30
36
|
base: _seedsColor.default.COLOR_NEUTRAL_1000
|
|
@@ -48,7 +54,10 @@ var colors = _extends({}, _theme.default.colors, {
|
|
|
48
54
|
red: _decorativePalettes.red.background,
|
|
49
55
|
neutral: _decorativePalettes.neutral.background
|
|
50
56
|
},
|
|
51
|
-
selected: _seedsColor.default.COLOR_NEUTRAL_0
|
|
57
|
+
selected: _seedsColor.default.COLOR_NEUTRAL_0,
|
|
58
|
+
positive_sentiment: _seedsColor.default.COLOR_BLUE_500,
|
|
59
|
+
negative_sentiment: _seedsColor.default.COLOR_RED_500,
|
|
60
|
+
neutral_sentiment: _seedsColor.default.COLOR_NEUTRAL_300
|
|
52
61
|
},
|
|
53
62
|
border: {
|
|
54
63
|
base: _seedsColor.default.COLOR_NEUTRAL_1100,
|
|
@@ -173,7 +182,10 @@ var colors = _extends({}, _theme.default.colors, {
|
|
|
173
182
|
error: _decorativePalettes.red.foreground,
|
|
174
183
|
danger: _decorativePalettes.red.foreground,
|
|
175
184
|
info: _decorativePalettes.blue.foreground,
|
|
176
|
-
opportunity: _decorativePalettes.purple.foreground
|
|
185
|
+
opportunity: _decorativePalettes.purple.foreground,
|
|
186
|
+
positive_sentiment: _seedsColor.default.COLOR_BLUE_700,
|
|
187
|
+
negative_sentiment: _seedsColor.default.COLOR_RED_600,
|
|
188
|
+
neutral_sentiment: _seedsColor.default.COLOR_NEUTRAL_600
|
|
177
189
|
},
|
|
178
190
|
form: {
|
|
179
191
|
background: {
|
|
@@ -209,7 +221,7 @@ var colors = _extends({}, _theme.default.colors, {
|
|
|
209
221
|
var darkTheme = _extends({}, _theme.default, {
|
|
210
222
|
colors: colors,
|
|
211
223
|
shadows: shadows,
|
|
212
|
-
mode:
|
|
224
|
+
mode: MODE
|
|
213
225
|
});
|
|
214
226
|
|
|
215
227
|
var _default = darkTheme;
|
|
@@ -23,12 +23,15 @@ var _seedsMotion = _interopRequireDefault(require("@sproutsocial/seeds-motion"))
|
|
|
23
23
|
|
|
24
24
|
var _seedsBorder = _interopRequireDefault(require("@sproutsocial/seeds-border"));
|
|
25
25
|
|
|
26
|
+
var _interact = _interopRequireDefault(require("../utils/interact"));
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
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); }
|
|
29
31
|
|
|
30
32
|
var breakpoints = ["900px", "1200px", "1500px", "1800px"];
|
|
31
33
|
exports.breakpoints = breakpoints;
|
|
34
|
+
var MODE = "default-light";
|
|
32
35
|
|
|
33
36
|
var colors = _extends({
|
|
34
37
|
app: {
|
|
@@ -54,7 +57,10 @@ var colors = _extends({
|
|
|
54
57
|
red: _decorativePalettes.red.background,
|
|
55
58
|
neutral: _decorativePalettes.neutral.background
|
|
56
59
|
},
|
|
57
|
-
selected: _seedsColor.default.COLOR_NEUTRAL_800
|
|
60
|
+
selected: _seedsColor.default.COLOR_NEUTRAL_800,
|
|
61
|
+
positive_sentiment: _seedsColor.default.COLOR_BLUE_500,
|
|
62
|
+
negative_sentiment: _seedsColor.default.COLOR_RED_500,
|
|
63
|
+
neutral_sentiment: _seedsColor.default.COLOR_NEUTRAL_300
|
|
58
64
|
},
|
|
59
65
|
border: {
|
|
60
66
|
base: _seedsColor.default.COLOR_NEUTRAL_200,
|
|
@@ -179,7 +185,10 @@ var colors = _extends({
|
|
|
179
185
|
error: _decorativePalettes.red.foreground,
|
|
180
186
|
danger: _decorativePalettes.red.foreground,
|
|
181
187
|
info: _decorativePalettes.blue.foreground,
|
|
182
|
-
opportunity: _decorativePalettes.purple.foreground
|
|
188
|
+
opportunity: _decorativePalettes.purple.foreground,
|
|
189
|
+
positive_sentiment: _seedsColor.default.COLOR_BLUE_700,
|
|
190
|
+
negative_sentiment: _seedsColor.default.COLOR_RED_600,
|
|
191
|
+
neutral_sentiment: _seedsColor.default.COLOR_NEUTRAL_600
|
|
183
192
|
},
|
|
184
193
|
form: {
|
|
185
194
|
background: {
|
|
@@ -312,6 +321,9 @@ var duration = {
|
|
|
312
321
|
};
|
|
313
322
|
exports.duration = duration;
|
|
314
323
|
var theme = {
|
|
324
|
+
utils: {
|
|
325
|
+
interact: (0, _interact.default)(MODE)
|
|
326
|
+
},
|
|
315
327
|
breakpoints: breakpoints,
|
|
316
328
|
colors: colors,
|
|
317
329
|
typography: _extends({}, typography, {
|
|
@@ -334,7 +346,8 @@ var theme = {
|
|
|
334
346
|
borderWidths: borderWidths,
|
|
335
347
|
shadows: shadows,
|
|
336
348
|
easing: easing,
|
|
337
|
-
duration: duration
|
|
349
|
+
duration: duration,
|
|
350
|
+
mode: MODE
|
|
338
351
|
};
|
|
339
352
|
var _default = theme;
|
|
340
353
|
exports.default = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _polished = require("polished");
|
|
7
|
+
|
|
8
|
+
var interact = function interact(mode) {
|
|
9
|
+
return function (themeValue) {
|
|
10
|
+
if (mode === "default-dark") {
|
|
11
|
+
return (0, _polished.lighten)(0.2, themeValue);
|
|
12
|
+
} else {
|
|
13
|
+
return (0, _polished.darken)(0.2, themeValue);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _default = interact;
|
|
19
|
+
exports.default = _default;
|
package/dist/themes/dark.scss
CHANGED
|
@@ -6,6 +6,9 @@ $dark: (
|
|
|
6
6
|
high: 0px 16px 32px #040404FF
|
|
7
7
|
),
|
|
8
8
|
default: (
|
|
9
|
+
utils: (
|
|
10
|
+
|
|
11
|
+
),
|
|
9
12
|
breakpoints: (900px, 1200px, 1500px, 1800px),
|
|
10
13
|
colors: (
|
|
11
14
|
app: (
|
|
@@ -31,7 +34,10 @@ $dark: (
|
|
|
31
34
|
red: #992222,
|
|
32
35
|
neutral: #273333
|
|
33
36
|
),
|
|
34
|
-
selected: #FFFFFF
|
|
37
|
+
selected: #FFFFFF,
|
|
38
|
+
positive_sentiment: #3896e3,
|
|
39
|
+
negative_sentiment: #f76054,
|
|
40
|
+
neutral_sentiment: #c8cccc
|
|
35
41
|
),
|
|
36
42
|
border: (
|
|
37
43
|
base: #040404,
|
|
@@ -156,7 +162,10 @@ $dark: (
|
|
|
156
162
|
error: #ffd5d2,
|
|
157
163
|
danger: #ffd5d2,
|
|
158
164
|
info: #dcf2ff,
|
|
159
|
-
opportunity: #eaeaf9
|
|
165
|
+
opportunity: #eaeaf9,
|
|
166
|
+
positive_sentiment: #2079c3,
|
|
167
|
+
negative_sentiment: #ed4c42,
|
|
168
|
+
neutral_sentiment: #6e797a
|
|
160
169
|
),
|
|
161
170
|
form: (
|
|
162
171
|
background: (
|
|
@@ -409,6 +418,9 @@ $dark: (
|
|
|
409
418
|
18: #ff7f6e,
|
|
410
419
|
19: #c2f2bd,
|
|
411
420
|
20: #ffe99a
|
|
421
|
+
),
|
|
422
|
+
utils: (
|
|
423
|
+
|
|
412
424
|
)
|
|
413
425
|
),
|
|
414
426
|
typography: (
|
|
@@ -590,6 +602,6 @@ $dark: (
|
|
|
590
602
|
medium: .3s,
|
|
591
603
|
slow: .6s
|
|
592
604
|
),
|
|
593
|
-
mode: dark
|
|
605
|
+
mode: default-dark
|
|
594
606
|
)
|
|
595
607
|
);
|
package/dist/themes/default.scss
CHANGED
|
@@ -100,6 +100,9 @@ $default: (
|
|
|
100
100
|
slow: .6s
|
|
101
101
|
),
|
|
102
102
|
default: (
|
|
103
|
+
utils: (
|
|
104
|
+
|
|
105
|
+
),
|
|
103
106
|
breakpoints: (900px, 1200px, 1500px, 1800px),
|
|
104
107
|
colors: (
|
|
105
108
|
app: (
|
|
@@ -125,7 +128,10 @@ $default: (
|
|
|
125
128
|
red: #ffd5d2,
|
|
126
129
|
neutral: #f3f4f4
|
|
127
130
|
),
|
|
128
|
-
selected: #364141
|
|
131
|
+
selected: #364141,
|
|
132
|
+
positive_sentiment: #3896e3,
|
|
133
|
+
negative_sentiment: #f76054,
|
|
134
|
+
neutral_sentiment: #c8cccc
|
|
129
135
|
),
|
|
130
136
|
border: (
|
|
131
137
|
base: #dee1e1,
|
|
@@ -250,7 +256,10 @@ $default: (
|
|
|
250
256
|
error: #992222,
|
|
251
257
|
danger: #992222,
|
|
252
258
|
info: #0c5689,
|
|
253
|
-
opportunity: #5e4eba
|
|
259
|
+
opportunity: #5e4eba,
|
|
260
|
+
positive_sentiment: #2079c3,
|
|
261
|
+
negative_sentiment: #ed4c42,
|
|
262
|
+
neutral_sentiment: #6e797a
|
|
254
263
|
),
|
|
255
264
|
form: (
|
|
256
265
|
background: (
|
|
@@ -683,6 +692,7 @@ $default: (
|
|
|
683
692
|
fast: .15s,
|
|
684
693
|
medium: .3s,
|
|
685
694
|
slow: .6s
|
|
686
|
-
)
|
|
695
|
+
),
|
|
696
|
+
mode: default-light
|
|
687
697
|
)
|
|
688
698
|
);
|
package/lib/Button/styles.js
CHANGED
|
@@ -42,6 +42,6 @@ var Container = styled.button.withConfig({
|
|
|
42
42
|
}, function (props) {
|
|
43
43
|
return props.disabled && disabled;
|
|
44
44
|
}, function (props) {
|
|
45
|
-
return props.appearance === "pill" && css(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode ? "screen" : "multiply", pill);
|
|
45
|
+
return props.appearance === "pill" && css(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "default-dark" ? "screen" : "multiply", pill);
|
|
46
46
|
}, Icon, LAYOUT, COMMON);
|
|
47
47
|
export default Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
|
package/lib/Checkbox/styles.js
CHANGED
|
@@ -22,7 +22,7 @@ export var InputWrapper = styled(Box).withConfig({
|
|
|
22
22
|
return props.theme.duration.fast;
|
|
23
23
|
}, function (props) {
|
|
24
24
|
return props.theme.easing.ease_inout;
|
|
25
|
-
}, props.theme.mode ? "screen" : "multiply", pill, props.theme.colors.app.background.base, PillInput, pill);
|
|
25
|
+
}, props.theme.mode === "default-dark" ? "screen" : "multiply", pill, props.theme.colors.app.background.base, PillInput, pill);
|
|
26
26
|
});
|
|
27
27
|
InputWrapper.displayName = "InputWrapper";
|
|
28
28
|
export var CheckboxBox = styled.div.withConfig({
|
package/lib/Menu/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as React from "react";
|
|
|
8
8
|
import styled from "styled-components";
|
|
9
9
|
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import uniqueId from "lodash.uniqueid";
|
|
11
|
-
import {
|
|
11
|
+
import { MenuItemContainer, MenuItemsContainer } from "./styles";
|
|
12
12
|
import { MENU_ITEM_ROLES, MENU_ROLES } from "./constants";
|
|
13
13
|
import Box from "../Box";
|
|
14
14
|
import Button from "../Button";
|
|
@@ -244,7 +244,9 @@ export var MenuGroup = function MenuGroup(_ref2) {
|
|
|
244
244
|
mt: 350,
|
|
245
245
|
color: "text.headline",
|
|
246
246
|
_css: isDisabled && disabled
|
|
247
|
-
}, title)), /*#__PURE__*/React.createElement(
|
|
247
|
+
}, title)), /*#__PURE__*/React.createElement(Box, _extends({}, props, {
|
|
248
|
+
m: 300,
|
|
249
|
+
p: 300,
|
|
248
250
|
role: "group"
|
|
249
251
|
}), children));
|
|
250
252
|
};
|
package/lib/Menu/styles.js
CHANGED
|
@@ -41,18 +41,7 @@ export var MenuItemContainer = styled(Box).withConfig({
|
|
|
41
41
|
}, function (props) {
|
|
42
42
|
return props.disabled && disabled;
|
|
43
43
|
});
|
|
44
|
-
export var MenuGroupContainer = styled(Box).withConfig({
|
|
45
|
-
displayName: "styles__MenuGroupContainer",
|
|
46
|
-
componentId: "fjvae4-1"
|
|
47
|
-
})(["", ";"], function (props) {
|
|
48
|
-
return props.appearance === "flush" ? css(["margin:0 -", ";"], function (props) {
|
|
49
|
-
return props.theme.space[300];
|
|
50
|
-
}) : css(["padding:", ";"], function (props) {
|
|
51
|
-
return props.theme.space[300];
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
44
|
export var MenuItemsContainer = styled(Box).withConfig({
|
|
55
45
|
displayName: "styles__MenuItemsContainer",
|
|
56
|
-
componentId: "fjvae4-
|
|
57
|
-
})(["list-style-type:none;outline:0;"]);
|
|
58
|
-
export default MenuGroupContainer;
|
|
46
|
+
componentId: "fjvae4-1"
|
|
47
|
+
})(["list-style-type:none;outline:0;"]);
|
package/lib/Token/index.js
CHANGED
|
@@ -18,14 +18,17 @@ var Token = function Token(_ref) {
|
|
|
18
18
|
valid = _ref$valid === void 0 ? true : _ref$valid,
|
|
19
19
|
_ref$disabled = _ref.disabled,
|
|
20
20
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
21
|
-
|
|
21
|
+
_ref$palette = _ref.palette,
|
|
22
|
+
palette = _ref$palette === void 0 ? "neutral" : _ref$palette,
|
|
23
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["children", "closeable", "onClick", "qa", "valid", "disabled", "palette"]);
|
|
22
24
|
|
|
23
25
|
var textContainer = useTextContent("");
|
|
24
26
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
25
27
|
ref: textContainer,
|
|
26
28
|
valid: valid,
|
|
27
|
-
|
|
29
|
+
palette: palette,
|
|
28
30
|
type: closeable || onClick ? "button" : undefined,
|
|
31
|
+
as: closeable || onClick ? "button" : "div",
|
|
29
32
|
closeable: closeable || onClick,
|
|
30
33
|
disabled: disabled,
|
|
31
34
|
onClick: onClick,
|
package/lib/Token/styles.js
CHANGED
|
@@ -4,55 +4,24 @@ import { focusRing } from "../utils/mixins";
|
|
|
4
4
|
var Container = styled.button.withConfig({
|
|
5
5
|
displayName: "styles__Container",
|
|
6
6
|
componentId: "nyn5zy-0"
|
|
7
|
-
})(["
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
return props.theme.duration.fast;
|
|
27
|
-
}, function (props) {
|
|
28
|
-
return props.theme.easing.ease_inout;
|
|
29
|
-
}, focusRing, function (props) {
|
|
30
|
-
return props.closeable && css(["cursor:pointer;&:hover,&:active{color:", ";border:1px solid ", ";background-color:", ";}"], function (props) {
|
|
31
|
-
return props.theme.colors.text.body;
|
|
32
|
-
}, function (props) {
|
|
33
|
-
return props.theme.colors.container.border.decorative.neutral;
|
|
34
|
-
}, function (props) {
|
|
35
|
-
return props.theme.colors.container.background.decorative.neutral;
|
|
36
|
-
});
|
|
37
|
-
}, function (props) {
|
|
38
|
-
return props.disabled && css(["opacity:0.4;cursor:not-allowed;&:hover,&:active{background:", ";border:1px solid ", ";}"], function (props) {
|
|
39
|
-
return props.theme.colors.container.background.base;
|
|
40
|
-
}, function (props) {
|
|
41
|
-
return props.theme.colors.container.border.base;
|
|
42
|
-
});
|
|
43
|
-
}, function (props) {
|
|
44
|
-
return !props.valid && css(["color:", ";border-color:", ";background:", ";&:hover{color:", ";border:1px solid ", ";background-color:", ";}"], function (props) {
|
|
45
|
-
return props.theme.colors.text.body;
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.theme.colors.container.border.error;
|
|
48
|
-
}, function (props) {
|
|
49
|
-
return props.theme.colors.container.background.error;
|
|
50
|
-
}, function (props) {
|
|
51
|
-
return props.theme.colors.text.body;
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.theme.colors.container.border.error;
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.theme.colors.container.background.error;
|
|
56
|
-
});
|
|
7
|
+
})(["position:relative;display:inline-block;margin:0;line-height:1;vertical-align:middle;outline:none;", " &:focus{", "}", " ", " ", " ", " ", ""], function (_ref) {
|
|
8
|
+
var theme = _ref.theme;
|
|
9
|
+
return css(["", " font-family:", ";font-weight:", ";border:1px solid ", ";border-radius:", ";color:", ";background:", ";padding:", " ", ";transition:all ", " ", ";"], theme.typography[200], theme.fontFamily, theme.fontWeights.normal, theme.colors.container.border.base, theme.radii[500], theme.colors.text.body, theme.colors.container.background.base, theme.space[200], theme.space[300], theme.duration.fast, theme.easing.ease_inout);
|
|
10
|
+
}, focusRing, function (_ref2) {
|
|
11
|
+
var theme = _ref2.theme,
|
|
12
|
+
palette = _ref2.palette;
|
|
13
|
+
return palette === "blue" && css(["color:", ";background:", ";border:1px solid ", ";&:hover,&:active{cursor:pointer;box-shadow:", ";border:1px solid ", ";}"], theme.colors.text.body, theme.colors.container.background.decorative.blue, theme.colors.container.border.decorative.blue, theme.shadows.low, theme.utils.interact(theme.colors.container.border.decorative.blue));
|
|
14
|
+
}, function (_ref3) {
|
|
15
|
+
var closeable = _ref3.closeable,
|
|
16
|
+
theme = _ref3.theme;
|
|
17
|
+
return closeable && css(["cursor:pointer;&:hover,&:active{box-shadow:", ";border:1px solid ", ";}"], theme.shadows.low, theme.utils.interact(theme.colors.container.border.base));
|
|
18
|
+
}, function (_ref4) {
|
|
19
|
+
var disabled = _ref4.disabled,
|
|
20
|
+
theme = _ref4.theme;
|
|
21
|
+
return disabled && css(["opacity:0.4;cursor:not-allowed;&:hover,&:active{box-shadow:none;border:1px solid ", ";}"], theme.colors.container.border.base);
|
|
22
|
+
}, function (_ref5) {
|
|
23
|
+
var valid = _ref5.valid,
|
|
24
|
+
theme = _ref5.theme;
|
|
25
|
+
return !valid && css(["color:", ";background:", ";border:1px solid ", ";&:hover{box-shadow:", ";border:1px solid ", ";}"], theme.colors.text.error, theme.colors.container.background.error, theme.colors.container.border.error, theme.shadows.low, theme.utils.interact(theme.colors.container.border.error));
|
|
57
26
|
}, COMMON);
|
|
58
27
|
export default Container;
|