@sproutsocial/racine 8.5.2 → 8.6.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 (39) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/__flow__/Collapsible/index.js +1 -0
  3. package/__flow__/Collapsible/styles.js +23 -24
  4. package/__flow__/Listbox/__snapshots__/index.test.js.snap +84 -42
  5. package/__flow__/Listbox/index.stories.js +33 -0
  6. package/__flow__/Listbox/index.test.js +52 -2
  7. package/__flow__/Menu/__snapshots__/index.test.js.snap +4 -0
  8. package/__flow__/Menu/hooks.js +8 -3
  9. package/__flow__/Menu/index.flow.js +1 -0
  10. package/__flow__/Menu/index.js +31 -4
  11. package/__flow__/Menu/index.stories.js +20 -0
  12. package/__flow__/Menu/styles.js +4 -0
  13. package/__flow__/dataviz/dataviz.stories.js +12 -0
  14. package/__flow__/dataviz/index.js +13 -0
  15. package/__flow__/themes/dark/dataviz-palette.js +50 -0
  16. package/__flow__/themes/dark/theme.js +2 -0
  17. package/__flow__/themes/default/dataviz-palette.js +50 -0
  18. package/__flow__/themes/default/theme.js +2 -0
  19. package/commonjs/Collapsible/index.js +1 -0
  20. package/commonjs/Collapsible/styles.js +5 -7
  21. package/commonjs/Menu/hooks.js +12 -3
  22. package/commonjs/Menu/index.js +26 -6
  23. package/commonjs/Menu/styles.js +4 -2
  24. package/commonjs/dataviz/index.js +24 -0
  25. package/commonjs/themes/dark/dataviz-palette.js +35 -0
  26. package/commonjs/themes/dark/theme.js +3 -1
  27. package/commonjs/themes/default/dataviz-palette.js +35 -0
  28. package/commonjs/themes/default/theme.js +3 -1
  29. package/lib/Collapsible/index.js +1 -0
  30. package/lib/Collapsible/styles.js +5 -7
  31. package/lib/Menu/hooks.js +12 -3
  32. package/lib/Menu/index.js +26 -6
  33. package/lib/Menu/styles.js +4 -2
  34. package/lib/dataviz/index.js +13 -0
  35. package/lib/themes/dark/dataviz-palette.js +26 -0
  36. package/lib/themes/dark/theme.js +2 -1
  37. package/lib/themes/default/dataviz-palette.js +26 -0
  38. package/lib/themes/default/theme.js +2 -1
  39. package/package.json +2 -2
@@ -203,3 +203,23 @@ export const MenuWithCheckboxes = (props) => {
203
203
  </Menu>
204
204
  );
205
205
  };
206
+
207
+ // Specifically testing that icons with a color inverse when active like the text does.
208
+ export const MenuWithIcons = (props) => {
209
+ return (
210
+ <Menu width="200px" {...props}>
211
+ <Menu.Item key="positive" onClick={() => alert("positive")}>
212
+ <Icon name="flat-positive-sentiment" mr={200} color="blue.600" />
213
+ Positive
214
+ </Menu.Item>
215
+ <Menu.Item key="negative" onClick={() => alert("negative")}>
216
+ <Icon name="flat-negative-sentiment" mr={200} color="red.500" />
217
+ Negative
218
+ </Menu.Item>
219
+ <Menu.Item key="neutral" onClick={() => alert("neutral")}>
220
+ <Icon name="flat-neutral-sentiment" mr={200} />
221
+ Neutral
222
+ </Menu.Item>
223
+ </Menu>
224
+ );
225
+ };
@@ -41,6 +41,10 @@ export const MenuItemContainer = styled<
41
41
  css`
42
42
  color: ${(props) => props.theme.colors.text.inverse};
43
43
  background-color: ${props.theme.colors.listItem.background.selected};
44
+
45
+ .Icon-svg {
46
+ color: ${(props) => props.theme.colors.text.inverse};
47
+ }
44
48
  `}
45
49
 
