@sproutsocial/racine 11.3.0-beta.1 → 11.3.1-beta-deps.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 (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/__flow__/Badge/constants.js +48 -0
  3. package/__flow__/Badge/index.js +60 -33
  4. package/__flow__/Badge/index.stories.js +35 -42
  5. package/__flow__/Badge/index.test.js +34 -32
  6. package/__flow__/Badge/styles.js +22 -42
  7. package/__flow__/Button/index.js +1 -0
  8. package/__flow__/Button/index.stories.js +51 -67
  9. package/__flow__/EmptyState/index.test.js +1 -1
  10. package/__flow__/Input/index.js +67 -116
  11. package/__flow__/Input/index.stories.js +0 -33
  12. package/__flow__/Input/index.test.js +1 -199
  13. package/__flow__/Input/styles.js +1 -1
  14. package/__flow__/Menu/__snapshots__/index.test.js.snap +3 -3
  15. package/__flow__/setupTests.js +1 -1
  16. package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +0 -14
  17. package/__flow__/systemProps/tests/layout.test.js +0 -9
  18. package/__flow__/themes/extendedThemes/README.md +6 -0
  19. package/commonjs/Badge/constants.js +43 -0
  20. package/commonjs/Badge/index.js +41 -39
  21. package/commonjs/Badge/styles.js +15 -31
  22. package/commonjs/Button/index.js +1 -0
  23. package/commonjs/DatePicker/styles.js +5 -1
  24. package/commonjs/Input/index.js +30 -66
  25. package/commonjs/Input/styles.js +1 -1
  26. package/commonjs/Menu/index.js +10 -10
  27. package/commonjs/Modal/styles.js +5 -1
  28. package/commonjs/Toast/index.js +14 -14
  29. package/commonjs/Toast/styles.js +5 -2
  30. package/lib/Badge/constants.js +38 -0
  31. package/lib/Badge/index.js +38 -39
  32. package/lib/Badge/styles.js +12 -27
  33. package/lib/Button/index.js +1 -0
  34. package/lib/DatePicker/styles.js +5 -1
  35. package/lib/Input/index.js +29 -59
  36. package/lib/Input/styles.js +1 -1
  37. package/lib/Menu/index.js +11 -10
  38. package/lib/Modal/styles.js +5 -1
  39. package/lib/Toast/index.js +14 -14
  40. package/lib/Toast/styles.js +5 -1
  41. package/package.json +25 -21
  42. package/__flow__/Button/__snapshots__/index.test.js.snap +0 -511
  43. package/__flow__/Button/index.test.js +0 -113
@@ -5,9 +5,13 @@ exports.default = void 0;
5
5
 
6
6
  var React = _interopRequireWildcard(require("react"));
7
7
 
8
+ var _Icon = _interopRequireDefault(require("../Icon"));
9
+
8
10
  var _styles = _interopRequireDefault(require("./styles"));
9
11
 
10
- var _excluded = ["size", "type", "tip", "text"];
12
+ var _Box = _interopRequireDefault(require("../Box"));
13
+
14
+ var _excluded = ["children", "text", "iconName", "type", "tip", "size", "badgeColor"];
11
15
 
12
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
17
 
@@ -19,43 +23,41 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
19
23
 
20
24
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
25
 
22
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
23
-
24
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
-
26
- var Badge = /*#__PURE__*/function (_React$Component) {
27
- _inheritsLoose(Badge, _React$Component);
28
-
29
- function Badge() {
30
- return _React$Component.apply(this, arguments) || this;
26
+ var Badge = function Badge(_ref) {
27
+ var children = _ref.children,
28
+ text = _ref.text,
29
+ iconName = _ref.iconName,
30
+ type = _ref.type,
31
+ tip = _ref.tip,
32
+ _ref$size = _ref.size,
33
+ size = _ref$size === void 0 ? "small" : _ref$size,
34
+ _ref$badgeColor = _ref.badgeColor,
35
+ badgeColor = _ref$badgeColor === void 0 ? "blue" : _ref$badgeColor,
36
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
37
+
38
+ if (children && text) {
39
+ throw new Error("can't use both `children` and `text` props. Text is deprecated, consider using children.");
31
40
  }
32
41
 
33
- var _proto = Badge.prototype;
34
-
35
- _proto.render = function render() {
36
- var _this$props = this.props,
37
- size = _this$props.size,
38
- type = _this$props.type,
39
- tip = _this$props.tip,
40
- text = _this$props.text,
41
- rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
42
-
43
- return /*#__PURE__*/React.createElement(_styles.default, _extends({
44
- type: type,
45
- small: size === "small",
46
- "data-tip": tip,
47
- "data-qa-badge": text || "",
48
- "data-qa-badge-type": type,
49
- "data-qa-badge-tip": tip || "" // $FlowIssue - upgrade v0.112.0
50
-
51
- }, rest), text);
52
- };
53
-
54
- return Badge;
55
- }(React.Component);
56
-
57
- exports.default = Badge;
58
- Badge.defaultProps = {
59
- type: "primary",
60
- size: "default"
61
- };
42
+ return /*#__PURE__*/React.createElement(_styles.default, _extends({}, rest, {
43
+ // size previously included default, which currently maps to small. Once consumers have updated this can be simplified.
44
+ size: size === "default" ? "large" : size,
45
+ badgeColor: badgeColor,
46
+ "data-tip": tip,
47
+ "data-qa-badge": text || "",
48
+ "data-qa-badge-type": type,
49
+ "data-qa-badge-tip": tip || "",
50
+ type: type && type
51
+ }), /*#__PURE__*/React.createElement(_Box.default, {
52
+ display: "flex",
53
+ alignItems: "center",
54
+ JustifyContent: "center"
55
+ }, iconName ? /*#__PURE__*/React.createElement(_Icon.default, {
56
+ mr: 200,
57
+ name: iconName,
58
+ size: size === "small" ? "mini" : "default"
59
+ }) : null, children || text));
60
+ };
61
+
62
+ var _default = Badge;
63
+ exports.default = _default;
@@ -3,46 +3,30 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
6
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
7
7
 
8
8
  var _systemProps = require("../utils/system-props");
9
9
 
10
10
  var _themeGet = require("@styled-system/theme-get");
11
11
 
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
-
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
-
16
- var colors = {
17
- primary: "colors.neutral.0",
18
- secondary: "colors.neutral.800",
19
- passive: "colors.neutral.800",
20
- common: "colors.neutral.0",
21
- approval: "colors.neutral.800",
22
- default: "colors.neutral.0",
23
- suggestion: "colors.neutral.900"
24
- };
25
- var backgroundColors = {
26
- primary: "colors.blue.700",
27
- secondary: "colors.yellow.500",
28
- passive: "colors.neutral.200",
29
- common: "colors.aqua.600",
30
- approval: "colors.orange.300",
31
- default: "colors.purple.700",
32
- suggestion: "colors.blue.300"
33
- }; // eslint-disable-next-line prettier/prettier
12
+ var _constants = require("./constants");
34
13
 
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ // eslint-disable-next-line prettier/prettier
35
17
  var Container = _styledComponents.default.span.withConfig({
36
18
  displayName: "styles__Container",
37
19
  componentId: "sc-g1g76b-0"
38
- })(["display:inline-block;text-align:center;border-radius:50px;font-family:", ";padding:", ";", " ", " ", ""], function (props) {
39
- return props.theme.fontFamily;
40
- }, function (props) {
41
- return props.small ? props.theme.space[200] + " " + props.theme.space[300] : props.theme.space[300] + " " + props.theme.space[350];
42
- }, function (props) {
43
- return props.small ? props.theme.typography[100] : props.theme.typography[200];
44
- }, function (props) {
45
- return (0, _styledComponents.css)(["color:", ";background:", ";"], (0, _themeGet.themeGet)(colors[props.type])(props), (0, _themeGet.themeGet)(backgroundColors[props.type])(props));
20
+ })(["font-family:", ";", ";border-radius:9999px;line-height:16px;display:inline-block;color:", ";background:", ";padding:", ";", ";"], function (p) {
21
+ return p.theme.fontFamily;
22
+ }, function (p) {
23
+ return p.size === "small" ? p.theme.typography[100] : p.theme.typography[200];
24
+ }, function (p) {
25
+ return p.type ? (0, _themeGet.themeGet)(_constants.legacyBadgeColors[p.type].color) : p.theme.colors.text.body;
26
+ }, function (p) {
27
+ return p.type ? (0, _themeGet.themeGet)(_constants.legacyBadgeColors[p.type].background) : p.theme.colors.container.background.decorative[p.badgeColor];
28
+ }, function (p) {
29
+ return p.size === "small" ? p.theme.space[0] + " " + p.theme.space[200] : "" + p.theme.space[300];
46
30
  }, _systemProps.COMMON);
47
31
 
48
32
  var _default = Container;
@@ -46,6 +46,7 @@ var Button = function Button(_ref) {
46
46
 
47
47
  var appearanceCheck = appearance === "default" ? "unstyled" : appearance;
48
48
  return /*#__PURE__*/React.createElement(_styles.default, _extends({
49
+ className: "container",
49
50
  title: title,
50
51
  active: active,
51
52
  href: href,
@@ -11,12 +11,16 @@ var _Box = _interopRequireDefault(require("../Box"));
11
11
 
12
12
  var _mixins = require("../utils/mixins");
13
13
 
14
+ var _templateObject;
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
19
 
18
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
21
 
22
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
23
+
20
24
  /*
21
25
  * Partial list of modifiers given to renderDayContents by airbnb/react-dates. There may be more.
22
26
  *
@@ -83,7 +87,7 @@ var CalendarDay = (0, _styledComponents.default)(_Box.default).withConfig({
83
87
  }
84
88
  });
85
89
  exports.CalendarDay = CalendarDay;
86
- var ReactDatesCssOverrides = (0, _styledComponents.createGlobalStyle)([".DayPicker{box-sizing:content-box;font-weight:", ";font-family:", ";&_transitionContainer{height:228px !important;}&_weekHeader{color:", ";border-bottom:1px solid ", ";top:26px;width:230px;&_ul{padding-left:10px;}}&_weekHeaders__horizontal{margin-left:0}&_weekHeader_li{", " color:", ";font-weight:", ";margin:0;}&__horizontal{box-shadow:none;background:", ";}}.CalendarDay{background-color:transparent;&__selected,&__selected_span,&:hover{background-color:transparent;}&__default{color:", ";}&__default,&__default:hover{border:none;color:", ";}}.CalendarMonth{", " background:", ";padding:0 15px;&_caption{", " color:", ";padding-top:0;background:", ";strong{font-weight:", ";}}&_table{line-height:21.333px;tr{vertical-align:middle;}td{padding:0;border-bottom:none;}}}.CalendarMonthGrid{background:", ";}.DayPickerNavigation_button__horizontal{color:", ";top:-4px;padding:7px 8px;position:absolute;line-height:0.78;border-radius:9999px;border:none;background:", ";&:nth-child(1){left:22px;}&:nth-child(2){right:22px;}&:hover{background:", ";}}"], function (_ref2) {
90
+ var ReactDatesCssOverrides = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\t.DayPicker {\n\t\tbox-sizing: content-box;\n\t\tfont-weight: ", ";\n\t\tfont-family: ", ";\n\n\t\t/* override react-dates height to better reflect how tall the component actually is */\n\t\t/* adding margin/padding will be more truer to our seeds system because the height */\n\t\t/* of the calendar adds an extra row of padding if we do not override it */\n\t\t&_transitionContainer {\n\t\t\t/* need !important because react-dates sets height on the element itself */\n\t\t\theight: 228px !important;\n\t\t}\n\n\t\t&_weekHeader {\n\t\t\tcolor: ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n \t\t\t/* Magic number to match position of .CalendarMonth_caption */\n\t\t\ttop: 26px;\n\n\t\t\t/* Magic number to make the bottom border line stretch the full width */\n\t\t\twidth: 230px;\n\n\t\t\t&_ul {\n \t\t\t\t/* Magic number to line up day name headings over the correct numbers */\n\t\t\t\tpadding-left: 10px;\n\t\t\t}\n\t\t}\n\n\t\t&_weekHeaders__horizontal {\n\t\t\tmargin-left: 0\n\t\t}\n\n\t\t&_weekHeader_li {\n\t\t\t", "\n\t\t\tcolor: ", ";\n\t\t\tfont-weight: ", ";\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t&__horizontal {\n\t\t\tbox-shadow: none;\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n\n .CalendarDay {\n\t\tbackground-color: transparent;\n\n &__selected, &__selected_span, &:hover {\n background-color: transparent;\n\t\t}\n\n\t\t&__default {\n\t\t\tcolor: ", ";\n\t\t}\n\t\t&__default,\n\t\t&__default:hover {\n\t\t\tborder: none;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n\n .CalendarMonth {\n\t\t", "\n\t\tbackground: ", ";\n\n \t\t/* spacing between visible months and months off canvas */\n\t\tpadding: 0 15px;\n\n\t\t&_caption {\n\t\t\t", "\n\t\t\tcolor: ", ";\n\t\t\tpadding-top: 0;\n\t\t\tbackground: ", ";\n\n\t\t\tstrong {\n\t\t\t\tfont-weight: ", ";\n\t\t\t}\n\n\t\t}\n\t\t&_table {\n\t\t\tline-height: 21.333px;\n\t\t\ttr {\n\t\t\t\tvertical-align: middle;\n\t\t\t}\n\t\t\ttd {\n\t\t\t\tpadding: 0;\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t.CalendarMonthGrid {\n\t\tbackground: ", ";\n\t}\n\n\t/* Left and Right Arrow Buttons to navigate months */\n\t.DayPickerNavigation_button__horizontal {\n\t\tcolor: ", ";\n\t\ttop: -4px;\n\t\tpadding: 7px 8px;\n\t\tposition: absolute;\n\t\tline-height: 0.78;\n\t\tborder-radius: 9999px;\n\t\tborder: none;\n\t\tbackground: ", ";\n\n\t\t&:nth-child(1) {\n\t\t\tleft: 22px;\n\t\t}\n\t\t&:nth-child(2) {\n\t\t\tright: 22px;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n"])), function (_ref2) {
87
91
  var theme = _ref2.theme;
88
92
  return theme.fontWeights.normal;
89
93
  }, function (props) {
@@ -7,13 +7,7 @@ var React = _interopRequireWildcard(require("react"));
7
7
 
8
8
  var _styles = _interopRequireWildcard(require("./styles"));
9
9
 
10
- var _Button = _interopRequireDefault(require("../Button"));
11
-
12
- var _Icon = _interopRequireDefault(require("../Icon"));
13
-
14
- var _excluded = ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "clearButtonLabel", "innerRef", "onBlur", "onChange", "onClear", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance"];
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ var _excluded = ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "innerRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance"];
17
11
 
18
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
13
 
@@ -27,21 +21,6 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
27
21
 
28
22
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
23
 
30
- var InputContext = /*#__PURE__*/React.createContext({});
31
-
32
- var ClearButton = function ClearButton() {
33
- var _React$useContext = React.useContext(InputContext),
34
- handleClear = _React$useContext.handleClear,
35
- clearButtonLabel = _React$useContext.clearButtonLabel;
36
-
37
- return /*#__PURE__*/React.createElement(_Button.default, {
38
- onClick: handleClear
39
- }, /*#__PURE__*/React.createElement(_Icon.default, {
40
- name: "circlex",
41
- title: clearButtonLabel || "Clear"
42
- }));
43
- };
44
-
45
24
  var Input = /*#__PURE__*/function (_React$Component) {
46
25
  _inheritsLoose(Input, _React$Component);
47
26
 
@@ -55,31 +34,39 @@ var Input = /*#__PURE__*/function (_React$Component) {
55
34
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
56
35
 
57
36
  _this.handleBlur = function (e) {
58
- return _this.props.onBlur == null ? void 0 : _this.props.onBlur(e);
59
- };
60
-
61
- _this.handleClear = function (e) {
62
- return _this.props.onClear == null ? void 0 : _this.props.onClear(e);
37
+ if (_this.props.onBlur) {
38
+ _this.props.onBlur(e);
39
+ }
63
40
  };
64
41
 
65
42
  _this.handleChange = function (e) {
66
- return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
43
+ if (_this.props.onChange) {
44
+ _this.props.onChange(e, e.currentTarget.value);
45
+ }
67
46
  };
68
47
 
69
48
  _this.handleFocus = function (e) {
70
- return _this.props.onFocus == null ? void 0 : _this.props.onFocus(e);
49
+ if (_this.props.onFocus) {
50
+ _this.props.onFocus(e);
51
+ }
71
52
  };
72
53
 
73
54
  _this.handleKeyDown = function (e) {
74
- return _this.props.onKeyDown == null ? void 0 : _this.props.onKeyDown(e, e.currentTarget.value);
55
+ if (_this.props.onKeyDown) {
56
+ _this.props.onKeyDown(e, e.currentTarget.value);
57
+ }
75
58
  };
76
59
 
77
60
  _this.handleKeyUp = function (e) {
78
- return _this.props.onKeyUp == null ? void 0 : _this.props.onKeyUp(e, e.currentTarget.value);
61
+ if (_this.props.onKeyUp) {
62
+ _this.props.onKeyUp(e, e.currentTarget.value);
63
+ }
79
64
  };
80
65
 
81
66
  _this.handlePaste = function (e) {
82
- return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
67
+ if (_this.props.onPaste) {
68
+ _this.props.onPaste(e, e.currentTarget.value);
69
+ }
83
70
  };
84
71
 
85
72
  return _this;
@@ -88,8 +75,6 @@ var Input = /*#__PURE__*/function (_React$Component) {
88
75
  var _proto = Input.prototype;
89
76
 
90
77
  _proto.render = function render() {
91
- var _elementAfter$type;
92
-
93
78
  var _this$props = this.props,
94
79
  autoComplete = _this$props.autoComplete,
95
80
  autoFocus = _this$props.autoFocus,
@@ -108,11 +93,9 @@ var Input = /*#__PURE__*/function (_React$Component) {
108
93
  maxLength = _this$props.maxLength,
109
94
  ariaLabel = _this$props.ariaLabel,
110
95
  ariaDescribedby = _this$props.ariaDescribedby,
111
- clearButtonLabel = _this$props.clearButtonLabel,
112
96
  innerRef = _this$props.innerRef,
113
97
  onBlur = _this$props.onBlur,
114
98
  onChange = _this$props.onChange,
115
- onClear = _this$props.onClear,
116
99
  onFocus = _this$props.onFocus,
117
100
  onKeyDown = _this$props.onKeyDown,
118
101
  onKeyUp = _this$props.onKeyUp,
@@ -122,38 +105,25 @@ var Input = /*#__PURE__*/function (_React$Component) {
122
105
  _this$props$qa = _this$props.qa,
123
106
  qa = _this$props$qa === void 0 ? {} : _this$props$qa,
124
107
  appearance = _this$props.appearance,
125
- rest = _objectWithoutPropertiesLoose(_this$props, _excluded); // Convert autoComplete from a boolean prop to a string value.
126
-
108
+ rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
127
109
 
128
110
  var autoCompleteValue = undefined;
129
111
 
130
112
  if (autoComplete !== undefined) {
131
113
  autoCompleteValue = autoComplete ? "on" : "off";
132
- } // Add default elemBefore and elemAfter elements if type is search.
133
-
134
-
135
- var elementBefore = type === "search" && !elemBefore ? /*#__PURE__*/React.createElement(_Icon.default, {
136
- name: "search",
137
- ariaHidden: true
138
- }) : elemBefore; // Do not add a ClearButton if no onClear callback is provided or if an elemAfter prop was passed.
114
+ }
139
115
 
140
- var elementAfter = type === "search" && onClear && !elemAfter ? /*#__PURE__*/React.createElement(ClearButton, null) : elemAfter;
141
116
  return /*#__PURE__*/React.createElement(_styles.default, _extends({
142
- hasBeforeElement: !!elementBefore,
143
- hasAfterElement: !!elementAfter,
117
+ hasBeforeElement: !!elemBefore,
118
+ hasAfterElement: !!elemAfter,
144
119
  disabled: disabled,
145
120
  invalid: !!isInvalid,
146
121
  warning: hasWarning,
147
122
  appearance: appearance // $FlowIssue - upgrade v0.112.0
148
123
 
149
- }, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
150
- value: {
151
- handleClear: this.handleClear,
152
- clearButtonLabel: clearButtonLabel
153
- }
154
- }, elementBefore && /*#__PURE__*/React.createElement(_styles.Accessory, {
124
+ }, rest), elemBefore && /*#__PURE__*/React.createElement(_styles.Accessory, {
155
125
  before: true
156
- }, elementBefore), /*#__PURE__*/React.createElement("input", _extends({
126
+ }, elemBefore), /*#__PURE__*/React.createElement("input", _extends({
157
127
  "aria-invalid": !!isInvalid,
158
128
  "aria-label": ariaLabel,
159
129
  "aria-describedby": ariaDescribedby,
@@ -178,25 +148,19 @@ var Input = /*#__PURE__*/function (_React$Component) {
178
148
  "data-qa-input": name || "",
179
149
  "data-qa-input-isdisabled": disabled === true,
180
150
  "data-qa-input-isrequired": required === true
181
- }, qa, inputProps)), elementAfter && /*#__PURE__*/React.createElement(_styles.Accessory, {
182
- after: true // Used for positioning. This logic will detect if the element is a ClearButton,
183
- // regardless of whether it was manually passed as elemAfter or automatically added to a search Input.
184
- ,
185
- isClearButton: (elementAfter == null ? void 0 : (_elementAfter$type = elementAfter.type) == null ? void 0 : _elementAfter$type.prototype) === Input.ClearButton.prototype
186
- }, elementAfter)));
151
+ }, qa, inputProps)), elemAfter && /*#__PURE__*/React.createElement(_styles.Accessory, {
152
+ after: true
153
+ }, elemAfter));
187
154
  };
188
155
 
189
156
  return Input;
190
157
  }(React.Component);
191
158
 
159
+ exports.default = Input;
192
160
  Input.defaultProps = {
193
161
  autoFocus: false,
194
162
  disabled: false,
195
163
  type: "text",
196
164
  size: "default",
197
165
  appearance: "primary"
198
- };
199
- Input.ClearButton = ClearButton;
200
- Input.ClearButton.displayName = "Input.ClearButton";
201
- var _default = Input;
202
- exports.default = _default;
166
+ };
@@ -86,7 +86,7 @@ var Accessory = _styledComponents.default.div.withConfig({
86
86
  }, function (props) {
87
87
  return props.before && (0, _styledComponents.css)(["left:", ";"], props.theme.space[350]);
88
88
  }, function (props) {
89
- return props.after && (0, _styledComponents.css)(["right:", ";"], props.isClearButton ? 0 : props.theme.space[350]);
89
+ return props.after && (0, _styledComponents.css)(["right:", ";"], props.theme.space[350]);
90
90
  });
91
91
 
92
92
  exports.Accessory = Accessory;
@@ -267,6 +267,13 @@ var MenuRadio = function MenuRadio(props) {
267
267
 
268
268
  exports.MenuRadio = MenuRadio;
269
269
 
270
+ var _StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
271
+ displayName: "Menu___StyledText",
272
+ componentId: "sc-1p3rdnp-0"
273
+ })(["", ""], function (p) {
274
+ return p._css;
275
+ });
276
+
270
277
  var MenuGroup = function MenuGroup(_ref2) {
271
278
  var children = _ref2.children,
272
279
  title = _ref2.title,
@@ -286,7 +293,7 @@ var MenuGroup = function MenuGroup(_ref2) {
286
293
  fontWeight: 600,
287
294
  mt: 350,
288
295
  color: "text.headline",
289
- $_css: isDisabled && _mixins.disabled
296
+ _css: isDisabled && _mixins.disabled
290
297
  }, title)), /*#__PURE__*/React.createElement(_Box.default, _extends({}, props, {
291
298
  p: 300,
292
299
  role: "group"
@@ -436,7 +443,7 @@ Menu.Divider.displayName = "Menu.Divider";
436
443
  Menu.FilterInput.displayName = "Menu.FilterInput";
437
444
  var CustomPopoutContent = (0, _styledComponents.default)(_Popout.default.Content).withConfig({
438
445
  displayName: "Menu__CustomPopoutContent",
439
- componentId: "sc-1p3rdnp-0"
446
+ componentId: "sc-1p3rdnp-1"
440
447
  })(["padding:0;margin-left:0;margin-right:0;"]);
441
448
 
442
449
  var MenuButton = function MenuButton(_ref5) {
@@ -494,11 +501,4 @@ var MenuButton = function MenuButton(_ref5) {
494
501
 
495
502
  exports.MenuButton = MenuButton;
496
503
  var _default = Menu;
497
- exports.default = _default;
498
-
499
- var _StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
500
- displayName: "Menu___StyledText",
501
- componentId: "sc-1p3rdnp-1"
502
- })(["", ""], function (p) {
503
- return p.$_css;
504
- });
504
+ exports.default = _default;
@@ -15,6 +15,8 @@ var _Box = _interopRequireDefault(require("../Box"));
15
15
 
16
16
  var _systemProps = require("../utils/system-props");
17
17
 
18
+ var _templateObject;
19
+
18
20
  var _excluded = ["className"];
19
21
 
20
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -23,6 +25,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
28
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
29
+
26
30
  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); }
27
31
 
28
32
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -51,7 +55,7 @@ function ReactModalAdapter(_ref) {
51
55
  }, props));
52
56
  }
53
57
 
54
- var Body = (0, _styledComponents.createGlobalStyle)([".ReactModal__Body--open{overflow:hidden;}"]); // eslint-disable-next-line prettier/prettier
58
+ var Body = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n .ReactModal__Body--open {\n overflow: hidden;\n }\n"]))); // eslint-disable-next-line prettier/prettier
55
59
 
56
60
  exports.Body = Body;
57
61
  var Container = (0, _styledComponents.default)(ReactModalAdapter).withConfig({
@@ -82,14 +82,26 @@ function toast(options) {
82
82
  });
83
83
  }
84
84
 
85
+ var _StyledBox = (0, _styledComponents.default)(_Box.default).withConfig({
86
+ displayName: "Toast___StyledBox",
87
+ componentId: "sc-1vii3dq-0"
88
+ })(["", ""], function (p) {
89
+ return p._css;
90
+ });
91
+
85
92
  var IconBox = function IconBox(props) {
86
93
  return /*#__PURE__*/React.createElement(_StyledBox, _extends({
87
94
  display: "inline-block"
88
95
  }, props, {
89
- $_css: "line-height: 1;"
96
+ _css: "line-height: 1;"
90
97
  }));
91
98
  };
92
99
 
100
+ var _StyledBox2 = (0, _styledComponents.default)(_Box.default).withConfig({
101
+ displayName: "Toast___StyledBox2",
102
+ componentId: "sc-1vii3dq-1"
103
+ })(["transform:translateY(1px);"]);
104
+
93
105
  var Toast = function Toast(_ref) {
94
106
  var content = _ref.content,
95
107
  theme = _ref.theme,
@@ -128,16 +140,4 @@ var Toast = function Toast(_ref) {
128
140
  };
129
141
 
130
142
  var _default = ToastContainer;
131
- exports.default = _default;
132
-
133
- var _StyledBox = (0, _styledComponents.default)(_Box.default).withConfig({
134
- displayName: "Toast___StyledBox",
135
- componentId: "sc-1vii3dq-0"
136
- })(["", ""], function (p) {
137
- return p.$_css;
138
- });
139
-
140
- var _StyledBox2 = (0, _styledComponents.default)(_Box.default).withConfig({
141
- displayName: "Toast___StyledBox2",
142
- componentId: "sc-1vii3dq-1"
143
- })(["transform:translateY(1px);"]);
143
+ exports.default = _default;
@@ -11,13 +11,16 @@ var _Icon = _interopRequireDefault(require("../Icon"));
11
11
 
12
12
  var _ReactToastify = _interopRequireDefault(require("!!raw-loader!react-toastify/dist/ReactToastify.css"));
13
13
 
14
+ var _templateObject;
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
19
 
18
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
21
 
20
- // $FlowIssue
22
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
23
+
21
24
  var Container = (0, _styledComponents.default)(_Box.default).withConfig({
22
25
  displayName: "styles__Container",
23
26
  componentId: "sc-wp5x29-0"
@@ -39,7 +42,7 @@ var CustomIcon = (0, _styledComponents.default)(_Icon.default).withConfig({
39
42
  return p.customColor ? undefined : p.theme.colors.icon[p.type];
40
43
  });
41
44
  exports.CustomIcon = CustomIcon;
42
- var GlobalToastStyles = (0, _styledComponents.createGlobalStyle)(["", " .Toastify__toast:last-of-type{margin-bottom:0;}.Toastify-container-overrides{padding:0;width:360px;}.Toastify-toast-overrides{padding:0;min-height:0;border-radius:2px;}.Toastify__toast-container--bottom-right{bottom:", ";right:", ";}@media only screen and (max-width:480px){.Toastify-container-overrides{min-width:initial;}}"], _ReactToastify.default, function (p) {
45
+ var GlobalToastStyles = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\t", "\n\n\t.Toastify__toast:last-of-type {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.Toastify-container-overrides {\n\t\tpadding: 0;\n\t\twidth: 360px;\n\t}\n\n\t.Toastify-toast-overrides {\n\t\tpadding: 0;\n\t\tmin-height: 0;\n\t\tborder-radius: 2px;\n\t}\n\n\t.Toastify__toast-container--bottom-right {\n\t\tbottom: ", ";\n\t\tright: ", ";\n\t}\n\n\t/* Override React Toastify's mobile width styles */\n\t@media only screen and (max-width: 480px) {\n\t\t.Toastify-container-overrides {\n\t\t\tmin-width: initial;\n\t\t}\n\t}\n"])), _ReactToastify.default, function (p) {
43
46
  return p.theme.space[400];
44
47
  }, function (p) {
45
48
  return p.theme.space[400];
@@ -0,0 +1,38 @@
1
+ var defaultPurple = {
2
+ color: "colors.text.body",
3
+ background: "colors.container.background.decorative.purple"
4
+ };
5
+ var suggestion = {
6
+ color: "colors.text.body",
7
+ background: "colors.container.background.decorative.blue"
8
+ };
9
+ var passive = {
10
+ color: "colors.text.body",
11
+ background: "colors.container.background.decorative.neutral"
12
+ };
13
+ var primary = {
14
+ color: "colors.text.body",
15
+ background: "colors.container.background.decorative.blue"
16
+ };
17
+ var secondary = {
18
+ color: "colors.text.body",
19
+ background: "colors.container.background.decorative.yellow"
20
+ };
21
+ var common = {
22
+ color: "colors.text.inverse",
23
+ background: "colors.aqua.600"
24
+ };
25
+ var approval = {
26
+ color: "colors.text.body",
27
+ background: "colors.container.background.decorative.orange"
28
+ }; //Deprecated former "types"
29
+
30
+ export var legacyBadgeColors = {
31
+ primary: primary,
32
+ secondary: secondary,
33
+ passive: passive,
34
+ common: common,
35
+ approval: approval,
36
+ default: defaultPurple,
37
+ suggestion: suggestion
38
+ };