@canonical/react-components 0.37.4 → 0.37.5

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 (30) hide show
  1. package/README.md +10 -10
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Accordion/Accordion.js +1 -1
  4. package/dist/components/{AccordionSection → Accordion/AccordionSection}/AccordionSection.d.ts +1 -1
  5. package/dist/components/{AccordionSection → Accordion/AccordionSection}/AccordionSection.js +1 -1
  6. package/dist/components/{AccordionSection → Accordion/AccordionSection}/index.d.ts +0 -0
  7. package/dist/components/{AccordionSection → Accordion/AccordionSection}/index.js +0 -0
  8. package/dist/components/{CheckableInput → CheckboxInput/CheckableInput}/CheckableInput.d.ts +1 -1
  9. package/dist/components/{CheckableInput → CheckboxInput/CheckableInput}/CheckableInput.js +1 -1
  10. package/dist/components/{CheckableInput → CheckboxInput/CheckableInput}/index.d.ts +0 -0
  11. package/dist/components/{CheckableInput → CheckboxInput/CheckableInput}/index.js +0 -0
  12. package/dist/components/CheckboxInput/CheckboxInput.d.ts +1 -1
  13. package/dist/components/CheckboxInput/CheckboxInput.js +1 -1
  14. package/dist/components/Loader/Loader.js +1 -1
  15. package/dist/components/Modal/Modal.js +2 -2
  16. package/dist/components/Notification/Notification.js +1 -1
  17. package/dist/components/Pagination/Pagination.js +2 -2
  18. package/dist/components/{PaginationButton → Pagination/PaginationButton}/PaginationButton.d.ts +0 -0
  19. package/dist/components/{PaginationButton → Pagination/PaginationButton}/PaginationButton.js +0 -0
  20. package/dist/components/{PaginationButton → Pagination/PaginationButton}/index.d.ts +0 -0
  21. package/dist/components/{PaginationButton → Pagination/PaginationButton}/index.js +0 -0
  22. package/dist/components/{PaginationItem → Pagination/PaginationItem}/PaginationItem.d.ts +0 -0
  23. package/dist/components/{PaginationItem → Pagination/PaginationItem}/PaginationItem.js +0 -0
  24. package/dist/components/{PaginationItem → Pagination/PaginationItem}/index.d.ts +0 -0
  25. package/dist/components/{PaginationItem → Pagination/PaginationItem}/index.js +0 -0
  26. package/dist/components/RadioInput/RadioInput.d.ts +1 -1
  27. package/dist/components/RadioInput/RadioInput.js +1 -1
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +14 -0
  30. package/package.json +43 -40
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # React components for Vanilla Framework.
1
+ # React components for Vanilla Framework
2
2
 
