@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.
- package/CHANGELOG.md +24 -0
- package/__flow__/Badge/constants.js +48 -0
- package/__flow__/Badge/index.js +60 -33
- package/__flow__/Badge/index.stories.js +35 -42
- package/__flow__/Badge/index.test.js +34 -32
- package/__flow__/Badge/styles.js +22 -42
- package/__flow__/Button/index.js +1 -0
- package/__flow__/Button/index.stories.js +51 -67
- package/__flow__/EmptyState/index.test.js +1 -1
- package/__flow__/Input/index.js +67 -116
- package/__flow__/Input/index.stories.js +0 -33
- package/__flow__/Input/index.test.js +1 -199
- package/__flow__/Input/styles.js +1 -1
- package/__flow__/Menu/__snapshots__/index.test.js.snap +3 -3
- package/__flow__/setupTests.js +1 -1
- package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +0 -14
- package/__flow__/systemProps/tests/layout.test.js +0 -9
- package/__flow__/themes/extendedThemes/README.md +6 -0
- package/commonjs/Badge/constants.js +43 -0
- package/commonjs/Badge/index.js +41 -39
- package/commonjs/Badge/styles.js +15 -31
- package/commonjs/Button/index.js +1 -0
- package/commonjs/DatePicker/styles.js +5 -1
- package/commonjs/Input/index.js +30 -66
- package/commonjs/Input/styles.js +1 -1
- package/commonjs/Menu/index.js +10 -10
- package/commonjs/Modal/styles.js +5 -1
- package/commonjs/Toast/index.js +14 -14
- package/commonjs/Toast/styles.js +5 -2
- package/lib/Badge/constants.js +38 -0
- package/lib/Badge/index.js +38 -39
- package/lib/Badge/styles.js +12 -27
- package/lib/Button/index.js +1 -0
- package/lib/DatePicker/styles.js +5 -1
- package/lib/Input/index.js +29 -59
- package/lib/Input/styles.js +1 -1
- package/lib/Menu/index.js +11 -10
- package/lib/Modal/styles.js +5 -1
- package/lib/Toast/index.js +14 -14
- package/lib/Toast/styles.js +5 -1
- package/package.json +25 -21
- package/__flow__/Button/__snapshots__/index.test.js.snap +0 -511
- package/__flow__/Button/index.test.js +0 -113
package/commonjs/Badge/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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;
|
package/commonjs/Badge/styles.js
CHANGED
|
@@ -3,46 +3,30 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _styledComponents =
|
|
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
|
-
|
|
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
|
-
})(["
|
|
39
|
-
return
|
|
40
|
-
}, function (
|
|
41
|
-
return
|
|
42
|
-
}, function (
|
|
43
|
-
return
|
|
44
|
-
}, function (
|
|
45
|
-
return
|
|
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;
|
package/commonjs/Button/index.js
CHANGED
|
@@ -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{
|
|
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) {
|
package/commonjs/Input/index.js
CHANGED
|
@@ -7,13 +7,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _styles = _interopRequireWildcard(require("./styles"));
|
|
9
9
|
|
|
10
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
+
if (_this.props.onFocus) {
|
|
50
|
+
_this.props.onFocus(e);
|
|
51
|
+
}
|
|
71
52
|
};
|
|
72
53
|
|
|
73
54
|
_this.handleKeyDown = function (e) {
|
|
74
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
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
|
-
}
|
|
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: !!
|
|
143
|
-
hasAfterElement: !!
|
|
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(
|
|
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
|
-
},
|
|
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)),
|
|
182
|
-
after: true
|
|
183
|
-
|
|
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
|
+
};
|
package/commonjs/Input/styles.js
CHANGED
|
@@ -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.
|
|
89
|
+
return props.after && (0, _styledComponents.css)(["right:", ";"], props.theme.space[350]);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
exports.Accessory = Accessory;
|
package/commonjs/Menu/index.js
CHANGED
|
@@ -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
|
-
|
|
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-
|
|
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;
|
package/commonjs/Modal/styles.js
CHANGED
|
@@ -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
|
|
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({
|
package/commonjs/Toast/index.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/commonjs/Toast/styles.js
CHANGED
|
@@ -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
|
-
|
|
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)(["", "
|
|
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
|
+
};
|