@sproutsocial/racine 12.4.0 → 12.6.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 +25 -0
- package/__flow__/Checkbox/index.js +7 -1
- package/__flow__/PartnerLogo/index.js +41 -4
- package/__flow__/PartnerLogo/index.stories.js +17 -0
- package/__flow__/themes/dark/decorative-palettes.js +1 -1
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +1 -1
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +1 -1
- package/__flow__/types/theme.colors.flow.js +1 -0
- package/commonjs/Checkbox/index.js +4 -3
- package/commonjs/PartnerLogo/index.js +31 -5
- package/commonjs/themes/dark/decorative-palettes.js +1 -1
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +1 -1
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +1 -1
- package/dist/themes/dark/theme.scss +547 -547
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +720 -720
- package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +720 -720
- package/dist/themes/light/theme.scss +621 -621
- package/lib/Checkbox/index.js +4 -3
- package/lib/PartnerLogo/index.js +25 -4
- package/lib/themes/dark/decorative-palettes.js +1 -1
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +1 -1
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +1 -1
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 12.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2a6861c: Adds size props and common system-props to the partner logo component
|
|
8
|
+
|
|
9
|
+
## 12.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- b9d2645: add optional label props to checkbox component
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- e73ecb3: Adjust neutral.background in decorative palette to differ from container.background.base"
|
|
18
|
+
- 178c7d9: Add tiktok to theme in network colors for flow typings
|
|
19
|
+
- 9955641: Fix typo for theme colors for settings navigation
|
|
20
|
+
|
|
21
|
+
## 12.4.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 19d74a4: Quote property names in theme.scss files
|
|
26
|
+
- This fixes a bug where properties with names that have specific meanings in CSS (such as "green") would not be accessible using SCSS's map-get.
|
|
27
|
+
|
|
3
28
|
## 12.4.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -18,6 +18,7 @@ export type TypeProps = {
|
|
|
18
18
|
label?: string,
|
|
19
19
|
/** Label used to describe the input (if not used with an accompanying visual label) */
|
|
20
20
|
ariaLabel?: string,
|
|
21
|
+
labelProps?: Object,
|
|
21
22
|
checked: boolean,
|
|
22
23
|
indeterminate: boolean,
|
|
23
24
|
disabled?: boolean,
|
|
@@ -59,6 +60,7 @@ export default class Checkbox extends React.Component<TypeProps> {
|
|
|
59
60
|
value,
|
|
60
61
|
name,
|
|
61
62
|
label,
|
|
63
|
+
labelProps,
|
|
62
64
|
checked,
|
|
63
65
|
disabled,
|
|
64
66
|
indeterminate,
|
|
@@ -102,7 +104,11 @@ export default class Checkbox extends React.Component<TypeProps> {
|
|
|
102
104
|
{...qa}
|
|
103
105
|
{...inputProps}
|
|
104
106
|
/>
|
|
105
|
-
{label &&
|
|
107
|
+
{label && (
|
|
108
|
+
<LabelText {...labelProps} disabled={disabled}>
|
|
109
|
+
{label}
|
|
110
|
+
</LabelText>
|
|
111
|
+
)}
|
|
106
112
|
</CheckboxContainer>
|
|
107
113
|
);
|
|
108
114
|
}
|
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
// @flow
|
|
1
|
+
// @flow
|
|
2
2
|
import React from "react";
|
|
3
3
|
import logoViewBoxes from "../LogoViewBoxes";
|
|
4
4
|
import type { TypePartnerNames } from "./TypePartnerNames";
|
|
5
5
|
import { useTheme } from "styled-components";
|
|
6
|
+
import styled, { type StyledComponent } from "styled-components";
|
|
7
|
+
import { COMMON, FLEXBOX } from "../utils/system-props";
|
|
8
|
+
import type {
|
|
9
|
+
TypeSystemCommonProps,
|
|
10
|
+
TypeSystemFlexboxProps,
|
|
11
|
+
} from "../types/system-props.flow";
|
|
12
|
+
import type { TypeTheme } from "../types/theme.flow";
|
|
13
|
+
|
|
14
|
+
type TypeSystemProps = {|
|
|
15
|
+
...TypeSystemCommonProps,
|
|
16
|
+
...TypeSystemFlexboxProps,
|
|
17
|
+
|};
|
|
18
|
+
|
|
19
|
+
type TypeStyledSVG = StyledComponent<TypeSystemProps, TypeTheme, *>;
|
|
20
|
+
|
|
21
|
+
const StyledSVG: TypeStyledSVG = styled.svg`
|
|
22
|
+
${FLEXBOX};
|
|
23
|
+
${COMMON}
|
|
24
|
+
`;
|
|
6
25
|
|
|
7
26
|
type TypeProps = {
|
|
8
27
|
/** The name of the partner whose logo you want to render. */
|
|
9
28
|
partnerName: TypePartnerNames,
|
|
10
29
|
/** Manually override the default mode behavior by rendering a logo based on the background it's displayed on. */
|
|
11
30
|
backgroundType?: "dark" | "light",
|
|
31
|
+
height?: string,
|
|
32
|
+
width?: string,
|
|
12
33
|
};
|
|
13
34
|
|
|
14
|
-
const PartnerLogo = ({
|
|
35
|
+
const PartnerLogo = ({
|
|
36
|
+
partnerName,
|
|
37
|
+
backgroundType,
|
|
38
|
+
height,
|
|
39
|
+
width,
|
|
40
|
+
...rest
|
|
41
|
+
}: TypeProps) => {
|
|
15
42
|
const { mode } = useTheme();
|
|
16
43
|
const whichLogo = (type) => {
|
|
17
44
|
if (type && type === "dark") {
|
|
@@ -25,14 +52,24 @@ const PartnerLogo = ({ partnerName, backgroundType }: TypeProps) => {
|
|
|
25
52
|
}
|
|
26
53
|
};
|
|
27
54
|
const logoViewBox = logoViewBoxes[whichLogo(backgroundType)];
|
|
55
|
+
const viewBoxCoordinates = logoViewBox?.split(" ") || [];
|
|
56
|
+
const defaultWidth = viewBoxCoordinates[2];
|
|
57
|
+
const defaultHeight = viewBoxCoordinates[3];
|
|
28
58
|
|
|
29
59
|
return (
|
|
30
|
-
<
|
|
60
|
+
<StyledSVG
|
|
61
|
+
width={width ? width : defaultWidth}
|
|
62
|
+
height={height ? height : defaultHeight}
|
|
63
|
+
viewBox={logoViewBox}
|
|
64
|
+
focusable={false}
|
|
65
|
+
// $FlowIssue - upgrade v0.112.0
|
|
66
|
+
{...rest}
|
|
67
|
+
>
|
|
31
68
|
<use
|
|
32
69
|
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
33
70
|
xlinkHref={`#sslogosvg-${whichLogo(backgroundType)}`}
|
|
34
71
|
/>
|
|
35
|
-
</
|
|
72
|
+
</StyledSVG>
|
|
36
73
|
);
|
|
37
74
|
};
|
|
38
75
|
|
|
@@ -71,3 +71,20 @@ ModeOverride.args = {
|
|
|
71
71
|
ModeOverride.story = {
|
|
72
72
|
name: "Mode override",
|
|
73
73
|
};
|
|
74
|
+
|
|
75
|
+
export const LogoLayout = (args) => (
|
|
76
|
+
<Box display="flex" alignItems="center">
|
|
77
|
+
<PartnerLogo partnerName="facebook" height="40" width="40" mr={400} />
|
|
78
|
+
<PartnerLogo
|
|
79
|
+
partnerName="microsoft-dynamics"
|
|
80
|
+
height="40"
|
|
81
|
+
width="40"
|
|
82
|
+
mr={400}
|
|
83
|
+
/>
|
|
84
|
+
<PartnerLogo partnerName="zendesk" />
|
|
85
|
+
</Box>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
LogoLayout.story = {
|
|
89
|
+
name: "Layout and size",
|
|
90
|
+
};
|
|
@@ -7,7 +7,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _styles = _interopRequireWildcard(require("./styles"));
|
|
9
9
|
|
|
10
|
-
var _excluded = ["id", "value", "name", "label", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex", "inputProps"];
|
|
10
|
+
var _excluded = ["id", "value", "name", "label", "labelProps", "checked", "disabled", "indeterminate", "onChange", "ariaLabel", "appearance", "qa", "tabIndex", "inputProps"];
|
|
11
11
|
|
|
12
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
13
|
|
|
@@ -63,6 +63,7 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
|
63
63
|
value = _this$props.value,
|
|
64
64
|
name = _this$props.name,
|
|
65
65
|
label = _this$props.label,
|
|
66
|
+
labelProps = _this$props.labelProps,
|
|
66
67
|
checked = _this$props.checked,
|
|
67
68
|
disabled = _this$props.disabled,
|
|
68
69
|
indeterminate = _this$props.indeterminate,
|
|
@@ -102,9 +103,9 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
|
102
103
|
"data-qa-checkbox-ischecked": indeterminate ? "indeterminate" : checked === true,
|
|
103
104
|
"data-qa-checkbox-isdisabled": disabled === true,
|
|
104
105
|
tabIndex: tabIndex
|
|
105
|
-
}, qa, inputProps)), label && /*#__PURE__*/React.createElement(_styles.LabelText, {
|
|
106
|
+
}, qa, inputProps)), label && /*#__PURE__*/React.createElement(_styles.LabelText, _extends({}, labelProps, {
|
|
106
107
|
disabled: disabled
|
|
107
|
-
}, label));
|
|
108
|
+
}), label));
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
return (
|
|
@@ -7,13 +7,33 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _LogoViewBoxes = _interopRequireDefault(require("../LogoViewBoxes"));
|
|
9
9
|
|
|
10
|
-
var _styledComponents = require("styled-components");
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _systemProps = require("../utils/system-props");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["partnerName", "backgroundType", "height", "width"];
|
|
15
|
+
|
|
16
|
+
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
|
+
|
|
18
|
+
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; }
|
|
11
19
|
|
|
12
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
21
|
|
|
22
|
+
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); }
|
|
23
|
+
|
|
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; }
|
|
25
|
+
|
|
26
|
+
var StyledSVG = _styledComponents.default.svg.withConfig({
|
|
27
|
+
displayName: "PartnerLogo__StyledSVG",
|
|
28
|
+
componentId: "sc-ivi11w-0"
|
|
29
|
+
})(["", ";", ""], _systemProps.FLEXBOX, _systemProps.COMMON);
|
|
30
|
+
|
|
14
31
|
var PartnerLogo = function PartnerLogo(_ref) {
|
|
15
32
|
var partnerName = _ref.partnerName,
|
|
16
|
-
backgroundType = _ref.backgroundType
|
|
33
|
+
backgroundType = _ref.backgroundType,
|
|
34
|
+
height = _ref.height,
|
|
35
|
+
width = _ref.width,
|
|
36
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
37
|
|
|
18
38
|
var _useTheme = (0, _styledComponents.useTheme)(),
|
|
19
39
|
mode = _useTheme.mode;
|
|
@@ -32,10 +52,16 @@ var PartnerLogo = function PartnerLogo(_ref) {
|
|
|
32
52
|
|
|
33
53
|
var logoViewBox = _LogoViewBoxes.default[whichLogo(backgroundType)];
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
var viewBoxCoordinates = (logoViewBox == null ? void 0 : logoViewBox.split(" ")) || [];
|
|
56
|
+
var defaultWidth = viewBoxCoordinates[2];
|
|
57
|
+
var defaultHeight = viewBoxCoordinates[3];
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(StyledSVG, _extends({
|
|
59
|
+
width: width ? width : defaultWidth,
|
|
60
|
+
height: height ? height : defaultHeight,
|
|
36
61
|
viewBox: logoViewBox,
|
|
37
|
-
focusable: false
|
|
38
|
-
|
|
62
|
+
focusable: false // $FlowIssue - upgrade v0.112.0
|
|
63
|
+
|
|
64
|
+
}, rest), /*#__PURE__*/_react.default.createElement("use", {
|
|
39
65
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
40
66
|
xlinkHref: "#sslogosvg-" + whichLogo(backgroundType)
|
|
41
67
|
}));
|
|
@@ -44,7 +44,7 @@ var red = {
|
|
|
44
44
|
};
|
|
45
45
|
exports.red = red;
|
|
46
46
|
var neutral = {
|
|
47
|
-
background: _seedsColor.default.
|
|
47
|
+
background: _seedsColor.default.COLOR_NEUTRAL_1000,
|
|
48
48
|
highlight: _seedsColor.default.COLOR_NEUTRAL_500,
|
|
49
49
|
foreground: _seedsColor.default.COLOR_NEUTRAL_100
|
|
50
50
|
};
|