@sproutsocial/racine 7.0.0-beta.0 → 7.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/__flow__/Banner/index.stories.js +16 -0
  3. package/__flow__/Banner/styles.js +2 -0
  4. package/__flow__/Box/styles.js +5 -5
  5. package/__flow__/Button/__snapshots__/index.test.js.snap +0 -6
  6. package/__flow__/ChartLegend/styles.js +6 -6
  7. package/__flow__/Checkbox/index.js +2 -2
  8. package/__flow__/Checkbox/styles.js +3 -8
  9. package/__flow__/Collapsible/index.js +6 -1
  10. package/__flow__/EnumIconNames.js +1 -1
  11. package/__flow__/IconViewBoxes.js +1 -1
  12. package/__flow__/Link/styles.js +2 -1
  13. package/__flow__/Listbox/__snapshots__/index.test.js.snap +0 -2
  14. package/__flow__/Toast/index.js +5 -7
  15. package/__flow__/Toast/styles.js +6 -3
  16. package/__flow__/themes/dark.js +2 -2
  17. package/__flow__/utils/theme.js +3 -2
  18. package/commonjs/Banner/styles.js +1 -1
  19. package/commonjs/Checkbox/index.js +1 -1
  20. package/commonjs/Checkbox/styles.js +7 -7
  21. package/commonjs/Collapsible/index.js +11 -1
  22. package/commonjs/IconViewBoxes.js +3 -0
  23. package/commonjs/Link/styles.js +2 -2
  24. package/commonjs/Toast/index.js +5 -9
  25. package/commonjs/Toast/styles.js +11 -2
  26. package/commonjs/include-icons.js +1 -1
  27. package/commonjs/themes/dark.js +2 -2
  28. package/commonjs/utils/theme.js +4 -3
  29. package/dist/iconList.js +1 -1
  30. package/dist/icons.svg +1 -1
  31. package/icons/stories.svg +3 -0
  32. package/icons/yelp-full-star.svg +3 -0
  33. package/icons/yelp-half-star.svg +4 -0
  34. package/includeIcons.js +1 -1
  35. package/lib/Banner/styles.js +1 -1
  36. package/lib/Checkbox/index.js +2 -2
  37. package/lib/Checkbox/styles.js +5 -5
  38. package/lib/Collapsible/index.js +11 -1
  39. package/lib/IconViewBoxes.js +3 -0
  40. package/lib/Link/styles.js +3 -3
  41. package/lib/Toast/index.js +6 -11
  42. package/lib/Toast/styles.js +9 -2
  43. package/lib/include-icons.js +1 -1
  44. package/lib/themes/dark.js +2 -2
  45. package/lib/utils/theme.js +4 -3
  46. package/package.json +2 -2
  47. package/__flow__/.DS_Store +0 -0
  48. package/__flow__/@doug/index.stories.js +0 -6
@@ -4,6 +4,6 @@ var Container = styled.div.withConfig({
4
4
  displayName: "styles__Container",
5
5
  componentId: "q43dr4-0"
6
6
  })(function (props) {
7
- return css(["display:flex;overflow:hidden;align-items:center;justify-content:space-between;color:", ";border-radius:", ";font-family:", ";", " padding:", ";border:1px solid ", ";background-color:", ";.Icon{margin-right:", ";min-width:16px;color:", ";}a,button{font-weight:", ";color:", ";font-size:inherit;text-decoration:underline;}> span:not(.Icon){display:block;}", " ", ""], props.theme.colors.text.headline, props.theme.radii.outer, props.theme.fontFamily, props.theme.typography[200], props.theme.space[300], props.theme.colors[props.type].border, props.theme.colors[props.type].background, props.theme.space[400], props.theme.colors[props.type].icon, props.theme.fontWeights.semibold, props.theme.colors.text.headline, COMMON, LAYOUT);
7
+ return css(["display:flex;overflow:hidden;align-items:center;justify-content:space-between;color:", ";border-radius:", ";font-family:", ";", " padding:", ";border:1px solid ", ";background-color:", ";.Icon{align-self:flex-start;margin-top:3px;margin-right:", ";min-width:16px;color:", ";}a,button{font-weight:", ";color:", ";font-size:inherit;text-decoration:underline;}> span:not(.Icon){display:block;}", " ", ""], props.theme.colors.text.headline, props.theme.radii.outer, props.theme.fontFamily, props.theme.typography[200], props.theme.space[300], props.theme.colors[props.type].border, props.theme.colors[props.type].background, props.theme.space[400], props.theme.colors[props.type].icon, props.theme.fontWeights.semibold, props.theme.colors.text.headline, COMMON, LAYOUT);
8
8
  });
9
9
  export default Container;
@@ -7,7 +7,7 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
7
7
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
8
8
 
9
9
  import * as React from "react";
10
- import Container, { CheckboxBox, CheckIcon, Input, InputWrapper, LabelText, CheckboxContainer } from "./styles";
10
+ import Container, { CheckboxBox, CheckIcon, PillInput, InputWrapper, LabelText, CheckboxContainer } from "./styles";
11
11
 
