@sproutsocial/racine 14.2.0 → 14.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/__flow__/Icon/Icon.flow.js +3 -1
- package/__flow__/PartnerLogo/PartnerLogo.flow.js +3 -3
- package/commonjs/Badge/Badge.js +2 -1
- package/commonjs/Banner/Banner.js +2 -1
- package/commonjs/Breadcrumb/Breadcrumb.js +2 -1
- package/commonjs/Checkbox/styles.js +6 -5
- package/commonjs/DatePicker/common.js +2 -1
- package/commonjs/Drawer/Drawer.js +9 -4
- package/commonjs/Icon/Icon.js +32 -10
- package/commonjs/IllustrationViewBoxes.d.js +5 -0
- package/commonjs/Indicator/Indicator.js +2 -1
- package/commonjs/Input/Input.js +2 -1
- package/commonjs/Listbox/Listbox.js +2 -1
- package/commonjs/LogoViewBoxes.d.js +5 -0
- package/commonjs/PartnerLogo/PartnerLogo.js +14 -13
- package/commonjs/PartnerLogo/PartnerLogoTypes.js +12 -1
- package/commonjs/PartnerLogo/index.js +0 -12
- package/commonjs/PartnerLogo/styles.js +1 -1
- package/commonjs/Select/Select.js +2 -1
- package/commonjs/Switch/Switch.js +1 -0
- package/commonjs/TableHeaderCell/TableHeaderCell.js +2 -1
- package/commonjs/TableRowAccordion/TableRowAccordion.js +6 -2
- package/commonjs/Toast/Toast.js +40 -34
- package/commonjs/ToggleHint/ToggleHint.js +4 -2
- package/commonjs/Token/Token.js +16 -2
- package/commonjs/Token/styles.js +1 -1
- package/commonjs/TokenInput/TokenInput.js +3 -1
- package/commonjs/themes/dark/theme.js +1 -1
- package/commonjs/themes/light/theme.js +1 -1
- package/commonjs/utils/index.js +12 -2
- package/dist/icon.svg +1 -1
- package/dist/themes/dark/theme.scss +1 -1
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +1 -1
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +1 -1
- package/dist/themes/light/theme.scss +1 -1
- package/dist/types/Badge/Badge.d.ts.map +1 -1
- package/dist/types/Banner/styles.d.ts +1 -1
- package/dist/types/Checkbox/styles.d.ts +4 -2
- package/dist/types/Checkbox/styles.d.ts.map +1 -1
- package/dist/types/Drawer/Drawer.d.ts +1 -1
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/Icon/Icon.d.ts +1 -1
- package/dist/types/Icon/Icon.d.ts.map +1 -1
- package/dist/types/Icon/IconTypes.d.ts +3 -2
- package/dist/types/Icon/IconTypes.d.ts.map +1 -1
- package/dist/types/PartnerLogo/PartnerLogo.d.ts +1 -1
- package/dist/types/PartnerLogo/PartnerLogo.d.ts.map +1 -1
- package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts +12 -3
- package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts.map +1 -1
- package/dist/types/PartnerLogo/index.d.ts +0 -1
- package/dist/types/PartnerLogo/index.d.ts.map +1 -1
- package/dist/types/Select/Select.d.ts.map +1 -1
- package/dist/types/TableRowAccordion/TableRowAccordion.d.ts.map +1 -1
- package/dist/types/Toast/Toast.d.ts.map +1 -1
- package/dist/types/Toast/styles.d.ts +1 -1
- package/dist/types/Token/Token.d.ts.map +1 -1
- package/dist/types/TokenInput/TokenInput.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +5 -0
- package/dist/types/utils/index.d.ts.map +1 -1
- package/icons/advocacy-outline.svg +2 -2
- package/icons/comment-ai-outline.svg +2 -2
- package/icons/comment-ai.svg +1 -1
- package/icons/dropbox.svg +2 -2
- package/icons/facebook-groups.svg +2 -2
- package/icons/facebook.svg +2 -2
- package/icons/feedly.svg +2 -2
- package/icons/flat-negative-sentiment-outline.svg +1 -1
- package/icons/flat-neutral-sentiment-outline.svg +1 -1
- package/icons/flat-positive-sentiment-outline.svg +1 -1
- package/icons/glassdoor.svg +2 -2
- package/icons/instagram.svg +2 -2
- package/icons/linkedin.svg +2 -2
- package/icons/messenger.svg +2 -2
- package/icons/pinterest.svg +2 -2
- package/icons/reddit-alien.svg +2 -2
- package/icons/reddit.svg +2 -2
- package/icons/reels-outline.svg +1 -1
- package/icons/salesforce.svg +2 -2
- package/icons/send-again-outline.svg +1 -1
- package/icons/send-again.svg +1 -1
- package/icons/tasks-check.svg +1 -1
- package/icons/tumblr.svg +2 -2
- package/icons/twitter.svg +2 -2
- package/icons/youtube.svg +2 -2
- package/icons/zendesk.svg +2 -2
- package/lib/Badge/Badge.js +2 -1
- package/lib/Banner/Banner.js +2 -1
- package/lib/Breadcrumb/Breadcrumb.js +2 -1
- package/lib/Checkbox/styles.js +6 -5
- package/lib/DatePicker/common.js +2 -1
- package/lib/Drawer/Drawer.js +9 -4
- package/lib/Icon/Icon.js +32 -10
- package/lib/IllustrationViewBoxes.d.js +1 -0
- package/lib/Indicator/Indicator.js +2 -1
- package/lib/Input/Input.js +2 -1
- package/lib/Listbox/Listbox.js +2 -1
- package/lib/LogoViewBoxes.d.js +1 -0
- package/lib/PartnerLogo/PartnerLogo.js +14 -13
- package/lib/PartnerLogo/PartnerLogoTypes.js +8 -1
- package/lib/PartnerLogo/index.js +1 -2
- package/lib/PartnerLogo/styles.js +1 -1
- package/lib/Select/Select.js +2 -1
- package/lib/Switch/Switch.js +1 -0
- package/lib/TableHeaderCell/TableHeaderCell.js +2 -1
- package/lib/TableRowAccordion/TableRowAccordion.js +6 -2
- package/lib/Toast/Toast.js +40 -34
- package/lib/ToggleHint/ToggleHint.js +4 -2
- package/lib/Token/Token.js +16 -2
- package/lib/Token/styles.js +1 -1
- package/lib/TokenInput/TokenInput.js +3 -1
- package/lib/themes/dark/theme.js +1 -1
- package/lib/themes/light/theme.js +1 -1
- package/lib/utils/index.js +9 -1
- package/package.json +3 -2
- package/dist/types/PartnerLogo/TypePartnerNames.d.ts +0 -2
- package/dist/types/PartnerLogo/TypePartnerNames.d.ts.map +0 -1
- /package/commonjs/{PartnerLogo/TypePartnerNames.js → IconViewBoxes.d.js} +0 -0
- /package/lib/{PartnerLogo/TypePartnerNames.js → IconViewBoxes.d.js} +0 -0
package/lib/Banner/Banner.js
CHANGED
|
@@ -40,7 +40,8 @@ var Breadcrumb = function Breadcrumb(_ref2) {
|
|
|
40
40
|
px: 200,
|
|
41
41
|
py: 0
|
|
42
42
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
43
|
-
name: "dotdotdot"
|
|
43
|
+
name: "dotdotdot",
|
|
44
|
+
"aria-hidden": true
|
|
44
45
|
}))), listItems.map(function (item, i) {
|
|
45
46
|
// @ts-notes - item is a childNode which can be a string or number but `cloneElement` requires props
|
|
46
47
|
var itemElem = _typeof(item) === 'object' && 'props' in item ? item : /*#__PURE__*/React.createElement("span", null, "item");
|
package/lib/Checkbox/styles.js
CHANGED
|
@@ -47,13 +47,14 @@ export var CheckboxBox = styled.div.withConfig({
|
|
|
47
47
|
return props.theme.easing.ease_in;
|
|
48
48
|
});
|
|
49
49
|
CheckboxBox.displayName = 'CheckboxBox';
|
|
50
|
-
export var CheckIcon = styled(Icon).
|
|
50
|
+
export var CheckIcon = styled(Icon).attrs({
|
|
51
|
+
'aria-hidden': true
|
|
52
|
+
}).withConfig({
|
|
51
53
|
displayName: "styles__CheckIcon",
|
|
52
54
|
componentId: "sc-1hcgibh-3"
|
|
53
|
-
})(["position:absolute;display:inline-flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;pointer-events:none;transition:all ", "
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return props.theme.easing.ease_inout;
|
|
55
|
+
})(["position:absolute;display:inline-flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;pointer-events:none;transition:all ", ";&,& .Icon-svg{width:10px;height:10px;line-height:10px;}"], function (_ref) {
|
|
56
|
+
var theme = _ref.theme;
|
|
57
|
+
return "".concat(theme.duration.fast, " ").concat(theme.easing.ease_inout);
|
|
57
58
|
});
|
|
58
59
|
CheckIcon.displayName = 'CheckIcon';
|
|
59
60
|
export var PillInput = styled.input.withConfig({
|
package/lib/DatePicker/common.js
CHANGED
|
@@ -11,7 +11,8 @@ export var CalendarNavButton = function CalendarNavButton(_ref) {
|
|
|
11
11
|
var type = _ref.type;
|
|
12
12
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
13
13
|
size: "mini",
|
|
14
|
-
name: iconNames[type]
|
|
14
|
+
name: iconNames[type],
|
|
15
|
+
"aria-hidden": true
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
18
|
export var commonDatePickerProps = {
|
package/lib/Drawer/Drawer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["title", "children", "render"],
|
|
2
|
+
var _excluded = ["title", "id", "children", "render"],
|
|
3
3
|
_excluded2 = ["children"],
|
|
4
4
|
_excluded3 = ["id", "style", "offset", "direction", "children", "disableCloseOnClickOutside", "onClose", "zIndex", "closeTargets"],
|
|
5
5
|
_excluded4 = ["children", "closeButtonLabel", "direction", "disableCloseOnClickOutside", "id", "isOpen", "offset", "onClose", "zIndex", "closeTargets"];
|
|
@@ -46,12 +46,15 @@ var DrawerCloseButton = function DrawerCloseButton(props) {
|
|
|
46
46
|
"aria-label": closeButtonLabel,
|
|
47
47
|
onClick: onClose
|
|
48
48
|
}, props), props.children || /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
+
"aria-hidden": true,
|
|
49
50
|
name: "x"
|
|
50
51
|
}));
|
|
51
52
|
};
|
|
52
53
|
var DrawerHeader = function DrawerHeader(_ref) {
|
|
53
54
|
var _ref$title = _ref.title,
|
|
54
55
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
56
|
+
_ref$id = _ref.id,
|
|
57
|
+
id = _ref$id === void 0 ? undefined : _ref$id,
|
|
55
58
|
children = _ref.children,
|
|
56
59
|
render = _ref.render,
|
|
57
60
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -70,7 +73,8 @@ var DrawerHeader = function DrawerHeader(_ref) {
|
|
|
70
73
|
as: "h2",
|
|
71
74
|
fontSize: 400,
|
|
72
75
|
fontWeight: "semibold",
|
|
73
|
-
color: "text.headline"
|
|
76
|
+
color: "text.headline",
|
|
77
|
+
id: id
|
|
74
78
|
}, title), /*#__PURE__*/React.createElement(DrawerCloseButton, null)));
|
|
75
79
|
};
|
|
76
80
|
var DrawerContent = function DrawerContent(_ref2) {
|
|
@@ -129,7 +133,7 @@ var Drawer = function Drawer(_ref3) {
|
|
|
129
133
|
}, [onClose, disableCloseOnClickOutside, closeTargets]);
|
|
130
134
|
return /*#__PURE__*/React.createElement(FocusLock, {
|
|
131
135
|
key: id,
|
|
132
|
-
autoFocus:
|
|
136
|
+
autoFocus: true,
|
|
133
137
|
returnFocus: true
|
|
134
138
|
}, /*#__PURE__*/React.createElement(AnimatedDrawer, _extends({
|
|
135
139
|
ref: drawerRef,
|
|
@@ -137,7 +141,8 @@ var Drawer = function Drawer(_ref3) {
|
|
|
137
141
|
width: DRAWER_WIDTH,
|
|
138
142
|
offset: offset,
|
|
139
143
|
direction: direction,
|
|
140
|
-
"data-qa-drawer": id
|
|
144
|
+
"data-qa-drawer": id,
|
|
145
|
+
role: "dialog"
|
|
141
146
|
}, rest), children));
|
|
142
147
|
};
|
|
143
148
|
var DrawerContainer = function DrawerContainer(_ref4) {
|
package/lib/Icon/Icon.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
var _excluded = ["name", "size", "fixedWidth", "ariaLabel"],
|
|
1
|
+
var _excluded = ["name", "size", "fixedWidth", "ariaLabel", "color", "svgProps"],
|
|
2
2
|
_excluded2 = ["activeName", "inactiveName", "isActive", "size", "fixedWidth", "ariaLabel"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
4
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
5
|
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; }
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
+
import iconViewBoxes from "../IconViewBoxes";
|
|
8
9
|
import Box from "../Box";
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
|
|
10
|
+
import PartnerLogo, { PartnerNames } from "../PartnerLogo";
|
|
11
|
+
import { includes } from "../utils";
|
|
12
|
+
|
|
12
13
|
// TODO: get json file working in flow so this can be shared
|
|
13
14
|
// import deprecatedIcons from './deprecatedIcons.json';
|
|
14
15
|
import deprecatedIcons from "./deprecatedIcons";
|
|
16
|
+
import Container from "./styles";
|
|
15
17
|
var Icon = function Icon(_ref) {
|
|
16
18
|
var name = _ref.name,
|
|
17
19
|
_ref$size = _ref.size,
|
|
@@ -19,20 +21,40 @@ var Icon = function Icon(_ref) {
|
|
|
19
21
|
_ref$fixedWidth = _ref.fixedWidth,
|
|
20
22
|
fixedWidth = _ref$fixedWidth === void 0 ? false : _ref$fixedWidth,
|
|
21
23
|
ariaLabel = _ref.ariaLabel,
|
|
24
|
+
color = _ref.color,
|
|
25
|
+
svgProps = _ref.svgProps,
|
|
22
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
if (includes(PartnerNames, name)) {
|
|
28
|
+
// Icon's "default" size is equivalent to PartnerLogo's "small" size
|
|
29
|
+
var logoSize = size === 'default' ? 'small' : size;
|
|
30
|
+
var logoProps = {
|
|
31
|
+
partnerName: name,
|
|
32
|
+
size: logoSize,
|
|
33
|
+
logoType: 'symbol',
|
|
34
|
+
svgProps: svgProps
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/React.createElement(PartnerLogo
|
|
37
|
+
// ariaLabel needs to be overridable by aria-label prop in ...rest
|
|
38
|
+
, _extends({
|
|
39
|
+
"aria-label": ariaLabel
|
|
40
|
+
}, rest, logoProps));
|
|
41
|
+
}
|
|
23
42
|
var iconName = deprecatedIcons[name] || name;
|
|
24
43
|
var iconViewBox = iconViewBoxes[iconName];
|
|
25
44
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
26
45
|
iconSize: size,
|
|
27
46
|
fixedWidth: !!fixedWidth,
|
|
28
47
|
key: name,
|
|
48
|
+
role: "img",
|
|
29
49
|
"aria-label": ariaLabel,
|
|
30
|
-
"data-qa-icon": name
|
|
31
|
-
|
|
50
|
+
"data-qa-icon": name,
|
|
51
|
+
color: color
|
|
52
|
+
}, rest), /*#__PURE__*/React.createElement("svg", _extends({
|
|
32
53
|
className: "Icon-svg",
|
|
33
54
|
viewBox: iconViewBox,
|
|
34
|
-
focusable: false
|
|
35
|
-
|
|
55
|
+
focusable: false,
|
|
56
|
+
"data-qa-icon-svg": "".concat(name, "-svg")
|
|
57
|
+
}, svgProps), /*#__PURE__*/React.createElement("use", {
|
|
36
58
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
37
59
|
xlinkHref: "#ssiconsvg-".concat(iconName)
|
|
38
60
|
})));
|
|
@@ -66,14 +88,14 @@ var IconToggle = function IconToggle(_ref2) {
|
|
|
66
88
|
name: activeName,
|
|
67
89
|
size: size,
|
|
68
90
|
fixedWidth: fixedWidth,
|
|
69
|
-
|
|
91
|
+
"aria-label": ariaLabel,
|
|
70
92
|
"aria-hidden": !isActive
|
|
71
93
|
}), /*#__PURE__*/React.createElement(ToggleableIcon, {
|
|
72
94
|
active: !isActive,
|
|
73
95
|
name: inactiveName,
|
|
74
96
|
size: size,
|
|
75
97
|
fixedWidth: fixedWidth,
|
|
76
|
-
|
|
98
|
+
"aria-label": ariaLabel,
|
|
77
99
|
"aria-hidden": isActive
|
|
78
100
|
}));
|
|
79
101
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -39,7 +39,8 @@ var Indicator = /*#__PURE__*/function (_React$Component) {
|
|
|
39
39
|
tabIndex: 0
|
|
40
40
|
}, rest), tooltip && /*#__PURE__*/React.createElement("div", null, tooltip), /*#__PURE__*/React.createElement(Icon, {
|
|
41
41
|
name: "indicator",
|
|
42
|
-
size: "mini"
|
|
42
|
+
size: "mini",
|
|
43
|
+
"aria-hidden": true
|
|
43
44
|
}));
|
|
44
45
|
}
|
|
45
46
|
}]);
|
package/lib/Input/Input.js
CHANGED
|
@@ -62,7 +62,8 @@ var ClearButton = function ClearButton() {
|
|
|
62
62
|
ariaLabel: clearButtonLabel || 'Clear',
|
|
63
63
|
color: "icon.base"
|
|
64
64
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
65
|
-
name: "circlex"
|
|
65
|
+
name: "circlex",
|
|
66
|
+
"aria-hidden": true
|
|
66
67
|
}));
|
|
67
68
|
};
|
|
68
69
|
ClearButton.displayName = 'Input.ClearButton';
|
package/lib/Listbox/Listbox.js
CHANGED
|
@@ -91,7 +91,8 @@ export var ListboxButton = function ListboxButton(_ref2) {
|
|
|
91
91
|
size: restProps.size
|
|
92
92
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
93
93
|
name: "chevron-down",
|
|
94
|
-
fixedWidth: true
|
|
94
|
+
fixedWidth: true,
|
|
95
|
+
"aria-hidden": true
|
|
95
96
|
})));
|
|
96
97
|
};
|
|
97
98
|
Listbox.Option = Listbox.Item = Menu.Item;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["partnerName", "backgroundType", "logoType", "height", "width", "size", "
|
|
1
|
+
var _excluded = ["partnerName", "backgroundType", "logoType", "height", "width", "size", "aria-label", "svgProps"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
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; }
|
|
@@ -10,16 +10,18 @@ import Container from "./styles";
|
|
|
10
10
|
var PartnerLogo = function PartnerLogo(_ref) {
|
|
11
11
|
var partnerName = _ref.partnerName,
|
|
12
12
|
backgroundType = _ref.backgroundType,
|
|
13
|
-
logoType = _ref.logoType,
|
|
13
|
+
_ref$logoType = _ref.logoType,
|
|
14
|
+
logoType = _ref$logoType === void 0 ? 'symbol' : _ref$logoType,
|
|
14
15
|
height = _ref.height,
|
|
15
16
|
width = _ref.width,
|
|
16
17
|
size = _ref.size,
|
|
17
|
-
|
|
18
|
+
ariaLabel = _ref['aria-label'],
|
|
19
|
+
svgProps = _ref.svgProps,
|
|
18
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
21
|
var _useTheme = useTheme(),
|
|
20
22
|
mode = _useTheme.mode;
|
|
21
23
|
var whichLogo = function whichLogo(type) {
|
|
22
|
-
var logo = logoType ? partnerName + '-' + logoType : partnerName;
|
|
24
|
+
var logo = logoType && logoType !== 'symbol' ? partnerName + '-' + logoType : partnerName;
|
|
23
25
|
if (type && type === 'dark') {
|
|
24
26
|
return "".concat(logo, "-dark");
|
|
25
27
|
} else if (type && type === 'light') {
|
|
@@ -39,17 +41,16 @@ var PartnerLogo = function PartnerLogo(_ref) {
|
|
|
39
41
|
height: height ? height : defaultHeight + 'px',
|
|
40
42
|
width: width ? width : defaultWidth + 'px',
|
|
41
43
|
logoSize: size,
|
|
42
|
-
className: "logo"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color: color
|
|
48
|
-
}, rest), /*#__PURE__*/React.createElement("svg", {
|
|
44
|
+
className: "logo",
|
|
45
|
+
role: "img",
|
|
46
|
+
"aria-label": ariaLabel,
|
|
47
|
+
"data-qa-logo": partnerName
|
|
48
|
+
}, rest), /*#__PURE__*/React.createElement("svg", _extends({
|
|
49
49
|
className: "logo-svg",
|
|
50
50
|
viewBox: logoViewBox,
|
|
51
|
-
focusable: false
|
|
52
|
-
|
|
51
|
+
focusable: false,
|
|
52
|
+
"data-qa-logo-svg": "".concat(partnerName, "-svg")
|
|
53
|
+
}, svgProps), /*#__PURE__*/React.createElement("use", {
|
|
53
54
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
54
55
|
xlinkHref: "#sslogosvg-".concat(whichLogo(backgroundType))
|
|
55
56
|
})));
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var PartnerNames = ['apple-app-store', 'bigcommerce', 'bitly', 'bynder', 'canva', 'dropbox', 'facebook', 'facebook-audience-network', 'facebook-groups', 'facebook-shops', 'feedly', 'glassdoor', 'google-analytics', 'google-business-messages', 'google-drive', 'google-my-business', 'google-play-store', 'hubspot', 'instagram', 'linkedin', 'linkedin-audience-network', 'marketo', 'messenger', 'microsoft-dynamics', 'pinterest', 'reddit', 'salesforce', 'shopify', 'slack', 'sproutsocial', 'tiktok', 'tripadvisor', 'tumblr', 'twitter', 'twitter-audience-network', 'whatsapp', 'woocommerce', 'yelp', 'youtube', 'zendesk'];
|
|
2
|
+
export var PartnerLogoSizes = {
|
|
3
|
+
mini: '12px',
|
|
4
|
+
small: '16px',
|
|
5
|
+
medium: '24px',
|
|
6
|
+
large: '32px',
|
|
7
|
+
jumbo: '64px'
|
|
8
|
+
};
|
package/lib/PartnerLogo/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var sizes = {
|
|
|
11
11
|
|
|
12
12
|
// TODO: remove width from stylesForSize
|
|
13
13
|
var stylesForSize = function stylesForSize(height, width, logoSize) {
|
|
14
|
-
return css(["line-height:", "
|
|
14
|
+
return css(["height:", ";line-height:", ";.logo-svg{height:", ";width:", ";}"], logoSize ? logoSize : height, logoSize ? logoSize : height, logoSize ? logoSize : height, logoSize ? logoSize : '');
|
|
15
15
|
};
|
|
16
16
|
var Container = styled('span').withConfig({
|
|
17
17
|
displayName: "styles__Container",
|
package/lib/Select/Select.js
CHANGED
|
@@ -83,7 +83,8 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
83
83
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
84
84
|
name: "chevron-down",
|
|
85
85
|
fixedWidth: true,
|
|
86
|
-
size: this.props.size === 'small' ? 'mini' : 'default'
|
|
86
|
+
size: this.props.size === 'small' ? 'mini' : 'default',
|
|
87
|
+
"aria-hidden": true
|
|
87
88
|
})));
|
|
88
89
|
}
|
|
89
90
|
}]);
|
package/lib/Switch/Switch.js
CHANGED
|
@@ -65,6 +65,7 @@ var Switch = /*#__PURE__*/function (_React$Component) {
|
|
|
65
65
|
"data-qa-switch-isdisabled": disabled === true,
|
|
66
66
|
checked: checked
|
|
67
67
|
}, qa, rest), /*#__PURE__*/React.createElement(VisuallyHidden, null, checked ? a11yLabels.on : a11yLabels.off), checked ? /*#__PURE__*/React.createElement(Icon, {
|
|
68
|
+
"aria-hidden": true,
|
|
68
69
|
size: "mini",
|
|
69
70
|
name: "check"
|
|
70
71
|
}) : null);
|
|
@@ -40,7 +40,8 @@ export var TableHeaderCell = /*#__PURE__*/function (_React$Component) {
|
|
|
40
40
|
}
|
|
41
41
|
return /*#__PURE__*/React.createElement(SortIcon, null, /*#__PURE__*/React.createElement(Icon, {
|
|
42
42
|
size: "mini",
|
|
43
|
-
name: iconName
|
|
43
|
+
name: iconName,
|
|
44
|
+
"aria-hidden": true
|
|
44
45
|
}));
|
|
45
46
|
});
|
|
46
47
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
@@ -72,12 +72,16 @@ var TableRowAccordion = /*#__PURE__*/function (_React$Component) {
|
|
|
72
72
|
}));
|
|
73
73
|
}), /*#__PURE__*/React.createElement(TableCell, {
|
|
74
74
|
id: "tableRowAccordion_trigger",
|
|
75
|
-
content:
|
|
75
|
+
content:
|
|
76
|
+
/*#__PURE__*/
|
|
77
|
+
// TODO: This trigger needs an accessible label passed in via props
|
|
78
|
+
React.createElement(Trigger, {
|
|
76
79
|
"data-tablerowaccordion-trigger": true,
|
|
77
80
|
onClick: this.handleToggle,
|
|
78
81
|
role: "button"
|
|
79
82
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
80
|
-
name: isExpanded ? 'chevron-up' : 'chevron-down'
|
|
83
|
+
name: isExpanded ? 'chevron-up' : 'chevron-down',
|
|
84
|
+
"aria-hidden": true
|
|
81
85
|
}))
|
|
82
86
|
})), /*#__PURE__*/React.createElement(Detail, {
|
|
83
87
|
isExpanded: isExpanded,
|
package/lib/Toast/Toast.js
CHANGED
|
@@ -68,40 +68,46 @@ var Toast = function Toast(_ref) {
|
|
|
68
68
|
theme = _ref.theme,
|
|
69
69
|
color = _ref.color,
|
|
70
70
|
icon = _ref.icon;
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
71
|
+
return (
|
|
72
|
+
/*#__PURE__*/
|
|
73
|
+
// TODO: if this closes when clicked, there should be a label saying "Click to close" that can be overriden
|
|
74
|
+
React.createElement(Container, {
|
|
75
|
+
type: theme || 'info',
|
|
76
|
+
customColor: color,
|
|
77
|
+
borderLeft: "2px solid",
|
|
78
|
+
"data-qa-toast": ""
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
80
|
+
display: "flex",
|
|
81
|
+
minHeight: "48px",
|
|
82
|
+
maxHeight: "800px",
|
|
83
|
+
p: 350,
|
|
84
|
+
alignItems: "flex-start",
|
|
85
|
+
m: "auto",
|
|
86
|
+
width: 1
|
|
87
|
+
}, /*#__PURE__*/React.createElement(IconBox, null, /*#__PURE__*/React.createElement(CustomIcon, {
|
|
88
|
+
type: theme || 'info'
|
|
89
|
+
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
,
|
|
93
|
+
color: color,
|
|
94
|
+
customColor: color,
|
|
95
|
+
name: theme ? themeIcon[theme] : icon || themeIcon['info'],
|
|
96
|
+
fixedWidth: true,
|
|
97
|
+
"aria-hidden": true
|
|
98
|
+
})), /*#__PURE__*/React.createElement(_StyledBox2, {
|
|
99
|
+
flex: 1
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
101
|
+
as: "div",
|
|
102
|
+
color: "text.body",
|
|
103
|
+
"data-qa-toast-content": ""
|
|
104
|
+
}, content)), /*#__PURE__*/React.createElement(IconBox, null, /*#__PURE__*/React.createElement(Icon, {
|
|
105
|
+
name: "x",
|
|
106
|
+
ml: 400,
|
|
107
|
+
color: "icon.base",
|
|
108
|
+
"aria-hidden": true
|
|
109
|
+
}))))
|
|
110
|
+
);
|
|
105
111
|
};
|
|
106
112
|
export default ToastContainer;
|
|
107
113
|
var _StyledBox = _styled(Box).withConfig({
|
|
@@ -35,11 +35,13 @@ var ToggleHint = /*#__PURE__*/function (_React$Component) {
|
|
|
35
35
|
_defineProperty(_assertThisInitialized(_this), "getIcon", function () {
|
|
36
36
|
if (_this.props.icon === 'chevron') {
|
|
37
37
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
38
|
-
name: "chevron-down"
|
|
38
|
+
name: "chevron-down",
|
|
39
|
+
"aria-hidden": true
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
42
|
-
name: _this.props.isOpen ? 'minus' : 'plus'
|
|
43
|
+
name: _this.props.isOpen ? 'minus' : 'plus',
|
|
44
|
+
"aria-hidden": true
|
|
43
45
|
});
|
|
44
46
|
});
|
|
45
47
|
return _this;
|
package/lib/Token/Token.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { useTextContent } from "../utils/hooks";
|
|
7
7
|
import Box from "../Box";
|
|
8
8
|
import Icon from "../Icon";
|
|
9
|
+
import { VisuallyHidden } from "../VisuallyHidden";
|
|
9
10
|
import Container from "./styles";
|
|
10
11
|
var Token = function Token(_ref) {
|
|
11
12
|
var children = _ref.children,
|
|
@@ -37,11 +38,24 @@ var Token = function Token(_ref) {
|
|
|
37
38
|
"data-qa-token-iscloseable": closeable === true,
|
|
38
39
|
"data-qa-token-isvalid": valid === true,
|
|
39
40
|
"data-qa-token-isdisabled": disabled === true
|
|
40
|
-
}, qa, rest),
|
|
41
|
+
}, qa, rest), !valid && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
42
|
+
as: "div",
|
|
43
|
+
role: "status"
|
|
44
|
+
}, "This is an invalid token"), /*#__PURE__*/React.createElement(Icon, {
|
|
45
|
+
"aria-hidden": true,
|
|
46
|
+
pr: 300,
|
|
47
|
+
name: "error",
|
|
48
|
+
size: "mini"
|
|
49
|
+
}), /*#__PURE__*/React.createElement(VisuallyHidden, null, "Invalid")), closeable ? /*#__PURE__*/React.createElement(Box, {
|
|
41
50
|
display: "flex",
|
|
42
51
|
alignItems: "center",
|
|
43
52
|
justifyContent: "space-between"
|
|
44
|
-
}, /*#__PURE__*/React.createElement(
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
54
|
+
as: "span",
|
|
55
|
+
display: "flex",
|
|
56
|
+
alignItems: "center"
|
|
57
|
+
}, children), /*#__PURE__*/React.createElement(Icon, {
|
|
58
|
+
"aria-hidden": true,
|
|
45
59
|
pl: 300,
|
|
46
60
|
name: "x",
|
|
47
61
|
size: "mini"
|
package/lib/Token/styles.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useInteractiveColor } from "../utils/useInteractiveColor";
|
|
|
5
5
|
var Container = styled.button.withConfig({
|
|
6
6
|
displayName: "styles__Container",
|
|
7
7
|
componentId: "sc-1mt4sof-0"
|
|
8
|
-
})(["position:relative;display:inline-
|
|
8
|
+
})(["position:relative;display:inline-flex;align-items:center;margin:0;line-height:1;outline:none;", " &:focus{", "}", " ", " ", " ", " ", ""], function (_ref) {
|
|
9
9
|
var theme = _ref.theme;
|
|
10
10
|
return css(["", " font-family:", ";font-weight:", ";border:1px solid ", ";border-radius:", ";color:", ";background:", ";padding:", " ", ";transition:all ", " ", ";"], theme.typography[200], theme.fontFamily, theme.fontWeights.normal, theme.colors.container.border.base, theme.radii[500], theme.colors.text.body, theme.colors.container.background.base, theme.space[200], theme.space[300], theme.duration.fast, theme.easing.ease_inout);
|
|
11
11
|
}, focusRing, function (_ref2) {
|
|
@@ -192,7 +192,9 @@ var TokenInput = /*#__PURE__*/function (_React$Component) {
|
|
|
192
192
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
193
193
|
display: "flex",
|
|
194
194
|
alignItems: "center"
|
|
195
|
-
},
|
|
195
|
+
},
|
|
196
|
+
// TODO: add the ability to take labels or aria props for accessibility
|
|
197
|
+
iconName && /*#__PURE__*/React.createElement(Icon, {
|
|
196
198
|
name: iconName,
|
|
197
199
|
size: "mini",
|
|
198
200
|
pr: 300
|
package/lib/themes/dark/theme.js
CHANGED
|
@@ -176,7 +176,7 @@ var colors = _objectSpread(_objectSpread({}, lightTheme.colors), {}, {
|
|
|
176
176
|
subtext: COLORS.COLOR_NEUTRAL_300,
|
|
177
177
|
body: COLORS.COLOR_NEUTRAL_100,
|
|
178
178
|
inverse: COLORS.COLOR_NEUTRAL_900,
|
|
179
|
-
error:
|
|
179
|
+
error: red.foreground,
|
|
180
180
|
background: {
|
|
181
181
|
highlight: COLORS.COLOR_YELLOW_900,
|
|
182
182
|
selection: COLORS.COLOR_BLUE_800
|
|
@@ -177,7 +177,7 @@ var colors = _objectSpread(_objectSpread({
|
|
|
177
177
|
subtext: COLORS.COLOR_NEUTRAL_700,
|
|
178
178
|
body: COLORS.COLOR_NEUTRAL_800,
|
|
179
179
|
inverse: COLORS.COLOR_NEUTRAL_0,
|
|
180
|
-
error:
|
|
180
|
+
error: red.foreground,
|
|
181
181
|
background: {
|
|
182
182
|
highlight: COLORS.COLOR_YELLOW_200,
|
|
183
183
|
selection: COLORS.COLOR_BLUE_300
|
package/lib/utils/index.js
CHANGED
|
@@ -29,4 +29,12 @@ export var mergeRefs = function mergeRefs(refs) {
|
|
|
29
29
|
_iterator.f();
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Type safe includes with narrowing
|
|
36
|
+
* https://fettblog.eu/typescript-array-includes/
|
|
37
|
+
*/
|
|
38
|
+
export function includes(coll, el) {
|
|
39
|
+
return coll.includes(el);
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"__flow__",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"start-package-only": "npm-run-all install-deps clean -p build-icons watch-package",
|
|
36
36
|
"start": "npm-run-all install-deps clean -p build-icons watch-package watch-app",
|
|
37
37
|
"build": "npm-run-all -s clean build-icons build:typescript build:ts-declarations build-package build-app",
|
|
38
|
+
"build:sync-icons": "npm-run-all -s clean build-icons build:typescript build:ts-declarations build-package",
|
|
38
39
|
"lint-js": "eslint --max-warnings=0 --fix .",
|
|
39
40
|
"lint-css": "stylelint 'src/**/*.js'",
|
|
40
41
|
"lint-icons": "yarn icon-lint check 'icons/*.svg'",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"backstop-approve": "yarn backstop approve --config='backstop.config.js' --docker",
|
|
50
51
|
"new": "node ./bin/scaffold.js",
|
|
51
52
|
"playground": "node ./bin/scaffold-playground.js && yarn start",
|
|
52
|
-
"release": "yarn test && yarn changeset publish",
|
|
53
|
+
"release": "yarn build && yarn test && yarn changeset publish",
|
|
53
54
|
"storybook": "rm -rf node_modules/.cache/storybook && start-storybook -c .storybook -p 9999",
|
|
54
55
|
"build-storybook": "build-storybook --quiet -c .storybook -o .storybook-dist",
|
|
55
56
|
"build-chromatic": "yarn build-icons && build-storybook --quiet -c .storybook -o .storybook-dist",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare type TypePartnerNames = 'zendesk' | 'dropbox' | 'bigcommerce' | 'bitly' | 'canva' | 'twitter' | 'twitter-audience-network' | 'whatsapp' | 'yelp' | 'youtube' | 'shopify' | 'pinterest' | 'microsoft-dynamics' | 'marketo' | 'slack' | 'woocommerce' | 'tripadvisor' | 'tumblr' | 'google-business-messages' | 'reddit' | 'hubspot' | 'feedly' | 'facebook' | 'facebook-shops' | 'facebook-groups' | 'facebook-audience-network' | 'glassdoor' | 'salesforce' | 'instagram' | 'linkedin' | 'linkedin-audience-network' | 'google-analytics' | 'messenger' | 'google-my-business' | 'google-drive' | 'tiktok' | 'sproutsocial' | 'google-play-store' | 'apple-app-store';
|
|
2
|
-
//# sourceMappingURL=TypePartnerNames.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypePartnerNames.d.ts","sourceRoot":"","sources":["../../../src/PartnerLogo/TypePartnerNames.ts"],"names":[],"mappings":"AAEA,oBAAY,gBAAgB,GACxB,SAAS,GACT,SAAS,GACT,aAAa,GACb,OAAO,GACP,OAAO,GACP,SAAS,GACT,0BAA0B,GAC1B,UAAU,GACV,MAAM,GACN,SAAS,GACT,SAAS,GACT,WAAW,GACX,oBAAoB,GACpB,SAAS,GACT,OAAO,GACP,aAAa,GACb,aAAa,GACb,QAAQ,GACR,0BAA0B,GAC1B,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,gBAAgB,GAChB,iBAAiB,GACjB,2BAA2B,GAC3B,WAAW,GACX,YAAY,GACZ,WAAW,GACX,UAAU,GACV,2BAA2B,GAC3B,kBAAkB,GAClB,WAAW,GACX,oBAAoB,GACpB,cAAc,GACd,QAAQ,GACR,cAAc,GACd,mBAAmB,GACnB,iBAAiB,CAAC"}
|
|
File without changes
|
|
File without changes
|