@canonical/react-components 0.52.0 → 0.53.1

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.
@@ -43,19 +43,15 @@ const Button = _ref => {
43
43
  const classes = (0, _classnames.default)(appearance ? "p-button--".concat(appearance) : "p-button", {
44
44
  "has-icon": hasIcon,
45
45
  "is-dense": dense,
46
- "is-disabled": Component !== "button" && disabled,
46
+ "is-disabled": disabled,
47
47
  "is-inline": inline,
48
48
  "is-small": small
49
49
  }, className);
50
50
  const onClickDisabled = e => e.preventDefault();
51
- const disabledProp = Component === "button" ? {
52
- disabled
53
- } : {
54
- "aria-disabled": disabled
55
- };
56
51
  return /*#__PURE__*/_react.default.createElement(Component, _extends({
57
52
  className: classes,
58
- onClick: disabled ? onClickDisabled : onClick
59
- }, disabledProp, buttonProps), children);
53
+ onClick: disabled ? onClickDisabled : onClick,
54
+ "aria-disabled": disabled || undefined
55
+ }, buttonProps), children);
60
56
  };
61
57
  var _default = exports.default = Button;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.EmptyState = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
7
8
  var _react = _interopRequireDefault(require("react"));
8
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
10
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -16,10 +17,14 @@ const EmptyState = _ref => {
16
17
  ...props
17
18
  } = _ref;
18
19
  return /*#__PURE__*/_react.default.createElement("div", _extends({
19
- className: className
20
- }, props), image, /*#__PURE__*/_react.default.createElement("h2", {
21
- className: "p-heading--4"
22
- }, title), children);
20
+ className: (0, _classnames.default)(["row", className])
21
+ }, props), /*#__PURE__*/_react.default.createElement("div", {
22
+ className: "u-align--right col-4 col-medium-2 col-small-1"
23
+ }, image), /*#__PURE__*/_react.default.createElement("div", {
24
+ className: "u-align--left col-8 col-medium-4 col-small-3"
25
+ }, /*#__PURE__*/_react.default.createElement("p", {
26
+ className: "p-heading--4 u-no-margin--bottom"
27
+ }, title), children));
23
28
  };
24
29
  exports.EmptyState = EmptyState;
25
30
  var _default = exports.default = EmptyState;
@@ -45,7 +45,7 @@ const generateLogo = (logo, generateLink) => {
45
45
  }, icon !== null && icon !== void 0 ? icon : /*#__PURE__*/_react.default.createElement("img", {
46
46
  className: "p-navigation__logo-icon",
47
47
  src: src,
48
- alt: ""
48
+ alt: "Logo"
49
49
  })), /*#__PURE__*/_react.default.createElement("span", {
50
50
  className: "p-navigation__logo-title"
51
51
  }, title));
@@ -2,7 +2,7 @@ import { MutableRefObject, useRef } from "react";
2
2
  /**
3
3
  * Handle clicks outside an element.
4
4
  */