46
50
  ${(props) =>
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { DataVizRotation } from ".";
3
+
4
+ export default {
5
+ title: "Dataviz color rotation",
6
+ };
7
+
8
+ export const JSdataviz = () => <DataVizRotation />;
9
+
10
+ JSdataviz.story = {
11
+ name: "JS dataviz rotation",
12
+ };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import Box from "../Box";
3
+ import { withTheme } from "styled-components";
4
+
5
+ export const DataVizRotation = withTheme((p) => {
6
+ return p.theme.colors.DATAVIZ_COLORS_LIST.map((color, i) => {
7
+ return (
8
+ <Box key={color} py={300} px={400} bg={color}>
9
+ {i + 1}
10
+ </Box>
11
+ );
12
+ });
13
+ });
@@ -0,0 +1,50 @@
1
+ // @flow strict-local
2
+
3
+ import COLORS from "@sproutsocial/seeds-color";
4
+
5
+ export const datavizPalette = {
6
+ DATAVIZ_COLORS_LIST: [
7
+ COLORS.COLOR_TEAL_400,
8
+ COLORS.COLOR_PURPLE_400,
9
+ COLORS.COLOR_PINK_400,
10
+ COLORS.COLOR_YELLOW_500,
11
+ COLORS.COLOR_BLUE_400,
12
+ COLORS.COLOR_MAGENTA_400,
13
+ COLORS.COLOR_GREEN_400,
14
+ COLORS.COLOR_ORANGE_400,
15
+ COLORS.COLOR_RED_700,
16
+ COLORS.COLOR_TEAL_700,
17
+ COLORS.COLOR_PURPLE_700,
18
+ COLORS.COLOR_PINK_700,
19
+ COLORS.COLOR_YELLOW_800,
20
+ COLORS.COLOR_BLUE_700,
21
+ COLORS.COLOR_MAGENTA_700,
22
+ COLORS.COLOR_GREEN_700,
23
+ COLORS.COLOR_ORANGE_700,
24
+ COLORS.COLOR_RED_400,
25
+ COLORS.COLOR_GREEN_200,
26
+ COLORS.COLOR_YELLOW_200,
27
+ ],
28
+ DATAVIZ_COLORS_MAP: {
29
+ "1": COLORS.COLOR_TEAL_400,
30
+ "2": COLORS.COLOR_PURPLE_400,
31
+ "3": COLORS.COLOR_PINK_400,
32
+ "4": COLORS.COLOR_YELLOW_500,
33
+ "5": COLORS.COLOR_BLUE_400,
34
+ "6": COLORS.COLOR_MAGENTA_400,
35
+ "7": COLORS.COLOR_GREEN_400,
36
+ "8": COLORS.COLOR_ORANGE_400,
37
+ "9": COLORS.COLOR_RED_700,
38
+ "10": COLORS.COLOR_TEAL_700,
39
+ "11": COLORS.COLOR_PURPLE_700,
40
+ "12": COLORS.COLOR_PINK_700,
41
+ "13": COLORS.COLOR_YELLOW_800,
42
+ "14": COLORS.COLOR_BLUE_700,
43
+ "15": COLORS.COLOR_MAGENTA_700,
44
+ "16": COLORS.COLOR_GREEN_700,
45
+ "17": COLORS.COLOR_ORANGE_700,
46
+ "18": COLORS.COLOR_RED_400,
47
+ "19": COLORS.COLOR_GREEN_200,
48
+ "20": COLORS.COLOR_YELLOW_200,
49
+ },
50
+ };
@@ -2,6 +2,7 @@
2
2
 
3
3
  import COLORS from "@sproutsocial/seeds-color";
4
4
  import defaultTheme from "../default/theme";
5
+ import { datavizPalette } from "./dataviz-palette";
5
6
  import {
6
7
  green,
7
8
  blue,
@@ -188,6 +189,7 @@ const darkTheme = {
188
189
  selected: COLORS.COLOR_NEUTRAL_0,
189
190
  },
190
191
  },
192
+ ...datavizPalette,
191
193
  },
192
194
  mode: "dark",
193
195
  };
