@sproutsocial/racine 8.6.3 → 8.8.0-beta-shadows.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bcfb6eb: Export themes as scss variables
8
+
3
9
  ## 8.6.3
4
10
 
5
11
  ### Patch Changes
@@ -51,7 +51,7 @@ const Container: StyledComponent<any, TypeTheme, *> = styled.button`
51
51
  props.theme.colors.button[props.appearance].background.hover};
52
52
  text-decoration: none;
53
53
  box-shadow: ${(props) =>
54
- props.appearance === "placeholder" ? props.theme.shadows[100] : "none"};
54
+ props.appearance === "placeholder" ? props.theme.shadows.low : "none"};
55
55
  }
56
56
 
57
57
  &:active {
@@ -19,7 +19,7 @@ const Container = styled<typeof Box, *>(Box)`
19
19
  width: 100%;
20
20
  height: 100%;
21
21
  opacity: 0;
22
- box-shadow: ${(props) => props.theme.shadows[100]};
22
+ box-shadow: ${(props) => props.theme.shadows.low};
23
23
  transition: opacity ${(props) => props.theme.duration.medium}
24
24
  ${(props) => props.theme.easing.ease_inout};
25
25
  }
@@ -17,7 +17,7 @@ const Container: StyledComponent<any, TypeTheme, *> = styled.div`
17
17
  height: 100%;
18
18
  width: ${(props) => props.width}px;
19
19
  background-color: ${(props) => props.theme.colors.container.background.base};
20
- box-shadow: ${(props) => props.theme.shadows[400]};
20
+ box-shadow: ${(props) => props.theme.shadows.high};
21
21
  filter: blur(0);
22
22
 
23
23
  ${(props) => css`
@@ -10,7 +10,7 @@ const Container: StyledComponent<{ ... }, TypeTheme, *> = styled.div`
10
10
  background-color: ${(props) => props.theme.colors.container.background.base};
11
11
  border: 1px solid ${(props) => props.theme.colors.container.border.base};
12
12
  border-radius: ${(props) => props.theme.radii[500]};
13
- box-shadow: ${(props) => props.theme.shadows[100]};
13
+ box-shadow: ${(props) => props.theme.shadows.low};
14
14
  padding: 0 ${(props) => props.theme.space[200]};
15
15
  min-width: 20px;
16
16
  justify-content: center;
@@ -213,7 +213,7 @@ export const MenuWithIcons = (props) => {
213
213
  border={500}
214
214
  borderRadius="outer"
215
215
  borderColor="container.border.base"
216
- boxShadow={300}
216
+ boxShadow="medium"
217
217
  backgroundColor="container.background.base"
218
218
  >
219
219
  <Menu {...props}>
@@ -45,7 +45,7 @@ exports[`Modal should render properly 1`] = `
45
45
  flex-direction: column;
46
46
  background: #FFFFFF;
47
47
  border-radius: 6px;
48
- box-shadow: 0px 8px 16px rgba(39,51,51,.24);
48
+ box-shadow: 0px 8px 16px #2733333D;
49
49
  -webkit-filter: blur(0);
50
50
  filter: blur(0);
51
51
  color: #364141;
