@canonical/react-components 0.30.0 → 0.33.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 +8 -12
- package/dist/components/ActionButton/ActionButton.js +7 -5
- package/dist/components/ArticlePagination/ArticlePagination.js +3 -1
- package/dist/components/Button/Button.js +3 -1
- 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 +15 -4
- package/dist/components/Chip/Chip.js +34 -10
- package/dist/components/Code/Code.js +6 -4
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +5 -4
- package/dist/components/CodeSnippet/CodeSnippet.js +13 -11
- package/dist/components/CodeSnippet/CodeSnippetBlock.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippetDropdown.js +5 -2
- 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 +13 -10
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +11 -8
- 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 +22 -16
- package/dist/components/Label/Label.js +3 -1
- package/dist/components/Link/Link.js +3 -1
- package/dist/components/List/List.js +8 -4
- 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/ModularTable/ModularTable.d.ts +20 -5
- package/dist/components/ModularTable/ModularTable.js +30 -16
- 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/PasswordToggle/PasswordToggle.js +7 -5
- package/dist/components/RadioInput/RadioInput.js +3 -1
- package/dist/components/Row/Row.js +3 -1
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +4 -4
- package/dist/components/SearchAndFilter/SearchAndFilter.js +8 -6
- package/dist/components/SearchAndFilter/utils.js +1 -1
- package/dist/components/SearchBox/SearchBox.d.ts +5 -4
- package/dist/components/SearchBox/SearchBox.js +12 -14
- 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/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 -1
- package/dist/components/Textarea/Textarea.js +8 -6
- package/dist/components/Tooltip/Tooltip.js +4 -4
- 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/useThrottle.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +51 -11
- package/package.json +39 -36
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.33.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"author": "Huw Wilkins <huw.wilkins@canonical.com>",
|
|
@@ -22,74 +22,77 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "/react-components/",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/cli": "7.
|
|
26
|
-
"@babel/eslint-parser": "7.
|
|
25
|
+
"@babel/cli": "7.17.6",
|
|
26
|
+
"@babel/eslint-parser": "7.17.0",
|
|
27
27
|
"@babel/preset-typescript": "7.16.7",
|
|
28
|
-
"@percy/cli": "1.0.0-beta.
|
|
28
|
+
"@percy/cli": "1.0.0-beta.76",
|
|
29
29
|
"@percy/storybook": "4.1.0",
|
|
30
|
-
"@storybook/addon-a11y": "6.4.
|
|
31
|
-
"@storybook/addon-controls": "6.4.
|
|
32
|
-
"@storybook/addon-docs": "6.4.
|
|
33
|
-
"@storybook/addons": "6.4.
|
|
34
|
-
"@storybook/react": "6.4.
|
|
35
|
-
"@storybook/theming": "6.4.
|
|
30
|
+
"@storybook/addon-a11y": "6.4.19",
|
|
31
|
+
"@storybook/addon-controls": "6.4.19",
|
|
32
|
+
"@storybook/addon-docs": "6.4.19",
|
|
33
|
+
"@storybook/addons": "6.4.19",
|
|
34
|
+
"@storybook/react": "6.4.19",
|
|
35
|
+
"@storybook/theming": "6.4.19",
|
|
36
36
|
"@testing-library/cypress": "8.0.2",
|
|
37
|
-
"@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.3",
|
|
38
40
|
"@testing-library/react-hooks": "7.0.2",
|
|
39
41
|
"@testing-library/user-event": "13.5.0",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
41
|
-
"@typescript-eslint/parser": "5.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "5.13.0",
|
|
43
|
+
"@typescript-eslint/parser": "5.13.0",
|
|
42
44
|
"@wojtekmaj/enzyme-adapter-react-17": "0.6.6",
|
|
43
|
-
"babel-jest": "27.
|
|
45
|
+
"babel-jest": "27.5.1",
|
|
44
46
|
"babel-loader": "8.2.3",
|
|
45
47
|
"babel-plugin-module-resolver": "4.1.0",
|
|
46
48
|
"babel-plugin-typescript-to-proptypes": "2.0.0",
|
|
47
|
-
"concurrently": "
|
|
49
|
+
"concurrently": "7.0.0",
|
|
48
50
|
"css-loader": "5.2.7",
|
|
49
|
-
"cypress": "9.
|
|
51
|
+
"cypress": "9.5.1",
|
|
50
52
|
"deepmerge": "4.2.2",
|
|
51
53
|
"enzyme": "3.11.0",
|
|
52
54
|
"enzyme-adapter-react-16": "1.15.6",
|
|
53
55
|
"enzyme-to-json": "3.6.2",
|
|
54
|
-
"eslint": "8.
|
|
55
|
-
"eslint-config-prettier": "8.
|
|
56
|
+
"eslint": "8.10.0",
|
|
57
|
+
"eslint-config-prettier": "8.5.0",
|
|
56
58
|
"eslint-config-react-app": "7.0.0",
|
|
57
59
|
"eslint-plugin-cypress": "2.12.1",
|
|
58
60
|
"eslint-plugin-flowtype": "8.0.3",
|
|
59
61
|
"eslint-plugin-import": "2.25.4",
|
|
60
62
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
61
63
|
"eslint-plugin-prettier": "4.0.0",
|
|
62
|
-
"eslint-plugin-react": "7.
|
|
64
|
+
"eslint-plugin-react": "7.29.2",
|
|
63
65
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
64
|
-
"
|
|
66
|
+
"eslint-plugin-testing-library": "5.0.5",
|
|
67
|
+
"jest": "27.5.1",
|
|
65
68
|
"npm-package-json-lint": "5.4.2",
|
|
66
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": "1.
|
|
71
|
-
"sass-loader": "10.2.
|
|
73
|
+
"sass": "1.49.9",
|
|
74
|
+
"sass-loader": "10.2.1",
|
|
72
75
|
"style-loader": "2.0.0",
|
|
73
|
-
"stylelint": "14.
|
|
76
|
+
"stylelint": "14.5.3",
|
|
74
77
|
"stylelint-config-prettier": "9.0.3",
|
|
75
78
|
"stylelint-config-recommended-scss": "5.0.2",
|
|
76
79
|
"stylelint-order": "5.0.0",
|
|
77
80
|
"stylelint-prettier": "2.0.0",
|
|
78
|
-
"ts-jest": "27.1.
|
|
79
|
-
"tsc-alias": "1.
|
|
80
|
-
"typescript": "4.
|
|
81
|
-
"vanilla-framework": "3.
|
|
81
|
+
"ts-jest": "27.1.3",
|
|
82
|
+
"tsc-alias": "1.6.3",
|
|
83
|
+
"typescript": "4.6.2",
|
|
84
|
+
"vanilla-framework": "3.1.1",
|
|
82
85
|
"wait-on": "5.3.0"
|
|
83
86
|
},
|
|
84
87
|
"dependencies": {
|
|
85
|
-
"@types/jest": "27.4.
|
|
86
|
-
"@types/node": "16.11.
|
|
87
|
-
"@types/react": "17.0.
|
|
88
|
-
"@types/react-dom": "17.0.
|
|
88
|
+
"@types/jest": "27.4.1",
|
|
89
|
+
"@types/node": "16.11.26",
|
|
90
|
+
"@types/react": "17.0.39",
|
|
91
|
+
"@types/react-dom": "17.0.13",
|
|
89
92
|
"@types/react-table": "7.7.9",
|
|
90
93
|
"classnames": "2.3.1",
|
|
91
|
-
"nanoid": "3.1
|
|
92
|
-
"prop-types": "15.8.
|
|
94
|
+
"nanoid": "3.3.1",
|
|
95
|
+
"prop-types": "15.8.1",
|
|
93
96
|
"react-table": "7.7.0",
|
|
94
97
|
"react-useportal": "1.0.16"
|
|
95
98
|
},
|
|
@@ -99,7 +102,7 @@
|
|
|
99
102
|
"peerDependencies": {
|
|
100
103
|
"react": "17.0.2",
|
|
101
104
|
"react-dom": "17.0.2",
|
|
102
|
-
"vanilla-framework": "3.
|
|
105
|
+
"vanilla-framework": "3.1.1"
|
|
103
106
|
},
|
|
104
107
|
"scripts": {
|
|
105
108
|
"build": "rm -rf dist && yarn build-local; yarn build-declaration",
|
|
@@ -151,10 +154,10 @@
|
|
|
151
154
|
"snapshotSerializers": [
|
|
152
155
|
"enzyme-to-json/serializer"
|
|
153
156
|
],
|
|
154
|
-
"
|
|
157
|
+
"setupFilesAfterEnv": [
|
|
155
158
|
"<rootDir>/src/setupTests.js"
|
|
156
159
|
],
|
|
157
|
-
"testEnvironment": "jsdom",
|
|
160
|
+
"testEnvironment": "jest-environment-jsdom",
|
|
158
161
|
"moduleDirectories": [
|
|
159
162
|
"node_modules",
|
|
160
163
|
"src"
|