@sproutsocial/racine 8.8.0 → 9.0.2

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/__flow__/Button/styles.js +4 -2
  3. package/__flow__/Card/styles.js +1 -1
  4. package/__flow__/Checkbox/styles.js +3 -1
  5. package/__flow__/Drawer/styles.js +1 -1
  6. package/__flow__/KeyboardKey/styles.js +1 -1
  7. package/__flow__/Listbox/__snapshots__/index.test.js.snap +40 -34
  8. package/__flow__/Menu/__snapshots__/index.test.js.snap +15 -12
  9. package/__flow__/Menu/index.js +3 -7
  10. package/__flow__/Menu/index.stories.js +1 -1
  11. package/__flow__/Menu/styles.js +1 -18
  12. package/__flow__/Modal/index.test.js +0 -16
  13. package/__flow__/Modal/styles.js +1 -1
  14. package/__flow__/Popout/index.js +1 -1
  15. package/__flow__/Token/index.js +4 -1
  16. package/__flow__/Token/index.stories.js +11 -0
  17. package/__flow__/Token/styles.js +43 -33
  18. package/__flow__/Tooltip/index.js +1 -1
  19. package/__flow__/themes/dark/theme.js +179 -159
  20. package/__flow__/themes/default/theme.js +15 -8
  21. package/__flow__/themes/utils/interact.js +12 -0
  22. package/__flow__/types/system-props.flow.js +1 -2
  23. package/commonjs/Button/styles.js +2 -2
  24. package/commonjs/Card/styles.js +1 -1
  25. package/commonjs/Checkbox/styles.js +1 -1
  26. package/commonjs/Drawer/styles.js +1 -1
  27. package/commonjs/KeyboardKey/styles.js +1 -1
  28. package/commonjs/Menu/index.js +3 -1
  29. package/commonjs/Menu/styles.js +3 -16
  30. package/commonjs/Modal/styles.js +1 -1
  31. package/commonjs/Popout/index.js +1 -1
  32. package/commonjs/Token/index.js +5 -2
  33. package/commonjs/Token/styles.js +19 -50
  34. package/commonjs/Tooltip/index.js +1 -1
  35. package/commonjs/themes/dark/theme.js +178 -157
  36. package/commonjs/themes/default/theme.js +15 -8
  37. package/commonjs/themes/utils/interact.js +19 -0
  38. package/dist/themes/dark.scss +18 -11
  39. package/dist/themes/default.scss +14 -15
  40. package/lib/Button/styles.js +2 -2
  41. package/lib/Card/styles.js +1 -1
  42. package/lib/Checkbox/styles.js +1 -1
  43. package/lib/Drawer/styles.js +1 -1
  44. package/lib/KeyboardKey/styles.js +1 -1
  45. package/lib/Menu/index.js +4 -2
  46. package/lib/Menu/styles.js +2 -13
  47. package/lib/Modal/styles.js +1 -1
  48. package/lib/Popout/index.js +1 -1
  49. package/lib/Token/index.js +5 -2
  50. package/lib/Token/styles.js +19 -50
  51. package/lib/Tooltip/index.js +1 -1
  52. package/lib/themes/dark/theme.js +173 -156
  53. package/lib/themes/default/theme.js +14 -8
  54. package/lib/themes/utils/interact.js +13 -0
  55. package/package.json +3 -3
  56. package/__flow__/Modal/__snapshots__/index.test.js.snap +0 -80
@@ -1,190 +1,207 @@
1
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
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 { green, blue, purple, yellow, orange, red, neutral } from "./decorative-palettes";
8
+ import interact from "../utils/interact";
9
+ var MODE = "default-dark";
10
+ export var shadows = {
11
+ low: DEPTH.ELEVATION_LEVEL_100 + " " + COLORS.COLOR_NEUTRAL_1100 + "FF",
12
+ medium: DEPTH.ELEVATION_LEVEL_300 + " " + COLORS.COLOR_NEUTRAL_1100 + "FF",
13
+ high: DEPTH.ELEVATION_LEVEL_400 + " " + COLORS.COLOR_NEUTRAL_1100 + "FF"
14
+ };
7
15
 
