@sproutsocial/racine 14.0.1 → 14.1.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/__flow__/Banner/Banner.flow.js +4 -0
  3. package/__flow__/systemProps/flexbox.js +4 -1
  4. package/__flow__/types/system-props.flow.js +3 -0
  5. package/__flow__/types/theme.flow.js +27 -0
  6. package/commonjs/Banner/Banner.js +45 -30
  7. package/commonjs/Banner/styles.js +10 -3
  8. package/commonjs/CharacterCounter/CharacterCounter.js +1 -0
  9. package/commonjs/Input/styles.js +13 -2
  10. package/commonjs/Select/styles.js +13 -2
  11. package/commonjs/StatefulStory.js +32 -0
  12. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +20 -0
  13. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +20 -0
  14. package/commonjs/utils/system-props/gap.js +22 -0
  15. package/commonjs/utils/system-props/index.js +16 -0
  16. package/commonjs/utils/{system-props.js → system-props/system-props.js} +2 -1
  17. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +40 -0
  18. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +40 -0
  19. package/dist/types/Badge/BadgeTypes.d.ts +1 -1
  20. package/dist/types/Badge/BadgeTypes.d.ts.map +1 -1
  21. package/dist/types/Banner/Banner.d.ts +1 -1
  22. package/dist/types/Banner/Banner.d.ts.map +1 -1
  23. package/dist/types/Banner/BannerTypes.d.ts +4 -0
  24. package/dist/types/Banner/BannerTypes.d.ts.map +1 -1
  25. package/dist/types/Banner/styles.d.ts +7 -0
  26. package/dist/types/Banner/styles.d.ts.map +1 -1
  27. package/dist/types/Box/Box.d.ts +1 -1
  28. package/dist/types/Box/Box.d.ts.map +1 -1
  29. package/dist/types/Card/styles.d.ts +1 -1
  30. package/dist/types/Card/styles.d.ts.map +1 -1
  31. package/dist/types/CharacterCounter/CharacterCounter.d.ts.map +1 -1
  32. package/dist/types/Checkbox/styles.d.ts +1 -1
  33. package/dist/types/Checkbox/styles.d.ts.map +1 -1
  34. package/dist/types/Collapsible/styles.d.ts +1 -1
  35. package/dist/types/DatePicker/styles.d.ts +1 -1
  36. package/dist/types/Drawer/Drawer.d.ts +3 -2
  37. package/dist/types/Drawer/Drawer.d.ts.map +1 -1
  38. package/dist/types/Drawer/styles.d.ts +1 -1
  39. package/dist/types/Drawer/styles.d.ts.map +1 -1
  40. package/dist/types/Fieldset/styles.d.ts +1 -1
  41. package/dist/types/Fieldset/styles.d.ts.map +1 -1
  42. package/dist/types/Input/styles.d.ts.map +1 -1
  43. package/dist/types/Menu/styles.d.ts +2 -2
  44. package/dist/types/Menu/styles.d.ts.map +1 -1
  45. package/dist/types/Message/styles.d.ts +5 -5
  46. package/dist/types/Message/styles.d.ts.map +1 -1
  47. package/dist/types/Modal/Modal.d.ts +1 -1
  48. package/dist/types/Modal/styles.d.ts +4 -4
  49. package/dist/types/Modal/styles.d.ts.map +1 -1
  50. package/dist/types/SegmentedControl/styles.d.ts +2 -2
  51. package/dist/types/SegmentedControl/styles.d.ts.map +1 -1
  52. package/dist/types/Select/styles.d.ts.map +1 -1
  53. package/dist/types/Skeleton/Skeleton.d.ts +1 -1
  54. package/dist/types/Skeleton/Skeleton.d.ts.map +1 -1
  55. package/dist/types/StatefulStory.d.ts +22 -0
  56. package/dist/types/StatefulStory.d.ts.map +1 -0
  57. package/dist/types/Toast/styles.d.ts +1 -1
  58. package/dist/types/Toast/styles.d.ts.map +1 -1
  59. package/dist/types/Tooltip/styles.d.ts +1 -1
  60. package/dist/types/Tooltip/styles.d.ts.map +1 -1
  61. package/dist/types/themes/extendedThemes/sproutTheme/dark/theme.d.ts +20 -0
  62. package/dist/types/themes/extendedThemes/sproutTheme/dark/theme.d.ts.map +1 -1
  63. package/dist/types/themes/extendedThemes/sproutTheme/light/theme.d.ts +20 -0
  64. package/dist/types/themes/extendedThemes/sproutTheme/light/theme.d.ts.map +1 -1
  65. package/dist/types/types/system-props.d.ts +24 -2
  66. package/dist/types/types/system-props.d.ts.map +1 -1
  67. package/dist/types/utils/system-props/gap.d.ts +2 -0
  68. package/dist/types/utils/system-props/gap.d.ts.map +1 -0
  69. package/dist/types/utils/system-props/index.d.ts +2 -0
  70. package/dist/types/utils/system-props/index.d.ts.map +1 -0
  71. package/dist/types/utils/system-props/system-props.d.ts.map +1 -0
  72. package/lib/Banner/Banner.js +45 -30
  73. package/lib/Banner/styles.js +7 -2
  74. package/lib/CharacterCounter/CharacterCounter.js +1 -0
  75. package/lib/Input/styles.js +13 -2
  76. package/lib/Select/styles.js +13 -2
  77. package/lib/StatefulStory.js +33 -0
  78. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +20 -0
  79. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +20 -0
  80. package/lib/utils/system-props/gap.js +15 -0
  81. package/lib/utils/system-props/index.js +1 -0
  82. package/lib/utils/{system-props.js → system-props/system-props.js} +2 -1
  83. package/package.json +1 -2
  84. package/dist/types/utils/system-props.d.ts.map +0 -1
  85. /package/dist/types/utils/{system-props.d.ts → system-props/system-props.d.ts} +0 -0
