@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 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 && <LabelText disabled={disabled}>{label}</LabelText>}
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 strict-local
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 = ({ partnerName, backgroundType }: TypeProps) => {
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
- <svg viewBox={logoViewBox} focusable={false}>
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
- </svg>
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
+ };
@@ -37,7 +37,7 @@ export const red = {
37
37
  };
38
38
 
39
39
  export const neutral = {
40
- background: COLORS.COLOR_NEUTRAL_900,
40
+ background: COLORS.COLOR_NEUTRAL_1000,
41
41
  highlight: COLORS.COLOR_NEUTRAL_500,
42
42
  foreground: COLORS.COLOR_NEUTRAL_100,
43
43
  };
@@ -17,7 +17,7 @@ export const navigation = {
17
17
  },
18
18
  settings: {
19
19
  listItem: {
20
- backgound: {
20
+ background: {
21
21
  base: "transparent",
22
22
  hover: baseDarkTheme.colors.neutral[1100],
23
23
  selected: baseDarkTheme.colors.neutral[800],
@@ -17,7 +17,7 @@ export const navigation = {
17
17
  },
18
18
  settings: {
19
19
  listItem: {
20
- backgound: {
20
+ background: {
21
21
  base: "transparent",
22
22
  hover: baseLightTheme.colors.neutral[200],
23
23
  selected: baseLightTheme.colors.neutral[0],
@@ -271,6 +271,7 @@ type TypeNetworkColors = {|
271
271
  microsoft_dynamics: string,
272
272
  yelp: string,
273
273
  whatsapp: string,
274
+ tiktok: string,
274
275
  },
275
276
  |};
276
277
 
@@ -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
- return /*#__PURE__*/_react.default.createElement("svg", {
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
- }, /*#__PURE__*/_react.default.createElement("use", {
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.COLOR_NEUTRAL_900,
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
  };
@@ -25,7 +25,7 @@ var navigation = {
25
25
  },
26
26
  settings: {
27
27
  listItem: {
28
- backgound: {
28
+ background: {
29
29
  base: "transparent",
30
30
  hover: _theme.default.colors.neutral[1100],
31
31
  selected: _theme.default.colors.neutral[800]
@@ -25,7 +25,7 @@ var navigation = {
25
25
  },
26
26
  settings: {
27
27
  listItem: {
28
- backgound: {
28
+ background: {
29
29
  base: "transparent",
30
30
  hover: _theme.default.colors.neutral[200],
31
31
  selected: _theme.default.colors.neutral[0]