@canonical/react-components 0.22.0 → 0.31.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.
- package/README.md +4 -4
- package/dist/components/Accordion/Accordion.js +9 -6
- package/dist/components/AccordionSection/AccordionSection.js +3 -16
- package/dist/components/ActionButton/ActionButton.js +9 -10
- package/dist/components/ArticlePagination/ArticlePagination.js +3 -1
- package/dist/components/Button/Button.d.ts +1 -2
- package/dist/components/Button/Button.js +5 -17
- package/dist/components/Button/index.js +7 -7
- package/dist/components/Card/Card.js +3 -1
- package/dist/components/CheckableInput/CheckableInput.js +6 -4
- package/dist/components/CheckboxInput/CheckboxInput.js +3 -1
- package/dist/components/Chip/Chip.d.ts +13 -2
- package/dist/components/Chip/Chip.js +45 -31
- package/dist/components/Code/Code.js +6 -4
- package/dist/components/CodeSnippet/CodeSnippetBlock.js +2 -13
- package/dist/components/CodeSnippet/CodeSnippetDropdown.js +6 -10
- package/dist/components/CodeSnippet/index.js +4 -4
- package/dist/components/Col/Col.js +3 -1
- package/dist/components/Col/index.js +7 -7
- package/dist/components/ContextualMenu/ContextualMenu.js +9 -6
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +11 -24
- package/dist/components/Field/Field.js +0 -16
- package/dist/components/Form/Form.js +3 -1
- package/dist/components/Icon/Icon.js +3 -1
- package/dist/components/Icon/index.js +7 -7
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +36 -13
- package/dist/components/Label/Label.js +3 -1
- package/dist/components/Link/Link.d.ts +1 -5
- package/dist/components/Link/Link.js +3 -4
- package/dist/components/List/List.js +9 -19
- package/dist/components/MainTable/MainTable.js +14 -9
- package/dist/components/Modal/Modal.js +72 -21
- package/dist/components/Notification/Notification.js +11 -9
- package/dist/components/Notification/index.js +7 -7
- package/dist/components/Pagination/Pagination.js +3 -1
- package/dist/components/PaginationButton/PaginationButton.js +1 -8
- package/dist/components/PaginationItem/PaginationItem.js +0 -7
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +99 -0
- package/dist/components/PasswordToggle/PasswordToggle.js +109 -0
- package/dist/components/PasswordToggle/index.d.ts +2 -0
- package/dist/components/PasswordToggle/index.js +15 -0
- package/dist/components/RadioInput/RadioInput.js +3 -1
- package/dist/components/Row/Row.js +3 -1
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +7 -8
- package/dist/components/SearchAndFilter/SearchAndFilter.js +8 -6
- package/dist/components/SearchAndFilter/utils.js +1 -1
- package/dist/components/Select/Select.js +8 -5
- package/dist/components/Slider/Slider.d.ts +1 -0
- package/dist/components/Slider/Slider.js +7 -3
- package/dist/components/Spinner/Spinner.d.ts +3 -2
- package/dist/components/Spinner/Spinner.js +13 -3
- package/dist/components/Strip/Strip.js +3 -1
- package/dist/components/SummaryButton/SummaryButton.js +0 -11
- package/dist/components/Table/Table.js +3 -1
- package/dist/components/TableCell/TableCell.js +3 -1
- package/dist/components/TableHeader/TableHeader.js +3 -1
- package/dist/components/TableRow/TableRow.js +3 -1
- package/dist/components/Tabs/Tabs.js +4 -8
- package/dist/components/Textarea/Textarea.js +8 -6
- package/dist/components/Tooltip/Tooltip.js +5 -16
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/useListener.js +1 -7
- package/dist/hooks/usePrevious.js +1 -7
- package/dist/hooks/useThrottle.js +2 -8
- package/dist/hooks/useWindowFitment.js +1 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -11
- package/package.json +62 -56
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -13,17 +13,19 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _Field = _interopRequireDefault(require("../Field"));
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
var _excluded = ["caution", "className", "error", "grow", "help", "id", "label", "labelClassName", "onKeyUp", "required", "stacked", "style", "success", "takeFocus", "wrapperClassName"];
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
function _extends() { _extends = Object.assign || 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); }
|
|
23
25
|
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
27
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
29
|
|
|
28
30
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
31
|
|
|
@@ -49,7 +51,7 @@ var Textarea = function Textarea(_ref) {
|
|
|
49
51
|
_ref$takeFocus = _ref.takeFocus,
|
|
50
52
|
takeFocus = _ref$takeFocus === void 0 ? false : _ref$takeFocus,
|
|
51
53
|
wrapperClassName = _ref.wrapperClassName,
|
|
52
|
-
props = _objectWithoutProperties(_ref,
|
|
54
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
53
55
|
|
|
54
56
|
var textareaRef = (0, _react.useRef)(null);
|
|
55
57
|
(0, _react.useEffect)(function () {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.adjustForWindow = void 0;
|
|
9
9
|
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
11
|
|
|
14
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -17,9 +15,9 @@ var _reactUseportal = _interopRequireDefault(require("react-useportal"));
|
|
|
17
15
|
|
|
18
16
|
var _hooks = require("../../hooks");
|
|
19
17
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
19
|
|
|
22
|
-
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; }
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
23
21
|
|
|
24
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
23
|
|
|
@@ -31,7 +29,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
31
29
|
|
|
32
30
|
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; }
|
|
33
31
|
|
|
34
|
-
function _iterableToArrayLimit(arr, i) {
|
|
32
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
33
|
|
|
36
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
35
|
|
|
@@ -226,7 +224,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
226
224
|
}
|
|
227
225
|
}, children), isOpen && /*#__PURE__*/_react.default.createElement(Portal, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
228
226
|
className: (0, _classnames.default)("p-tooltip--".concat(adjustedPosition), "is-detached", tooltipClassName),
|
|
229
|
-
"data-
|
|
227
|
+
"data-testid": "tooltip-portal",
|
|
230
228
|
style: positionStyle
|
|
231
229
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
232
230
|
className: "p-tooltip__message",
|
|
@@ -236,14 +234,5 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
236
234
|
}, children));
|
|
237
235
|
};
|
|
238
236
|
|
|
239
|
-
Tooltip.propTypes = {
|
|
240
|
-
autoAdjust: _propTypes.default.bool,
|
|
241
|
-
children: _propTypes.default.node.isRequired,
|
|
242
|
-
followMouse: _propTypes.default.bool,
|
|
243
|
-
message: _propTypes.default.node,
|
|
244
|
-
position: _propTypes.default.oneOf(["btm-center", "btm-left", "btm-right", "left", "right", "top-center", "top-left", "top-right"]),
|
|
245
|
-
positionElementClassName: _propTypes.default.string,
|
|
246
|
-
tooltipClassName: _propTypes.default.string
|
|
247
|
-
};
|
|
248
237
|
var _default = Tooltip;
|
|
249
238
|
exports.default = _default;
|
package/dist/hooks/index.js
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "useWindowFitment", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _useWindowFitment.useWindowFitment;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "useListener", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function get() {
|
|
@@ -27,6 +21,12 @@ Object.defineProperty(exports, "useThrottle", {
|
|
|
27
21
|
return _useThrottle.useThrottle;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "useWindowFitment", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _useWindowFitment.useWindowFitment;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
var _useWindowFitment = require("./useWindowFitment");
|
|
32
32
|
|
|
@@ -1,22 +1,16 @@
|
|
|
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.useListener = void 0;
|
|
9
7
|
|
|
10
|
-
var _react =
|
|
8
|
+
var _react = require("react");
|
|
11
9
|
|
|
12
10
|
var _useThrottle = require("./useThrottle");
|
|
13
11
|
|
|
14
12
|
var _usePrevious = require("./usePrevious");
|
|
15
13
|
|
|
16
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* A hook that handles attaching/removing listeners and smartly reattaching if
|
|
22
16
|
* any of the attributes change.
|
|
@@ -1,17 +1,11 @@
|
|
|
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.usePrevious = void 0;
|
|
9
7
|
|
|
10
|
-
var _react =
|
|
11
|
-
|
|
12
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
13
|
-
|
|
14
|
-
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; }
|
|
8
|
+
var _react = require("react");
|
|
15
9
|
|
|
16
10
|
/**
|
|
17
11
|
* A hook to handle storing the previous value of anything.
|
|
@@ -1,17 +1,11 @@
|
|
|
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.useThrottle = exports.THROTTLE_DELAY = void 0;
|
|
9
7
|
|
|
10
|
-
var _react =
|
|
11
|
-
|
|
12
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
13
|
-
|
|
14
|
-
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; }
|
|
8
|
+
var _react = require("react");
|
|
15
9
|
|
|
16
10
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
11
|
|
|
@@ -19,7 +13,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
19
13
|
|
|
20
14
|
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); }
|
|
21
15
|
|
|
22
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
16
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
17
|
|
|
24
18
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
19
|
|
|
@@ -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 =
|
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -95,16 +95,16 @@ Object.defineProperty(exports, "Form", {
|
|
|
95
95
|
return _Form.default;
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
-
Object.defineProperty(exports, "
|
|
98
|
+
Object.defineProperty(exports, "ICONS", {
|
|
99
99
|
enumerable: true,
|
|
100
100
|
get: function get() {
|
|
101
|
-
return _Icon.
|
|
101
|
+
return _Icon.ICONS;
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
Object.defineProperty(exports, "
|
|
104
|
+
Object.defineProperty(exports, "Icon", {
|
|
105
105
|
enumerable: true,
|
|
106
106
|
get: function get() {
|
|
107
|
-
return _Icon.
|
|
107
|
+
return _Icon.default;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "Input", {
|
|
@@ -143,16 +143,16 @@ Object.defineProperty(exports, "MainTable", {
|
|
|
143
143
|
return _MainTable.default;
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
|
-
Object.defineProperty(exports, "
|
|
146
|
+
Object.defineProperty(exports, "Modal", {
|
|
147
147
|
enumerable: true,
|
|
148
148
|
get: function get() {
|
|
149
|
-
return
|
|
149
|
+
return _Modal.default;
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
|
-
Object.defineProperty(exports, "
|
|
152
|
+
Object.defineProperty(exports, "ModularTable", {
|
|
153
153
|
enumerable: true,
|
|
154
154
|
get: function get() {
|
|
155
|
-
return
|
|
155
|
+
return _ModularTable.default;
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "Notification", {
|
|
@@ -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"));
|
|
@@ -350,8 +358,8 @@ var _Textarea = _interopRequireDefault(require("./components/Textarea"));
|
|
|
350
358
|
|
|
351
359
|
var _Tooltip = _interopRequireDefault(require("./components/Tooltip"));
|
|
352
360
|
|
|
353
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
361
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
354
362
|
|
|
355
|
-
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; }
|
|
363
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
356
364
|
|
|
357
365
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.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.
|
|
26
|
-
"@babel/
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@storybook
|
|
30
|
-
"@storybook/addon-
|
|
31
|
-
"@storybook/
|
|
32
|
-
"@storybook/
|
|
33
|
-
"@storybook/
|
|
25
|
+
"@babel/cli": "7.17.0",
|
|
26
|
+
"@babel/eslint-parser": "7.17.0",
|
|
27
|
+
"@babel/preset-typescript": "7.16.7",
|
|
28
|
+
"@percy/cli": "1.0.0-beta.74",
|
|
29
|
+
"@percy/storybook": "4.1.0",
|
|
30
|
+
"@storybook/addon-a11y": "6.4.18",
|
|
31
|
+
"@storybook/addon-controls": "6.4.18",
|
|
32
|
+
"@storybook/addon-docs": "6.4.18",
|
|
33
|
+
"@storybook/addons": "6.4.18",
|
|
34
|
+
"@storybook/react": "6.4.18",
|
|
35
|
+
"@storybook/theming": "6.4.18",
|
|
36
|
+
"@testing-library/cypress": "8.0.2",
|
|
37
|
+
"@testing-library/dom": "8.11.3",
|
|
34
38
|
"@testing-library/react-hooks": "7.0.2",
|
|
35
|
-
"@
|
|
36
|
-
"@typescript-eslint/
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"babel-jest": "27.
|
|
40
|
-
"babel-loader": "8.2.
|
|
39
|
+
"@testing-library/user-event": "13.5.0",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "5.10.2",
|
|
41
|
+
"@typescript-eslint/parser": "5.10.2",
|
|
42
|
+
"@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
|
|
43
|
+
"babel-jest": "27.4.6",
|
|
44
|
+
"babel-loader": "8.2.3",
|
|
41
45
|
"babel-plugin-module-resolver": "4.1.0",
|
|
42
|
-
"babel-plugin-typescript-to-proptypes": "
|
|
43
|
-
"concurrently": "
|
|
46
|
+
"babel-plugin-typescript-to-proptypes": "2.0.0",
|
|
47
|
+
"concurrently": "7.0.0",
|
|
44
48
|
"css-loader": "5.2.7",
|
|
45
|
-
"cypress": "
|
|
49
|
+
"cypress": "9.4.1",
|
|
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": "
|
|
54
|
+
"eslint": "8.8.0",
|
|
51
55
|
"eslint-config-prettier": "8.3.0",
|
|
52
|
-
"eslint-config-react-app": "
|
|
53
|
-
"eslint-plugin-cypress": "2.
|
|
54
|
-
"eslint-plugin-flowtype": "
|
|
55
|
-
"eslint-plugin-import": "2.
|
|
56
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
57
|
-
"eslint-plugin-prettier": "
|
|
58
|
-
"eslint-plugin-react": "7.
|
|
59
|
-
"eslint-plugin-react-hooks": "4.
|
|
60
|
-
"jest": "27.
|
|
61
|
-
"
|
|
62
|
-
"
|
|
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.7",
|
|
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",
|
|
67
|
-
"sass
|
|
70
|
+
"sass": "1.49.7",
|
|
71
|
+
"sass-loader": "10.2.1",
|
|
68
72
|
"style-loader": "2.0.0",
|
|
69
|
-
"stylelint": "
|
|
70
|
-
"stylelint-config-prettier": "
|
|
71
|
-
"stylelint-config-
|
|
72
|
-
"stylelint-order": "
|
|
73
|
-
"stylelint-prettier": "
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"vanilla-framework": "2.36.0",
|
|
73
|
+
"stylelint": "14.3.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.3",
|
|
79
|
+
"tsc-alias": "1.5.0",
|
|
80
|
+
"typescript": "4.5.5",
|
|
81
|
+
"vanilla-framework": "3.1.0",
|
|
79
82
|
"wait-on": "5.3.0"
|
|
80
83
|
},
|
|
81
84
|
"dependencies": {
|
|
82
|
-
"@types/jest": "
|
|
83
|
-
"@types/node": "
|
|
84
|
-
"@types/react": "17.0.
|
|
85
|
-
"@types/react-dom": "17.0.
|
|
86
|
-
"@types/react-table": "7.7.
|
|
85
|
+
"@types/jest": "27.4.0",
|
|
86
|
+
"@types/node": "16.11.22",
|
|
87
|
+
"@types/react": "17.0.39",
|
|
88
|
+
"@types/react-dom": "17.0.11",
|
|
89
|
+
"@types/react-table": "7.7.9",
|
|
87
90
|
"classnames": "2.3.1",
|
|
88
|
-
"nanoid": "3.
|
|
89
|
-
"prop-types": "15.
|
|
91
|
+
"nanoid": "3.2.0",
|
|
92
|
+
"prop-types": "15.8.1",
|
|
90
93
|
"react-table": "7.7.0",
|
|
91
|
-
"react-useportal": "1.0.
|
|
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": "
|
|
102
|
+
"vanilla-framework": "3.1.0"
|
|
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
|
|
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
|
},
|