@sproutsocial/racine 11.3.1-beta-deps.5 → 11.4.1-input-beta.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 (43) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/__flow__/Button/__snapshots__/index.test.js.snap +511 -0
  3. package/__flow__/Button/index.js +0 -2
  4. package/__flow__/Button/index.stories.js +67 -51
  5. package/__flow__/Button/index.test.js +113 -0
  6. package/__flow__/Button/styles.js +1 -1
  7. package/__flow__/EmptyState/index.test.js +1 -1
  8. package/__flow__/Input/index.js +187 -67
  9. package/__flow__/Input/index.stories.js +65 -0
  10. package/__flow__/Input/index.test.js +230 -1
  11. package/__flow__/Input/styles.js +1 -1
  12. package/__flow__/Link/index.js +2 -1
  13. package/__flow__/Menu/__snapshots__/index.test.js.snap +2 -2
  14. package/__flow__/TokenInput/index.js +1 -1
  15. package/__flow__/setupTests.js +1 -1
  16. package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +14 -0
  17. package/__flow__/systemProps/tests/layout.test.js +9 -0
  18. package/__flow__/themes/dark/theme.js +3 -0
  19. package/__flow__/themes/light/theme.js +3 -0
  20. package/__flow__/types/theme.colors.flow.js +3 -0
  21. package/__flow__/utils/index.js +23 -0
  22. package/commonjs/Button/index.js +0 -1
  23. package/commonjs/Button/styles.js +0 -1
  24. package/commonjs/Input/index.js +124 -32
  25. package/commonjs/Input/styles.js +1 -1
  26. package/commonjs/Message/styles.js +1 -1
  27. package/commonjs/TokenInput/index.js +1 -1
  28. package/commonjs/themes/dark/theme.js +4 -1
  29. package/commonjs/themes/light/theme.js +4 -1
  30. package/commonjs/utils/index.js +29 -2
  31. package/dist/themes/dark/dark.scss +4 -1
  32. package/dist/themes/light/light.scss +4 -1
  33. package/lib/Button/index.js +0 -1
  34. package/lib/Button/styles.js +0 -1
  35. package/lib/Input/index.js +116 -32
  36. package/lib/Input/styles.js +1 -1
  37. package/lib/Message/styles.js +1 -1
  38. package/lib/TokenInput/index.js +1 -1
  39. package/lib/themes/dark/theme.js +4 -1
  40. package/lib/themes/light/theme.js +4 -1
  41. package/lib/utils/index.js +24 -0
  42. package/package.json +20 -24
  43. package/bin/buildNpm.js +0 -58