12
12
  var Checkbox = /*#__PURE__*/function (_React$Component) {
13
13
  _inheritsLoose(Checkbox, _React$Component);
@@ -100,7 +100,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
100
100
  as: label && "label"
101
101
  }, rest), /*#__PURE__*/React.createElement(InputWrapper, {
102
102
  appearance: appearance
103
- }, /*#__PURE__*/React.createElement(Input, _extends({
103
+ }, /*#__PURE__*/React.createElement(PillInput, _extends({
104
104
  type: "checkbox",
105
105
  id: id,
106
106
  "aria-label": ariaLabel,
@@ -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
- }, pill, props.theme.colors.background.app, Input, pill);
25
+ }, pill, props.theme.colors.background.app, PillInput, pill);
26
26
  });
27
27
  InputWrapper.displayName = "InputWrapper";
28
28
  export var CheckboxBox = styled.div.withConfig({
@@ -55,13 +55,13 @@ export var CheckIcon = styled(Icon).withConfig({
55
55
  return props.theme.easing.ease_inout;
56
56
  });
57
57
  CheckIcon.displayName = "CheckIcon";
58
- export var Input = styled.input.withConfig({
59
- displayName: "styles__Input",
58
+ export var PillInput = styled.input.withConfig({
59
+ displayName: "styles__PillInput",
60
60
  componentId: "sc-59uw8o-4"
61
61
  })(["position:absolute;top:0;left:0;width:100%;height:100%;margin:0;appearance:none;cursor:", ";border-radius:4px;&::-ms-check{display:none;}&:focus{", "}", " ", " ", ""], function (props) {
62
62
  return props.disabled ? "not-allowed" : "pointer";
63
63
  }, focusRing, function (props) {
64
- return !props.checked && css(["&:hover,&:focus{~ ", "{border-color:", ";background-color:", ";}~ ", " ", "{opacity:", ";color:", ";}}"], CheckboxBox, props.theme.colors.forms.hoverBorderColor, props.theme.colors.background.container, CheckboxBox, CheckIcon, function (props) {
64
+ return !props.checked && css(["&:hover,&:focus{~ ", " ", "{opacity:", ";color:", ";}}"], CheckboxBox, CheckIcon, function (props) {
65
65
  return props.disabled ? 0 : 1;
66
66
  }, props.theme.colors.forms.borderColor);
67
67
  }, function (props) {
@@ -69,7 +69,7 @@ export var Input = styled.input.withConfig({
69
69
  }, function (props) {
70
70
  return props.disabled && css(["~ ", "{opacity:0.4;}~ ", " ", "{opacity:", ";}"], CheckboxBox, CheckboxBox, CheckIcon, props.checked ? 1 : 0);
71
71
  });
72
- Input.displayName = "Input";
72
+ PillInput.displayName = "PillInput";
73
73
  export var LabelText = styled(Text).withConfig({
74
74
  displayName: "styles__LabelText",
75
75
  componentId: "sc-59uw8o-5"
@@ -75,7 +75,17 @@ var Panel = function Panel(_ref3) {
75
75
  return clearTimeout(timeoutID);
76
76
  };
77
77
  } else {
78
- setIsHidden(!isOpen);
78
+ // Similar to the close animation, we need to delay setting hidden to run slightly async.
79
+ // An issue occurs with the initial render isHidden logic that causes the animation to occur sporadically.
80
+ // using this 0 second timeout just allows this component to initially render with an undefined max height,
81
+ // Then go directly from undefined to the full max height, without a brief 0 value that triggers an animation
82
+ var _timeoutID = setTimeout(function () {
83
+ return setIsHidden(!isOpen);
84
+ }, 0);
85
+
86
+ return function () {
87
+ return clearTimeout(_timeoutID);
88
+ };
79
89
  }
80
90
  }, [isOpen]);
81
91
  return /*#__PURE__*/React.createElement(CollapsingBox, _extends({
@@ -287,6 +287,7 @@ module.exports = {
287
287
  "star": "0 0 18 16",
288
288
  "sticky-note-outline": "0 0 16 16",
289
289
  "sticky-note": "0 0 16 16",
290
+ "stories": "0 0 16 17",
290
291
  "story": "0 0 16 16",
291
292
  "suggestions": "0 0 11 16",
292
293
  "sun": "0 0 16 16",
@@ -333,6 +334,8 @@ module.exports = {
333
334
  "window-regular": "0 0 16 16",
334
335
  "window-restore": "0 0 16 16",
335
336
  "x": "0 0 16 18",
337
+ "yelp-full-star": "0 0 16 16",
338
+ "yelp-half-star": "0 0 16 16",
336
339
  "yelp": "0 0 14 16",
337
340
  "youtube": "0 0 16 15",
338
341
  "zendesk": "0 0 16 16"
@@ -1,11 +1,11 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import { focusRing, disabled } from "../utils/mixins";
3
3
  import Text from "../Text";
4
- import { TYPOGRAPHY } from "../utils/system-props";
4
+ import { TYPOGRAPHY, COMMON } from "../utils/system-props";
5
5
  var Container = styled(Text).withConfig({
6
6
  displayName: "styles__Container",
7
7
  componentId: "adcw4a-0"
8
- })(["border:0;font-family:", ";transition:all ", " ", ";text-decoration:none;appearance:none;cursor:pointer;", " font-weight:", ";color:", ";&:hover{color:", ";text-decoration:underline;}&:active{color:", ";}&:focus{", "}&:focus:active{box-shadow:none;}", " ", " ", ""], function (props) {
8
+ })(["border:0;font-family:", ";transition:all ", " ", ";text-decoration:none;appearance:none;cursor:pointer;", " font-weight:", ";color:", ";&:hover{color:", ";text-decoration:underline;}&:active{color:", ";}&:focus{", "}&:focus:active{box-shadow:none;}", " ", " ", " ", ""], function (props) {
9
9
  return props.theme.fontFamily;
10
10
  }, function (props) {
11
11
  return props.theme.duration.fast;
@@ -25,5 +25,5 @@ var Container = styled(Text).withConfig({
25
25
  return !props.href && css(["background:none;"]);
26
26
  }, function (props) {
27
27
  return props.disabled && disabled;
28
- }, TYPOGRAPHY);
28
+ }, COMMON, TYPOGRAPHY);
29
29
  export default Container;
@@ -1,11 +1,10 @@
1
- import _styled3 from "styled-components";
2
1
  import _styled2 from "styled-components";
3
2
  import _styled from "styled-components";
4
3
 
5
4
  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); }
6
5
 
7
6
  import * as React from "react";
8
- import Container, { GlobalToastStyles } from "./styles";
7
+ import Container, { GlobalToastStyles, CustomIcon } from "./styles";
9
8
  import { toast as toastifyToast, ToastContainer as BaseToastContainer, cssTransition } from "react-toastify";
10
9
  import { MOTION_DURATION_MEDIUM, MOTION_DURATION_SLOW } from "@sproutsocial/seeds-motion/dist/seeds-motion-unitless";
11
10
  import Icon from "../Icon";
@@ -79,14 +78,9 @@ var IconBox = function IconBox(props) {
79
78
  }));
80
79
  };
81
80
 
82
- var _StyledIcon = _styled(Icon).withConfig({
83
- displayName: "Toast___StyledIcon",
84
- componentId: "sc-1vii3dq-1"
85
- })(["transform:translateY(4px);"]);
86
-
87
81
  var _StyledBox2 = _styled(Box).withConfig({
88
82
  displayName: "Toast___StyledBox2",
89
- componentId: "sc-1vii3dq-2"
83
+ componentId: "sc-1vii3dq-1"
90
84
  })(["transform:translateY(1px);"]);
91
85
 
92
86
  var Toast = function Toast(_ref) {
@@ -107,10 +101,11 @@ var Toast = function Toast(_ref) {
107
101
  alignItems: "flex-start",
108
102
  m: "auto",
109
103
  width: 1
110
- }, /*#__PURE__*/React.createElement(IconBox, null, /*#__PURE__*/React.createElement(_StyledIcon, {
111
- name: theme ? themeIcon[theme] : icon || themeIcon["info"],
104
+ }, /*#__PURE__*/React.createElement(IconBox, null, /*#__PURE__*/React.createElement(CustomIcon, {
105
+ type: theme || "info",
112
106
  color: color,
113
- mr: 400,
107
+ customColor: color,
108
+ name: theme ? themeIcon[theme] : icon || themeIcon["info"],
114
109
  fixedWidth: true
115
110
  })), /*#__PURE__*/React.createElement(_StyledBox2, {
116
111
  flex: 1
@@ -3,13 +3,14 @@ var _templateObject;
3
3
  function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
4
4
 
5
5
  import styled, { createGlobalStyle } from "styled-components";
6
- import Box from "../Box"; // $FlowIssue
6
+ import Box from "../Box";
7
+ import Icon from "../Icon"; // $FlowIssue
7
8
 
8
9
  import toastStyles from "!!raw-loader!react-toastify/dist/ReactToastify.css";
9
10
  var Container = styled(Box).withConfig({
10
11
  displayName: "styles__Container",
11
12
  componentId: "wp5x29-0"
12
- })(["display:flex;align-items:center;font-family:", ";", " position:relative;background:", ";border-left:2px solid ", ";.Icon{color:", ";}"], function (p) {
13
+ })(["display:flex;align-items:center;font-family:", ";", " position:relative;background:", ";border-left:2px solid ", ";"], function (p) {
13
14
  return p.theme.fontFamily;
14
15
  }, function (p) {
15
16
  return p.theme.typography[200];
@@ -17,6 +18,12 @@ var Container = styled(Box).withConfig({
17
18
  return p.theme.colors.background.container;
18
19
  }, function (p) {
19
20
  return p.theme.colors[p.type].border;
21
+ });
22
+ export var CustomIcon = styled(Icon).withConfig({
23
+ displayName: "styles__CustomIcon",
24
+ componentId: "wp5x29-1"
25
+ })(["margin-right:", ";transform:translateY(4px);color:", ";"], function (props) {
26
+ return props.theme.space[400];
20
27
  }, function (p) {
21
28
  return p.customColor ? undefined : p.theme.colors[p.type].icon;
22
29
  });