@@ -4,7 +4,7 @@ import { COMMON } from "../utils/system-props";
4
4
  var Container = styled.div.withConfig({
5
5
  displayName: "styles__Container",
6
6
  componentId: "sc-4stdun-0"
7
- })(["box-sizing:border-box;position:relative;input{box-sizing:border-box;width:100%;border:1px solid transparent;border-radius:", ";background-color:", ";color:", ";outline:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";appearance:none;line-height:16px;margin:0;padding:", ";font-size:", ";&::-ms-clear{display:none;}&::-webkit-search-cancel-button{appearance:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}&::placeholder{color:", ";}", " ", "}", " ", " ", " ", " ", ""], function (props) {
7
+ })(["box-sizing:border-box;position:relative;input{box-sizing:border-box;width:100%;border:1px solid transparent;border-radius:", ";background-color:", ";color:", ";outline:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";appearance:none;margin:0;padding:", ";font-size:", ";line-height:", ";&::-ms-clear{display:none;}&::-webkit-search-cancel-button{appearance:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}&::placeholder{color:", ";}", " ", "}", " ", " ", " ", " ", ""], function (props) {
8
8
  return props.theme.radii[500];
9
9
  }, function (props) {
10
10
  return props.theme.colors.form.background.base;
@@ -25,7 +25,7 @@ var Container = styled.div.withConfig({
25
25
  }, function (props) {
26
26
  switch (props.size) {
27
27
  case 'large':
28
- return props.theme.space[400];
28
+ return "".concat(props.theme.space[350], " ").concat(props.theme.space[400]);
29
29
  case 'small':
30
30
  return props.theme.space[200];
31
31
  case 'default':
@@ -41,6 +41,17 @@ var Container = styled.div.withConfig({
41
41
  default:
42
42
  return props.theme.typography[200].fontSize;
43
43
  }
44
+ }, function (props) {
45
+ switch (props.size) {
46
+ case 'large':
47
+ return props.theme.typography[300].lineHeight;
48
+
49
+ /* 16px was the value prior to this change to 'large'. Leaving as-is but it is a non-Seeds typography line-height. It may have a big impact though */
50
+ case 'small':
51
+ case 'default':
52
+ default:
53
+ return '16px';
54
+ }
44
55
  }, focusRing, function (props) {
45
56
  return props.theme.colors.form.placeholder.base;
46
57
  }, function (props) {
@@ -4,7 +4,7 @@ import { COMMON } from "../utils/system-props";
4
4
  var Container = styled.div.withConfig({
5
5
  displayName: "styles__Container",
6
6
  componentId: "sc-egruk2-0"
7
- })(["position:relative;box-sizing:border-box;select{box-sizing:border-box;width:100%;border:1px solid ", ";border-radius:", ";background-color:", ";color:", ";cursor:", ";outline:none;appearance:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";margin:0;visibility:visible;padding:", ";font-size:", ";&::-ms-expand{display:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}}@-moz-document url-prefix(){select{line-height:14px;}}", " ", " ", ""], function (props) {
7
+ })(["position:relative;box-sizing:border-box;select{box-sizing:border-box;width:100%;border:1px solid ", ";border-radius:", ";background-color:", ";color:", ";cursor:", ";outline:none;appearance:none;transition:border-color ", " ", ",box-shadow ", " ", ";font-family:", ";font-weight:", ";margin:0;visibility:visible;padding:", ";font-size:", ";line-height:", ";&::-ms-expand{display:none;}&:focus{", "}&:not(output):not(:focus):-moz-ui-invalid{box-shadow:none;}}", " ", " ", ""], function (props) {
8
8
  return props.theme.colors.form.border.base;
9
9
  }, function (props) {
10
10
  return props.theme.radii[500];
@@ -29,7 +29,7 @@ var Container = styled.div.withConfig({
29
29
  }, function (props) {
30
30
  switch (props.size) {
31
31
  case 'large':
32
- return "".concat(props.theme.space[400], " ").concat(props.theme.space[600], " ").concat(props.theme.space[400], " ").concat(props.theme.space[400]);
32
+ return "".concat(props.theme.space[350], " ").concat(props.theme.space[600], " ").concat(props.theme.space[350], " ").concat(props.theme.space[400]);
33
33
  case 'small':
34
34
  return "".concat(props.theme.space[200], " ").concat(props.theme.space[500], " ").concat(props.theme.space[200], " ").concat(props.theme.space[200]);
35
35
  case 'default':
@@ -45,6 +45,17 @@ var Container = styled.div.withConfig({
45
45
  default:
46
46
  return props.theme.typography[200].fontSize;
47
47
  }
48
+ }, function (props) {
49
+ switch (props.size) {
50
+ case 'large':
51
+ return props.theme.typography[300].lineHeight;
52
+
53
+ /* hardcoded to 'normal' so the large change doesn't impact small/default */
54
+ case 'small':
55
+ case 'default':
56
+ default:
57
+ return 'normal';
58
+ }
48
59
  }, focusRing, function (props) {
49
60
  return props.disabled && css(["opacity:0.4;"]);
50
61
  }, function (props) {
@@ -0,0 +1,33 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useState } from 'react';
8
+
9
+ /**
10
+ * Props for the StatefulStory component.
11
+ *
12
+ * This type automatically detects the type of the `initialState` prop and passes it to the `children` when rendered.
13
+ */
14
+
15
+ /**
16
+ * A wrapper component that allows you to pass in an initial state.
17
+ *
18
+ * This is useful for adding state inline for stories. Story functions are not intepretted as React components,
19
+ * so you can't use hooks in them. This component allows you to useState in a story without having to create a
20
+ * custom component for every story.
21
+ */
22
+ export function StatefulStory(_ref) {
23
+ var children = _ref.children,
24
+ initialState = _ref.initialState;
25
+ var _useState = useState(initialState),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ state = _useState2[0],
28
+ setState = _useState2[1];
29
+ return children({
30
+ state: state,
31
+ setState: setState
32
+ });
33
+ }
@@ -85,6 +85,26 @@ export var analytics = {
85
85
  }
86
86
  };
87
87
  export var listening = {
88
+ chart: {
89
+ indicator: {
90
+ default: {
91
+ primary: baseDarkTheme.colors.neutral[100],
92
+ secondary: baseDarkTheme.colors.neutral[900]
93
+ },
94
+ hover: {
95
+ primary: baseDarkTheme.colors.neutral[300],
96
+ secondary: baseDarkTheme.colors.neutral[0]
97
+ }
98
+ },
99
+ spike: {
100
+ background: {
101
+ base: baseDarkTheme.colors.teal[500]
102
+ },
103
+ icon: {
104
+ base: baseDarkTheme.colors.neutral[0]
105
+ }
106
+ }
107
+ },
88
108
  topicTypes: {
89
109
  customTopic: baseDarkTheme.colors.teal[400],
90
110
  brandHealth: baseDarkTheme.colors.red[400],
@@ -82,6 +82,26 @@ export var analytics = {
82
82
  }
83
83
  };
84
84
  export var listening = {
85
+ chart: {
86
+ indicator: {
87
+ default: {
88
+ primary: baseLightTheme.colors.neutral[400],
89
+ secondary: baseLightTheme.colors.neutral[0]
90
+ },
91
+ hover: {
92
+ primary: baseLightTheme.colors.neutral[1000],
93
+ secondary: baseLightTheme.colors.neutral[0]
94
+ }
95
+ },
96
+ spike: {
97
+ background: {
98
+ base: baseLightTheme.colors.teal[500]
99
+ },
100
+ icon: {
101
+ base: baseLightTheme.colors.neutral[0]
102
+ }
103
+ }
104
+ },
85
105
  topicTypes: {
86
106
  customTopic: baseLightTheme.colors.blue[400],
87
107
  brandHealth: baseLightTheme.colors.red[400],
@@ -0,0 +1,15 @@
1
+ import { system } from 'styled-system';
2
+ export var gap = system({
3
+ gap: {
4
+ property: 'gap',
5
+ scale: 'space'
6
+ },
7
+ rowGap: {
8
+ property: 'rowGap',
9
+ scale: 'space'
10
+ },
11
+ columnGap: {
12
+ property: 'columnGap',
13
+ scale: 'space'
14
+ }
15
+ });
@@ -0,0 +1 @@
1
+ export * from "./system-props";
@@ -1,5 +1,6 @@
1
1
  // eslint-disable-next-line no-restricted-syntax
2
2
  import * as styles from 'styled-system';
3
+ import { gap } from "./gap";
3
4
  var typeScale = styles.variant({
4
5
  key: 'typography',
5
6
  prop: 'typeScale'
@@ -18,5 +19,5 @@ styles.boxShadow);
18
19
  export var TYPOGRAPHY = styles.compose(typeScale, styles.fontFamily, styles.fontStyle, styles.fontWeight, styles.lineHeight, styles.textAlign);
19
20
  export var LAYOUT = styles.compose(styles.display, styles.size, styles.width, styles.height, styles.minWidth, styles.minHeight, styles.maxWidth, styles.maxHeight, styles.overflow, styles.verticalAlign);
20
21
  export var POSITION = styles.compose(styles.position, styles.zIndex, styles.top, styles.right, styles.bottom, styles.left);
21
- export var FLEXBOX = styles.compose(styles.flexBasis, styles.flexDirection, styles.flexWrap, styles.alignContent, styles.alignItems, styles.justifyContent, styles.justifyItems, styles.order, styles.flex, styles.flexShrink, styles.flexGrow, styles.justifySelf, styles.alignSelf);
22
+ export var FLEXBOX = styles.compose(styles.flexBasis, styles.flexDirection, styles.flexWrap, styles.alignContent, styles.alignItems, styles.justifyContent, styles.justifyItems, styles.order, styles.flex, styles.flexShrink, styles.flexGrow, styles.justifySelf, styles.alignSelf, gap);
22
23
  export var GRID = styles.grid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "14.0.1",
3
+ "version": "14.1.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -100,7 +100,6 @@
100
100
  "@babel/preset-typescript": "^7.18.6",
101
101
  "@changesets/cli": "^2.12.0",
102
102
  "@khanacademy/flow-to-ts": "^0.5.2",
103
- "@reach/component-component": "^0.1.3",
104
103
  "@sproutsocial/seeds-border": "^1.1.0",
105
104
  "@sproutsocial/seeds-color": "^1.5.3",
106
105
  "@sproutsocial/seeds-depth": "^3.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"system-props.d.ts","sourceRoot":"","sources":["../../../src/utils/system-props.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAOxC,eAAO,MAAM,MAAM,gBAOlB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAgBlB,CAAC;AAEF,eAAO,MAAM,UAAU,gBAOtB,CAAC;AAEF,eAAO,MAAM,MAAM,gBAWlB,CAAC;AAEF,eAAO,MAAM,QAAQ,gBAOpB,CAAC;AAEF,eAAO,MAAM,OAAO,gBAcnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBAAc,CAAC"}