3
3
  This is a collection of components designed to be the way to consume [Vanilla Framework](http://vanillaframework.io) when using React.
4
4
 
5
5
  ## How to use the components
6
6
 
7
- See the [component docs](https://canonical-web-and-design.github.io/react-components/) for usage instructions.
7
+ See the [component docs](https://canonical.github.io/react-components/) for usage instructions.
8
8
 
9
- ![CI](https://github.com/canonical-web-and-design/react-components/workflows/CI/badge.svg?branch=main)
10
- ![Cypress chrome headless](https://github.com/canonical-web-and-design/react-components/workflows/Cypress%20chrome%20headless/badge.svg)
9
+ ![CI](https://github.com/canonical/react-components/workflows/CI/badge.svg?branch=main)
10
+ ![Cypress chrome headless](https://github.com/canonical/react-components/workflows/Cypress%20chrome%20headless/badge.svg)
11
11
 
12
12
  ## Requirements
13
13
 
@@ -29,16 +29,16 @@ npm install @canonical/react-components
29
29
 
30
30
  ## Issues
31
31
 
32
- Please file any issues at [GitHub](https://github.com/canonical-web-and-design/react-components/issues).
32
+ Please file any issues at [GitHub](https://github.com/canonical/react-components/issues).
33
33
 
34
34
  ## Contributing
35
35
 
36
36
  You might want to:
37
37
 
38
- - [View the source](https://github.com/canonical-web-and-design/react-components) on GitHub.
39
- - Read about [developing components](https://github.com/canonical-web-and-design/react-components/blob/main/HACKING.md).
40
- - Find out how to [publish to NPM](https://github.com/canonical-web-and-design/react-components/blob/main/PUBLISH-NPM-PACKAGE.md).
41
- - Know how to [publish the docs](https://github.com/canonical-web-and-design/react-components/blob/main/PUBLISHING-DOCS.md) to GitHub Pages.
38
+ - [View the source](https://github.com/canonical/react-components) on GitHub.
39
+ - Read about [developing components](https://github.com/canonical/react-components/blob/main/HACKING.md).
40
+ - Find out how to [publish to NPM](https://github.com/canonical/react-components/blob/main/PUBLISH-NPM-PACKAGE.md).
41
+ - Know how to [publish the docs](https://github.com/canonical/react-components/blob/main/PUBLISHING-DOCS.md) to GitHub Pages.
42
42
 
43
43
  ## Developing locally using this repository
44
44
 
@@ -47,7 +47,7 @@ You may wish to link this library directly to your projects while developing loc
47
47
  You can do this by cloning this repo to your local workspace;
48
48
 
49
49
  ```shell
50
- git clone https://github.com/canonical-web-and-design/react-components
50
+ git clone https://github.com/canonical/react-components
51
51
  ```
52
52
 
53
53
  If you then drop into that folder and run;
@@ -1,5 +1,5 @@
1
1
  import { HTMLProps } from "react";
2
- import type { AccordionHeadings, AccordionSectionProps } from "../AccordionSection";
2
+ import type { AccordionHeadings, AccordionSectionProps } from "./AccordionSection";
3
3
  import type { ClassName, PropsWithSpread } from "../../types";
4
4
  export declare type Section = AccordionSectionProps & {
5
5
  /**
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
- var _AccordionSection = _interopRequireDefault(require("../AccordionSection"));
14
+ var _AccordionSection = _interopRequireDefault(require("./AccordionSection"));
15
15
 
16
16
  var _excluded = ["key"],
17
17
  _excluded2 = ["className", "expanded", "externallyControlled", "onExpandedChange", "sections", "titleElement"];
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- import type { Headings } from "../../types";
2
+ import type { Headings } from "../../../types";
3
3
  export declare type AccordionHeadings = Exclude<Headings, "h1">;
4
4
  export declare type Props = {
5
5
  /**
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _useId = require("../../hooks/useId");
10
+ var _useId = require("../../../hooks/useId");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
@@ -1,6 +1,6 @@
1
1
  import { HTMLProps } from "react";
2
2
  import type { ReactNode } from "react";
3
- import type { PropsWithSpread } from "../../types";
3
+ import type { PropsWithSpread } from "../../../types";
4
4
  export declare type Props = PropsWithSpread<{
5
5
  /**
6
6
  * The type of the input element.
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
- var _useId = require("../../hooks/useId");
14
+ var _useId = require("../../../hooks/useId");
15
15
 
16
16
  var _excluded = ["inputType", "label", "labelClassName", "indeterminate"];
17
17
 
@@ -1,4 +1,4 @@
1
- import type { Props as CheckableInputProps } from "../CheckableInput/CheckableInput";
1
+ import type { CheckableInputProps } from "./CheckableInput";
2
2
  export declare type Props = Omit<CheckableInputProps, "inputType">;
3
3
  declare const CheckboxInput: ({ label, indeterminate, ...checkboxProps }: Props) => JSX.Element;
4
4
  export default CheckboxInput;
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _CheckableInput = _interopRequireDefault(require("../CheckableInput"));
10
+ var _CheckableInput = _interopRequireDefault(require("./CheckableInput"));
11
11
 
12
12
  var _excluded = ["label", "indeterminate"];
13
13
 
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
18
  */
19
19
  var Loader = function Loader(props) {
20
20
  if (_utils.IS_DEV) {
21
- console.warn("The Loader component has been renamed to Spinner and will be removed in a future release. https://canonical-web-and-design.github.io/react-components/?path=/story/spinner--default-story");
21
+ console.warn("The Loader component has been renamed to Spinner and will be removed in a future release. https://canonical.github.io/react-components/?path=/story/spinner--default-story");
22
22
  }
23
23
 
24
24
  return /*#__PURE__*/_react.default.createElement(_Spinner.default, props);
@@ -61,7 +61,7 @@ var Modal = function Modal(_ref) {
61
61
  }
62
62
  };
63
63
 
64
- var keyListenersMap = new Map([[27, close], [9, handleTabKey]]);
64
+ var keyListenersMap = new Map([["Escape", close], ["Tab", handleTabKey]]);
65
65
  (0, _react.useEffect)(function () {
66
66
  modalRef.current.focus();
67
67
  }, [modalRef]);
@@ -73,7 +73,7 @@ var Modal = function Modal(_ref) {
73
73
  }, []);
74
74
  (0, _react.useEffect)(function () {
75
75
  var keyDown = function keyDown(e) {
76
- var listener = keyListenersMap.get(e.keyCode);
76
+ var listener = keyListenersMap.get(e.code);
77
77
  return listener && listener(e);
78
78
  };
79
79
 
@@ -76,7 +76,7 @@ var Notification = function Notification(_ref) {
76
76
  }, [onDismiss, timeout]);
77
77
 
78
78
  if (_utils.IS_DEV && (close || status || type)) {
79
- console.warn("The Notification component is using deprecated props. Refer to the deprecated list for details: https://canonical-web-and-design.github.io/react-components/?path=/docs/notification--information#deprecated");
79
+ console.warn("The Notification component is using deprecated props. Refer to the deprecated list for details: https://canonical.github.io/react-components/?path=/docs/notification--information#deprecated");
80
80
  }
81
81
 
82
82
  return /*#__PURE__*/_react.default.createElement("div", _extends({
@@ -7,9 +7,9 @@ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _PaginationButton = _interopRequireDefault(require("../PaginationButton"));
10
+ var _PaginationButton = _interopRequireDefault(require("./PaginationButton"));
11
11
 
12
- var _PaginationItem = _interopRequireDefault(require("../PaginationItem"));
12
+ var _PaginationItem = _interopRequireDefault(require("./PaginationItem"));
13
13
 
14
14
  var _excluded = ["itemsPerPage", "totalItems", "paginate", "currentPage", "scrollToTop", "truncateThreshold"];
15
15
 
@@ -1,4 +1,4 @@
1
- import type { Props as CheckableInputProps } from "../CheckableInput/CheckableInput";
1
+ import type { CheckableInputProps } from "../CheckboxInput/CheckableInput";
2
2
  export declare type Props = Omit<CheckableInputProps, "inputType">;
3
3
  declare const RadioInput: ({ label, ...radioProps }: Props) => JSX.Element;
4
4
  export default RadioInput;
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _CheckableInput = _interopRequireDefault(require("../CheckableInput"));
10
+ var _CheckableInput = _interopRequireDefault(require("../CheckboxInput/CheckableInput"));
11
11
 
12
12
  var _excluded = ["label"];
13
13
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as Accordion } from "./components/Accordion";
2
2
  export { default as ActionButton } from "./components/ActionButton";
3
3
  export { default as ArticlePagination } from "./components/ArticlePagination";
4
+ export { default as Badge } from "./components/Badge";
4
5
  export { default as Button, ButtonAppearance } from "./components/Button";
5
6
  export { default as Card } from "./components/Card";
6
7
  export { default as CheckboxInput } from "./components/CheckboxInput";
@@ -43,12 +44,11 @@ export { default as Tabs } from "./components/Tabs";
43
44
  export { default as Textarea } from "./components/Textarea";
44
45
  export { default as Tooltip } from "./components/Tooltip";
45
46
  export type { AccordionProps } from "./components/Accordion";
46
- export type { AccordionHeadings, AccordionSectionProps, } from "./components/AccordionSection";
47
47
  export type { ActionButtonProps } from "./components/ActionButton";
48
48
  export type { ArticlePaginationProps } from "./components/ArticlePagination";
49
+ export type { BadgeProps } from "./components/Badge";
49
50
  export type { ButtonProps } from "./components/Button";
50
51
  export type { CardProps } from "./components/Card";
51
- export type { CheckableInputProps } from "./components/CheckableInput";
52
52
  export type { CheckboxInputProps } from "./components/CheckboxInput";
53
53
  export type { ChipProps } from "./components/Chip";
54
54
  export type { CodeProps } from "./components/Code";
@@ -85,7 +85,7 @@ export type { TableRowProps } from "./components/TableRow";
85
85
  export type { TabsProps } from "./components/Tabs";
86
86
  export type { TextareaProps } from "./components/Textarea";
87
87
  export type { TooltipProps } from "./components/Tooltip";
88
- export { useClickOutside, useId, useListener, useOnEscapePressed, usePrevious, useThrottle, useWindowFitment, } from "./hooks";
88
+ export { useClickOutside, useId, useListener, useOnEscapePressed, usePagination, usePrevious, useThrottle, useWindowFitment, } from "./hooks";
89
89
  export type { WindowFitment } from "./hooks";
90
90
  export { isNavigationAnchor, isNavigationButton } from "./utils";
91
91
  export type { ClassName, Headings, PropsWithSpread, SortDirection, SubComponentProps, TSFixMe, ValueOf, } from "./types";
package/dist/index.js CHANGED
@@ -23,6 +23,12 @@ Object.defineProperty(exports, "ArticlePagination", {
23
23
  return _ArticlePagination.default;
24
24
  }
25
25
  });
26
+ Object.defineProperty(exports, "Badge", {
27
+ enumerable: true,
28
+ get: function get() {
29
+ return _Badge.default;
30
+ }
31
+ });
26
32
  Object.defineProperty(exports, "Button", {
27
33
  enumerable: true,
28
34
  get: function get() {
@@ -341,6 +347,12 @@ Object.defineProperty(exports, "useOnEscapePressed", {
341
347
  return _hooks.useOnEscapePressed;
342
348
  }
343
349
  });
350
+ Object.defineProperty(exports, "usePagination", {
351
+ enumerable: true,
352
+ get: function get() {
353
+ return _hooks.usePagination;
354
+ }
355
+ });
344
356
  Object.defineProperty(exports, "usePrevious", {
345
357
  enumerable: true,
346
358
  get: function get() {
@@ -366,6 +378,8 @@ var _ActionButton = _interopRequireDefault(require("./components/ActionButton"))
366
378
 
367
379
  var _ArticlePagination = _interopRequireDefault(require("./components/ArticlePagination"));
368
380
 
381
+ var _Badge = _interopRequireDefault(require("./components/Badge"));
382
+
369
383
  var _Button = _interopRequireWildcard(require("./components/Button"));
370
384
 
371
385
  var _Card = _interopRequireDefault(require("./components/Card"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "0.37.4",
3
+ "version": "0.37.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "Huw Wilkins <huw.wilkins@canonical.com>",
@@ -15,89 +15,92 @@
15
15
  ],
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git@github.com:canonical-web-and-design/react-components.git"
18
+ "url": "git@github.com:canonical/react-components.git"
19
19
  },
20
20
  "bugs": {
21
- "url": "https://github.com/canonical-web-and-design/react-components/issues"
21
+ "url": "https://github.com/canonical/react-components/issues"
22
22
  },
23
- "homepage": "/react-components/",
23
+ "homepage": "https://canonical.github.io/react-components",
24
24
  "devDependencies": {
25
- "@babel/cli": "7.17.10",
26
- "@babel/eslint-parser": "7.18.2",
27
- "@babel/preset-typescript": "7.17.12",
28
- "@percy/cli": "1.2.1",
29
- "@percy/storybook": "4.2.1",
30
- "@storybook/addon-a11y": "6.4.22",
31
- "@storybook/addon-controls": "6.4.22",
25
+ "@babel/cli": "7.18.9",
26
+ "@babel/eslint-parser": "7.18.9",
27
+ "@babel/preset-typescript": "7.18.6",
28
+ "@percy/cli": "1.7.2",
29
+ "@percy/storybook": "4.3.1",
30
+ "@storybook/addon-a11y": "6.5.10",
31
+ "@storybook/addon-controls": "6.5.10",
32
32
  "@storybook/addon-docs": "6.4.22",
33
- "@storybook/addons": "6.4.22",
34
- "@storybook/react": "6.4.22",
35
- "@storybook/theming": "6.4.22",
36
- "@testing-library/cypress": "8.0.2",
37
- "@testing-library/dom": "8.14.0",
33
+ "@storybook/addons": "6.5.10",
34
+ "@storybook/builder-webpack5": "6.5.10",
35
+ "@storybook/manager-webpack5": "6.5.10",
36
+ "@storybook/react": "6.5.10",
37
+ "@storybook/theming": "6.5.10",
38
+ "@testing-library/cypress": "8.0.3",
39
+ "@testing-library/dom": "8.16.0",
38
40
  "@testing-library/jest-dom": "5.16.4",
39
41
  "@testing-library/react": "12.1.5",
40
- "@testing-library/react-hooks": "7.0.2",
41
- "@testing-library/user-event": "13.5.0",
42
- "@typescript-eslint/eslint-plugin": "5.29.0",
43
- "@typescript-eslint/parser": "5.29.0",
42
+ "@testing-library/react-hooks": "8.0.1",
43
+ "@testing-library/user-event": "14.3.0",
44
+ "@typescript-eslint/eslint-plugin": "5.32.0",
45
+ "@typescript-eslint/parser": "5.32.0",
44
46
  "@wojtekmaj/enzyme-adapter-react-17": "0.6.7",
45
47
  "babel-jest": "27.5.1",
46
48
  "babel-loader": "8.2.5",
47
49
  "babel-plugin-module-resolver": "4.1.0",
48
50
  "babel-plugin-typescript-to-proptypes": "2.0.0",
49
- "concurrently": "7.2.1",
50
- "css-loader": "5.2.7",
51
+ "concurrently": "7.3.0",
52
+ "css-loader": "6.7.1",
51
53
  "cypress": "9.7.0",
52
54
  "deepmerge": "4.2.2",
53
55
  "enzyme": "3.11.0",
54
56
  "enzyme-adapter-react-16": "1.15.6",
55
57
  "enzyme-to-json": "3.6.2",
56
- "eslint": "8.16.0",
58
+ "eslint": "8.21.0",
57
59
  "eslint-config-prettier": "8.5.0",
58
60
  "eslint-config-react-app": "7.0.1",
59
61
  "eslint-plugin-cypress": "2.12.1",
60
62
  "eslint-plugin-flowtype": "8.0.3",
61
63
  "eslint-plugin-import": "2.26.0",
62
- "eslint-plugin-jsx-a11y": "6.5.1",
63
- "eslint-plugin-prettier": "4.0.0",
64
- "eslint-plugin-react": "7.30.0",
65
- "eslint-plugin-react-hooks": "4.5.0",
66
- "eslint-plugin-testing-library": "5.5.1",
64
+ "eslint-plugin-jsx-a11y": "6.6.1",
65
+ "eslint-plugin-prettier": "4.2.1",
66
+ "eslint-plugin-react": "7.30.1",
67
+ "eslint-plugin-react-hooks": "4.6.0",
68
+ "eslint-plugin-testing-library": "5.6.0",
67
69
  "jest": "27.5.1",
68
70
  "npm-package-json-lint": "5.4.2",
69
- "prettier": "2.6.2",
71
+ "prettier": "2.7.1",
70
72
  "react": "17.0.2",
71
73
  "react-docgen-typescript-loader": "3.7.2",
72
74
  "react-dom": "17.0.2",
73
- "sass": "1.52.2",
74
- "sass-loader": "10.2.1",
75
- "style-loader": "2.0.0",
76
- "stylelint": "14.8.5",
75
+ "sass": "1.54.0",
76
+ "sass-loader": "10.3.1",
77
+ "style-loader": "3.3.1",
78
+ "stylelint": "14.9.1",
77
79
  "stylelint-config-prettier": "9.0.3",
78
80
  "stylelint-config-recommended-scss": "5.0.2",
79
81
  "stylelint-order": "5.0.0",
80
82
  "stylelint-prettier": "2.0.0",
81
83
  "ts-jest": "27.1.5",
82
- "tsc-alias": "1.6.8",
83
- "typescript": "4.7.2",
84
+ "tsc-alias": "1.7.0",
85
+ "typescript": "4.7.4",
84
86
  "vanilla-framework": "3.6.1",
85
- "wait-on": "5.3.0"
87
+ "wait-on": "5.3.0",
88
+ "webpack": "5.74.0"
86
89
  },
87
90
  "dependencies": {
88
91
  "@types/jest": "27.5.2",
89
- "@types/node": "16.11.38",
90
- "@types/react": "17.0.45",
92
+ "@types/node": "16.11.47",
93
+ "@types/react": "17.0.48",
91
94
  "@types/react-dom": "17.0.17",
92
95
  "@types/react-table": "7.7.12",
93
96
  "classnames": "2.3.1",
94
97
  "nanoid": "3.3.4",
95
98
  "prop-types": "15.8.1",
96
99
  "react-table": "7.8.0",
97
- "react-useportal": "1.0.16"
100
+ "react-useportal": "1.0.17"
98
101
  },
99
102
  "resolutions": {
100
- "@types/react": "17.0.45",
103
+ "@types/react": "17.0.48",
101
104
  "@types/react-dom": "17.0.17",
102
105
  "postcss": "^8.3.11"
103
106
  },