@sproutsocial/racine 11.4.2-input-beta.0 → 11.5.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.
@@ -10,15 +10,6 @@ describe("layout system props", () => {
10
10
  ${layoutSystemProps}
11
11
  `;
12
12
 
13
- test("display", () => {
14
- const { container } = render(
15
- <>
16
- <Component display="string" />
17
- </>
18
- );
19
- expect(container).toMatchSnapshot();
20
- });
21
-
22
13
  test("height", () => {
23
14
  const { container } = render(
24
15
  <>
@@ -19,21 +19,13 @@ describe("normalizeResponsiveProp", () => {
19
19
 
20
20
  it("should handle arrays with 4 values", () => {
21
21
  expect(normalizeResponsiveProp([0, 1, 2, 3])).toMatchObject([
22
- 0,
23
- 1,
24
- 2,
25
- 3,
26
- 3,
22
+ 0, 1, 2, 3, 3,
27
23
  ]);
28
24
  });
29
25
 
30
26
  it("should handle arrays with 5 values", () => {
31
27
  expect(normalizeResponsiveProp([0, 1, 2, 3, 4])).toMatchObject([
32
- 0,
33
- 1,
34
- 2,
35
- 3,
36
- 4,
28
+ 0, 1, 2, 3, 4,
37
29
  ]);
38
30
  });
39
31
  });
@@ -65,5 +65,6 @@ var Button = function Button(_ref) {
65
65
  }, qa, rest), children);
66
66
  };
67
67
 
68
+ Button.displayName = "Button";
68
69
  var _default = Button;
69
70
  exports.default = _default;
@@ -60,6 +60,7 @@ var Container = _styledComponents.default.button.withConfig({
60
60
  return props.appearance === "pill" && (0, _styledComponents.css)(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "dark" ? "screen" : "multiply", _mixins.pill);
61
61
  }, _styles.default, _systemProps.LAYOUT, _systemProps.COMMON);
62
62
 
63
+ Container.displayName = "Button-Container";
63
64
  var _default = Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
64
65
 
65
66
  exports.default = _default;
@@ -95,10 +95,14 @@ var isClearButton = function isClearButton(elem) {
95
95
  var Input = /*#__PURE__*/function (_React$Component) {
96
96
  _inheritsLoose(Input, _React$Component);
97
97
 
98
- function Input(props) {
98
+ function Input() {
99
99
  var _this;
100
100
 
101
- _this = _React$Component.call(this, props) || this;
101
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
102
+ args[_key] = arguments[_key];
103
+ }
104
+
105
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
102
106
  _this.inputRef = /*#__PURE__*/React.createRef();
103
107
 
104
108
  _this.handleBlur = function (e) {
@@ -113,9 +117,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
113
117
  };
114
118
 
115
119
  _this.handleChange = function (e) {
116
- _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
117
-
118
- _this.updateState(e.currentTarget.value);
120
+ return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
119
121
  };
120
122
 
121
123
  _this.handleFocus = function (e) {
@@ -134,22 +136,6 @@ var Input = /*#__PURE__*/function (_React$Component) {
134
136
  return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
135
137
  };
136
138
 
137
- _this.updateState = function (value) {
138
- var hasValue = value !== "";
139
- var hadValue = _this.state.hasValue; // Only update state if the value has changed to avoid unnecessary renders.
140
-
141
- if (hasValue !== hadValue) {
142
- _this.setState({
143
- hasValue: hasValue
144
- });
145
- }
146
- };
147
-
148
- _this.state = {
149
- // tracking hasValue in state allows us to hide ClearButton when there is no value to clear
150
- // for both controlled and uncontrolled inputs.
151
- hasValue: !!props.value
152
- };
153
139
  return _this;
154
140
  }
155
141
 
@@ -218,7 +204,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
218
204
  }, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
219
205
  value: {
220
206
  handleClear: this.handleClear,
221
- hasValue: this.state.hasValue,
207
+ hasValue: !!value,
222
208
  clearButtonLabel: clearButtonLabel,
223
209
  onClear: onClear,
224
210
  size: size
@@ -105,7 +105,7 @@ exports.MessageBody = MessageBody;
105
105
  var MessageFooter = (0, _styledComponents.default)(_Box.default).withConfig({
106
106
  displayName: "styles__MessageFooter",
107
107
  componentId: "sc-1ju6d1v-3"
108
- })(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", ";>:first-child{margin-left:-", ";}"], function (props) {
108
+ })(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", ";> :first-child{margin-left:-", ";}"], function (props) {
109
109
  return props.density === _Message.default.DENSITIES.CONDENSED ? 0 : props.theme.space[300];
110
110
  }, function (props) {
111
111
  return getContentPadding(props);
@@ -53,4 +53,5 @@ var Button = function Button(_ref) {
53
53
  }, qa, rest), children);
54
54
  };
55
55
 
56
+ Button.displayName = "Button";
56
57
  export default Button;
@@ -44,4 +44,5 @@ var Container = styled.button.withConfig({
44
44
  }, function (props) {
45
45
  return props.appearance === "pill" && css(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "dark" ? "screen" : "multiply", pill);
46
46
  }, Icon, LAYOUT, COMMON);
47
+ Container.displayName = "Button-Container";
47
48
  export default Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
@@ -78,10 +78,14 @@ var isClearButton = function isClearButton(elem) {
78
78
  var Input = /*#__PURE__*/function (_React$Component) {
79
79
  _inheritsLoose(Input, _React$Component);
80
80
 
81
- function Input(props) {
81
+ function Input() {
82
82
  var _this;
83
83
 
84
- _this = _React$Component.call(this, props) || this;
84
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
85
+ args[_key] = arguments[_key];
86
+ }
87
+
88
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
85
89
  _this.inputRef = /*#__PURE__*/React.createRef();
86
90
 
87
91
  _this.handleBlur = function (e) {
@@ -96,9 +100,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
96
100
  };
97
101
 
98
102
  _this.handleChange = function (e) {
99
- _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
100
-
101
- _this.updateState(e.currentTarget.value);
103
+ return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
102
104
  };
103
105
 
104
106
  _this.handleFocus = function (e) {
@@ -117,22 +119,6 @@ var Input = /*#__PURE__*/function (_React$Component) {
117
119
  return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
118
120
  };
119
121
 
120
- _this.updateState = function (value) {
121
- var hasValue = value !== "";
122
- var hadValue = _this.state.hasValue; // Only update state if the value has changed to avoid unnecessary renders.
123
-
124
- if (hasValue !== hadValue) {
125
- _this.setState({
126
- hasValue: hasValue
127
- });
128
- }
129
- };
130
-
131
- _this.state = {
132
- // tracking hasValue in state allows us to hide ClearButton when there is no value to clear
133
- // for both controlled and uncontrolled inputs.
134
- hasValue: !!props.value
135
- };
136
122
  return _this;
137
123
  }
138
124
 
@@ -201,7 +187,7 @@ var Input = /*#__PURE__*/function (_React$Component) {
201
187
  }, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
202
188
  value: {
203
189
  handleClear: this.handleClear,
204
- hasValue: this.state.hasValue,
190
+ hasValue: !!value,
205
191
  clearButtonLabel: clearButtonLabel,
206
192
  onClear: onClear,
207
193
  size: size
@@ -91,7 +91,7 @@ export var MessageBody = styled(Box).withConfig({
91
91
  export var MessageFooter = styled(Box).withConfig({
92
92
  displayName: "styles__MessageFooter",
93
93
  componentId: "sc-1ju6d1v-3"
94
- })(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", ";>:first-child{margin-left:-", ";}"], function (props) {
94
+ })(["padding-bottom:", ";padding-left:", ";padding-right:", ";border-radius:0 0 ", " ", ";display:flex;justify-content:space-between;align-items:center;flex-wrap:", ";> :first-child{margin-left:-", ";}"], function (props) {
95
95
  return props.density === Message.DENSITIES.CONDENSED ? 0 : props.theme.space[300];
96
96
  }, function (props) {
97
97
  return getContentPadding(props);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.4.2-input-beta.0",
3
+ "version": "11.5.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -69,7 +69,7 @@
69
69
  "lodash.curry": "^4.1.1",
70
70
  "lodash.uniqueid": "^4.0.1",
71
71
  "lru-memoize": "^1.1.0",
72
- "mutationobserver-shim": "^0.3.3",
72
+ "mutationobserver-shim": "^0.3.7",
73
73
  "polished": "^3.4.1",
74
74
  "raw-loader": "^3.0.0",
75
75
  "react-focus-lock": "^2.0.3",
@@ -84,7 +84,7 @@
84
84
  },
85
85
  "devDependencies": {
86
86
  "@babel/cli": "^7.5.5",
87
- "@babel/core": "^7.4.5",
87
+ "@babel/core": "^7.12.9",
88
88
  "@babel/plugin-proposal-class-properties": "^7.4.4",
89
89
  "@babel/plugin-syntax-dynamic-import": "^7.0.0",
90
90
  "@babel/preset-env": "^7.8.0",
@@ -99,23 +99,26 @@
99
99
  "@sproutsocial/seeds-networkcolor": "^2.9.0",
100
100
  "@sproutsocial/seeds-space": "^0.4.7",
101
101
  "@sproutsocial/seeds-typography": "^3.0.1",
102
- "@storybook/addon-a11y": "^6.1.11",
103
- "@storybook/addon-actions": "^6.3.8",
104
- "@storybook/addon-knobs": "^6.1.11",
105
- "@storybook/addon-storysource": "^6.1.11",
106
- "@storybook/addon-viewport": "^6.1.11",
107
- "@storybook/addons": "^6.1.11",
102
+ "@storybook/addon-a11y": "^6.4.19",
103
+ "@storybook/addon-actions": "^6.4.19",
104
+ "@storybook/addon-controls": "^6.4.19",
105
+ "@storybook/addon-knobs": "^6.4.0",
106
+ "@storybook/addon-storysource": "^6.4.19",
107
+ "@storybook/addon-viewport": "^6.4.19",
108
+ "@storybook/addons": "^6.4.19",
108
109
  "@storybook/react": "^6.4.19",
109
- "@storybook/theming": "^6.1.11",
110
+ "@storybook/theming": "^6.4.19",
111
+ "@testing-library/jest-dom": "^5.16.4",
110
112
  "@testing-library/react": "^11.2.2",
111
113
  "@testing-library/user-event": "^13.0.0",
114
+ "axios": "^0.26.1",
112
115
  "babel-core": "^7.0.0-bridge",
113
116
  "babel-eslint": "10.1.0",
114
- "babel-jest": "26.1.0",
115
- "babel-loader": "8.0.6",
117
+ "babel-jest": "27.x.x",
118
+ "babel-loader": "8.2.3",
116
119
  "babel-plugin-inline-import": "^3.0.0",
117
120
  "babel-plugin-polished": "^1.1.0",
118
- "babel-plugin-styled-components": "^1.10.0",
121
+ "babel-plugin-styled-components": "^2.0.7",
119
122
  "babel-polyfill": "^6.26.0",
120
123
  "chalk": "^2.3.2",
121
124
  "chokidar": "^3.0.2",
@@ -137,9 +140,8 @@
137
140
  "identity-obj-proxy": "^3.0.0",
138
141
  "inquirer": "^6.4.1",
139
142
  "is-glob": "^4.0.1",
140
- "jest": "26.1.0",
141
- "jest-axe": "3.4.0",
142
- "jest-dom": "^3.5.0",
143
+ "jest": "27.x.x",
144
+ "jest-axe": "6.0.0",
143
145
  "jest-styled-components": "7.0.0-beta.1",
144
146
  "jscodeshift": "^0.6.4",
145
147
  "json-to-scss": "^1.6.2",
@@ -148,15 +150,15 @@
148
150
  "npm-run-all": "^4.1.2",
149
151
  "outdent": "^0.7.0",
150
152
  "pify": "^4.0.1",
151
- "playroom": "^0.22.2",
153
+ "playroom": "^0.27.9",
152
154
  "prettier": "^2.0.5",
153
155
  "prop-types": "^15.6.1",
154
156
  "react": "16.12.0",
155
157
  "react-dates": "^21.8.0",
156
158
  "react-dom": "16.12.0",
157
159
  "rimraf": "^2.6.3",
158
- "storybook-dark-mode": "^1.0.7",
159
- "styled-components": "5.0.0-rc.2",
160
+ "storybook-dark-mode": "^1.0.9",
161
+ "styled-components": "^5.2.3",
160
162
  "stylelint": "^13.8.0",
161
163
  "stylelint-config-recommended": "^2.2.0",
162
164
  "stylelint-config-styled-components": "^0.1.1",
@@ -178,13 +180,15 @@
178
180
  "prop-types": "^15.0.0",
179
181
  "react": "^16.2.0",
180
182
  "react-dates": "^21.8.0",
181
- "styled-components": "^5.0.0-rc.2"
183
+ "react-virtualized": "9.18.5",
184
+ "styled-components": "^5.2.3"
182
185
  },
183
186
  "resolutions": {
184
187
  "lodash": "^4.17.21",
185
188
  "react-popper/create-react-context": "^0.3.0"
186
189
  },
187
190
  "jest": {
191
+ "testEnvironment": "jsdom",
188
192
  "setupFilesAfterEnv": [
189
193
  "<rootDir>/src/setupTests.js"
190
194
  ],