@sproutsocial/racine 8.8.0-dar35-beta.1 → 9.0.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 +24 -0
- package/__flow__/Button/styles.js +1 -1
- package/__flow__/Card/styles.js +1 -1
- package/__flow__/Drawer/index.stories.js +3 -3
- package/__flow__/Drawer/styles.js +1 -1
- package/__flow__/KeyboardKey/styles.js +1 -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/index.stories.js +1 -1
- package/__flow__/Menu/styles.js +1 -18
- package/__flow__/Modal/index.test.js +0 -16
- package/__flow__/Modal/styles.js +1 -1
- package/__flow__/Popout/index.js +1 -1
- package/__flow__/Token/index.js +4 -1
- package/__flow__/Token/index.stories.js +11 -0
- package/__flow__/Token/styles.js +43 -33
- package/__flow__/Tooltip/index.js +1 -1
- package/__flow__/themes/_themes.scss +19 -17
- package/__flow__/themes/dark/theme.js +179 -159
- package/__flow__/themes/default/theme.js +15 -8
- package/__flow__/themes/utils/interact.js +12 -0
- package/__flow__/types/system-props.flow.js +1 -2
- package/commonjs/Button/styles.js +1 -1
- package/commonjs/Card/styles.js +1 -1
- package/commonjs/Drawer/styles.js +1 -1
- package/commonjs/KeyboardKey/styles.js +1 -1
- package/commonjs/Menu/index.js +3 -1
- package/commonjs/Menu/styles.js +3 -16
- package/commonjs/Modal/styles.js +1 -1
- package/commonjs/Popout/index.js +1 -1
- package/commonjs/Token/index.js +5 -2
- package/commonjs/Token/styles.js +19 -50
- package/commonjs/Tooltip/index.js +1 -1
- package/commonjs/themes/dark/theme.js +178 -157
- package/commonjs/themes/default/theme.js +15 -8
- package/commonjs/themes/utils/interact.js +19 -0
- package/dist/themes/_themes.scss +19 -17
- package/dist/themes/dark.scss +18 -11
- package/dist/themes/default.scss +14 -15
- package/lib/Button/styles.js +1 -1
- package/lib/Card/styles.js +1 -1
- package/lib/Drawer/styles.js +1 -1
- package/lib/KeyboardKey/styles.js +1 -1
- package/lib/Menu/index.js +4 -2
- package/lib/Menu/styles.js +2 -13
- package/lib/Modal/styles.js +1 -1
- package/lib/Popout/index.js +1 -1
- package/lib/Token/index.js +5 -2
- package/lib/Token/styles.js +19 -50
- package/lib/Tooltip/index.js +1 -1
- package/lib/themes/dark/theme.js +173 -156
- package/lib/themes/default/theme.js +14 -8
- package/lib/themes/utils/interact.js +13 -0
- package/package.json +3 -3
- package/__flow__/Modal/__snapshots__/index.test.js.snap +0 -80
package/__flow__/Token/styles.js
CHANGED
|
@@ -6,68 +6,78 @@ import { focusRing } from "../utils/mixins";
|
|
|
6
6
|
import type { TypeTheme } from "../types/theme.flow";
|
|
7
7
|
|
|
8
8
|
const Container: StyledComponent<any, TypeTheme, *> = styled.button`
|
|
9
|
-
font-family: ${(props) => props.theme.fontFamily};
|
|
10
|
-
${(props) => props.theme.typography[200]};
|
|
11
9
|
position: relative;
|
|
12
10
|
display: inline-block;
|
|
13
|
-
padding: ${(props) => props.theme.space[200]}
|
|
14
|
-
${(props) => props.theme.space[300]};
|
|
15
11
|
margin: 0;
|
|
16
|
-
color: ${(props) => props.theme.colors.text.body};
|
|
17
|
-
background: ${(props) => props.theme.colors.container.background.base};
|
|
18
|
-
border: 1px solid ${(props) => props.theme.colors.container.border.base};
|
|
19
|
-
font-weight: ${(props) => props.theme.fontWeights.normal};
|
|
20
12
|
line-height: 1;
|
|
21
13
|
vertical-align: middle;
|
|
22
|
-
border-radius: ${(props) => props.theme.radii[500]};
|
|
23
14
|
outline: none;
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
/* Theme Properties */
|
|
16
|
+
${({ theme }) => css`
|
|
17
|
+
${theme.typography[200]}
|
|
18
|
+
font-family: ${theme.fontFamily};
|
|
19
|
+
font-weight: ${theme.fontWeights.normal};
|
|
20
|
+
border: 1px solid ${theme.colors.container.border.base};
|
|
21
|
+
border-radius: ${theme.radii[500]};
|
|
22
|
+
color: ${theme.colors.text.body};
|
|
23
|
+
background: ${theme.colors.container.background.base};
|
|
24
|
+
padding: ${theme.space[200]} ${theme.space[300]};
|
|
25
|
+
transition: all ${theme.duration.fast} ${theme.easing.ease_inout};
|
|
26
|
+
`}
|
|
26
27
|
|
|
27
28
|
&:focus {
|
|
28
29
|
${focusRing}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
${(
|
|
32
|
-
|
|
32
|
+
${({ theme, palette }) =>
|
|
33
|
+
palette === "blue" &&
|
|
33
34
|
css`
|
|
34
|
-
|
|
35
|
+
color: ${theme.colors.text.body};
|
|
36
|
+
background: ${theme.colors.container.background.decorative.blue};
|
|
37
|
+
border: 1px solid ${theme.colors.container.border.decorative.blue};
|
|
38
|
+
&:hover,
|
|
39
|
+
&:active {
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
box-shadow: ${theme.shadows.low};
|
|
42
|
+
border: 1px solid
|
|
43
|
+
${theme.utils.interact(theme.colors.container.border.decorative.blue)};
|
|
44
|
+
}
|
|
45
|
+
`}
|
|
35
46
|
|
|
47
|
+
${({ closeable, theme }) =>
|
|
48
|
+
closeable &&
|
|
49
|
+
css`
|
|
50
|
+
cursor: pointer;
|
|
36
51
|
&:hover,
|
|
37
52
|
&:active {
|
|
38
|
-
|
|
53
|
+
box-shadow: ${theme.shadows.low};
|
|
39
54
|
border: 1px solid
|
|
40
|
-
${(
|
|
41
|
-
background-color: ${(props) =>
|
|
42
|
-
props.theme.colors.container.background.decorative.neutral};
|
|
55
|
+
${theme.utils.interact(theme.colors.container.border.base)};
|
|
43
56
|
}
|
|
44
57
|
`}
|
|
45
58
|
|
|
46
|
-
${(
|
|
47
|
-
|
|
59
|
+
${({ disabled, theme }) =>
|
|
60
|
+
disabled &&
|
|
48
61
|
css`
|
|
49
62
|
opacity: 0.4;
|
|
50
63
|
cursor: not-allowed;
|
|
51
64
|
&:hover,
|
|
52
65
|
&:active {
|
|
53
|
-
|
|
54
|
-
border: 1px solid ${
|
|
66
|
+
box-shadow: none;
|
|
67
|
+
border: 1px solid ${theme.colors.container.border.base};
|
|
55
68
|
}
|
|
56
69
|
`}
|
|
57
|
-
|
|
58
|
-
${(
|
|
59
|
-
!
|
|
70
|
+
|
|
71
|
+
${({ valid, theme }) =>
|
|
72
|
+
!valid &&
|
|
60
73
|
css`
|
|
61
|
-
color: ${
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
color: ${theme.colors.text.error};
|
|
75
|
+
background: ${theme.colors.container.background.error};
|
|
76
|
+
border: 1px solid ${theme.colors.container.border.error};
|
|
65
77
|
&:hover {
|
|
66
|
-
|
|
78
|
+
box-shadow: ${theme.shadows.low};
|
|
67
79
|
border: 1px solid
|
|
68
|
-
${(
|
|
69
|
-
background-color: ${(props) =>
|
|
70
|
-
props.theme.colors.container.background.error};
|
|
80
|
+
${theme.utils.interact(theme.colors.container.border.error)};
|
|
71
81
|
}
|
|
72
82
|
`}
|
|
73
83
|
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
// In the JS theme files, the theme object is exported as "default" (i.e., using "export default"),
|
|
10
10
|
// so we need to map-get "default" to access it.
|
|
11
11
|
$themes: (
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
light: map-get($default, "default"),
|
|
13
|
+
dark: map-get($dark, "default")
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
// MIXIN
|
|
@@ -33,68 +33,68 @@ $themes: (
|
|
|
33
33
|
// This function will allow you to get any value from the theme.
|
|
34
34
|
// @param {string} $key - the period-separated path to the value in the theme object. e.g., "colors.text.body"
|
|
35
35
|
@function t($key) {
|
|
36
|
-
$keys:
|
|
36
|
+
$keys: _str-split($key, ".");
|
|
37
37
|
@return _map-deep-get($theme-map, $keys);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// The rest of the functions are convenience methods to get theme values for subsets of the theme.
|
|
41
41
|
// @param {string} $key - the period-separated path to the value in the theme object, with "colors." omitted. e.g., "text.body"
|
|
42
42
|
@function colors($key) {
|
|
43
|
-
$keys:
|
|
43
|
+
$keys: _str-split($key, ".");
|
|
44
44
|
@return _map-deep-get($theme-map, join("colors", $keys));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// @param {string} $key - the period-separated path to the value in the theme object, with "typography." omitted. e.g., "100.fontSize"
|
|
48
48
|
@function typography($key) {
|
|
49
|
-
$keys:
|
|
49
|
+
$keys: _str-split($key, ".");
|
|
50
50
|
@return _map-deep-get($theme-map, join("typography", $keys));
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// @param {string} $key - the period-separated path to the value in the theme object, with "fontWeights." omitted. e.g., "normal"
|
|
54
54
|
@function fontWeights($key) {
|
|
55
|
-
$keys:
|
|
55
|
+
$keys: _str-split($key, ".");
|
|
56
56
|
@return _map-deep-get($theme-map, join("fontWeights", $keys));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// @param {string} $key - the period-separated path to the value in the theme object, with "space." omitted. e.g., "100"
|
|
60
60
|
@function space($key) {
|
|
61
|
-
$keys:
|
|
61
|
+
$keys: _str-split($key, ".");
|
|
62
62
|
@return _map-deep-get($theme-map, join("space", $keys));
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// @param {string} $key - the period-separated path to the value in the theme object, with "radii." omitted. e.g., "inner"
|
|
66
66
|
@function radii($key) {
|
|
67
|
-
$keys:
|
|
67
|
+
$keys: _str-split($key, ".");
|
|
68
68
|
@return _map-deep-get($theme-map, join("radii", $keys));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// @param {string} $key - the period-separated path to the value in the theme object, with "borders." omitted. e.g., "500"
|
|
72
72
|
@function borders($key) {
|
|
73
|
-
$keys:
|
|
73
|
+
$keys: _str-split($key, ".");
|
|
74
74
|
@return _map-deep-get($theme-map, join("borders", $keys));
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// @param {string} $key - the period-separated path to the value in the theme object, with "borderWidths." omitted. e.g., "500"
|
|
78
78
|
@function borderWidths($key) {
|
|
79
|
-
$keys:
|
|
79
|
+
$keys: _str-split($key, ".");
|
|
80
80
|
@return _map-deep-get($theme-map, join("borderWidths", $keys));
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// @param {string} $key - the period-separated path to the value in the theme object, with "shadows." omitted. e.g., "low"
|
|
84
84
|
@function shadows($key) {
|
|
85
|
-
$keys:
|
|
85
|
+
$keys: _str-split($key, ".");
|
|
86
86
|
@return _map-deep-get($theme-map, join("shadows", $keys));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// @param {string} $key - the period-separated path to the value in the theme object, with "easing." omitted. e.g., "ease_in"
|
|
90
90
|
@function easing($key) {
|
|
91
|
-
$keys:
|
|
91
|
+
$keys: _str-split($key, ".");
|
|
92
92
|
@return _map-deep-get($theme-map, join("easing", $keys));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// @param {string} $key - the period-separated path to the value in the theme object, with "duration." omitted. e.g., "fast"
|
|
96
96
|
@function duration($key) {
|
|
97
|
-
$keys:
|
|
97
|
+
$keys: _str-split($key, ".");
|
|
98
98
|
@return _map-deep-get($theme-map, join("duration", $keys));
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -103,8 +103,9 @@ $themes: (
|
|
|
103
103
|
// If you import this file with @use, these functions will be excluded because they are private.
|
|
104
104
|
|
|
105
105
|
// Via https://stackoverflow.com/a/42295154
|
|
106
|
-
//
|
|
107
|
-
|
|
106
|
+
// Used to split period-separated object keys, e.g. "colors.text.body" => ["colors", "text", "body"]
|
|
107
|
+
// Only works with a single-character separator.
|
|
108
|
+
@function _str-split($string, $separator) {
|
|
108
109
|
// empty array/list
|
|
109
110
|
$split-arr: ();
|
|
110
111
|
// first index of separator in string
|
|
@@ -127,7 +128,8 @@ $themes: (
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
// Adapted from https://css-tricks.com/snippets/sass/deep-getset-maps/
|
|
130
|
-
// Iterates over a list of keys to read multi-level maps
|
|
131
|
+
// Iterates over a list of keys to read multi-level maps.
|
|
132
|
+
// e.g., _map-deep-get((colors: (text: (body: "#364141"))), ["colors", "text", "body"]) => "#364141"
|
|
131
133
|
@function _map-deep-get($map, $keys) {
|
|
132
134
|
@each $key in $keys {
|
|
133
135
|
$map: map-get($map, $key);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @flow strict-local
|
|
2
2
|
|
|
3
3
|
import COLORS from "@sproutsocial/seeds-color";
|
|
4
|
+
import DEPTH from "@sproutsocial/seeds-depth";
|
|
4
5
|
import defaultTheme from "../default/theme";
|
|
5
6
|
import { datavizPalette } from "./dataviz-palette";
|
|
6
7
|
import {
|
|
@@ -13,189 +14,208 @@ import {
|
|
|
13
14
|
neutral,
|
|
14
15
|
} from "./decorative-palettes";
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
import interact from "../utils/interact";
|
|
18
|
+
|
|
19
|
+
const MODE = "default-dark";
|
|
20
|
+
|
|
21
|
+
export const shadows = {
|
|
22
|
+
low: `${DEPTH.ELEVATION_LEVEL_100} ${COLORS.COLOR_NEUTRAL_1100}FF`,
|
|
23
|
+
medium: `${DEPTH.ELEVATION_LEVEL_300} ${COLORS.COLOR_NEUTRAL_1100}FF`,
|
|
24
|
+
high: `${DEPTH.ELEVATION_LEVEL_400} ${COLORS.COLOR_NEUTRAL_1100}FF`,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const colors = {
|
|
28
|
+
...defaultTheme.colors,
|
|
29
|
+
utils: {
|
|
30
|
+
interact: interact(MODE),
|
|
31
|
+
},
|
|
32
|
+
app: {
|
|
33
|
+
background: {
|
|
34
|
+
base: COLORS.COLOR_NEUTRAL_1000,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
container: {
|
|
38
|
+
background: {
|
|
39
|
+
base: COLORS.COLOR_NEUTRAL_900,
|
|
40
|
+
success: green.background,
|
|
41
|
+
warning: yellow.background,
|
|
42
|
+
error: red.background,
|
|
43
|
+
info: blue.background,
|
|
44
|
+
opportunity: purple.background,
|
|
45
|
+
danger: red.background,
|
|
46
|
+
decorative: {
|
|
47
|
+
green: green.background,
|
|
48
|
+
blue: blue.background,
|
|
49
|
+
purple: purple.background,
|
|
50
|
+
yellow: yellow.background,
|
|
51
|
+
orange: orange.background,
|
|
52
|
+
red: red.background,
|
|
53
|
+
neutral: neutral.background,
|
|
54
|
+
},
|
|
55
|
+
selected: COLORS.COLOR_NEUTRAL_0,
|
|
56
|
+
},
|
|
57
|
+
border: {
|
|
58
|
+
base: COLORS.COLOR_NEUTRAL_1100,
|
|
59
|
+
success: green.highlight,
|
|
60
|
+
warning: yellow.highlight,
|
|
61
|
+
error: red.highlight,
|
|
62
|
+
danger: red.highlight,
|
|
63
|
+
info: blue.highlight,
|
|
64
|
+
opportunity: purple.highlight,
|
|
65
|
+
decorative: {
|
|
66
|
+
green: green.highlight,
|
|
67
|
+
blue: blue.highlight,
|
|
68
|
+
purple: purple.highlight,
|
|
69
|
+
yellow: yellow.highlight,
|
|
70
|
+
orange: orange.highlight,
|
|
71
|
+
red: red.highlight,
|
|
72
|
+
neutral: neutral.highlight,
|
|
23
73
|
},
|
|
74
|
+
selected: COLORS.COLOR_NEUTRAL_0,
|
|
24
75
|
},
|
|
25
|
-
|
|
76
|
+
},
|
|
77
|
+
button: {
|
|
78
|
+
primary: {
|
|
26
79
|
background: {
|
|
27
|
-
base: COLORS.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
error: red.background,
|
|
31
|
-
info: blue.background,
|
|
32
|
-
opportunity: purple.background,
|
|
33
|
-
danger: red.background,
|
|
34
|
-
decorative: {
|
|
35
|
-
green: green.background,
|
|
36
|
-
blue: blue.background,
|
|
37
|
-
purple: purple.background,
|
|
38
|
-
yellow: yellow.background,
|
|
39
|
-
orange: orange.background,
|
|
40
|
-
red: red.background,
|
|
41
|
-
neutral: neutral.background,
|
|
42
|
-
},
|
|
43
|
-
selected: COLORS.COLOR_NEUTRAL_0,
|
|
80
|
+
base: COLORS.COLOR_BLUE_400,
|
|
81
|
+
hover: COLORS.COLOR_BLUE_300,
|
|
82
|
+
active: COLORS.COLOR_BLUE_200,
|
|
44
83
|
},
|
|
45
84
|
border: {
|
|
46
|
-
base:
|
|
47
|
-
success: green.highlight,
|
|
48
|
-
warning: yellow.highlight,
|
|
49
|
-
error: red.highlight,
|
|
50
|
-
danger: red.highlight,
|
|
51
|
-
info: blue.highlight,
|
|
52
|
-
opportunity: purple.highlight,
|
|
53
|
-
decorative: {
|
|
54
|
-
green: green.highlight,
|
|
55
|
-
blue: blue.highlight,
|
|
56
|
-
purple: purple.highlight,
|
|
57
|
-
yellow: yellow.highlight,
|
|
58
|
-
orange: orange.highlight,
|
|
59
|
-
red: red.highlight,
|
|
60
|
-
neutral: neutral.highlight,
|
|
61
|
-
},
|
|
62
|
-
selected: COLORS.COLOR_NEUTRAL_0,
|
|
85
|
+
base: "transparent",
|
|
63
86
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
background: {
|
|
68
|
-
base: COLORS.COLOR_BLUE_400,
|
|
69
|
-
hover: COLORS.COLOR_BLUE_300,
|
|
70
|
-
active: COLORS.COLOR_BLUE_200,
|
|
71
|
-
},
|
|
72
|
-
border: {
|
|
73
|
-
base: "transparent",
|
|
74
|
-
},
|
|
75
|
-
text: {
|
|
76
|
-
base: COLORS.COLOR_NEUTRAL_900,
|
|
77
|
-
hover: COLORS.COLOR_NEUTRAL_1000,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
secondary: {
|
|
81
|
-
background: {
|
|
82
|
-
base: "transparent",
|
|
83
|
-
hover: COLORS.COLOR_NEUTRAL_100,
|
|
84
|
-
active: COLORS.COLOR_NEUTRAL_0,
|
|
85
|
-
},
|
|
86
|
-
border: {
|
|
87
|
-
base: COLORS.COLOR_NEUTRAL_0,
|
|
88
|
-
},
|
|
89
|
-
text: {
|
|
90
|
-
base: COLORS.COLOR_NEUTRAL_0,
|
|
91
|
-
hover: COLORS.COLOR_NEUTRAL_800,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
pill: {
|
|
95
|
-
background: {
|
|
96
|
-
base: "transparent",
|
|
97
|
-
hover: COLORS.COLOR_NEUTRAL_1000,
|
|
98
|
-
active: COLORS.COLOR_NEUTRAL_900,
|
|
99
|
-
},
|
|
100
|
-
border: {
|
|
101
|
-
base: "transparent",
|
|
102
|
-
},
|
|
103
|
-
text: {
|
|
104
|
-
base: COLORS.COLOR_NEUTRAL_100,
|
|
105
|
-
hover: COLORS.COLOR_NEUTRAL_0,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
destructive: {
|
|
109
|
-
background: {
|
|
110
|
-
base: COLORS.COLOR_RED_400,
|
|
111
|
-
hover: COLORS.COLOR_RED_300,
|
|
112
|
-
active: COLORS.COLOR_RED_200,
|
|
113
|
-
},
|
|
114
|
-
border: {
|
|
115
|
-
base: "transparent",
|
|
116
|
-
},
|
|
117
|
-
text: {
|
|
118
|
-
base: COLORS.COLOR_NEUTRAL_900,
|
|
119
|
-
hover: COLORS.COLOR_NEUTRAL_1000,
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
placeholder: {
|
|
123
|
-
background: {
|
|
124
|
-
base: "transparent",
|
|
125
|
-
hover: COLORS.COLOR_NEUTRAL_1100,
|
|
126
|
-
active: COLORS.COLOR_NEUTRAL_1100,
|
|
127
|
-
},
|
|
128
|
-
border: {
|
|
129
|
-
base: COLORS.COLOR_NEUTRAL_500,
|
|
130
|
-
},
|
|
131
|
-
text: {
|
|
132
|
-
base: COLORS.COLOR_BLUE_400,
|
|
133
|
-
hover: COLORS.COLOR_BLUE_300,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
unstyled: {
|
|
137
|
-
background: {
|
|
138
|
-
base: "transparent",
|
|
139
|
-
},
|
|
140
|
-
border: {
|
|
141
|
-
base: "transparent",
|
|
142
|
-
},
|
|
143
|
-
text: {
|
|
144
|
-
base: COLORS.COLOR_NEUTRAL_300,
|
|
145
|
-
hover: COLORS.COLOR_NEUTRAL_200,
|
|
146
|
-
},
|
|
87
|
+
text: {
|
|
88
|
+
base: COLORS.COLOR_NEUTRAL_900,
|
|
89
|
+
hover: COLORS.COLOR_NEUTRAL_1000,
|
|
147
90
|
},
|
|
148
91
|
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
92
|
+
secondary: {
|
|
93
|
+
background: {
|
|
94
|
+
base: "transparent",
|
|
95
|
+
hover: COLORS.COLOR_NEUTRAL_100,
|
|
96
|
+
active: COLORS.COLOR_NEUTRAL_0,
|
|
97
|
+
},
|
|
98
|
+
border: {
|
|
99
|
+
base: COLORS.COLOR_NEUTRAL_0,
|
|
100
|
+
},
|
|
101
|
+
text: {
|
|
102
|
+
base: COLORS.COLOR_NEUTRAL_0,
|
|
103
|
+
hover: COLORS.COLOR_NEUTRAL_800,
|
|
104
|
+
},
|
|
159
105
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
106
|
+
pill: {
|
|
107
|
+
background: {
|
|
108
|
+
base: "transparent",
|
|
109
|
+
hover: COLORS.COLOR_NEUTRAL_1000,
|
|
110
|
+
active: COLORS.COLOR_NEUTRAL_900,
|
|
111
|
+
},
|
|
112
|
+
border: {
|
|
113
|
+
base: "transparent",
|
|
114
|
+
},
|
|
115
|
+
text: {
|
|
116
|
+
base: COLORS.COLOR_NEUTRAL_100,
|
|
117
|
+
hover: COLORS.COLOR_NEUTRAL_0,
|
|
118
|
+
},
|
|
169
119
|
},
|
|
170
|
-
|
|
120
|
+
destructive: {
|
|
171
121
|
background: {
|
|
122
|
+
base: COLORS.COLOR_RED_400,
|
|
123
|
+
hover: COLORS.COLOR_RED_300,
|
|
124
|
+
active: COLORS.COLOR_RED_200,
|
|
125
|
+
},
|
|
126
|
+
border: {
|
|
127
|
+
base: "transparent",
|
|
128
|
+
},
|
|
129
|
+
text: {
|
|
172
130
|
base: COLORS.COLOR_NEUTRAL_900,
|
|
173
|
-
|
|
131
|
+
hover: COLORS.COLOR_NEUTRAL_1000,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
placeholder: {
|
|
135
|
+
background: {
|
|
136
|
+
base: "transparent",
|
|
137
|
+
hover: COLORS.COLOR_NEUTRAL_1100,
|
|
138
|
+
active: COLORS.COLOR_NEUTRAL_1100,
|
|
174
139
|
},
|
|
175
140
|
border: {
|
|
176
141
|
base: COLORS.COLOR_NEUTRAL_500,
|
|
177
|
-
error: red.highlight,
|
|
178
|
-
warning: yellow.highlight,
|
|
179
|
-
selected: COLORS.COLOR_NEUTRAL_0,
|
|
180
142
|
},
|
|
181
|
-
|
|
182
|
-
base: COLORS.
|
|
143
|
+
text: {
|
|
144
|
+
base: COLORS.COLOR_BLUE_400,
|
|
145
|
+
hover: COLORS.COLOR_BLUE_300,
|
|
183
146
|
},
|
|
184
147
|
},
|
|
185
|
-
|
|
148
|
+
unstyled: {
|
|
186
149
|
background: {
|
|
187
150
|
base: "transparent",
|
|
188
|
-
hover: COLORS.COLOR_NEUTRAL_800,
|
|
189
|
-
selected: COLORS.COLOR_NEUTRAL_0,
|
|
190
151
|
},
|
|
152
|
+
border: {
|
|
153
|
+
base: "transparent",
|
|
154
|
+
},
|
|
155
|
+
text: {
|
|
156
|
+
base: COLORS.COLOR_NEUTRAL_300,
|
|
157
|
+
hover: COLORS.COLOR_NEUTRAL_200,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
link: {
|
|
162
|
+
base: COLORS.COLOR_BLUE_400,
|
|
163
|
+
hover: COLORS.COLOR_BLUE_300,
|
|
164
|
+
},
|
|
165
|
+
text: {
|
|
166
|
+
headline: COLORS.COLOR_NEUTRAL_0,
|
|
167
|
+
subtext: COLORS.COLOR_NEUTRAL_300,
|
|
168
|
+
body: COLORS.COLOR_NEUTRAL_100,
|
|
169
|
+
inverse: COLORS.COLOR_NEUTRAL_900,
|
|
170
|
+
error: COLORS.COLOR_RED_400,
|
|
171
|
+
},
|
|
172
|
+
icon: {
|
|
173
|
+
base: COLORS.COLOR_NEUTRAL_100,
|
|
174
|
+
inverse: COLORS.COLOR_NEUTRAL_900,
|
|
175
|
+
success: green.foreground,
|
|
176
|
+
warning: yellow.foreground,
|
|
177
|
+
error: red.foreground,
|
|
178
|
+
danger: red.foreground,
|
|
179
|
+
info: blue.foreground,
|
|
180
|
+
opportunity: purple.foreground,
|
|
181
|
+
},
|
|
182
|
+
form: {
|
|
183
|
+
background: {
|
|
184
|
+
base: COLORS.COLOR_NEUTRAL_900,
|
|
185
|
+
selected: COLORS.COLOR_NEUTRAL_0,
|
|
191
186
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
187
|
+
border: {
|
|
188
|
+
base: COLORS.COLOR_NEUTRAL_500,
|
|
189
|
+
error: red.highlight,
|
|
190
|
+
warning: yellow.highlight,
|
|
191
|
+
selected: COLORS.COLOR_NEUTRAL_0,
|
|
192
|
+
},
|
|
193
|
+
placeholder: {
|
|
194
|
+
base: COLORS.COLOR_NEUTRAL_500,
|
|
195
195
|
},
|
|
196
|
-
...datavizPalette,
|
|
197
196
|
},
|
|
198
|
-
|
|
197
|
+
listItem: {
|
|
198
|
+
background: {
|
|
199
|
+
base: "transparent",
|
|
200
|
+
hover: COLORS.COLOR_NEUTRAL_800,
|
|
201
|
+
selected: COLORS.COLOR_NEUTRAL_0,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
elevation: {
|
|
205
|
+
base: COLORS.COLOR_NEUTRAL_1100,
|
|
206
|
+
},
|
|
207
|
+
dataviz: {
|
|
208
|
+
map: datavizPalette.DATAVIZ_COLORS_MAP,
|
|
209
|
+
list: datavizPalette.DATAVIZ_COLORS_LIST,
|
|
210
|
+
},
|
|
211
|
+
...datavizPalette,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const darkTheme = {
|
|
215
|
+
...defaultTheme,
|
|
216
|
+
colors,
|
|
217
|
+
shadows,
|
|
218
|
+
mode: MODE,
|
|
199
219
|
};
|
|
200
220
|
|
|
201
221
|
export default darkTheme;
|
|
@@ -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: {
|
|
@@ -194,6 +198,9 @@ const colors = {
|
|
|
194
198
|
selected: COLORS.COLOR_NEUTRAL_800,
|
|
195
199
|
},
|
|
196
200
|
},
|
|
201
|
+
elevation: {
|
|
202
|
+
base: `${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
203
|
+
},
|
|
197
204
|
network: {
|
|
198
205
|
twitter: NETWORKCOLORS.NETWORK_COLOR_TWITTER,
|
|
199
206
|
twitter_like: NETWORKCOLORS.NETWORK_COLOR_TWITTER_LIKE,
|
|
@@ -300,10 +307,9 @@ export const borderWidths = {
|
|
|
300
307
|
};
|
|
301
308
|
|
|
302
309
|
export const shadows = {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
"400": DEPTH.ELEVATION_LEVEL_400,
|
|
310
|
+
low: `${DEPTH.ELEVATION_LEVEL_100} ${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
311
|
+
medium: `${DEPTH.ELEVATION_LEVEL_300} ${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
312
|
+
high: `${DEPTH.ELEVATION_LEVEL_400} ${COLORS.COLOR_NEUTRAL_900}3D`,
|
|
307
313
|
};
|
|
308
314
|
|
|
309
315
|
export const easing = {
|
|
@@ -319,6 +325,9 @@ export const duration = {
|
|
|
319
325
|
};
|
|
320
326
|
|
|
321
327
|
const theme = {
|
|
328
|
+
utils: {
|
|
329
|
+
interact: interact(MODE),
|
|
330
|
+
},
|
|
322
331
|
breakpoints,
|
|
323
332
|
colors,
|
|
324
333
|
typography: {
|
|
@@ -342,12 +351,10 @@ const theme = {
|
|
|
342
351
|
},
|
|
343
352
|
borders,
|
|
344
353
|
borderWidths,
|
|
345
|
-
shadows
|
|
346
|
-
...shadows,
|
|
347
|
-
shadows,
|
|
348
|
-
},
|
|
354
|
+
shadows,
|
|
349
355
|
easing,
|
|
350
356
|
duration,
|
|
357
|
+
mode: MODE,
|
|
351
358
|
};
|
|
352
359
|
|
|
353
360
|
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;
|