5
- export declare const useOnClickOutside: <E extends HTMLElement>(elementRef: MutableRefObject<E>, onClickOutside: () => void, { isEnabled }?: {
5
+ export declare const useOnClickOutside: <E extends HTMLElement>(elementRef: ReturnType<typeof useRef<E | null>>, onClickOutside: () => void, { isEnabled }?: {
6
6
  isEnabled: boolean;
7
7
  }) => void;
8
8
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "0.52.0",
3
+ "version": "0.53.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "Huw Wilkins <huw.wilkins@canonical.com>",
@@ -22,80 +22,80 @@
22
22
  },
23
23
  "homepage": "https://canonical.github.io/react-components",
24
24
  "devDependencies": {
25
- "@babel/cli": "7.23.4",
26
- "@babel/eslint-parser": "7.23.3",
27
- "@babel/preset-typescript": "7.23.3",
28
- "@percy/cli": "1.27.6",
29
- "@percy/storybook": "5.0.1",
25
+ "@babel/cli": "7.24.5",
26
+ "@babel/eslint-parser": "7.24.5",
27
+ "@babel/preset-typescript": "7.24.1",
28
+ "@percy/cli": "1.28.5",
29
+ "@percy/storybook": "5.0.3",
30
30
  "@semantic-release/changelog": "6.0.3",
31
31
  "@semantic-release/git": "10.0.1",
32
- "@storybook/addon-a11y": "7.6.7",
33
- "@storybook/addon-essentials": "7.6.7",
34
- "@storybook/addon-interactions": "7.6.7",
35
- "@storybook/addon-links": "7.6.7",
36
- "@storybook/addon-mdx-gfm": "7.6.7",
37
- "@storybook/addon-onboarding": "1.0.10",
38
- "@storybook/blocks": "7.6.7",
39
- "@storybook/react": "7.6.7",
40
- "@storybook/react-webpack5": "7.6.7",
32
+ "@storybook/addon-a11y": "7.6.19",
33
+ "@storybook/addon-essentials": "7.6.19",
34
+ "@storybook/addon-interactions": "7.6.19",
35
+ "@storybook/addon-links": "7.6.19",
36
+ "@storybook/addon-mdx-gfm": "7.6.19",
37
+ "@storybook/addon-onboarding": "1.0.11",
38
+ "@storybook/blocks": "7.6.19",
39
+ "@storybook/react": "7.6.19",
40
+ "@storybook/react-webpack5": "7.6.19",
41
41
  "@testing-library/cypress": "10.0.1",
42
- "@testing-library/dom": "9.3.3",
43
- "@testing-library/jest-dom": "6.2.1",
44
- "@testing-library/react": "14.1.2",
42
+ "@testing-library/dom": "10.1.0",
43
+ "@testing-library/jest-dom": "6.4.5",
44
+ "@testing-library/react": "15.0.7",
45
45
  "@testing-library/user-event": "14.5.2",
46
46
  "@types/lodash.isequal": "4",
47
- "@typescript-eslint/eslint-plugin": "6.19.1",
48
- "@typescript-eslint/parser": "6.19.1",
47
+ "@typescript-eslint/eslint-plugin": "7.8.0",
48
+ "@typescript-eslint/parser": "7.8.0",
49
49
  "babel-jest": "29.7.0",
50
50
  "babel-loader": "9.1.3",
51
- "babel-plugin-module-resolver": "5.0.0",
51
+ "babel-plugin-module-resolver": "5.0.2",
52
52
  "babel-plugin-typescript-to-proptypes": "2.1.0",
53
53
  "concurrently": "8.2.2",
54
- "css-loader": "6.8.1",
55
- "cypress": "13.6.3",
54
+ "css-loader": "7.1.1",
55
+ "cypress": "13.9.0",
56
56
  "deepmerge": "4.3.1",
57
- "eslint": "8.56.0",
57
+ "eslint": "8.57.0",
58
58
  "eslint-config-prettier": "9.1.0",
59
59
  "eslint-config-react-app": "7.0.1",
60
- "eslint-plugin-cypress": "2.15.1",
60
+ "eslint-plugin-cypress": "3.2.0",
61
61
  "eslint-plugin-flowtype": "8.0.3",
62
62
  "eslint-plugin-import": "2.29.1",
63
63
  "eslint-plugin-jsx-a11y": "6.8.0",
64
64
  "eslint-plugin-prettier": "5.1.3",
65
- "eslint-plugin-react": "7.33.2",
66
- "eslint-plugin-react-hooks": "4.6.0",
67
- "eslint-plugin-storybook": "0.6.15",
68
- "eslint-plugin-testing-library": "6.2.0",
69
- "formik": "2.4.5",
65
+ "eslint-plugin-react": "7.34.1",
66
+ "eslint-plugin-react-hooks": "4.6.2",
67
+ "eslint-plugin-storybook": "0.8.0",
68
+ "eslint-plugin-testing-library": "6.2.2",
69
+ "formik": "2.4.6",
70
70
  "jest": "29.7.0",
71
71
  "npm-package-json-lint": "7.1.0",
72
- "prettier": "3.2.4",
73
- "react": "18.2.0",
72
+ "prettier": "3.2.5",
73
+ "react": "18.3.1",
74
74
  "react-docgen-typescript-loader": "3.7.2",
75
- "react-dom": "18.2.0",
76
- "sass": "1.69.7",
77
- "sass-loader": "14.0.0",
78
- "semantic-release": "23.0.0",
79
- "storybook": "7.6.7",
80
- "style-loader": "3.3.3",
81
- "stylelint": "16.2.0",
75
+ "react-dom": "18.3.1",
76
+ "sass": "1.77.0",
77
+ "sass-loader": "14.2.1",
78
+ "semantic-release": "23.0.8",
79
+ "storybook": "7.6.19",
80
+ "style-loader": "4.0.0",
81
+ "stylelint": "16.5.0",
82
82
  "stylelint-config-prettier": "9.0.5",
83
83
  "stylelint-config-recommended-scss": "14.0.0",
84
84
  "stylelint-order": "6.0.4",
85
85
  "stylelint-prettier": "5.0.0",
86
86
  "ts-jest": "29.1.2",
87
87
  "tsc-alias": "1.8.8",
88
- "typescript": "5.3.3",
89
- "vanilla-framework": "4.9.0",
88
+ "typescript": "5.4.5",
89
+ "vanilla-framework": "4.11.0",
90
90
  "wait-on": "7.2.0",
91
- "webpack": "5.89.0"
91
+ "webpack": "5.91.0"
92
92
  },
93
93
  "dependencies": {
94
- "@types/jest": "29.5.11",
95
- "@types/node": "20.8.5",
96
- "@types/react": "18.2.46",
97
- "@types/react-dom": "18.2.18",
98
- "@types/react-table": "7.7.19",
94
+ "@types/jest": "29.5.12",
95
+ "@types/node": "20.12.11",
96
+ "@types/react": "18.3.1",
97
+ "@types/react-dom": "18.3.0",
98
+ "@types/react-table": "7.7.20",
99
99
  "classnames": "2.5.1",
100
100
  "jest-environment-jsdom": "29.7.0",
101
101
  "lodash.isequal": "4.5.0",
@@ -104,10 +104,10 @@
104
104
  "react-useportal": "1.0.19"
105
105
  },
106
106
  "resolutions": {
107
- "@types/react": "18.2.46",
108
- "@types/react-dom": "18.2.18",
107
+ "@types/react": "18.3.1",
108
+ "@types/react-dom": "18.3.0",
109
109
  "postcss": "^8.3.11",
110
- "jackspeak": "2.1.1"
110
+ "jackspeak": "2.3.6"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "@types/react": "^17.0.2 || ^18.0.0",