@canonical/react-components 0.21.0 → 0.30.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 (40) hide show
  1. package/README.md +4 -4
  2. package/dist/components/AccordionSection/AccordionSection.js +0 -13
  3. package/dist/components/ActionButton/ActionButton.js +2 -5
  4. package/dist/components/Button/Button.d.ts +1 -2
  5. package/dist/components/Button/Button.js +2 -16
  6. package/dist/components/Chip/Chip.d.ts +1 -1
  7. package/dist/components/Chip/Chip.js +26 -29
  8. package/dist/components/CodeSnippet/CodeSnippetBlock.js +1 -12
  9. package/dist/components/CodeSnippet/CodeSnippetDropdown.js +1 -8
  10. package/dist/components/ContextualMenu/ContextualMenu.js +1 -1
  11. package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +0 -16
  12. package/dist/components/Field/Field.js +0 -16
  13. package/dist/components/Icon/Icon.d.ts +8 -0
  14. package/dist/components/Icon/Icon.js +9 -1
  15. package/dist/components/Input/Input.d.ts +1 -1
  16. package/dist/components/Input/Input.js +30 -9
  17. package/dist/components/Link/Link.d.ts +1 -5
  18. package/dist/components/Link/Link.js +1 -4
  19. package/dist/components/List/List.js +1 -15
  20. package/dist/components/Modal/Modal.js +66 -17
  21. package/dist/components/Notification/Notification.js +5 -5
  22. package/dist/components/PaginationButton/PaginationButton.js +1 -8
  23. package/dist/components/PaginationItem/PaginationItem.js +0 -7
  24. package/dist/components/PasswordToggle/PasswordToggle.d.ts +99 -0
  25. package/dist/components/PasswordToggle/PasswordToggle.js +107 -0
  26. package/dist/components/PasswordToggle/index.d.ts +2 -0
  27. package/dist/components/PasswordToggle/index.js +15 -0
  28. package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +3 -4
  29. package/dist/components/SearchBox/SearchBox.d.ts +9 -8
  30. package/dist/components/SearchBox/SearchBox.js +22 -22
  31. package/dist/components/SummaryButton/SummaryButton.js +0 -11
  32. package/dist/components/Tabs/Tabs.js +1 -7
  33. package/dist/components/Tooltip/Tooltip.js +1 -12
  34. package/dist/hooks/useListener.js +1 -7
  35. package/dist/hooks/usePrevious.js +1 -7
  36. package/dist/hooks/useThrottle.js +1 -7
  37. package/dist/hooks/useWindowFitment.js +1 -7
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +8 -0
  40. package/package.json +62 -56
@@ -1,20 +1,14 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.useWindowFitment = void 0;
9
7
 
10
- var _react = _interopRequireWildcard(require("react"));
8
+ var _react = require("react");
11
9
 
12
10
  var _useListener = require("./useListener");
13
11
 
