@canonical/react-components 0.36.0 → 0.37.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 +1 -1
- package/dist/components/ActionButton/ActionButton.js +1 -1
- package/dist/components/ArticlePagination/ArticlePagination.js +1 -1
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Button/Button.js +2 -1
- package/dist/components/Card/Card.js +1 -1
- package/dist/components/CheckableInput/CheckableInput.js +1 -1
- package/dist/components/CheckboxInput/CheckboxInput.js +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Code/Code.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippet.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippetBlock.js +1 -1
- package/dist/components/CodeSnippet/CodeSnippetDropdown.js +1 -1
- package/dist/components/Col/Col.js +1 -1
- package/dist/components/ContextualMenu/ContextualMenu.js +1 -2
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +1 -1
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Label/Label.js +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/List/List.js +28 -17
- package/dist/components/MainTable/MainTable.js +2 -2
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/ModularTable/ModularTable.js +1 -1
- package/dist/components/Navigation/Navigation.d.ts +57 -0
- package/dist/components/Navigation/Navigation.js +266 -0
- package/dist/components/Navigation/NavigationLink/NavigationLink.d.ts +11 -0
- package/dist/components/Navigation/NavigationLink/NavigationLink.js +57 -0
- package/dist/components/Navigation/NavigationLink/index.d.ts +1 -0
- package/dist/components/Navigation/NavigationLink/index.js +15 -0
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.d.ts +11 -0
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.js +97 -0
- package/dist/components/Navigation/NavigationMenu/index.d.ts +1 -0
- package/dist/components/Navigation/NavigationMenu/index.js +15 -0
- package/dist/components/Navigation/index.d.ts +3 -0
- package/dist/components/Navigation/index.js +15 -0
- package/dist/components/Navigation/types.d.ts +57 -0
- package/dist/components/Navigation/types.js +5 -0
- package/dist/components/Notification/Notification.js +1 -1
- package/dist/components/PasswordToggle/PasswordToggle.js +1 -1
- package/dist/components/RadioInput/RadioInput.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/SearchAndFilter/SearchAndFilter.js +12 -16
- package/dist/components/SearchBox/SearchBox.d.ts +6 -5
- package/dist/components/SearchBox/SearchBox.js +22 -8
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/StatusLabel/StatusLabel.d.ts +31 -0
- package/dist/components/StatusLabel/StatusLabel.js +51 -0
- package/dist/components/StatusLabel/index.d.ts +2 -0
- package/dist/components/StatusLabel/index.js +25 -0
- package/dist/components/Strip/Strip.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/TableCell/TableCell.js +1 -1
- package/dist/components/TableHeader/TableHeader.js +1 -1
- package/dist/components/TableRow/TableRow.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Textarea/Textarea.js +1 -1
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/index.js +19 -3
- package/dist/hooks/useClickOutside.d.ts +7 -0
- package/dist/hooks/useClickOutside.js +41 -0
- package/dist/hooks/useOnEscapePressed.d.ts +4 -0
- package/dist/hooks/useOnEscapePressed.js +27 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +34 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.js +49 -1
- package/package.json +42 -40
package/dist/index.js
CHANGED
|
@@ -155,6 +155,12 @@ Object.defineProperty(exports, "ModularTable", {
|
|
|
155
155
|
return _ModularTable.default;
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
+
Object.defineProperty(exports, "Navigation", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function get() {
|
|
161
|
+
return _Navigation.default;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
158
164
|
Object.defineProperty(exports, "Notification", {
|
|
159
165
|
enumerable: true,
|
|
160
166
|
get: function get() {
|
|
@@ -221,6 +227,18 @@ Object.defineProperty(exports, "Spinner", {
|
|
|
221
227
|
return _Spinner.default;
|
|
222
228
|
}
|
|
223
229
|
});
|
|
230
|
+
Object.defineProperty(exports, "StatusLabel", {
|
|
231
|
+
enumerable: true,
|
|
232
|
+
get: function get() {
|
|
233
|
+
return _StatusLabel.default;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
Object.defineProperty(exports, "StatusLabelAppearance", {
|
|
237
|
+
enumerable: true,
|
|
238
|
+
get: function get() {
|
|
239
|
+
return _StatusLabel.StatusLabelAppearance;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
224
242
|
Object.defineProperty(exports, "Strip", {
|
|
225
243
|
enumerable: true,
|
|
226
244
|
get: function get() {
|
|
@@ -281,6 +299,12 @@ Object.defineProperty(exports, "Tooltip", {
|
|
|
281
299
|
return _Tooltip.default;
|
|
282
300
|
}
|
|
283
301
|
});
|
|
302
|
+
Object.defineProperty(exports, "useClickOutside", {
|
|
303
|
+
enumerable: true,
|
|
304
|
+
get: function get() {
|
|
305
|
+
return _hooks.useClickOutside;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
284
308
|
Object.defineProperty(exports, "useId", {
|
|
285
309
|
enumerable: true,
|
|
286
310
|
get: function get() {
|
|
@@ -293,6 +317,12 @@ Object.defineProperty(exports, "useListener", {
|
|
|
293
317
|
return _hooks.useListener;
|
|
294
318
|
}
|
|
295
319
|
});
|
|
320
|
+
Object.defineProperty(exports, "useOnEscapePressed", {
|
|
321
|
+
enumerable: true,
|
|
322
|
+
get: function get() {
|
|
323
|
+
return _hooks.useOnEscapePressed;
|
|
324
|
+
}
|
|
325
|
+
});
|
|
296
326
|
Object.defineProperty(exports, "usePrevious", {
|
|
297
327
|
enumerable: true,
|
|
298
328
|
get: function get() {
|
|
@@ -354,6 +384,8 @@ var _MainTable = _interopRequireDefault(require("./components/MainTable"));
|
|
|
354
384
|
|
|
355
385
|
var _ModularTable = _interopRequireDefault(require("./components/ModularTable"));
|
|
356
386
|
|
|
387
|
+
var _Navigation = _interopRequireDefault(require("./components/Navigation"));
|
|
388
|
+
|
|
357
389
|
var _Modal = _interopRequireDefault(require("./components/Modal"));
|
|
358
390
|
|
|
359
391
|
var _Notification = _interopRequireWildcard(require("./components/Notification"));
|
|
@@ -378,6 +410,8 @@ var _Switch = _interopRequireDefault(require("./components/Switch"));
|
|
|
378
410
|
|
|
379
411
|
var _Spinner = _interopRequireDefault(require("./components/Spinner"));
|
|
380
412
|
|
|
413
|
+
var _StatusLabel = _interopRequireWildcard(require("./components/StatusLabel"));
|
|
414
|
+
|
|
381
415
|
var _Strip = _interopRequireDefault(require("./components/Strip"));
|
|
382
416
|
|
|
383
417
|
var _SummaryButton = _interopRequireDefault(require("./components/SummaryButton"));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -35,3 +35,16 @@ export declare type TSFixMe = any;
|
|
|
35
35
|
* defined in EnumLike.
|
|
36
36
|
*/
|
|
37
37
|
export declare type ValueOf<T> = T[keyof T];
|
|
38
|
+
/**
|
|
39
|
+
* The Vanilla theme types.
|
|
40
|
+
*/
|
|
41
|
+
export declare enum Theme {
|
|
42
|
+
/**
|
|
43
|
+
* The dark Vanilla theme.
|
|
44
|
+
*/
|
|
45
|
+
DARK = "dark",
|
|
46
|
+
/**
|
|
47
|
+
* The light Vanilla theme.
|
|
48
|
+
*/
|
|
49
|
+
LIGHT = "light"
|
|
50
|
+
}
|
package/dist/types/index.js
CHANGED
|
@@ -2,4 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.Theme = void 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This type should be used for all className props in order to ensure
|
|
10
|
+
* consistency across components.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The allowable heading levels.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This type can be used when defining props that also spread the props of
|
|
19
|
+
* something else. It ensures that the defined component props are never
|
|
20
|
+
* overwritten by the spread props.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The allowable sort directions e.g. for a sortable table.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This type can be used when passing props to a sub component. It makes all
|
|
29
|
+
* component props optional.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This type is simply an alias for the 'any' type and should be used sparingly,
|
|
34
|
+
* if at all.
|
|
35
|
+
*/
|
|
36
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* This type allows for converting an object const into an enum-like construct,
|
|
40
|
+
* e.g. value: ValueOf<typeof EnumLike> will only allow value to be a value
|
|
41
|
+
* defined in EnumLike.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Vanilla theme types.
|
|
46
|
+
*/
|
|
47
|
+
var Theme;
|
|
48
|
+
exports.Theme = Theme;
|
|
49
|
+
|
|
50
|
+
(function (Theme) {
|
|
51
|
+
Theme["DARK"] = "dark";
|
|
52
|
+
Theme["LIGHT"] = "light";
|
|
53
|
+
})(Theme || (exports.Theme = Theme = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"author": "Huw Wilkins <huw.wilkins@canonical.com>",
|
|
@@ -22,87 +22,89 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "/react-components/",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/cli": "7.17.
|
|
26
|
-
"@babel/eslint-parser": "7.
|
|
27
|
-
"@babel/preset-typescript": "7.
|
|
28
|
-
"@percy/cli": "1.
|
|
29
|
-
"@percy/storybook": "4.2.
|
|
30
|
-
"@storybook/addon-a11y": "6.
|
|
31
|
-
"@storybook/addon-controls": "6.
|
|
32
|
-
"@storybook/addon-docs": "6.
|
|
33
|
-
"@storybook/addons": "6.
|
|
34
|
-
"@storybook/react": "6.
|
|
35
|
-
"@storybook/theming": "6.
|
|
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.5.6",
|
|
31
|
+
"@storybook/addon-controls": "6.5.6",
|
|
32
|
+
"@storybook/addon-docs": "6.5.6",
|
|
33
|
+
"@storybook/addons": "6.5.6",
|
|
34
|
+
"@storybook/react": "6.5.6",
|
|
35
|
+
"@storybook/theming": "6.5.6",
|
|
36
36
|
"@testing-library/cypress": "8.0.2",
|
|
37
|
-
"@testing-library/dom": "8.
|
|
38
|
-
"@testing-library/jest-dom": "5.16.
|
|
39
|
-
"@testing-library/react": "12.1.
|
|
37
|
+
"@testing-library/dom": "8.13.0",
|
|
38
|
+
"@testing-library/jest-dom": "5.16.4",
|
|
39
|
+
"@testing-library/react": "12.1.5",
|
|
40
40
|
"@testing-library/react-hooks": "7.0.2",
|
|
41
41
|
"@testing-library/user-event": "13.5.0",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
43
|
-
"@typescript-eslint/parser": "5.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "5.27.0",
|
|
43
|
+
"@typescript-eslint/parser": "5.27.0",
|
|
44
44
|
"@wojtekmaj/enzyme-adapter-react-17": "0.6.7",
|
|
45
45
|
"babel-jest": "27.5.1",
|
|
46
|
-
"babel-loader": "8.2.
|
|
46
|
+
"babel-loader": "8.2.5",
|
|
47
47
|
"babel-plugin-module-resolver": "4.1.0",
|
|
48
48
|
"babel-plugin-typescript-to-proptypes": "2.0.0",
|
|
49
|
-
"concurrently": "7.1
|
|
49
|
+
"concurrently": "7.2.1",
|
|
50
50
|
"css-loader": "5.2.7",
|
|
51
|
-
"cypress": "9.
|
|
51
|
+
"cypress": "9.7.0",
|
|
52
52
|
"deepmerge": "4.2.2",
|
|
53
53
|
"enzyme": "3.11.0",
|
|
54
54
|
"enzyme-adapter-react-16": "1.15.6",
|
|
55
55
|
"enzyme-to-json": "3.6.2",
|
|
56
|
-
"eslint": "8.
|
|
56
|
+
"eslint": "8.16.0",
|
|
57
57
|
"eslint-config-prettier": "8.5.0",
|
|
58
|
-
"eslint-config-react-app": "7.0.
|
|
58
|
+
"eslint-config-react-app": "7.0.1",
|
|
59
59
|
"eslint-plugin-cypress": "2.12.1",
|
|
60
60
|
"eslint-plugin-flowtype": "8.0.3",
|
|
61
|
-
"eslint-plugin-import": "2.
|
|
61
|
+
"eslint-plugin-import": "2.26.0",
|
|
62
62
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
63
63
|
"eslint-plugin-prettier": "4.0.0",
|
|
64
|
-
"eslint-plugin-react": "7.
|
|
65
|
-
"eslint-plugin-react-hooks": "4.
|
|
66
|
-
"eslint-plugin-testing-library": "5.
|
|
64
|
+
"eslint-plugin-react": "7.30.0",
|
|
65
|
+
"eslint-plugin-react-hooks": "4.5.0",
|
|
66
|
+
"eslint-plugin-testing-library": "5.5.1",
|
|
67
67
|
"jest": "27.5.1",
|
|
68
68
|
"npm-package-json-lint": "5.4.2",
|
|
69
69
|
"prettier": "2.6.2",
|
|
70
70
|
"react": "17.0.2",
|
|
71
71
|
"react-docgen-typescript-loader": "3.7.2",
|
|
72
72
|
"react-dom": "17.0.2",
|
|
73
|
-
"sass": "1.
|
|
73
|
+
"sass": "1.52.2",
|
|
74
74
|
"sass-loader": "10.2.1",
|
|
75
75
|
"style-loader": "2.0.0",
|
|
76
|
-
"stylelint": "14.
|
|
76
|
+
"stylelint": "14.8.5",
|
|
77
77
|
"stylelint-config-prettier": "9.0.3",
|
|
78
78
|
"stylelint-config-recommended-scss": "5.0.2",
|
|
79
79
|
"stylelint-order": "5.0.0",
|
|
80
80
|
"stylelint-prettier": "2.0.0",
|
|
81
|
-
"ts-jest": "27.1.
|
|
82
|
-
"tsc-alias": "1.6.
|
|
83
|
-
"typescript": "4.
|
|
84
|
-
"vanilla-framework": "3.
|
|
81
|
+
"ts-jest": "27.1.5",
|
|
82
|
+
"tsc-alias": "1.6.8",
|
|
83
|
+
"typescript": "4.7.2",
|
|
84
|
+
"vanilla-framework": "3.4.0",
|
|
85
85
|
"wait-on": "5.3.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@types/jest": "27.
|
|
89
|
-
"@types/node": "16.11.
|
|
90
|
-
"@types/react": "17.0.
|
|
91
|
-
"@types/react-dom": "17.0.
|
|
92
|
-
"@types/react-table": "7.7.
|
|
88
|
+
"@types/jest": "27.5.2",
|
|
89
|
+
"@types/node": "16.11.38",
|
|
90
|
+
"@types/react": "17.0.45",
|
|
91
|
+
"@types/react-dom": "17.0.17",
|
|
92
|
+
"@types/react-table": "7.7.12",
|
|
93
93
|
"classnames": "2.3.1",
|
|
94
|
-
"nanoid": "3.3.
|
|
94
|
+
"nanoid": "3.3.4",
|
|
95
95
|
"prop-types": "15.8.1",
|
|
96
|
-
"react-table": "7.
|
|
96
|
+
"react-table": "7.8.0",
|
|
97
97
|
"react-useportal": "1.0.16"
|
|
98
98
|
},
|
|
99
99
|
"resolutions": {
|
|
100
|
+
"@types/react": "17.0.45",
|
|
101
|
+
"@types/react-dom": "17.0.17",
|
|
100
102
|
"postcss": "^8.3.11"
|
|
101
103
|
},
|
|
102
104
|
"peerDependencies": {
|
|
103
105
|
"react": "17.0.2",
|
|
104
106
|
"react-dom": "17.0.2",
|
|
105
|
-
"vanilla-framework": "3.
|
|
107
|
+
"vanilla-framework": "3.4.0"
|
|
106
108
|
},
|
|
107
109
|
"scripts": {
|
|
108
110
|
"build": "rm -rf dist && yarn build-local; yarn build-declaration",
|