@@ -1,3 +1,27 @@
1
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2
+
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
+
5
+ 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; }
6
+
1
7
  export var canUseDOM = function canUseDOM() {
2
8
  return Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
9
+ };
10
+ // Allows a component to pass its own ref *and* a ref prop to the same element.
11
+ // Via https://www.davedrinks.coffee/how-do-i-use-two-react-refs/
12
+ export var mergeRefs = function mergeRefs(refs) {
13
+ var filteredRefs = refs.filter(Boolean);
14
+ if (!filteredRefs.length) return null;
15
+ if (filteredRefs.length === 0) return filteredRefs[0];
16
+ return function (inst) {
17
+ for (var _iterator = _createForOfIteratorHelperLoose(filteredRefs), _step; !(_step = _iterator()).done;) {
18
+ var ref = _step.value;
19
+
20
+ if (typeof ref === "function") {
21
+ ref(inst);
22
+ } else if (ref) {
23
+ ref.current = inst;
24
+ }
25
+ }
26
+ };
3
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.3.1-beta-deps.5",
3
+ "version": "11.4.1-input-beta.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.7",
72
+ "mutationobserver-shim": "^0.3.3",
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.12.9",
87
+ "@babel/core": "^7.4.5",
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,26 +99,23 @@
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.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",
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",
109
108
  "@storybook/react": "^6.4.19",
110
- "@storybook/theming": "^6.4.19",
111
- "@testing-library/jest-dom": "^5.16.4",
109
+ "@storybook/theming": "^6.1.11",
112
110
  "@testing-library/react": "^11.2.2",
113
111
  "@testing-library/user-event": "^13.0.0",
114
- "axios": "^0.26.1",
115
112
  "babel-core": "^7.0.0-bridge",
116
113
  "babel-eslint": "10.1.0",
117
- "babel-jest": "27.x.x",
118
- "babel-loader": "8.2.3",
114
+ "babel-jest": "26.1.0",
115
+ "babel-loader": "8.0.6",
119
116
  "babel-plugin-inline-import": "^3.0.0",
120
117
  "babel-plugin-polished": "^1.1.0",
121
- "babel-plugin-styled-components": "^2.0.7",
118
+ "babel-plugin-styled-components": "^1.10.0",
122
119
  "babel-polyfill": "^6.26.0",
123
120
  "chalk": "^2.3.2",
124
121
  "chokidar": "^3.0.2",
@@ -140,8 +137,9 @@
140
137
  "identity-obj-proxy": "^3.0.0",
141
138
  "inquirer": "^6.4.1",
142
139
  "is-glob": "^4.0.1",
143
- "jest": "27.x.x",
144
- "jest-axe": "6.0.0",
140
+ "jest": "26.1.0",
141
+ "jest-axe": "3.4.0",
142
+ "jest-dom": "^3.5.0",
145
143
  "jest-styled-components": "7.0.0-beta.1",
146
144
  "jscodeshift": "^0.6.4",
147
145
  "json-to-scss": "^1.6.2",
@@ -150,15 +148,15 @@
150
148
  "npm-run-all": "^4.1.2",
151
149
  "outdent": "^0.7.0",
152
150
  "pify": "^4.0.1",
153
- "playroom": "^0.27.9",
151
+ "playroom": "^0.22.2",
154
152
  "prettier": "^2.0.5",
155
153
  "prop-types": "^15.6.1",
156
154
  "react": "16.12.0",
157
155
  "react-dates": "^21.8.0",
158
156
  "react-dom": "16.12.0",
159
157
  "rimraf": "^2.6.3",
160
- "storybook-dark-mode": "^1.0.9",
161
- "styled-components": "^5.2.3",
158
+ "storybook-dark-mode": "^1.0.7",
159
+ "styled-components": "5.0.0-rc.2",
162
160
  "stylelint": "^13.8.0",
163
161
  "stylelint-config-recommended": "^2.2.0",
164
162
  "stylelint-config-styled-components": "^0.1.1",
@@ -180,15 +178,13 @@
180
178
  "prop-types": "^15.0.0",
181
179
  "react": "^16.2.0",
182
180
  "react-dates": "^21.8.0",
183
- "react-virtualized": "9.18.5",
184
- "styled-components": "^5.2.3"
181
+ "styled-components": "^5.0.0-rc.2"
185
182
  },
186
183
  "resolutions": {
187
184
  "lodash": "^4.17.21",
188
185
  "react-popper/create-react-context": "^0.3.0"
189
186
  },
190
187
  "jest": {
191
- "testEnvironment": "jsdom",
192
188
  "setupFilesAfterEnv": [
193
189
  "<rootDir>/src/setupTests.js"
194
190
  ],
package/bin/buildNpm.js DELETED
@@ -1,58 +0,0 @@
1
- /**
2
- * This file handles the generation of an .npmrc with Jfrog credentials during the CI process.
3
- * It replicates the local configuration requirements of a developer running `yarn` on their machine
4
- * If run locally please do not commit your auth credentials
5
- */
6
- const fs = require("fs");
7
- const https = require("https");
8
- const { exit } = require("process");
9
-
10
- const { ARTIFACTORY_KEY, CI } = process.env;
11
-
12
- // Check if we're in CI context, otherwise skip the process
13
- if (!CI) {
14
- exit();
15
- }
16
-
17
- const options = {
18
- hostname: "sproutsocial.jfrog.io",
19
- path: "/artifactory/api/npm/auth",
20
- method: "GET",
21
- headers: {
22
- "X-JFrog-Art-Api": ARTIFACTORY_KEY,
23
- },
24
- };
25
-
26
- const req = https.request(options, (res) => {
27
- console.log(`statusCode: ${res.statusCode}`);
28
-
29
- // Call our auth endpoint with environment credentials
30
- res.on("data", (data) => {
31
- // Writes out an .npmrc file with the response
32
- fs.writeFile(".npmrc", data, (err) => {
33
- if (err) console.log(err);
34
- else {
35
- console.log(".npmrc generated successfully!");
36
- }
37
- });
38
-
39
- // Once the file is created we append the registry info
40
- fs.appendFile(
41
- ".npmrc",
42
- "registry=https://sproutsocial.jfrog.io/artifactory/api/npm/npm_virtual",
43
- function (err) {
44
- if (err) throw err;
45
- console.log("Registry Config Added!");
46
- }
47
- );
48
-
49
- // Finally, we set permissions for the file so that netlify recognizes it
50
- fs.chmodSync(".npmrc", "0600");
51
- });
52
- });
53
-
54
- req.on("error", (error) => {
55
- console.error(error);
56
- });
57
-
58
- req.end();