@@ -0,0 +1,50 @@
1
+ // @flow strict-local
2
+
3
+ import COLORS from "@sproutsocial/seeds-color";
4
+
5
+ export const datavizPalette = {
6
+ DATAVIZ_COLORS_LIST: [
7
+ COLORS.COLOR_TEAL_500,
8
+ COLORS.COLOR_PURPLE_700,
9
+ COLORS.COLOR_PINK_700,
10
+ COLORS.COLOR_YELLOW_500,
11
+ COLORS.COLOR_BLUE_500,
12
+ COLORS.COLOR_MAGENTA_500,
13
+ COLORS.COLOR_GREEN_500,
14
+ COLORS.COLOR_ORANGE_500,
15
+ COLORS.COLOR_RED_700,
16
+ COLORS.COLOR_TEAL_900,
17
+ COLORS.COLOR_PURPLE_400,
18
+ COLORS.COLOR_PINK_900,
19
+ COLORS.COLOR_YELLOW_900,
20
+ COLORS.COLOR_BLUE_900,
21
+ COLORS.COLOR_MAGENTA_900,
22
+ COLORS.COLOR_GREEN_900,
23
+ COLORS.COLOR_ORANGE_900,
24
+ COLORS.COLOR_RED_400,
25
+ COLORS.COLOR_GREEN_700,
26
+ COLORS.COLOR_YELLOW_800,
27
+ ],
28
+ DATAVIZ_COLORS_MAP: {
29
+ "1": COLORS.COLOR_TEAL_500,
30
+ "2": COLORS.COLOR_PURPLE_700,
31
+ "3": COLORS.COLOR_PINK_700,
32
+ "4": COLORS.COLOR_YELLOW_500,
33
+ "5": COLORS.COLOR_BLUE_500,
34
+ "6": COLORS.COLOR_MAGENTA_500,
35
+ "7": COLORS.COLOR_GREEN_500,
36
+ "8": COLORS.COLOR_ORANGE_500,
37
+ "9": COLORS.COLOR_RED_700,
38
+ "10": COLORS.COLOR_TEAL_900,
39
+ "11": COLORS.COLOR_PURPLE_400,
40
+ "12": COLORS.COLOR_PINK_900,
41
+ "13": COLORS.COLOR_YELLOW_900,
42
+ "14": COLORS.COLOR_BLUE_900,
43
+ "15": COLORS.COLOR_MAGENTA_900,
44
+ "16": COLORS.COLOR_GREEN_900,
45
+ "17": COLORS.COLOR_ORANGE_900,
46
+ "18": COLORS.COLOR_RED_400,
47
+ "19": COLORS.COLOR_GREEN_700,
48
+ "20": COLORS.COLOR_YELLOW_800,
49
+ },
50
+ };
@@ -2,6 +2,7 @@
2
2
 
3
3
  import COLORS from "@sproutsocial/seeds-color";
4
4
  import literalColors from "./literal-colors";
5
+ import { datavizPalette } from "./dataviz-palette";
5
6
  import {
6
7
  green,
7
8
  blue,
@@ -223,6 +224,7 @@ const colors = {
223
224
  tiktok: NETWORKCOLORS.NETWORK_COLOR_TIKTOK,
224
225
  },
225
226
  ...literalColors,
227
+ ...datavizPalette,
226
228
  };
227
229
 
228
230
  export const typography = {
@@ -118,6 +118,7 @@ var Panel = function Panel(_ref3) {
118
118
  }
119
119
  }, [isOpen]);