14
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15
-
16
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
17
-
18
12
  /**
19
13
  * A hook to determine if an element fits on the window.
20
14
  * @param targetNode The element to try and fit on the window.
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export { default as ModularTable } from "./components/ModularTable";
22
22
  export { default as Modal } from "./components/Modal";
23
23
  export { default as Notification, NotificationSeverity, } from "./components/Notification";
24
24
  export { default as Pagination } from "./components/Pagination";
25
+ export { default as PasswordToggle } from "./components/PasswordToggle";
25
26
  export { default as RadioInput } from "./components/RadioInput";
26
27
  export { default as Row } from "./components/Row";
27
28
  export { default as SearchAndFilter } from "./components/SearchAndFilter";
package/dist/index.js CHANGED
@@ -173,6 +173,12 @@ Object.defineProperty(exports, "Pagination", {
173
173
  return _Pagination.default;
174
174
  }
175
175
  });
176
+ Object.defineProperty(exports, "PasswordToggle", {
177
+ enumerable: true,
178
+ get: function get() {
179
+ return _PasswordToggle.default;
180
+ }
181
+ });
176
182
  Object.defineProperty(exports, "RadioInput", {
177
183
  enumerable: true,
178
184
  get: function get() {
@@ -318,6 +324,8 @@ var _Notification = _interopRequireWildcard(require("./components/Notification")
318
324
 
319
325
  var _Pagination = _interopRequireDefault(require("./components/Pagination"));
320
326
 
327
+ var _PasswordToggle = _interopRequireDefault(require("./components/PasswordToggle"));
328
+
321
329
  var _RadioInput = _interopRequireDefault(require("./components/RadioInput"));
322
330
 
323
331
  var _Row = _interopRequireDefault(require("./components/Row"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "0.21.0",
3
+ "version": "0.30.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "Huw Wilkins <huw.wilkins@canonical.com>",
@@ -22,78 +22,84 @@
22
22
  },
23
23
  "homepage": "/react-components/",
24
24
  "devDependencies": {
25
- "@babel/cli": "7.14.8",
26
- "@babel/preset-typescript": "7.14.5",
27
- "@percy/storybook": "3.3.1",
28
- "@storybook/addon-a11y": "6.3.2",
29
- "@storybook/addon-controls": "6.3.2",
30
- "@storybook/addon-docs": "6.3.2",
31
- "@storybook/addons": "6.3.2",
32
- "@storybook/react": "6.3.2",
33
- "@storybook/theming": "6.3.2",
34
- "@testing-library/react-hooks": "7.0.1",
35
- "@typescript-eslint/eslint-plugin": "4.28.1",
36
- "@typescript-eslint/parser": "4.28.1",
37
- "@wojtekmaj/enzyme-adapter-react-17": "0.6.3",
38
- "babel-eslint": "10.1.0",
39
- "babel-jest": "27.0.6",
40
- "babel-loader": "8.2.2",
25
+ "@babel/cli": "7.16.7",
26
+ "@babel/eslint-parser": "7.16.5",
27
+ "@babel/preset-typescript": "7.16.7",
28
+ "@percy/cli": "1.0.0-beta.71",
29
+ "@percy/storybook": "4.1.0",
30
+ "@storybook/addon-a11y": "6.4.9",
31
+ "@storybook/addon-controls": "6.4.9",
32
+ "@storybook/addon-docs": "6.4.9",
33
+ "@storybook/addons": "6.4.9",
34
+ "@storybook/react": "6.4.9",
35
+ "@storybook/theming": "6.4.9",
36
+ "@testing-library/cypress": "8.0.2",
37
+ "@testing-library/dom": "8.11.1",
38
+ "@testing-library/react-hooks": "7.0.2",
39
+ "@testing-library/user-event": "13.5.0",
40
+ "@typescript-eslint/eslint-plugin": "5.9.1",
41
+ "@typescript-eslint/parser": "5.9.1",
42
+ "@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
43
+ "babel-jest": "27.4.5",
44
+ "babel-loader": "8.2.3",
41
45
  "babel-plugin-module-resolver": "4.1.0",
42
- "babel-plugin-typescript-to-proptypes": "1.4.2",
43
- "concurrently": "6.2.1",
46
+ "babel-plugin-typescript-to-proptypes": "2.0.0",
47
+ "concurrently": "6.5.1",
44
48
  "css-loader": "5.2.7",
45
- "cypress": "7.6.0",
49
+ "cypress": "9.2.0",
46
50
  "deepmerge": "4.2.2",
47
51
  "enzyme": "3.11.0",
48
52
  "enzyme-adapter-react-16": "1.15.6",
49
53
  "enzyme-to-json": "3.6.2",
50
- "eslint": "7.30.0",
54
+ "eslint": "8.6.0",
51
55
  "eslint-config-prettier": "8.3.0",
52
- "eslint-config-react-app": "6.0.0",
53
- "eslint-plugin-cypress": "2.11.3",
54
- "eslint-plugin-flowtype": "5.8.2",
55
- "eslint-plugin-import": "2.23.4",
56
- "eslint-plugin-jsx-a11y": "6.4.1",
57
- "eslint-plugin-prettier": "3.4.0",
58
- "eslint-plugin-react": "7.24.0",
59
- "eslint-plugin-react-hooks": "4.2.0",
60
- "jest": "27.0.6",
61
- "node-sass": "6.0.1",
62
- "npm-package-json-lint": "5.1.0",
63
- "prettier": "2.3.2",
56
+ "eslint-config-react-app": "7.0.0",
57
+ "eslint-plugin-cypress": "2.12.1",
58
+ "eslint-plugin-flowtype": "8.0.3",
59
+ "eslint-plugin-import": "2.25.4",
60
+ "eslint-plugin-jsx-a11y": "6.5.1",
61
+ "eslint-plugin-prettier": "4.0.0",
62
+ "eslint-plugin-react": "7.28.0",
63
+ "eslint-plugin-react-hooks": "4.3.0",
64
+ "jest": "27.4.5",
65
+ "npm-package-json-lint": "5.4.2",
66
+ "prettier": "2.5.1",
64
67
  "react": "17.0.2",
65
68
  "react-docgen-typescript-loader": "3.7.2",
66
69
  "react-dom": "17.0.2",
70
+ "sass": "1.48.0",
67
71
  "sass-loader": "10.2.0",
68
72
  "style-loader": "2.0.0",
69
- "stylelint": "13.13.1",
70
- "stylelint-config-prettier": "8.0.2",
71
- "stylelint-config-standard": "22.0.0",
72
- "stylelint-order": "4.1.0",
73
- "stylelint-prettier": "1.2.0",
74
- "stylelint-scss": "3.19.0",
75
- "ts-jest": "27.0.4",
76
- "tsc-alias": "1.3.8",
77
- "typescript": "4.3.5",
78
- "vanilla-framework": "2.34.0",
73
+ "stylelint": "14.2.0",
74
+ "stylelint-config-prettier": "9.0.3",
75
+ "stylelint-config-recommended-scss": "5.0.2",
76
+ "stylelint-order": "5.0.0",
77
+ "stylelint-prettier": "2.0.0",
78
+ "ts-jest": "27.1.2",
79
+ "tsc-alias": "1.5.0",
80
+ "typescript": "4.5.4",
81
+ "vanilla-framework": "3.0.1",
79
82
  "wait-on": "5.3.0"
80
83
  },
81
84
  "dependencies": {
82
- "@types/jest": "26.0.24",
83
- "@types/node": "14.17.9",
84
- "@types/react": "17.0.18",
85
- "@types/react-dom": "17.0.9",
86
- "@types/react-table": "7.7.2",
85
+ "@types/jest": "27.4.0",
86
+ "@types/node": "16.11.18",
87
+ "@types/react": "17.0.38",
88
+ "@types/react-dom": "17.0.11",
89
+ "@types/react-table": "7.7.9",
87
90
  "classnames": "2.3.1",
88
- "nanoid": "3.1.25",
89
- "prop-types": "15.7.2",
91
+ "nanoid": "3.1.30",
92
+ "prop-types": "15.8.0",
90
93
  "react-table": "7.7.0",
91
- "react-useportal": "1.0.14"
94
+ "react-useportal": "1.0.16"
95
+ },
96
+ "resolutions": {
97
+ "postcss": "^8.3.11"
92
98
  },
93
99
  "peerDependencies": {
94
100
  "react": "17.0.2",
95
101
  "react-dom": "17.0.2",
96
- "vanilla-framework": "2.34.0"
102
+ "vanilla-framework": "3.0.1"
97
103
  },
98
104
  "scripts": {
99
105
  "build": "rm -rf dist && yarn build-local; yarn build-declaration",
@@ -102,20 +108,20 @@
102
108
  "build-watch": "yarn run build-local --watch",
103
109
  "build-docs": "build-storybook -c .storybook -o docs",
104
110
  "clean": "rm -rf node_modules dist .out",
105
- "docs": "start-storybook --port ${PORT}",
111
+ "docs": "start-storybook --port ${PORT:-9009}",
106
112
  "link-packages": "yarn install && yarn build && yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link",
107
113
  "lint-js": "eslint src",
108
- "lint-style": "stylelint src",
114
+ "lint-style": "stylelint src/**/*.scss",
109
115
  "lint-package-json": "npmPkgJsonLint .",
110
116
  "lint": "yarn lint-package-json && yarn lint-js && yarn lint-style",
111
- "percy": "yarn build-docs && percy-storybook --build_dir=docs --widths=1280",
117
+ "percy": "yarn build-docs && percy storybook ./docs",
112
118
  "prepublishOnly": "yarn clean && yarn install && yarn build",
113
119
  "serve": "yarn docs",
114
120
  "start": "yarn docs",
115
121
  "test": "jest",
116
122
  "test-cypress": "concurrently 'yarn run docs' 'yarn run cypress:test' -k -s first",
117
123
  "unlink-packages": "yarn unlink && cd node_modules/react && yarn unlink && cd ../react-dom && yarn unlink",
118
- "cypress:test": "wait-on http://localhost:${PORT} && cypress run --env port=${PORT}",
124
+ "cypress:test": "wait-on http://localhost:${PORT:-9009} && cypress run --env port=${PORT:-9009}",
119
125
  "cypress:run": "cypress run",
120
126
  "cypress:open": "cypress open"
121
127
  },