@canonical/react-components 0.24.0 → 0.32.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/dist/components/Accordion/Accordion.js +9 -6
- package/dist/components/AccordionSection/AccordionSection.js +7 -24
- 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.d.ts +9 -1
- package/dist/components/CheckableInput/CheckableInput.js +13 -10
- 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 +14 -11
- 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.js +40 -14
- 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.d.ts +4 -0
- package/dist/components/MainTable/MainTable.js +23 -11
- package/dist/components/Modal/Modal.js +14 -12
- package/dist/components/Notification/Notification.js +6 -4
- 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 +9 -1
- package/dist/components/PasswordToggle/PasswordToggle.js +10 -6
- 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 +11 -2
- package/dist/components/Spinner/Spinner.js +24 -6
- package/dist/components/Strip/Strip.js +3 -1
- package/dist/components/SummaryButton/SummaryButton.js +0 -11
- package/dist/components/Switch/Switch.d.ts +14 -0
- package/dist/components/Switch/Switch.js +42 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +15 -0
- 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 +3 -7
- package/dist/components/Textarea/Textarea.js +8 -6
- package/dist/components/Tooltip/Tooltip.js +4 -15
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +11 -3
- package/dist/hooks/useId.d.ts +6 -0
- package/dist/hooks/useId.js +21 -0
- 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 +3 -0
- package/dist/index.js +51 -11
- package/package.json +57 -51
package/dist/hooks/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "useId", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _useId.useId;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useListener", {
|
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "useThrottle", {
|
|
|
27
27
|
return _useThrottle.useThrottle;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "useWindowFitment", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _useWindowFitment.useWindowFitment;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
|
|
31
37
|
var _useWindowFitment = require("./useWindowFitment");
|
|
32
38
|
|
|
@@ -34,4 +40,6 @@ var _useListener = require("./useListener");
|
|
|
34
40
|
|
|
35
41
|
var _usePrevious = require("./usePrevious");
|
|
36
42
|
|
|
37
|
-
var _useThrottle = require("./useThrottle");
|
|
43
|
+
var _useThrottle = require("./useThrottle");
|
|
44
|
+
|
|
45
|
+
var _useId = require("./useId");
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useId = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _nanoid = require("nanoid");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A hook that returns the same random ID string on every render.
|
|
14
|
+
* Can be used as a value for HTML "id" attributes.
|
|
15
|
+
* @returns random ID string
|
|
16
|
+
*/
|
|
17
|
+
var useId = function useId() {
|
|
18
|
+
return (0, _react.useRef)((0, _nanoid.nanoid)()).current;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.useId = useId;
|
|
@@ -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
|
@@ -29,6 +29,7 @@ export { default as SearchAndFilter } from "./components/SearchAndFilter";
|
|
|
29
29
|
export { default as SearchBox } from "./components/SearchBox";
|
|
30
30
|
export { default as Select } from "./components/Select";
|
|
31
31
|
export { default as Slider } from "./components/Slider";
|
|
32
|
+
export { default as Switch } from "./components/Switch";
|
|
32
33
|
export { default as Spinner } from "./components/Spinner";
|
|
33
34
|
export { default as Strip } from "./components/Strip";
|
|
34
35
|
export { default as SummaryButton } from "./components/SummaryButton";
|
|
@@ -80,4 +81,6 @@ export type { TableRowProps } from "./components/TableRow";
|
|
|
80
81
|
export type { TabsProps } from "./components/Tabs";
|
|
81
82
|
export type { TextareaProps } from "./components/Textarea";
|
|
82
83
|
export type { TooltipProps } from "./components/Tooltip";
|
|
84
|
+
export { useWindowFitment, useListener, usePrevious, useThrottle, useId, } from "./hooks";
|
|
85
|
+
export type { WindowFitment } from "./hooks";
|
|
83
86
|
export type { ClassName, Headings, PropsWithSpread, SortDirection, SubComponentProps, TSFixMe, ValueOf, } from "./types";
|
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", {
|
|
@@ -233,6 +233,12 @@ Object.defineProperty(exports, "SummaryButton", {
|
|
|
233
233
|
return _SummaryButton.default;
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
|
+
Object.defineProperty(exports, "Switch", {
|
|
237
|
+
enumerable: true,
|
|
238
|
+
get: function get() {
|
|
239
|
+
return _Switch.default;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
236
242
|
Object.defineProperty(exports, "Table", {
|
|
237
243
|
enumerable: true,
|
|
238
244
|
get: function get() {
|
|
@@ -275,6 +281,36 @@ Object.defineProperty(exports, "Tooltip", {
|
|
|
275
281
|
return _Tooltip.default;
|
|
276
282
|
}
|
|
277
283
|
});
|
|
284
|
+
Object.defineProperty(exports, "useId", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
get: function get() {
|
|
287
|
+
return _hooks.useId;
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
Object.defineProperty(exports, "useListener", {
|
|
291
|
+
enumerable: true,
|
|
292
|
+
get: function get() {
|
|
293
|
+
return _hooks.useListener;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
Object.defineProperty(exports, "usePrevious", {
|
|
297
|
+
enumerable: true,
|
|
298
|
+
get: function get() {
|
|
299
|
+
return _hooks.usePrevious;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
Object.defineProperty(exports, "useThrottle", {
|
|
303
|
+
enumerable: true,
|
|
304
|
+
get: function get() {
|
|
305
|
+
return _hooks.useThrottle;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
Object.defineProperty(exports, "useWindowFitment", {
|
|
309
|
+
enumerable: true,
|
|
310
|
+
get: function get() {
|
|
311
|
+
return _hooks.useWindowFitment;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
278
314
|
|
|
279
315
|
var _Accordion = _interopRequireDefault(require("./components/Accordion"));
|
|
280
316
|
|
|
@@ -338,6 +374,8 @@ var _Select = _interopRequireDefault(require("./components/Select"));
|
|
|
338
374
|
|
|
339
375
|
var _Slider = _interopRequireDefault(require("./components/Slider"));
|
|
340
376
|
|
|
377
|
+
var _Switch = _interopRequireDefault(require("./components/Switch"));
|
|
378
|
+
|
|
341
379
|
var _Spinner = _interopRequireDefault(require("./components/Spinner"));
|
|
342
380
|
|
|
343
381
|
var _Strip = _interopRequireDefault(require("./components/Strip"));
|
|
@@ -358,8 +396,10 @@ var _Textarea = _interopRequireDefault(require("./components/Textarea"));
|
|
|
358
396
|
|
|
359
397
|
var _Tooltip = _interopRequireDefault(require("./components/Tooltip"));
|
|
360
398
|
|
|
361
|
-
|
|
399
|
+
var _hooks = require("./hooks");
|
|
400
|
+
|
|
401
|
+
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); }
|
|
362
402
|
|
|
363
|
-
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; }
|
|
403
|
+
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; }
|
|
364
404
|
|
|
365
405
|
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.32.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"author": "Huw Wilkins <huw.wilkins@canonical.com>",
|
|
@@ -22,81 +22,87 @@
|
|
|
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",
|
|
34
36
|
"@testing-library/cypress": "8.0.2",
|
|
35
|
-
"@testing-library/dom": "8.11.
|
|
37
|
+
"@testing-library/dom": "8.11.3",
|
|
38
|
+
"@testing-library/jest-dom": "5.16.2",
|
|
39
|
+
"@testing-library/react": "12.1.2",
|
|
36
40
|
"@testing-library/react-hooks": "7.0.2",
|
|
37
41
|
"@testing-library/user-event": "13.5.0",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "
|
|
39
|
-
"@typescript-eslint/parser": "
|
|
40
|
-
"@wojtekmaj/enzyme-adapter-react-17": "0.6.
|
|
41
|
-
"babel-
|
|
42
|
-
"babel-jest": "27.3.1",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "5.10.2",
|
|
43
|
+
"@typescript-eslint/parser": "5.10.2",
|
|
44
|
+
"@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
|
|
45
|
+
"babel-jest": "27.4.6",
|
|
43
46
|
"babel-loader": "8.2.3",
|
|
44
47
|
"babel-plugin-module-resolver": "4.1.0",
|
|
45
|
-
"babel-plugin-typescript-to-proptypes": "
|
|
46
|
-
"concurrently": "
|
|
48
|
+
"babel-plugin-typescript-to-proptypes": "2.0.0",
|
|
49
|
+
"concurrently": "7.0.0",
|
|
47
50
|
"css-loader": "5.2.7",
|
|
48
|
-
"cypress": "
|
|
51
|
+
"cypress": "9.4.1",
|
|
49
52
|
"deepmerge": "4.2.2",
|
|
50
53
|
"enzyme": "3.11.0",
|
|
51
54
|
"enzyme-adapter-react-16": "1.15.6",
|
|
52
55
|
"enzyme-to-json": "3.6.2",
|
|
53
|
-
"eslint": "
|
|
56
|
+
"eslint": "8.8.0",
|
|
54
57
|
"eslint-config-prettier": "8.3.0",
|
|
55
|
-
"eslint-config-react-app": "
|
|
58
|
+
"eslint-config-react-app": "7.0.0",
|
|
56
59
|
"eslint-plugin-cypress": "2.12.1",
|
|
57
|
-
"eslint-plugin-flowtype": "
|
|
58
|
-
"eslint-plugin-import": "2.25.
|
|
60
|
+
"eslint-plugin-flowtype": "8.0.3",
|
|
61
|
+
"eslint-plugin-import": "2.25.4",
|
|
59
62
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
60
|
-
"eslint-plugin-prettier": "
|
|
61
|
-
"eslint-plugin-react": "7.
|
|
63
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
64
|
+
"eslint-plugin-react": "7.28.0",
|
|
62
65
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
66
|
+
"eslint-plugin-testing-library": "5.0.5",
|
|
67
|
+
"jest": "27.4.7",
|
|
65
68
|
"npm-package-json-lint": "5.4.2",
|
|
66
|
-
"prettier": "2.
|
|
69
|
+
"prettier": "2.5.1",
|
|
67
70
|
"react": "17.0.2",
|
|
68
71
|
"react-docgen-typescript-loader": "3.7.2",
|
|
69
72
|
"react-dom": "17.0.2",
|
|
70
|
-
"sass
|
|
73
|
+
"sass": "1.49.7",
|
|
74
|
+
"sass-loader": "10.2.1",
|
|
71
75
|
"style-loader": "2.0.0",
|
|
72
|
-
"stylelint": "
|
|
73
|
-
"stylelint-config-prettier": "
|
|
74
|
-
"stylelint-config-
|
|
75
|
-
"stylelint-order": "
|
|
76
|
-
"stylelint-prettier": "
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"vanilla-framework": "2.37.1",
|
|
76
|
+
"stylelint": "14.3.0",
|
|
77
|
+
"stylelint-config-prettier": "9.0.3",
|
|
78
|
+
"stylelint-config-recommended-scss": "5.0.2",
|
|
79
|
+
"stylelint-order": "5.0.0",
|
|
80
|
+
"stylelint-prettier": "2.0.0",
|
|
81
|
+
"ts-jest": "27.1.3",
|
|
82
|
+
"tsc-alias": "1.5.0",
|
|
83
|
+
"typescript": "4.5.5",
|
|
84
|
+
"vanilla-framework": "3.1.1",
|
|
82
85
|
"wait-on": "5.3.0"
|
|
83
86
|
},
|
|
84
87
|
"dependencies": {
|
|
85
|
-
"@types/jest": "27.0
|
|
86
|
-
"@types/node": "16.11.
|
|
87
|
-
"@types/react": "17.0.
|
|
88
|
+
"@types/jest": "27.4.0",
|
|
89
|
+
"@types/node": "16.11.22",
|
|
90
|
+
"@types/react": "17.0.39",
|
|
88
91
|
"@types/react-dom": "17.0.11",
|
|
89
|
-
"@types/react-table": "7.7.
|
|
92
|
+
"@types/react-table": "7.7.9",
|
|
90
93
|
"classnames": "2.3.1",
|
|
91
|
-
"nanoid": "3.
|
|
92
|
-
"prop-types": "15.
|
|
94
|
+
"nanoid": "3.2.0",
|
|
95
|
+
"prop-types": "15.8.1",
|
|
93
96
|
"react-table": "7.7.0",
|
|
94
|
-
"react-useportal": "1.0.
|
|
97
|
+
"react-useportal": "1.0.16"
|
|
98
|
+
},
|
|
99
|
+
"resolutions": {
|
|
100
|
+
"postcss": "^8.3.11"
|
|
95
101
|
},
|
|
96
102
|
"peerDependencies": {
|
|
97
103
|
"react": "17.0.2",
|
|
98
104
|
"react-dom": "17.0.2",
|
|
99
|
-
"vanilla-framework": "
|
|
105
|
+
"vanilla-framework": "3.1.1"
|
|
100
106
|
},
|
|
101
107
|
"scripts": {
|
|
102
108
|
"build": "rm -rf dist && yarn build-local; yarn build-declaration",
|
|
@@ -108,10 +114,10 @@
|
|
|
108
114
|
"docs": "start-storybook --port ${PORT:-9009}",
|
|
109
115
|
"link-packages": "yarn install && yarn build && yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link",
|
|
110
116
|
"lint-js": "eslint src",
|
|
111
|
-
"lint-style": "stylelint src",
|
|
117
|
+
"lint-style": "stylelint src/**/*.scss",
|
|
112
118
|
"lint-package-json": "npmPkgJsonLint .",
|
|
113
119
|
"lint": "yarn lint-package-json && yarn lint-js && yarn lint-style",
|
|
114
|
-
"percy": "yarn build-docs && percy
|
|
120
|
+
"percy": "yarn build-docs && percy storybook ./docs",
|
|
115
121
|
"prepublishOnly": "yarn clean && yarn install && yarn build",
|
|
116
122
|
"serve": "yarn docs",
|
|
117
123
|
"start": "yarn docs",
|
|
@@ -148,10 +154,10 @@
|
|
|
148
154
|
"snapshotSerializers": [
|
|
149
155
|
"enzyme-to-json/serializer"
|
|
150
156
|
],
|
|
151
|
-
"
|
|
157
|
+
"setupFilesAfterEnv": [
|
|
152
158
|
"<rootDir>/src/setupTests.js"
|
|
153
159
|
],
|
|
154
|
-
"testEnvironment": "jsdom",
|
|
160
|
+
"testEnvironment": "jest-environment-jsdom",
|
|
155
161
|
"moduleDirectories": [
|
|
156
162
|
"node_modules",
|
|
157
163
|
"src"
|