@@ -84,7 +84,7 @@ export const Container: StyledComponent<any, TypeTheme, *> = styled(ReactModalAd
84
84
  flex-direction: column;
85
85
  background: ${(props) => props.theme.colors.container.background.base};
86
86
  border-radius: ${(props) => props.theme.radii[500]};
87
- box-shadow: ${(props) => props.theme.shadows[300]};
87
+ box-shadow: ${(props) => props.theme.shadows.medium};
88
88
  filter: blur(0);
89
89
  color: ${(props) => props.theme.colors.text.body};
90
90
 
@@ -395,7 +395,7 @@ Popout.Content = ({ children, ...rest }: TypePopoutContentProps) => (
395
395
  border={500}
396
396
  borderColor="container.border.base"
397
397
  borderRadius="outer"
398
- boxShadow={300}
398
+ boxShadow="medium"
399
399
  p={400}
400
400
  m={300}
401
401
  {...rest}
@@ -159,7 +159,7 @@ const Content = ({
159
159
  m={200}
160
160
  color="text.body"
161
161
  bg="container.background.base"
162
- boxShadow={300}
162
+ boxShadow="medium"
163
163
  border={500}
164
164
  borderColor="container.border.base"
165
165
  // $FlowIssue - upgrade v0.112.0
@@ -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,184 +14,200 @@ import {
13
14
  neutral,
14
15
  } from "./decorative-palettes";
15
16
 
16
- const darkTheme = {
17
- ...defaultTheme,
18
- colors: {
19
- ...defaultTheme.colors,
20
- app: {
21
- background: {
22
- base: COLORS.COLOR_NEUTRAL_1000,
17
+ export const shadows = {
18
+ low: `${DEPTH.ELEVATION_LEVEL_100} ${COLORS.COLOR_NEUTRAL_1100}FF`,
19
+ medium: `${DEPTH.ELEVATION_LEVEL_300} ${COLORS.COLOR_NEUTRAL_1100}FF`,
20
+ high: `${DEPTH.ELEVATION_LEVEL_400} ${COLORS.COLOR_NEUTRAL_1100}FF`,
21
+ };
22
+
23
+ const colors = {
24
+ ...defaultTheme.colors,
25
+ app: {
26
+ background: {
27
+ base: COLORS.COLOR_NEUTRAL_1000,
28
+ },
29
+ },
30
+ container: {
31
+ background: {
32
+ base: COLORS.COLOR_NEUTRAL_900,
33
+ success: green.background,
34
+ warning: yellow.background,
35
+ error: red.background,
36
+ info: blue.background,
37
+ opportunity: purple.background,
38
+ danger: red.background,
39
+ decorative: {
40
+ green: green.background,
41
+ blue: blue.background,
42
+ purple: purple.background,
43
+ yellow: yellow.background,
44
+ orange: orange.background,
45
+ red: red.background,
46
+ neutral: neutral.background,
23
47
  },
48
+ selected: COLORS.COLOR_NEUTRAL_0,
24
49
  },
25
- container: {
50
+ border: {
51
+ base: COLORS.COLOR_NEUTRAL_1100,
52
+ success: green.highlight,
53
+ warning: yellow.highlight,
54
+ error: red.highlight,
55
+ danger: red.highlight,
56
+ info: blue.highlight,
57
+ opportunity: purple.highlight,
58
+ decorative: {
59
+ green: green.highlight,
60
+ blue: blue.highlight,
61
+ purple: purple.highlight,
62
+ yellow: yellow.highlight,
63
+ orange: orange.highlight,
64
+ red: red.highlight,
65
+ neutral: neutral.highlight,
66
+ },
67
+ selected: COLORS.COLOR_NEUTRAL_0,
68
+ },
69
+ },
70
+ button: {
71
+ primary: {
26
72
  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,
73
+ base: COLORS.COLOR_BLUE_400,
74
+ hover: COLORS.COLOR_BLUE_300,
75
+ active: COLORS.COLOR_BLUE_200,
44
76
  },
45
77
  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,
78
+ base: "transparent",
63
79
  },
64
- },
65
- button: {
66
- primary: {
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
- },
80
+ text: {
81
+ base: COLORS.COLOR_NEUTRAL_900,
82
+ hover: COLORS.COLOR_NEUTRAL_1000,
147
83
  },
148
84
  },
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,
85
+ secondary: {
86
+ background: {
87
+ base: "transparent",
88
+ hover: COLORS.COLOR_NEUTRAL_100,
89
+ active: COLORS.COLOR_NEUTRAL_0,
90
+ },
91
+ border: {
92
+ base: COLORS.COLOR_NEUTRAL_0,
93
+ },
94
+ text: {
95
+ base: COLORS.COLOR_NEUTRAL_0,
96
+ hover: COLORS.COLOR_NEUTRAL_800,
97
+ },
159
98
  },
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,
99
+ pill: {
100
+ background: {
101
+ base: "transparent",
102
+ hover: COLORS.COLOR_NEUTRAL_1000,
103
+ active: COLORS.COLOR_NEUTRAL_900,
104
+ },
105
+ border: {
106
+ base: "transparent",
107
+ },
108
+ text: {
109
+ base: COLORS.COLOR_NEUTRAL_100,
110
+ hover: COLORS.COLOR_NEUTRAL_0,
111
+ },
169
112
  },
170
- form: {
113
+ destructive: {
171
114
  background: {
115
+ base: COLORS.COLOR_RED_400,
116
+ hover: COLORS.COLOR_RED_300,
117
+ active: COLORS.COLOR_RED_200,
118
+ },
119
+ border: {
120
+ base: "transparent",
121
+ },
122
+ text: {
172
123
  base: COLORS.COLOR_NEUTRAL_900,
173
- selected: COLORS.COLOR_NEUTRAL_0,
124
+ hover: COLORS.COLOR_NEUTRAL_1000,
125
+ },
126
+ },
127
+ placeholder: {
128
+ background: {
129
+ base: "transparent",
130
+ hover: COLORS.COLOR_NEUTRAL_1100,
131
+ active: COLORS.COLOR_NEUTRAL_1100,
174
132
  },
175
133
  border: {
176
134
  base: COLORS.COLOR_NEUTRAL_500,
177
- error: red.highlight,
178
- warning: yellow.highlight,
179
- selected: COLORS.COLOR_NEUTRAL_0,
180
135
  },
181
- placeholder: {
182
- base: COLORS.COLOR_NEUTRAL_500,
136
+ text: {
137
+ base: COLORS.COLOR_BLUE_400,
138
+ hover: COLORS.COLOR_BLUE_300,
183
139
  },
184
140
  },
185
- listItem: {
141
+ unstyled: {
186
142
  background: {
187
143
  base: "transparent",
188
- hover: COLORS.COLOR_NEUTRAL_800,
189
- selected: COLORS.COLOR_NEUTRAL_0,
144
+ },
145
+ border: {
146
+ base: "transparent",
147
+ },
148
+ text: {
149
+ base: COLORS.COLOR_NEUTRAL_300,
150
+ hover: COLORS.COLOR_NEUTRAL_200,
190
151
  },
191
152
  },
192
- ...datavizPalette,
193
153
  },
154
+ link: {
155
+ base: COLORS.COLOR_BLUE_400,
156
+ hover: COLORS.COLOR_BLUE_300,
157
+ },
158
+ text: {
159
+ headline: COLORS.COLOR_NEUTRAL_0,
160
+ subtext: COLORS.COLOR_NEUTRAL_300,
161
+ body: COLORS.COLOR_NEUTRAL_100,
162
+ inverse: COLORS.COLOR_NEUTRAL_900,
163
+ error: COLORS.COLOR_RED_400,
164
+ },
165
+ icon: {
166
+ base: COLORS.COLOR_NEUTRAL_100,
167
+ inverse: COLORS.COLOR_NEUTRAL_900,
168
+ success: green.foreground,
169
+ warning: yellow.foreground,
170
+ error: red.foreground,
171
+ danger: red.foreground,
172
+ info: blue.foreground,
173
+ opportunity: purple.foreground,
174
+ },
175
+ form: {
176
+ background: {
177
+ base: COLORS.COLOR_NEUTRAL_900,
178
+ selected: COLORS.COLOR_NEUTRAL_0,
179
+ },
180
+ border: {
181
+ base: COLORS.COLOR_NEUTRAL_500,
182
+ error: red.highlight,
183
+ warning: yellow.highlight,
184
+ selected: COLORS.COLOR_NEUTRAL_0,
185
+ },
186
+ placeholder: {
187
+ base: COLORS.COLOR_NEUTRAL_500,
188
+ },
189
+ },
190
+ listItem: {
191
+ background: {
192
+ base: "transparent",
193
+ hover: COLORS.COLOR_NEUTRAL_800,
194
+ selected: COLORS.COLOR_NEUTRAL_0,
195
+ },
196
+ },
197
+ elevation: {
198
+ base: COLORS.COLOR_NEUTRAL_1100,
199
+ },
200
+ dataviz: {
201
+ map: datavizPalette.DATAVIZ_COLORS_MAP,
202
+ list: datavizPalette.DATAVIZ_COLORS_LIST,
203
+ },
204
+ ...datavizPalette,
205
+ };
206
+
207
+ const darkTheme = {
208
+ ...defaultTheme,
209
+ colors,
210
+ shadows,
194
211
  mode: "dark",
195
212
  };
196
213
 
@@ -194,6 +194,9 @@ const colors = {
194
194
  selected: COLORS.COLOR_NEUTRAL_800,
195
195
  },
196
196
  },
197
+ elevation: {
198
+ base: `${COLORS.COLOR_NEUTRAL_900}3D`,
199
+ },
197
200
  network: {
198
201
  twitter: NETWORKCOLORS.NETWORK_COLOR_TWITTER,
199
202
  twitter_like: NETWORKCOLORS.NETWORK_COLOR_TWITTER_LIKE,
@@ -223,6 +226,10 @@ const colors = {
223
226
  whatsapp: NETWORKCOLORS.NETWORK_COLOR_WHATSAPP,
224
227
  tiktok: NETWORKCOLORS.NETWORK_COLOR_TIKTOK,
225
228
  },
229
+ dataviz: {
230
+ map: datavizPalette.DATAVIZ_COLORS_MAP,
231
+ list: datavizPalette.DATAVIZ_COLORS_LIST,
232
+ },
226
233
  ...literalColors,
227
234
  ...datavizPalette,
228
235
  };
@@ -296,10 +303,9 @@ export const borderWidths = {
296
303
  };
297
304
 
298
305
  export const shadows = {
299
- "100": DEPTH.ELEVATION_LEVEL_100,
300
- "200": DEPTH.ELEVATION_LEVEL_200,
301
- "300": DEPTH.ELEVATION_LEVEL_300,
302
- "400": DEPTH.ELEVATION_LEVEL_400,
306
+ low: `${DEPTH.ELEVATION_LEVEL_100} ${COLORS.COLOR_NEUTRAL_900}3D`,
307
+ medium: `${DEPTH.ELEVATION_LEVEL_300} ${COLORS.COLOR_NEUTRAL_900}3D`,
308
+ high: `${DEPTH.ELEVATION_LEVEL_400} ${COLORS.COLOR_NEUTRAL_900}3D`,
303
309
  };
304
310
 
305
311
  export const easing = {
@@ -338,10 +344,7 @@ const theme = {
338
344
  },
339
345
  borders,
340
346
  borderWidths,
341
- shadows: {
342
- ...shadows,
343
- shadows,
344
- },
347
+ shadows,
345
348
  easing,
346
349
  duration,
347
350
  };
@@ -67,7 +67,6 @@ export type TypeSystemCommonProps = $ReadOnly<{|
67
67
  ...TypeSpaceProps,
68
68
  cursor?: TypeResponsiveBase<>,
69
69
  |}>;
70
-
71
70
  export type TypeSystemBorderProps = $ReadOnly<{|
72
71
  border?: TypeResponsiveBase<>,
73
72
  borderWidth?: TypeResponsiveBase<>,
@@ -85,7 +84,7 @@ export type TypeSystemBorderProps = $ReadOnly<{|
85
84
  borderX?: TypeResponsiveBase<>,
86
85
  borderY?: TypeResponsiveBase<>,
87
86
  boxShadow?: TypeResponsiveBase<>,
88
- textShadow?: TypeResponsiveBase<>,
87
+ textShadow?: TypeResponsiveBase<>
89
88
  |}>;
90
89
 
91
90
  type TypeResponsiveTypeographySize = TypeResponsiveString<TypeTypography>;
@@ -47,7 +47,7 @@ var Container = _styledComponents.default.button.withConfig({
47
47
  }, function (props) {
48
48
  return props.theme.colors.button[props.appearance].background.hover;
49
49
  }, function (props) {
50
- return props.appearance === "placeholder" ? props.theme.shadows[100] : "none";
50
+ return props.appearance === "placeholder" ? props.theme.shadows.low : "none";
51
51
  }, function (props) {
52
52
  return props.theme.colors.button[props.appearance].text.hover;
53
53
  }, function (props) {
@@ -19,7 +19,7 @@ var Container = (0, _styledComponents.default)(_Box.default).withConfig({
19
19
  }, function (props) {
20
20
  return props.theme.radii[500];
21
21
  }, function (props) {
22
- return props.theme.shadows[100];
22
+ return props.theme.shadows.low;
23
23
  }, function (props) {
24
24
  return props.theme.duration.medium;
25
25
  }, function (props) {
@@ -29,7 +29,7 @@ var Container = _styledComponents.default.div.withConfig({
29
29
  }, function (props) {
30
30
  return props.theme.colors.container.background.base;
31
31
  }, function (props) {
32
- return props.theme.shadows[400];
32
+ return props.theme.shadows.high;
33
33
  }, function (props) {
34
34
  return (0, _styledComponents.css)(["", ":", "px;"], props.direction, props.offset);
35
35
  }, _systemProps.COMMON);
@@ -21,7 +21,7 @@ var Container = _styledComponents.default.div.withConfig({
21
21
  }, function (props) {
22
22
  return props.theme.radii[500];
23
23
  }, function (props) {
24
- return props.theme.shadows[100];
24
+ return props.theme.shadows.low;
25
25
  }, function (props) {
26
26
  return props.theme.space[200];
27
27
  }, _systemProps.COMMON);
@@ -72,7 +72,7 @@ var Container = (0, _styledComponents.default)(ReactModalAdapter).withConfig({
72
72
  }, function (props) {
73
73
  return props.theme.radii[500];
74
74
  }, function (props) {
75
- return props.theme.shadows[300];
75
+ return props.theme.shadows.medium;
76
76
  }, function (props) {
77
77
  return props.theme.colors.text.body;
78
78
  }, BODY_PADDING, BODY_PADDING, BODY_PADDING, _styledSystem.width, _systemProps.COMMON);
@@ -290,7 +290,7 @@ Popout.Content = function (_ref4) {
290
290
  border: 500,
291
291
  borderColor: "container.border.base",
292
292
  borderRadius: "outer",
293
- boxShadow: 300,
293
+ boxShadow: "medium",
294
294
  p: 400,
295
295
  m: 300
296
296
  }, rest), children);
@@ -132,7 +132,7 @@ var Content = function Content(_ref2) {
132
132
  m: 200,
133
133
  color: "text.body",
134
134
  bg: "container.background.base",
135
- boxShadow: 300,
135
+ boxShadow: "medium",
136
136
  border: 500,
137
137
  borderColor: "container.border.base" // $FlowIssue - upgrade v0.112.0
138
138