120
120
  return /*#__PURE__*/React.createElement(_styles.CollapsingBox, _extends({
121
+ hasShadow: collapsedHeight || openHeight > 0,
121
122
  scrollable: isOpen,
122
123
  maxHeight: isOpen ? maxHeight : collapsedHeight,
123
124
  minHeight: collapsedHeight,
@@ -12,16 +12,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  var CollapsingBox = (0, _styledComponents.default)(_Box.default).withConfig({
13
13
  displayName: "styles__CollapsingBox",
14
14
  componentId: "sc-1xvfbl7-0"
15
- })(["transition:max-height ", " ", ";will-change:max-height;position:relative;overflow:auto;background:linear-gradient( ", " 30%,rgba(255,255,255,0) ),linear-gradient( rgba(255,255,255,0),", " 70% ) 0 100%,radial-gradient( farthest-side at 50% 0,rgb(39 51 51 / 5%),rgba(0,0,0,0) ),radial-gradient( farthest-side at 50% 100%,rgb(39 51 51 / 5%),rgba(0,0,0,0) ) 0 100%;background-repeat:no-repeat;background-size:100% 40px,100% 40px,100% 14px,100% 14px;background-attachment:local,local,scroll,scroll;", ";"], function (p) {
15
+ })(["transition:max-height ", " ", ";will-change:max-height;position:relative;overflow:auto;", ""], function (p) {
16
16
  return p.theme.duration.medium;
17
17
  }, function (p) {
18
18
  return p.theme.easing.ease_inout;
19
- }, function (p) {
20
- return p.theme.colors.neutral[100];
21
- }, function (p) {
22
- return p.theme.colors.neutral[100];
23
19
  }, function (_ref) {
24
- var scrollable = _ref.scrollable;
25
- return scrollable ? "overflow: auto" : "overflow: hidden";
20
+ var hasShadow = _ref.hasShadow,
21
+ theme = _ref.theme,
22
+ scrollable = _ref.scrollable;
23
+ return hasShadow ? "background: /* Shadow covers */ linear-gradient(\n transparent 30%,\n rgba(255, 255, 255, 0)\n ),\n linear-gradient(rgba(255, 255, 255, 0), transparent 70%) 0 100%,\n /* Shadows */\n radial-gradient(\n farthest-side at 50% 0,\n rgb(39 51 51 / 5%),\n rgba(0, 0, 0, 0)\n ),\n radial-gradient(\n farthest-side at 50% 100%,\n rgb(39 51 51 / 5%),\n rgba(0, 0, 0, 0)\n )\n 0 100%;\n background-repeat: no-repeat;\n background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;\n background-attachment: local, local, scroll, scroll;\n " + (scrollable ? "overflow: auto" : "overflow: hidden") + ";" : "";
26
24
  });
27
25
  exports.CollapsingBox = CollapsingBox;
@@ -25,7 +25,8 @@ var MenuContext = /*#__PURE__*/(0, _react.createContext)({
25
25
  state: {
26
26
  selectionIndex: 0,
27
27
  filterQuery: "",
28
- filteredItems: null
28
+ filteredItems: null,
29
+ isFilterInputFocused: false
29
30
  },
30
31
  setState: function setState() {},
31
32
  selectCallbacks: {
@@ -75,7 +76,8 @@ function useMenuKeyDown() {
75
76
  _useContext$state = _useContext.state,
76
77
  filterQuery = _useContext$state.filterQuery,
77
78
  selectionIndex = _useContext$state.selectionIndex,
78
- filteredItems = _useContext$state.filteredItems;
79
+ filteredItems = _useContext$state.filteredItems,
80
+ isFilterInputFocused = _useContext$state.isFilterInputFocused;
79
81
 
80
82
  var _useContext2 = (0, _react.useContext)(MenuButtonContext),
81
83
  closePopout = _useContext2.closePopout,
@@ -134,8 +136,15 @@ function useMenuKeyDown() {
134
136
  var key = event.key;
135
137
 
136
138
  switch (key) {
137
- case "Enter":
138
139
  case " ":
140
+ if (isFilterInputFocused) {
141
+ return;
142
+ }
143
+
144
+ // falls through
145
+ // eslint-disable-next-line no-fallthrough
146
+
147
+ case "Enter":
139
148
  var selected = items[selectionIndex];
140
149
 
141
150
  if (selected) {
@@ -296,18 +296,37 @@ var MenuDivider = function MenuDivider(props) {
296
296
  exports.MenuDivider = MenuDivider;
297
297
 
298
298
  var MenuFilterInput = function MenuFilterInput(props) {
299
+ var onChange = props.onChange,
300
+ onFocus = props.onFocus,
301
+ onBlur = props.onBlur;
302
+
299
303
  var _useContext3 = (0, React.useContext)(_hooks2.MenuContext),
300
304
  state = _useContext3.state,
301
305
  setState = _useContext3.setState;
302
306
 
303
- var updateFilterQuery = (0, React.useCallback)(function (event) {
304
- return setState({
305
- filterQuery: event.currentTarget.value
307
+ var handleOnChange = (0, React.useCallback)(function (event, value) {
308
+ onChange && onChange(event, value);
309
+ setState({
310
+ filterQuery: value
311
+ });
312
+ }, [setState, onChange]);
313
+ var handleOnFocus = (0, React.useCallback)(function (event) {
314
+ onFocus && onFocus(event);
315
+ setState({
316
+ isFilterInputFocused: true
317
+ });
318
+ }, [setState, onFocus]);
319
+ var handleOnBlur = (0, React.useCallback)(function (event) {
320
+ onBlur && onBlur(event);
321
+ setState({
322
+ isFilterInputFocused: false
306
323
  });
307
- }, [setState]);
324
+ }, [setState, onBlur]);
308
325
  return /*#__PURE__*/React.createElement(_Input.default, _extends({}, props, {
309
326
  value: state.filterQuery,
310
- onChange: updateFilterQuery
327
+ onChange: handleOnChange,
328
+ onFocus: handleOnFocus,
329
+ onBlur: handleOnBlur
311
330
  }));
312
331
  };
313
332
 
@@ -353,7 +372,8 @@ var Menu = function Menu(_ref4) {
353
372
  var _useState = (0, React.useState)({
354
373
  selectionIndex: 0,
355
374
  filterQuery: "",
356
- filteredItems: null
375
+ filteredItems: null,
376
+ isFilterInputFocused: false
357
377
  }),
358
378
  state = _useState[0],
359
379
  setState = _useState[1];
@@ -35,9 +35,11 @@ var MenuItemContainer = (0, _styledComponents.default)(_Box.default).withConfig(
35
35
  }, function (props) {
36
36
  return (0, _styledComponents.css)(["", ";"], props.theme.typography[200]);
37
37
  }, function (props) {
38
- return props.active && !props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";"], function (props) {
38
+ return props.active && !props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";.Icon-svg{color:", ";}"], function (props) {
39
39
  return props.theme.colors.text.inverse;
40
- }, props.theme.colors.listItem.background.selected);
40
+ }, props.theme.colors.listItem.background.selected, function (props) {
41
+ return props.theme.colors.text.inverse;
42
+ });
41
43
  }, function (props) {
42
44
  return props.selected && !props.isCheckboxOrRadio && (0, _styledComponents.css)(["font-weight:", ";"], function (props) {
43
45
  return props.theme.fontWeights.semibold;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.DataVizRotation = void 0;
5
+
6
+ var _react = _interopRequireDefault(require("react"));
7
+
8
+ var _Box = _interopRequireDefault(require("../Box"));
9
+
10
+ var _styledComponents = require("styled-components");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var DataVizRotation = (0, _styledComponents.withTheme)(function (p) {
15
+ return p.theme.colors.DATAVIZ_COLORS_LIST.map(function (color, i) {
16
+ return /*#__PURE__*/_react.default.createElement(_Box.default, {
17
+ key: color,
18
+ py: 300,
19
+ px: 400,
20
+ bg: color
21
+ }, i + 1);
22
+ });
23
+ });
24
+ exports.DataVizRotation = DataVizRotation;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.datavizPalette = void 0;
5
+
6
+ var _seedsColor = _interopRequireDefault(require("@sproutsocial/seeds-color"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ var datavizPalette = {
11
+ DATAVIZ_COLORS_LIST: [_seedsColor.default.COLOR_TEAL_400, _seedsColor.default.COLOR_PURPLE_400, _seedsColor.default.COLOR_PINK_400, _seedsColor.default.COLOR_YELLOW_500, _seedsColor.default.COLOR_BLUE_400, _seedsColor.default.COLOR_MAGENTA_400, _seedsColor.default.COLOR_GREEN_400, _seedsColor.default.COLOR_ORANGE_400, _seedsColor.default.COLOR_RED_700, _seedsColor.default.COLOR_TEAL_700, _seedsColor.default.COLOR_PURPLE_700, _seedsColor.default.COLOR_PINK_700, _seedsColor.default.COLOR_YELLOW_800, _seedsColor.default.COLOR_BLUE_700, _seedsColor.default.COLOR_MAGENTA_700, _seedsColor.default.COLOR_GREEN_700, _seedsColor.default.COLOR_ORANGE_700, _seedsColor.default.COLOR_RED_400, _seedsColor.default.COLOR_GREEN_200, _seedsColor.default.COLOR_YELLOW_200],
12
+ DATAVIZ_COLORS_MAP: {
13
+ "1": _seedsColor.default.COLOR_TEAL_400,
14
+ "2": _seedsColor.default.COLOR_PURPLE_400,
15
+ "3": _seedsColor.default.COLOR_PINK_400,
16
+ "4": _seedsColor.default.COLOR_YELLOW_500,
17
+ "5": _seedsColor.default.COLOR_BLUE_400,
18
+ "6": _seedsColor.default.COLOR_MAGENTA_400,
19
+ "7": _seedsColor.default.COLOR_GREEN_400,
20
+ "8": _seedsColor.default.COLOR_ORANGE_400,
21
+ "9": _seedsColor.default.COLOR_RED_700,
22
+ "10": _seedsColor.default.COLOR_TEAL_700,
23
+ "11": _seedsColor.default.COLOR_PURPLE_700,
24
+ "12": _seedsColor.default.COLOR_PINK_700,
25
+ "13": _seedsColor.default.COLOR_YELLOW_800,
26
+ "14": _seedsColor.default.COLOR_BLUE_700,
27
+ "15": _seedsColor.default.COLOR_MAGENTA_700,
28
+ "16": _seedsColor.default.COLOR_GREEN_700,
29
+ "17": _seedsColor.default.COLOR_ORANGE_700,
30
+ "18": _seedsColor.default.COLOR_RED_400,
31
+ "19": _seedsColor.default.COLOR_GREEN_200,
32
+ "20": _seedsColor.default.COLOR_YELLOW_200
33
+ }
34
+ };
35
+ exports.datavizPalette = datavizPalette;
@@ -7,6 +7,8 @@ var _seedsColor = _interopRequireDefault(require("@sproutsocial/seeds-color"));
7
7
 
8
8
  var _theme = _interopRequireDefault(require("../default/theme"));
9
9
 
10
+ var _datavizPalette = require("./dataviz-palette");
11
+
10
12
  var _decorativePalettes = require("./decorative-palettes");
11
13
 
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -187,7 +189,7 @@ var darkTheme = _extends({}, _theme.default, {
187
189
  selected: _seedsColor.default.COLOR_NEUTRAL_0
188
190
  }
189
191
  }
190
- }),
192
+ }, _datavizPalette.datavizPalette),
191
193
  mode: "dark"
192
194
  });
193
195
 
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.datavizPalette = void 0;
5
+
6
+ var _seedsColor = _interopRequireDefault(require("@sproutsocial/seeds-color"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ var datavizPalette = {
11
+ DATAVIZ_COLORS_LIST: [_seedsColor.default.COLOR_TEAL_500, _seedsColor.default.COLOR_PURPLE_700, _seedsColor.default.COLOR_PINK_700, _seedsColor.default.COLOR_YELLOW_500, _seedsColor.default.COLOR_BLUE_500, _seedsColor.default.COLOR_MAGENTA_500, _seedsColor.default.COLOR_GREEN_500, _seedsColor.default.COLOR_ORANGE_500, _seedsColor.default.COLOR_RED_700, _seedsColor.default.COLOR_TEAL_900, _seedsColor.default.COLOR_PURPLE_400, _seedsColor.default.COLOR_PINK_900, _seedsColor.default.COLOR_YELLOW_900, _seedsColor.default.COLOR_BLUE_900, _seedsColor.default.COLOR_MAGENTA_900, _seedsColor.default.COLOR_GREEN_900, _seedsColor.default.COLOR_ORANGE_900, _seedsColor.default.COLOR_RED_400, _seedsColor.default.COLOR_GREEN_700, _seedsColor.default.COLOR_YELLOW_800],
12
+ DATAVIZ_COLORS_MAP: {
13
+ "1": _seedsColor.default.COLOR_TEAL_500,
14
+ "2": _seedsColor.default.COLOR_PURPLE_700,
15
+ "3": _seedsColor.default.COLOR_PINK_700,
16
+ "4": _seedsColor.default.COLOR_YELLOW_500,
17
+ "5": _seedsColor.default.COLOR_BLUE_500,
18
+ "6": _seedsColor.default.COLOR_MAGENTA_500,
19
+ "7": _seedsColor.default.COLOR_GREEN_500,
20
+ "8": _seedsColor.default.COLOR_ORANGE_500,
21
+ "9": _seedsColor.default.COLOR_RED_700,
22
+ "10": _seedsColor.default.COLOR_TEAL_900,
23
+ "11": _seedsColor.default.COLOR_PURPLE_400,
24
+ "12": _seedsColor.default.COLOR_PINK_900,
25
+ "13": _seedsColor.default.COLOR_YELLOW_900,
26
+ "14": _seedsColor.default.COLOR_BLUE_900,
27
+ "15": _seedsColor.default.COLOR_MAGENTA_900,
28
+ "16": _seedsColor.default.COLOR_GREEN_900,
29
+ "17": _seedsColor.default.COLOR_ORANGE_900,
30
+ "18": _seedsColor.default.COLOR_RED_400,
31
+ "19": _seedsColor.default.COLOR_GREEN_700,
32
+ "20": _seedsColor.default.COLOR_YELLOW_800
33
+ }
34
+ };
35
+ exports.datavizPalette = datavizPalette;
@@ -7,6 +7,8 @@ var _seedsColor = _interopRequireDefault(require("@sproutsocial/seeds-color"));
7
7
 
8
8
  var _literalColors = _interopRequireDefault(require("./literal-colors"));
9
9
 
10
+ var _datavizPalette = require("./dataviz-palette");
11
+
10
12
  var _decorativePalettes = require("./decorative-palettes");
11
13
 
12
14
  var _seedsNetworkcolor = _interopRequireDefault(require("@sproutsocial/seeds-networkcolor"));
@@ -228,7 +230,7 @@ var colors = _extends({
228
230
  whatsapp: _seedsNetworkcolor.default.NETWORK_COLOR_WHATSAPP,
229
231
  tiktok: _seedsNetworkcolor.default.NETWORK_COLOR_TIKTOK
230
232
  }
231
- }, _literalColors.default);
233
+ }, _literalColors.default, _datavizPalette.datavizPalette);
232
234
 
233
235
  var typography = {
234
236
  "100": _seedsTypography.default.TYPOGRAPHY_SIZE_100,
@@ -104,6 +104,7 @@ var Panel = function Panel(_ref3) {
104
104
  }
105
105
  }, [isOpen]);
106
106
  return /*#__PURE__*/React.createElement(CollapsingBox, _extends({
107
+ hasShadow: collapsedHeight || openHeight > 0,
107
108
  scrollable: isOpen,
108
109
  maxHeight: isOpen ? maxHeight : collapsedHeight,
109
110
  minHeight: collapsedHeight,
@@ -3,15 +3,13 @@ import Box from "../Box";
3
3
  export var CollapsingBox = styled(Box).withConfig({
4
4
  displayName: "styles__CollapsingBox",
5
5
  componentId: "sc-1xvfbl7-0"
6
- })(["transition:max-height ", " ", ";will-change:max-height;position:relative;overflow:auto;background:linear-gradient( ", " 30%,rgba(255,255,255,0) ),linear-gradient( rgba(255,255,255,0),", " 70% ) 0 100%,radial-gradient( farthest-side at 50% 0,rgb(39 51 51 / 5%),rgba(0,0,0,0) ),radial-gradient( farthest-side at 50% 100%,rgb(39 51 51 / 5%),rgba(0,0,0,0) ) 0 100%;background-repeat:no-repeat;background-size:100% 40px,100% 40px,100% 14px,100% 14px;background-attachment:local,local,scroll,scroll;", ";"], function (p) {
6
+ })(["transition:max-height ", " ", ";will-change:max-height;position:relative;overflow:auto;", ""], function (p) {
7
7
  return p.theme.duration.medium;
8
8
  }, function (p) {
9
9
  return p.theme.easing.ease_inout;
10
- }, function (p) {
11
- return p.theme.colors.neutral[100];
12
- }, function (p) {
13
- return p.theme.colors.neutral[100];
14
10
  }, function (_ref) {
15
- var scrollable = _ref.scrollable;
16
- return scrollable ? "overflow: auto" : "overflow: hidden";
11
+ var hasShadow = _ref.hasShadow,
12
+ theme = _ref.theme,
13
+ scrollable = _ref.scrollable;
14
+ return hasShadow ? "background: /* Shadow covers */ linear-gradient(\n transparent 30%,\n rgba(255, 255, 255, 0)\n ),\n linear-gradient(rgba(255, 255, 255, 0), transparent 70%) 0 100%,\n /* Shadows */\n radial-gradient(\n farthest-side at 50% 0,\n rgb(39 51 51 / 5%),\n rgba(0, 0, 0, 0)\n ),\n radial-gradient(\n farthest-side at 50% 100%,\n rgb(39 51 51 / 5%),\n rgba(0, 0, 0, 0)\n )\n 0 100%;\n background-repeat: no-repeat;\n background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;\n background-attachment: local, local, scroll, scroll;\n " + (scrollable ? "overflow: auto" : "overflow: hidden") + ";" : "";
17
15
  });
package/lib/Menu/hooks.js CHANGED
@@ -13,7 +13,8 @@ export var MenuContext = /*#__PURE__*/createContext({
13
13
  state: {
14
14
  selectionIndex: 0,
15
15
  filterQuery: "",
16
- filteredItems: null
16
+ filteredItems: null,
17
+ isFilterInputFocused: false
17
18
  },
18
19
  setState: function setState() {},
19
20
  selectCallbacks: {
@@ -59,7 +60,8 @@ export function useMenuKeyDown() {
59
60
  _useContext$state = _useContext.state,
60
61
  filterQuery = _useContext$state.filterQuery,
61
62
  selectionIndex = _useContext$state.selectionIndex,
62
- filteredItems = _useContext$state.filteredItems;
63
+ filteredItems = _useContext$state.filteredItems,
64
+ isFilterInputFocused = _useContext$state.isFilterInputFocused;
63
65
 
64
66
  var _useContext2 = useContext(MenuButtonContext),
65
67
  closePopout = _useContext2.closePopout,
@@ -118,8 +120,15 @@ export function useMenuKeyDown() {
118
120
  var key = event.key;
119
121
 
120
122
  switch (key) {
121
- case "Enter":
122
123
  case " ":
124
+ if (isFilterInputFocused) {
125
+ return;
126
+ }
127
+
128
+ // falls through
129
+ // eslint-disable-next-line no-fallthrough
130
+
131
+ case "Enter":
123
132
  var selected = items[selectionIndex];
124
133
 
125
134
  if (selected) {
package/lib/Menu/index.js CHANGED
@@ -258,18 +258,37 @@ export var MenuDivider = function MenuDivider(props) {
258
258
  };
259
259
 
260
260
  var MenuFilterInput = function MenuFilterInput(props) {
261
+ var onChange = props.onChange,
262
+ onFocus = props.onFocus,
263
+ onBlur = props.onBlur;
264
+
261
265
  var _useContext3 = useContext(MenuContext),
262
266
  state = _useContext3.state,
263
267
  setState = _useContext3.setState;
264
268
 
265
- var updateFilterQuery = useCallback(function (event) {
266
- return setState({
267
- filterQuery: event.currentTarget.value
269
+ var handleOnChange = useCallback(function (event, value) {
270
+ onChange && onChange(event, value);
271
+ setState({
272
+ filterQuery: value
273
+ });
274
+ }, [setState, onChange]);
275
+ var handleOnFocus = useCallback(function (event) {
276
+ onFocus && onFocus(event);
277
+ setState({
278
+ isFilterInputFocused: true
279
+ });
280
+ }, [setState, onFocus]);
281
+ var handleOnBlur = useCallback(function (event) {
282
+ onBlur && onBlur(event);
283
+ setState({
284
+ isFilterInputFocused: false
268
285
  });
269
- }, [setState]);
286
+ }, [setState, onBlur]);
270
287
  return /*#__PURE__*/React.createElement(Input, _extends({}, props, {
271
288
  value: state.filterQuery,
272
- onChange: updateFilterQuery
289
+ onChange: handleOnChange,
290
+ onFocus: handleOnFocus,
291
+ onBlur: handleOnBlur
273
292
  }));
274
293
  };
275
294
 
@@ -315,7 +334,8 @@ export var Menu = function Menu(_ref4) {
315
334
  var _useState = useState({
316
335
  selectionIndex: 0,
317
336
  filterQuery: "",
318
- filteredItems: null
337
+ filteredItems: null,
338
+ isFilterInputFocused: false
319
339
  }),
320
340
  state = _useState[0],
321
341
  setState = _useState[1];
@@ -21,9 +21,11 @@ export var MenuItemContainer = styled(Box).withConfig({
21
21
  }, function (props) {
22
22
  return css(["", ";"], props.theme.typography[200]);
23
23
  }, function (props) {
24
- return props.active && !props.disabled && css(["color:", ";background-color:", ";"], function (props) {
24
+ return props.active && !props.disabled && css(["color:", ";background-color:", ";.Icon-svg{color:", ";}"], function (props) {
25
25
  return props.theme.colors.text.inverse;
26
- }, props.theme.colors.listItem.background.selected);
26
+ }, props.theme.colors.listItem.background.selected, function (props) {
27
+ return props.theme.colors.text.inverse;
28
+ });
27
29
  }, function (props) {
28
30
  return props.selected && !props.isCheckboxOrRadio && css(["font-weight:", ";"], function (props) {
29
31
  return props.theme.fontWeights.semibold;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import Box from "../Box";
3
+ import { withTheme } from "styled-components";
4
+ export var DataVizRotation = withTheme(function (p) {
5
+ return p.theme.colors.DATAVIZ_COLORS_LIST.map(function (color, i) {
6
+ return /*#__PURE__*/React.createElement(Box, {
7
+ key: color,
8
+ py: 300,
9
+ px: 400,
10
+ bg: color
11
+ }, i + 1);
12
+ });
13
+ });
@@ -0,0 +1,26 @@
1
+ import COLORS from "@sproutsocial/seeds-color";
2
+ export var datavizPalette = {
3
+ DATAVIZ_COLORS_LIST: [COLORS.COLOR_TEAL_400, COLORS.COLOR_PURPLE_400, COLORS.COLOR_PINK_400, COLORS.COLOR_YELLOW_500, COLORS.COLOR_BLUE_400, COLORS.COLOR_MAGENTA_400, COLORS.COLOR_GREEN_400, COLORS.COLOR_ORANGE_400, COLORS.COLOR_RED_700, COLORS.COLOR_TEAL_700, COLORS.COLOR_PURPLE_700, COLORS.COLOR_PINK_700, COLORS.COLOR_YELLOW_800, COLORS.COLOR_BLUE_700, COLORS.COLOR_MAGENTA_700, COLORS.COLOR_GREEN_700, COLORS.COLOR_ORANGE_700, COLORS.COLOR_RED_400, COLORS.COLOR_GREEN_200, COLORS.COLOR_YELLOW_200],
4
+ DATAVIZ_COLORS_MAP: {
5
+ "1": COLORS.COLOR_TEAL_400,
6
+ "2": COLORS.COLOR_PURPLE_400,
7
+ "3": COLORS.COLOR_PINK_400,
8
+ "4": COLORS.COLOR_YELLOW_500,
9
+ "5": COLORS.COLOR_BLUE_400,
10
+ "6": COLORS.COLOR_MAGENTA_400,
11
+ "7": COLORS.COLOR_GREEN_400,
12
+ "8": COLORS.COLOR_ORANGE_400,
13
+ "9": COLORS.COLOR_RED_700,
14
+ "10": COLORS.COLOR_TEAL_700,
15
+ "11": COLORS.COLOR_PURPLE_700,
16
+ "12": COLORS.COLOR_PINK_700,
17
+ "13": COLORS.COLOR_YELLOW_800,
18
+ "14": COLORS.COLOR_BLUE_700,
19
+ "15": COLORS.COLOR_MAGENTA_700,
20
+ "16": COLORS.COLOR_GREEN_700,
21
+ "17": COLORS.COLOR_ORANGE_700,
22
+ "18": COLORS.COLOR_RED_400,
23
+ "19": COLORS.COLOR_GREEN_200,
24
+ "20": COLORS.COLOR_YELLOW_200
25
+ }
26
+ };