8
- var darkTheme = _extends({}, defaultTheme, {
9
- colors: _extends({}, defaultTheme.colors, {
10
- app: {
16
+ var colors = _extends({}, defaultTheme.colors, {
17
+ utils: {
18
+ interact: interact(MODE)
19
+ },
20
+ app: {
21
+ background: {
22
+ base: COLORS.COLOR_NEUTRAL_1000
23
+ }
24
+ },
25
+ container: {
26
+ background: {
27
+ base: COLORS.COLOR_NEUTRAL_900,
28
+ success: green.background,
29
+ warning: yellow.background,
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
44
+ },
45
+ border: {
46
+ base: COLORS.COLOR_NEUTRAL_1100,
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
63
+ }
64
+ },
65
+ button: {
66
+ primary: {
11
67
  background: {
12
- base: COLORS.COLOR_NEUTRAL_1000
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
13
78
  }
14
79
  },
15
- container: {
80
+ secondary: {
16
81
  background: {
17
- base: COLORS.COLOR_NEUTRAL_900,
18
- success: green.background,
19
- warning: yellow.background,
20
- error: red.background,
21
- info: blue.background,
22
- opportunity: purple.background,
23
- danger: red.background,
24
- decorative: {
25
- green: green.background,
26
- blue: blue.background,
27
- purple: purple.background,
28
- yellow: yellow.background,
29
- orange: orange.background,
30
- red: red.background,
31
- neutral: neutral.background
32
- },
33
- selected: COLORS.COLOR_NEUTRAL_0
82
+ base: "transparent",
83
+ hover: COLORS.COLOR_NEUTRAL_100,
84
+ active: COLORS.COLOR_NEUTRAL_0
34
85
  },
35
86
  border: {
36
- base: COLORS.COLOR_NEUTRAL_1100,
37
- success: green.highlight,
38
- warning: yellow.highlight,
39
- error: red.highlight,
40
- danger: red.highlight,
41
- info: blue.highlight,
42
- opportunity: purple.highlight,
43
- decorative: {
44
- green: green.highlight,
45
- blue: blue.highlight,
46
- purple: purple.highlight,
47
- yellow: yellow.highlight,
48
- orange: orange.highlight,
49
- red: red.highlight,
50
- neutral: neutral.highlight
51
- },
52
- selected: COLORS.COLOR_NEUTRAL_0
87
+ base: COLORS.COLOR_NEUTRAL_0
88
+ },
89
+ text: {
90
+ base: COLORS.COLOR_NEUTRAL_0,
91
+ hover: COLORS.COLOR_NEUTRAL_800
53
92
  }
54
93
  },
55
- button: {
56
- primary: {
57
- background: {
58
- base: COLORS.COLOR_BLUE_400,
59
- hover: COLORS.COLOR_BLUE_300,
60
- active: COLORS.COLOR_BLUE_200
61
- },
62
- border: {
63
- base: "transparent"
64
- },
65
- text: {
66
- base: COLORS.COLOR_NEUTRAL_900,
67
- hover: COLORS.COLOR_NEUTRAL_1000
68
- }
69
- },
70
- secondary: {
71
- background: {
72
- base: "transparent",
73
- hover: COLORS.COLOR_NEUTRAL_100,
74
- active: COLORS.COLOR_NEUTRAL_0
75
- },
76
- border: {
77
- base: COLORS.COLOR_NEUTRAL_0
78
- },
79
- text: {
80
- base: COLORS.COLOR_NEUTRAL_0,
81
- hover: COLORS.COLOR_NEUTRAL_800
82
- }
94
+ pill: {
95
+ background: {
96
+ base: "transparent",
97
+ hover: COLORS.COLOR_NEUTRAL_1000,
98
+ active: COLORS.COLOR_NEUTRAL_900
83
99
  },
84
- pill: {
85
- background: {
86
- base: "transparent",
87
- hover: COLORS.COLOR_NEUTRAL_1000,
88
- active: COLORS.COLOR_NEUTRAL_900
89
- },
90
- border: {
91
- base: "transparent"
92
- },
93
- text: {
94
- base: COLORS.COLOR_NEUTRAL_100,
95
- hover: COLORS.COLOR_NEUTRAL_0
96
- }
100
+ border: {
101
+ base: "transparent"
97
102
  },
98
- destructive: {
99
- background: {
100
- base: COLORS.COLOR_RED_400,
101
- hover: COLORS.COLOR_RED_300,
102
- active: COLORS.COLOR_RED_200
103
- },
104
- border: {
105
- base: "transparent"
106
- },
107
- text: {
108
- base: COLORS.COLOR_NEUTRAL_900,
109
- hover: COLORS.COLOR_NEUTRAL_1000
110
- }
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
111
113
  },
112
- placeholder: {
113
- background: {
114
- base: "transparent",
115
- hover: COLORS.COLOR_NEUTRAL_1100,
116
- active: COLORS.COLOR_NEUTRAL_1100
117
- },
118
- border: {
119
- base: COLORS.COLOR_NEUTRAL_500
120
- },
121
- text: {
122
- base: COLORS.COLOR_BLUE_400,
123
- hover: COLORS.COLOR_BLUE_300
124
- }
114
+ border: {
115
+ base: "transparent"
125
116
  },
126
- unstyled: {
127
- background: {
128
- base: "transparent"
129
- },
130
- border: {
131
- base: "transparent"
132
- },
133
- text: {
134
- base: COLORS.COLOR_NEUTRAL_300,
135
- hover: COLORS.COLOR_NEUTRAL_200
136
- }
117
+ text: {
118
+ base: COLORS.COLOR_NEUTRAL_900,
119
+ hover: COLORS.COLOR_NEUTRAL_1000
137
120
  }
138
121
  },
139
- link: {
140
- base: COLORS.COLOR_BLUE_400,
141
- hover: COLORS.COLOR_BLUE_300
142
- },
143
- text: {
144
- headline: COLORS.COLOR_NEUTRAL_0,
145
- subtext: COLORS.COLOR_NEUTRAL_300,
146
- body: COLORS.COLOR_NEUTRAL_100,
147
- inverse: COLORS.COLOR_NEUTRAL_900,
148
- error: COLORS.COLOR_RED_400
149
- },
150
- icon: {
151
- base: COLORS.COLOR_NEUTRAL_100,
152
- inverse: COLORS.COLOR_NEUTRAL_900,
153
- success: green.foreground,
154
- warning: yellow.foreground,
155
- error: red.foreground,
156
- danger: red.foreground,
157
- info: blue.foreground,
158
- opportunity: purple.foreground
159
- },
160
- form: {
122
+ placeholder: {
161
123
  background: {
162
- base: COLORS.COLOR_NEUTRAL_900,
163
- selected: COLORS.COLOR_NEUTRAL_0
124
+ base: "transparent",
125
+ hover: COLORS.COLOR_NEUTRAL_1100,
126
+ active: COLORS.COLOR_NEUTRAL_1100
164
127
  },
165
128
  border: {
166
- base: COLORS.COLOR_NEUTRAL_500,
167
- error: red.highlight,
168
- warning: yellow.highlight,
169
- selected: COLORS.COLOR_NEUTRAL_0
170
- },
171
- placeholder: {
172
129
  base: COLORS.COLOR_NEUTRAL_500
130
+ },
131
+ text: {
132
+ base: COLORS.COLOR_BLUE_400,
133
+ hover: COLORS.COLOR_BLUE_300
173
134
  }
174
135
  },
175
- listItem: {
136
+ unstyled: {
176
137
  background: {
177
- base: "transparent",
178
- hover: COLORS.COLOR_NEUTRAL_800,
179
- selected: COLORS.COLOR_NEUTRAL_0
138
+ base: "transparent"
139
+ },
140
+ border: {
141
+ base: "transparent"
142
+ },
143
+ text: {
144
+ base: COLORS.COLOR_NEUTRAL_300,
145
+ hover: COLORS.COLOR_NEUTRAL_200
180
146
  }
147
+ }
148
+ },
149
+ link: {
150
+ base: COLORS.COLOR_BLUE_400,
151
+ hover: COLORS.COLOR_BLUE_300
152
+ },
153
+ text: {
154
+ headline: COLORS.COLOR_NEUTRAL_0,
155
+ subtext: COLORS.COLOR_NEUTRAL_300,
156
+ body: COLORS.COLOR_NEUTRAL_100,
157
+ inverse: COLORS.COLOR_NEUTRAL_900,
158
+ error: COLORS.COLOR_RED_400
159
+ },
160
+ icon: {
161
+ base: COLORS.COLOR_NEUTRAL_100,
162
+ inverse: COLORS.COLOR_NEUTRAL_900,
163
+ success: green.foreground,
164
+ warning: yellow.foreground,
165
+ error: red.foreground,
166
+ danger: red.foreground,
167
+ info: blue.foreground,
168
+ opportunity: purple.foreground
169
+ },
170
+ form: {
171
+ background: {
172
+ base: COLORS.COLOR_NEUTRAL_900,
173
+ selected: COLORS.COLOR_NEUTRAL_0
181
174
  },
182
- dataviz: {
183
- map: datavizPalette.DATAVIZ_COLORS_MAP,
184
- list: datavizPalette.DATAVIZ_COLORS_LIST
175
+ border: {
176
+ base: COLORS.COLOR_NEUTRAL_500,
177
+ error: red.highlight,
178
+ warning: yellow.highlight,
179
+ selected: COLORS.COLOR_NEUTRAL_0
180
+ },
181
+ placeholder: {
182
+ base: COLORS.COLOR_NEUTRAL_500
183
+ }
184
+ },
185
+ listItem: {
186
+ background: {
187
+ base: "transparent",
188
+ hover: COLORS.COLOR_NEUTRAL_800,
189
+ selected: COLORS.COLOR_NEUTRAL_0
185
190
  }
186
- }, datavizPalette),
187
- mode: "dark"
191
+ },
192
+ elevation: {
193
+ base: COLORS.COLOR_NEUTRAL_1100
194
+ },
195
+ dataviz: {
196
+ map: datavizPalette.DATAVIZ_COLORS_MAP,
197
+ list: datavizPalette.DATAVIZ_COLORS_LIST
198
+ }
199
+ }, datavizPalette);
200
+
201
+ var darkTheme = _extends({}, defaultTheme, {
202
+ colors: colors,
203
+ shadows: shadows,
204
+ mode: MODE
188
205
  });
189
206
 
190
207
  export default darkTheme;
@@ -10,7 +10,9 @@ import SPACE from "@sproutsocial/seeds-space";
10
10
  import DEPTH from "@sproutsocial/seeds-depth";
11
11
  import MOTION from "@sproutsocial/seeds-motion";
12
12
  import BORDER from "@sproutsocial/seeds-border";
13
+ import interact from "../utils/interact";
13
14
  export var breakpoints = ["900px", "1200px", "1500px", "1800px"];
15
+ var MODE = "default-light";
14
16
 
15
17
  var colors = _extends({
16
18
  app: {
@@ -185,6 +187,9 @@ var colors = _extends({
185
187
  selected: COLORS.COLOR_NEUTRAL_800
186
188
  }
187
189
  },
190
+ elevation: {
191
+ base: COLORS.COLOR_NEUTRAL_900 + "3D"
192
+ },
188
193
  network: {
189
194
  twitter: NETWORKCOLORS.NETWORK_COLOR_TWITTER,
190
195
  twitter_like: NETWORKCOLORS.NETWORK_COLOR_TWITTER_LIKE,
@@ -266,10 +271,9 @@ export var borderWidths = {
266
271
  "500": BORDER.BORDER_WIDTH_500
267
272
  };
268
273
  export var shadows = {
269
- "100": DEPTH.ELEVATION_LEVEL_100,
270
- "200": DEPTH.ELEVATION_LEVEL_200,
271
- "300": DEPTH.ELEVATION_LEVEL_300,
272
- "400": DEPTH.ELEVATION_LEVEL_400
274
+ low: DEPTH.ELEVATION_LEVEL_100 + " " + COLORS.COLOR_NEUTRAL_900 + "3D",
275
+ medium: DEPTH.ELEVATION_LEVEL_300 + " " + COLORS.COLOR_NEUTRAL_900 + "3D",
276
+ high: DEPTH.ELEVATION_LEVEL_400 + " " + COLORS.COLOR_NEUTRAL_900 + "3D"
273
277
  };
274
278
  export var easing = {
275
279
  ease_in: MOTION.MOTION_EASE_IN,
@@ -282,6 +286,9 @@ export var duration = {
282
286
  slow: MOTION.MOTION_DURATION_SLOW
283
287
  };
284
288
  var theme = {
289
+ utils: {
290
+ interact: interact(MODE)
291
+ },
285
292
  breakpoints: breakpoints,
286
293
  colors: colors,
287
294
  typography: _extends({}, typography, {
@@ -302,10 +309,9 @@ var theme = {
302
309
  }),
303
310
  borders: borders,
304
311
  borderWidths: borderWidths,
305
- shadows: _extends({}, shadows, {
306
- shadows: shadows
307
- }),
312
+ shadows: shadows,
308
313
  easing: easing,
309
- duration: duration
314
+ duration: duration,
315
+ mode: MODE
310
316
  };
311
317
  export default theme;
@@ -0,0 +1,13 @@
1
+ import { darken, lighten } from "polished";
2
+
3
+ var interact = function interact(mode) {
4
+ return function (themeValue) {
5
+ if (mode === "default-dark") {
6
+ return lighten(0.2, themeValue);
7
+ } else {
8
+ return darken(0.2, themeValue);
9
+ }
10
+ };
11
+ };
12
+
13
+ export default interact;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "8.8.0",
3
+ "version": "9.0.2",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -92,7 +92,7 @@
92
92
  "@reach/component-component": "^0.1.3",
93
93
  "@sproutsocial/seeds-border": "^1.1.0",
94
94
  "@sproutsocial/seeds-color": "^1.5.3",
95
- "@sproutsocial/seeds-depth": "^1.1.1",
95
+ "@sproutsocial/seeds-depth": "^3.0.0",
96
96
  "@sproutsocial/seeds-motion": "^1.2.0",
97
97
  "@sproutsocial/seeds-networkcolor": "^2.9.0",
98
98
  "@sproutsocial/seeds-space": "^0.4.7",
@@ -103,7 +103,7 @@
103
103
  "@storybook/addon-storysource": "^6.1.11",
104
104
  "@storybook/addon-viewport": "^6.1.11",
105
105
  "@storybook/addons": "^6.1.11",
106
- "@storybook/react": "^6.1.11",
106
+ "@storybook/react": "^6.4.19",
107
107
  "@storybook/theming": "^6.1.11",
108
108
  "@testing-library/react": "^11.2.2",
109
109
  "@testing-library/user-event": "^13.0.0",
@@ -1,80 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Modal should render properly 1`] = `
4
- .c0__Overlay {
5
- position: fixed;
6
- top: 0px;
7
- left: 0px;
8
- right: 0px;
9
- bottom: 0px;
10
- display: -webkit-box;
11
- display: -webkit-flex;
12
- display: -ms-flexbox;
13
- display: flex;
14
- -webkit-align-items: center;
15
- -webkit-box-align: center;
16
- -ms-flex-align: center;
17
- align-items: center;
18
- -webkit-box-pack: center;
19
- -webkit-justify-content: center;
20
- -ms-flex-pack: center;
21
- justify-content: center;
22
- background-color: rgba(22,32,32,0.68);
23
- opacity: 0;
24
- will-change: opacity;
25
- -webkit-transition: opacity .3s cubic-bezier(.4,0,.2,1);
26
- transition: opacity .3s cubic-bezier(.4,0,.2,1);
27
- z-index: 6;
28
- }
29
-
30
- .c0__Overlay.ReactModal__Overlay--after-open {
31
- opacity: 1;
32
- }
33
-
34
- .c0__Overlay.ReactModal__Overlay--before-close {
35
- opacity: 0;
36
- }
37
-
38
- .c0__Content {
39
- display: -webkit-box;
40
- display: -webkit-flex;
41
- display: -ms-flexbox;
42
- display: flex;
43
- -webkit-flex-direction: column;
44
- -ms-flex-direction: column;
45
- flex-direction: column;
46
- background: #FFFFFF;
47
- border-radius: 6px;
48
- box-shadow: 0px 8px 16px rgba(39,51,51,.24);
49
- -webkit-filter: blur(0);
50
- filter: blur(0);
51
- color: #364141;
52
- outline: none;
53
- max-width: calc(100vw - 64px);
54
- max-height: calc(100vh - 64px);
55
- width: 800px;
56
- background-color: #c1c1f7;
57
- }
58
-
59
- @media screen and (-ms-high-contrast:active),(-ms-high-contrast:none) {
60
- .c0__Content {
61
- height: calc(100vh - 64px);
62
- }
63
- }
64
-
65
- <div
66
- class="ReactModal__Overlay ReactModal__Overlay--after-open styles__Container-sc-9lom4g-0__Overlay c0 c0__Overlay"
67
- >
68
- <div
69
- aria-label="Label"
70
- aria-modal="true"
71
- class="ReactModal__Content ReactModal__Content--after-open styles__Container-sc-9lom4g-0__Content c0 c0__Content"
72
- data-qa-modal=""
73
- data-qa-modal-isopen="true"
74
- role="dialog"
75
- tabindex="-1"
76
- >
77
- ajdsfljasdlfjlasdjf
78
- </div>
79
- </div>
80
- `;