@canonical/react-components 0.41.0 → 0.43.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.
Files changed (151) hide show
  1. package/dist/__mocks__/nanoid.js +0 -2
  2. package/dist/components/Accordion/Accordion.js +13 -37
  3. package/dist/components/Accordion/AccordionSection/AccordionSection.js +8 -14
  4. package/dist/components/Accordion/AccordionSection/index.js +0 -2
  5. package/dist/components/Accordion/index.js +0 -2
  6. package/dist/components/ActionButton/ActionButton.js +36 -65
  7. package/dist/components/ActionButton/index.js +0 -2
  8. package/dist/components/ArticlePagination/ArticlePagination.js +5 -15
  9. package/dist/components/ArticlePagination/index.js +0 -2
  10. package/dist/components/Badge/Badge.js +10 -28
  11. package/dist/components/Badge/index.js +0 -2
  12. package/dist/components/Button/Button.js +12 -25
  13. package/dist/components/Button/index.js +0 -4
  14. package/dist/components/Card/Card.js +7 -18
  15. package/dist/components/Card/index.js +0 -2
  16. package/dist/components/CheckboxInput/CheckableInput/CheckableInput.js +6 -20
  17. package/dist/components/CheckboxInput/CheckableInput/index.js +0 -2
  18. package/dist/components/CheckboxInput/CheckboxInput.js +3 -13
  19. package/dist/components/CheckboxInput/index.js +0 -2
  20. package/dist/components/Chip/Chip.js +14 -30
  21. package/dist/components/Chip/index.js +0 -2
  22. package/dist/components/Code/Code.js +5 -23
  23. package/dist/components/Code/index.js +0 -2
  24. package/dist/components/CodeSnippet/CodeSnippet.js +2 -12
  25. package/dist/components/CodeSnippet/CodeSnippetBlock.js +10 -18
  26. package/dist/components/CodeSnippet/CodeSnippetDropdown.js +5 -14
  27. package/dist/components/CodeSnippet/index.js +0 -3
  28. package/dist/components/Col/Col.js +15 -25
  29. package/dist/components/Col/index.js +0 -4
  30. package/dist/components/ConfirmationButton/ConfirmationButton.d.ts +25 -0
  31. package/dist/components/ConfirmationButton/ConfirmationButton.js +59 -0
  32. package/dist/components/ConfirmationButton/index.d.ts +2 -0
  33. package/dist/components/ConfirmationButton/index.js +13 -0
  34. package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +33 -0
  35. package/dist/components/ConfirmationModal/ConfirmationModal.js +38 -0
  36. package/dist/components/ConfirmationModal/index.d.ts +2 -0
  37. package/dist/components/ConfirmationModal/index.js +13 -0
  38. package/dist/components/ContextualMenu/ContextualMenu.d.ts +3 -3
  39. package/dist/components/ContextualMenu/ContextualMenu.js +66 -101
  40. package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +2 -1
  41. package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +48 -85
  42. package/dist/components/ContextualMenu/ContextualMenuDropdown/index.js +0 -2
  43. package/dist/components/ContextualMenu/index.js +0 -2
  44. package/dist/components/EmptyState/EmptyState.d.ts +22 -0
  45. package/dist/components/EmptyState/EmptyState.js +27 -0
  46. package/dist/components/EmptyState/index.d.ts +2 -0
  47. package/dist/components/EmptyState/index.js +13 -0
  48. package/dist/components/Field/Field.js +35 -51
  49. package/dist/components/Field/index.js +0 -2
  50. package/dist/components/Form/Form.js +4 -14
  51. package/dist/components/Form/index.js +0 -2
  52. package/dist/components/Icon/Icon.js +3 -14
  53. package/dist/components/Icon/Icon.stories.scss +1 -0
  54. package/dist/components/Icon/index.js +0 -4
  55. package/dist/components/Input/Input.js +21 -39
  56. package/dist/components/Input/index.js +0 -2
  57. package/dist/components/Label/Label.js +7 -13
  58. package/dist/components/Label/index.js +0 -2
  59. package/dist/components/Link/Link.js +10 -22
  60. package/dist/components/Link/index.js +0 -2
  61. package/dist/components/List/List.d.ts +5 -5
  62. package/dist/components/List/List.js +17 -32
  63. package/dist/components/List/index.js +0 -2
  64. package/dist/components/Loader/Loader.js +0 -7
  65. package/dist/components/Loader/index.js +0 -2
  66. package/dist/components/MainTable/MainTable.js +59 -111
  67. package/dist/components/MainTable/index.js +0 -2
  68. package/dist/components/Modal/Modal.js +7 -34
  69. package/dist/components/Modal/index.js +0 -2
  70. package/dist/components/ModularTable/ModularTable.d.ts +9 -1
  71. package/dist/components/ModularTable/ModularTable.js +39 -46
  72. package/dist/components/ModularTable/index.js +0 -2
  73. package/dist/components/Navigation/Navigation.js +46 -82
  74. package/dist/components/Navigation/NavigationLink/NavigationLink.js +15 -30
  75. package/dist/components/Navigation/NavigationLink/index.js +0 -2
  76. package/dist/components/Navigation/NavigationMenu/NavigationMenu.js +12 -35
  77. package/dist/components/Navigation/NavigationMenu/index.js +0 -2
  78. package/dist/components/Navigation/index.js +0 -2
  79. package/dist/components/Notification/Notification.d.ts +6 -0
  80. package/dist/components/Notification/Notification.js +29 -42
  81. package/dist/components/Notification/index.js +0 -4
  82. package/dist/components/NotificationProvider/NotificationProvider.d.ts +5 -0
  83. package/dist/components/NotificationProvider/NotificationProvider.js +119 -0
  84. package/dist/components/NotificationProvider/index.d.ts +3 -0
  85. package/dist/components/NotificationProvider/index.js +49 -0
  86. package/dist/components/NotificationProvider/messageBuilder.d.ts +6 -0
  87. package/dist/components/NotificationProvider/messageBuilder.js +41 -0
  88. package/dist/components/NotificationProvider/types.d.ts +30 -0
  89. package/dist/components/NotificationProvider/types.js +5 -0
  90. package/dist/components/Pagination/Pagination.js +14 -44
  91. package/dist/components/Pagination/PaginationButton/PaginationButton.js +3 -10
  92. package/dist/components/Pagination/PaginationButton/index.js +0 -2
  93. package/dist/components/Pagination/PaginationItem/PaginationItem.js +3 -8
  94. package/dist/components/Pagination/PaginationItem/index.js +0 -2
  95. package/dist/components/Pagination/index.js +0 -2
  96. package/dist/components/PasswordToggle/PasswordToggle.js +16 -45
  97. package/dist/components/PasswordToggle/index.js +0 -2
  98. package/dist/components/RadioInput/RadioInput.js +1 -11
  99. package/dist/components/RadioInput/index.js +0 -2
  100. package/dist/components/Row/Row.js +2 -12
  101. package/dist/components/Row/index.js +0 -2
  102. package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +27 -49
  103. package/dist/components/SearchAndFilter/FilterPanelSection/index.js +0 -2
  104. package/dist/components/SearchAndFilter/SearchAndFilter.d.ts +9 -1
  105. package/dist/components/SearchAndFilter/SearchAndFilter.js +68 -104
  106. package/dist/components/SearchAndFilter/index.js +0 -2
  107. package/dist/components/SearchAndFilter/utils.js +1 -7
  108. package/dist/components/SearchBox/SearchBox.js +14 -34
  109. package/dist/components/SearchBox/index.js +0 -2
  110. package/dist/components/Select/Select.js +20 -33
  111. package/dist/components/Select/index.js +0 -2
  112. package/dist/components/Slider/Slider.js +16 -32
  113. package/dist/components/Slider/index.js +0 -2
  114. package/dist/components/Spinner/Spinner.js +8 -19
  115. package/dist/components/Spinner/index.js +0 -2
  116. package/dist/components/StatusLabel/StatusLabel.js +4 -15
  117. package/dist/components/StatusLabel/index.js +0 -4
  118. package/dist/components/Strip/Strip.js +25 -36
  119. package/dist/components/Strip/index.js +0 -2
  120. package/dist/components/SummaryButton/SummaryButton.js +4 -10
  121. package/dist/components/SummaryButton/index.js +0 -2
  122. package/dist/components/Switch/Switch.js +3 -12
  123. package/dist/components/Switch/index.js +0 -2
  124. package/dist/components/Table/Table.js +6 -16
  125. package/dist/components/Table/index.js +0 -2
  126. package/dist/components/TableCell/TableCell.js +10 -20
  127. package/dist/components/TableCell/index.js +0 -2
  128. package/dist/components/TableHeader/TableHeader.js +2 -11
  129. package/dist/components/TableHeader/index.js +0 -2
  130. package/dist/components/TableRow/TableRow.js +1 -10
  131. package/dist/components/TableRow/index.js +0 -2
  132. package/dist/components/Tabs/Tabs.js +7 -17
  133. package/dist/components/Tabs/index.js +0 -2
  134. package/dist/components/Textarea/Textarea.js +23 -36
  135. package/dist/components/Textarea/index.js +0 -2
  136. package/dist/components/Tooltip/Tooltip.js +38 -88
  137. package/dist/components/Tooltip/index.js +0 -4
  138. package/dist/enums.js +0 -2
  139. package/dist/hooks/index.js +0 -8
  140. package/dist/hooks/useClickOutside.js +2 -7
  141. package/dist/hooks/useId.js +0 -4
  142. package/dist/hooks/useListener.js +0 -8
  143. package/dist/hooks/useOnEscapePressed.js +0 -3
  144. package/dist/hooks/usePagination.js +13 -25
  145. package/dist/hooks/usePrevious.js +0 -3
  146. package/dist/hooks/useThrottle.js +1 -15
  147. package/dist/hooks/useWindowFitment.js +6 -13
  148. package/dist/index.d.ts +8 -0
  149. package/dist/index.js +64 -52
  150. package/dist/utils.js +3 -10
  151. package/package.json +31 -28
package/dist/index.d.ts CHANGED
@@ -9,7 +9,10 @@ export { default as Chip } from "./components/Chip";
9
9
  export { default as Code } from "./components/Code";
10
10
  export { default as CodeSnippet, CodeSnippetBlockAppearance, } from "./components/CodeSnippet";
11
11
  export { default as Col } from "./components/Col";
12
+ export { default as ConfirmationButton } from "./components/ConfirmationButton";
13
+ export { default as ConfirmationModal } from "./components/ConfirmationModal";
12
14
  export { default as ContextualMenu } from "./components/ContextualMenu";
15
+ export { default as EmptyState } from "./components/EmptyState";
13
16
  export { default as Field } from "./components/Field";
14
17
  export { default as Form } from "./components/Form";
15
18
  export { default as Icon, ICONS } from "./components/Icon";
@@ -23,6 +26,7 @@ export { default as ModularTable } from "./components/ModularTable";
23
26
  export { default as Navigation } from "./components/Navigation";
24
27
  export { default as Modal } from "./components/Modal";
25
28
  export { default as Notification, NotificationSeverity, } from "./components/Notification";
29
+ export { NotificationConsumer, NotificationProvider, useNotify, info, success, failure, queue, } from "./components/NotificationProvider";
26
30
  export { default as Pagination } from "./components/Pagination";
27
31
  export { default as PasswordToggle } from "./components/PasswordToggle";
28
32
  export { default as RadioInput } from "./components/RadioInput";
@@ -54,7 +58,10 @@ export type { ChipProps } from "./components/Chip";
54
58
  export type { CodeProps } from "./components/Code";
55
59
  export type { CodeSnippetProps, CodeSnippetBlockProps, CodeSnippetDropdownProps, } from "./components/CodeSnippet";
56
60
  export type { ColProps, ColSize } from "./components/Col";
61
+ export type { ConfirmationButtonProps } from "./components/ConfirmationButton";
62
+ export type { ConfirmationModalProps } from "./components/ConfirmationModal";
57
63
  export type { ContextualMenuProps, ContextualMenuDropdownProps, MenuLink, Position, } from "./components/ContextualMenu";
64
+ export type { EmptyStateProps } from "./components/EmptyState";
58
65
  export type { FieldProps } from "./components/Field";
59
66
  export type { FormProps } from "./components/Form";
60
67
  export type { IconProps } from "./components/Icon";
@@ -67,6 +74,7 @@ export type { ModularTableProps } from "./components/ModularTable";
67
74
  export type { ModalProps } from "./components/Modal";
68
75
  export type { GenerateLink, LogoProps, NavigationProps, NavItem, NavLink, NavLinkAnchor, NavLinkBase, NavLinkButton, } from "./components/Navigation";
69
76
  export type { NotificationProps } from "./components/Notification";
77
+ export type { NotificationAction, NotificationType, QueuedNotification, NotificationHelper, } from "./components/NotificationProvider";
70
78
  export type { PaginationProps } from "./components/Pagination";
71
79
  export type { RadioInputProps } from "./components/RadioInput";
72
80
  export type { RowProps } from "./components/Row";
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
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
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -83,12 +82,30 @@ Object.defineProperty(exports, "Col", {
83
82
  return _Col.default;
84
83
  }
85
84
  });
85
+ Object.defineProperty(exports, "ConfirmationButton", {
86
+ enumerable: true,
87
+ get: function get() {
88
+ return _ConfirmationButton.default;
89
+ }
90
+ });
91
+ Object.defineProperty(exports, "ConfirmationModal", {
92
+ enumerable: true,
93
+ get: function get() {
94
+ return _ConfirmationModal.default;
95
+ }
96
+ });
86
97
  Object.defineProperty(exports, "ContextualMenu", {
87
98
  enumerable: true,
88
99
  get: function get() {
89
100
  return _ContextualMenu.default;
90
101
  }
91
102
  });
103
+ Object.defineProperty(exports, "EmptyState", {
104
+ enumerable: true,
105
+ get: function get() {
106
+ return _EmptyState.default;
107
+ }
108
+ });
92
109
  Object.defineProperty(exports, "Field", {
93
110
  enumerable: true,
94
111
  get: function get() {
@@ -173,6 +190,18 @@ Object.defineProperty(exports, "Notification", {
173
190
  return _Notification.default;
174
191
  }
175
192
  });
193
+ Object.defineProperty(exports, "NotificationConsumer", {
194
+ enumerable: true,
195
+ get: function get() {
196
+ return _NotificationProvider.NotificationConsumer;
197
+ }
198
+ });
199
+ Object.defineProperty(exports, "NotificationProvider", {
200
+ enumerable: true,
201
+ get: function get() {
202
+ return _NotificationProvider.NotificationProvider;
203
+ }
204
+ });
176
205
  Object.defineProperty(exports, "NotificationSeverity", {
177
206
  enumerable: true,
178
207
  get: function get() {
@@ -311,6 +340,18 @@ Object.defineProperty(exports, "Tooltip", {
311
340
  return _Tooltip.default;
312
341
  }
313
342
  });
343
+ Object.defineProperty(exports, "failure", {
344
+ enumerable: true,
345
+ get: function get() {
346
+ return _NotificationProvider.failure;
347
+ }
348
+ });
349
+ Object.defineProperty(exports, "info", {
350
+ enumerable: true,
351
+ get: function get() {
352
+ return _NotificationProvider.info;
353
+ }
354
+ });
314
355
  Object.defineProperty(exports, "isNavigationAnchor", {
315
356
  enumerable: true,
316
357
  get: function get() {
@@ -323,6 +364,18 @@ Object.defineProperty(exports, "isNavigationButton", {
323
364
  return _utils.isNavigationButton;
324
365
  }
325
366
  });
367
+ Object.defineProperty(exports, "queue", {
368
+ enumerable: true,
369
+ get: function get() {
370
+ return _NotificationProvider.queue;
371
+ }
372
+ });
373
+ Object.defineProperty(exports, "success", {
374
+ enumerable: true,
375
+ get: function get() {
376
+ return _NotificationProvider.success;
377
+ }
378
+ });
326
379
  Object.defineProperty(exports, "useClickOutside", {
327
380
  enumerable: true,
328
381
  get: function get() {
@@ -341,6 +394,12 @@ Object.defineProperty(exports, "useListener", {
341
394
  return _hooks.useListener;
342
395
  }
343
396
  });
397
+ Object.defineProperty(exports, "useNotify", {
398
+ enumerable: true,
399
+ get: function get() {
400
+ return _NotificationProvider.useNotify;
401
+ }
402
+ });
344
403
  Object.defineProperty(exports, "useOnEscapePressed", {
345
404
  enumerable: true,
346
405
  get: function get() {
@@ -371,105 +430,58 @@ Object.defineProperty(exports, "useWindowFitment", {
371
430
  return _hooks.useWindowFitment;
372
431
  }
373
432
  });
374
-
375
433
  var _Accordion = _interopRequireDefault(require("./components/Accordion"));
376
-
377
434
  var _ActionButton = _interopRequireDefault(require("./components/ActionButton"));
378
-
379
435
  var _ArticlePagination = _interopRequireDefault(require("./components/ArticlePagination"));
380
-
381
436
  var _Badge = _interopRequireDefault(require("./components/Badge"));
382
-
383
437
  var _Button = _interopRequireWildcard(require("./components/Button"));
384
-
385
438
  var _Card = _interopRequireDefault(require("./components/Card"));
386
-
387
439
  var _CheckboxInput = _interopRequireDefault(require("./components/CheckboxInput"));
388
-
389
440
  var _Chip = _interopRequireDefault(require("./components/Chip"));
390
-
391
441
  var _Code = _interopRequireDefault(require("./components/Code"));
392
-
393
442
  var _CodeSnippet = _interopRequireWildcard(require("./components/CodeSnippet"));
394
-
395
443
  var _Col = _interopRequireDefault(require("./components/Col"));
396
-
444
+ var _ConfirmationButton = _interopRequireDefault(require("./components/ConfirmationButton"));
445
+ var _ConfirmationModal = _interopRequireDefault(require("./components/ConfirmationModal"));
397
446
  var _ContextualMenu = _interopRequireDefault(require("./components/ContextualMenu"));
398
-
447
+ var _EmptyState = _interopRequireDefault(require("./components/EmptyState"));
399
448
  var _Field = _interopRequireDefault(require("./components/Field"));
400
-
401
449
  var _Form = _interopRequireDefault(require("./components/Form"));
402
-
403
450
  var _Icon = _interopRequireWildcard(require("./components/Icon"));
404
-
405
451
  var _Input = _interopRequireDefault(require("./components/Input"));
406
-
407
452
  var _Label = _interopRequireDefault(require("./components/Label"));
408
-
409
453
  var _Link = _interopRequireDefault(require("./components/Link"));
410
-
411
454
  var _List = _interopRequireDefault(require("./components/List"));
412
-
413
455
  var _Loader = _interopRequireDefault(require("./components/Loader"));
414
-
415
456
  var _MainTable = _interopRequireDefault(require("./components/MainTable"));
416
-
417
457
  var _ModularTable = _interopRequireDefault(require("./components/ModularTable"));
418
-
419
458
  var _Navigation = _interopRequireDefault(require("./components/Navigation"));
420
-
421
459
  var _Modal = _interopRequireDefault(require("./components/Modal"));
422
-
423
460
  var _Notification = _interopRequireWildcard(require("./components/Notification"));
424
-
461
+ var _NotificationProvider = require("./components/NotificationProvider");
425
462
  var _Pagination = _interopRequireDefault(require("./components/Pagination"));
426
-
427
463
  var _PasswordToggle = _interopRequireDefault(require("./components/PasswordToggle"));
428
-
429
464
  var _RadioInput = _interopRequireDefault(require("./components/RadioInput"));
430
-
431
465
  var _Row = _interopRequireDefault(require("./components/Row"));
432
-
433
466
  var _SearchAndFilter = _interopRequireDefault(require("./components/SearchAndFilter"));
434
-
435
467
  var _SearchBox = _interopRequireDefault(require("./components/SearchBox"));
436
-
437
468
  var _Select = _interopRequireDefault(require("./components/Select"));
438
-
439
469
  var _Slider = _interopRequireDefault(require("./components/Slider"));
440
-
441
470
  var _Switch = _interopRequireDefault(require("./components/Switch"));
442
-
443
471
  var _Spinner = _interopRequireDefault(require("./components/Spinner"));
444
-
445
472
  var _StatusLabel = _interopRequireWildcard(require("./components/StatusLabel"));
446
-
447
473
  var _Strip = _interopRequireDefault(require("./components/Strip"));
448
-
449
474
  var _SummaryButton = _interopRequireDefault(require("./components/SummaryButton"));
450
-
451
475
  var _Table = _interopRequireDefault(require("./components/Table"));
452
-
453
476
  var _TableCell = _interopRequireDefault(require("./components/TableCell"));
454
-
455
477
  var _TableHeader = _interopRequireDefault(require("./components/TableHeader"));
456
-
457
478
  var _TableRow = _interopRequireDefault(require("./components/TableRow"));
458
-
459
479
  var _Tabs = _interopRequireDefault(require("./components/Tabs"));
460
-
461
480
  var _Textarea = _interopRequireDefault(require("./components/Textarea"));
462
-
463
481
  var _Tooltip = _interopRequireDefault(require("./components/Tooltip"));
464
-
465
482
  var _hooks = require("./hooks");
466
-
467
483
  var _utils = require("./utils");
468
-
469
484
  var _enums = require("./enums");
470
-
471
485
  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); }
472
-
473
486
  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; }
474
-
475
487
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
package/dist/utils.js CHANGED
@@ -5,15 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.isNavigationButton = exports.isNavigationAnchor = exports.highlightSubString = exports.IS_DEV = void 0;
7
7
  var IS_DEV = process.env.NODE_ENV === "development";
8
+
8
9
  /**
9
10
  * Find substring and wrap in <strong /> tag
10
11
  * @param {string} str - The string to search
11
12
  * @param {string} subString - The substring to find
12
13
  * @return {Obj} newStr - Object with text and match bool
13
14
  */
14
-
15
15
  exports.IS_DEV = IS_DEV;
16
-
17
16
  var highlightSubString = function highlightSubString(str, subString) {
18
17
  if (typeof str !== "string" || typeof subString !== "string") {
19
18
  return {
@@ -21,7 +20,6 @@ var highlightSubString = function highlightSubString(str, subString) {
21
20
  match: false
22
21
  };
23
22
  }
24
-
25
23
  var caseInsensitiveRegex = new RegExp(subString, "gi");
26
24
  var newStr = str.replace(caseInsensitiveRegex, function (match) {
27
25
  return "<strong>".concat(match, "</strong>");
@@ -31,27 +29,22 @@ var highlightSubString = function highlightSubString(str, subString) {
31
29
  match: newStr !== str
32
30
  };
33
31
  };
32
+
34
33
  /**
35
34
  * Whether a navigation item is an anchor.
36
35
  * @param link - The navigation item.
37
36
  */
38
-
39
-
40
37
  exports.highlightSubString = highlightSubString;
41
-
42
38
  var isNavigationAnchor = function isNavigationAnchor(link) {
43
39
  return !!link.url;
44
40
  };
41
+
45
42
  /**
46
43
  * Whether a navigation item is a button.
47
44
  * @param link - The navigation item.
48
45
  */
49
-
50
-
51
46
  exports.isNavigationAnchor = isNavigationAnchor;
52
-
53
47
  var isNavigationButton = function isNavigationButton(link) {
54
48
  return !link.url;
55
49
  };
56
-
57
50
  exports.isNavigationButton = isNavigationButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-components",
3
- "version": "0.41.0",
3
+ "version": "0.43.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "Huw Wilkins <huw.wilkins@canonical.com>",
@@ -22,10 +22,10 @@
22
22
  },
23
23
  "homepage": "https://canonical.github.io/react-components",
24
24
  "devDependencies": {
25
- "@babel/cli": "7.21.5",
26
- "@babel/eslint-parser": "7.21.3",
27
- "@babel/preset-typescript": "7.21.5",
28
- "@percy/cli": "1.24.0",
25
+ "@babel/cli": "7.22.5",
26
+ "@babel/eslint-parser": "7.22.5",
27
+ "@babel/preset-typescript": "7.22.5",
28
+ "@percy/cli": "1.26.1",
29
29
  "@percy/storybook": "4.3.6",
30
30
  "@storybook/addon-a11y": "6.5.16",
31
31
  "@storybook/addon-controls": "6.5.16",
@@ -36,22 +36,22 @@
36
36
  "@storybook/react": "6.5.16",
37
37
  "@storybook/theming": "6.5.16",
38
38
  "@testing-library/cypress": "9.0.0",
39
- "@testing-library/dom": "9.2.0",
39
+ "@testing-library/dom": "9.3.1",
40
40
  "@testing-library/jest-dom": "5.16.5",
41
- "@testing-library/react": "12.1.5",
42
- "@testing-library/react-hooks": "8.0.1",
41
+ "@testing-library/react": "14.0.0",
43
42
  "@testing-library/user-event": "14.4.3",
44
- "@typescript-eslint/eslint-plugin": "5.59.1",
45
- "@typescript-eslint/parser": "5.59.1",
43
+ "@types/react-router-dom": "5.3.3",
44
+ "@typescript-eslint/eslint-plugin": "5.60.1",
45
+ "@typescript-eslint/parser": "5.60.1",
46
46
  "babel-jest": "27.5.1",
47
47
  "babel-loader": "9.1.2",
48
48
  "babel-plugin-module-resolver": "5.0.0",
49
49
  "babel-plugin-typescript-to-proptypes": "2.1.0",
50
- "concurrently": "7.6.0",
51
- "css-loader": "6.7.3",
52
- "cypress": "12.11.0",
50
+ "concurrently": "8.2.0",
51
+ "css-loader": "6.8.1",
52
+ "cypress": "12.16.0",
53
53
  "deepmerge": "4.3.1",
54
- "eslint": "8.39.0",
54
+ "eslint": "8.43.0",
55
55
  "eslint-config-prettier": "8.8.0",
56
56
  "eslint-config-react-app": "7.0.1",
57
57
  "eslint-plugin-cypress": "2.13.3",
@@ -61,17 +61,17 @@
61
61
  "eslint-plugin-prettier": "4.2.1",
62
62
  "eslint-plugin-react": "7.32.2",
63
63
  "eslint-plugin-react-hooks": "4.6.0",
64
- "eslint-plugin-testing-library": "5.10.3",
64
+ "eslint-plugin-testing-library": "5.11.0",
65
65
  "jest": "27.5.1",
66
66
  "npm-package-json-lint": "5.4.2",
67
67
  "prettier": "2.8.8",
68
- "react": "17.0.2",
68
+ "react": "18.2.0",
69
69
  "react-docgen-typescript-loader": "3.7.2",
70
- "react-dom": "17.0.2",
71
- "sass": "1.62.1",
70
+ "react-dom": "18.2.0",
71
+ "sass": "1.63.6",
72
72
  "sass-loader": "10.4.1",
73
- "style-loader": "3.3.2",
74
- "stylelint": "14.16.1",
73
+ "style-loader": "3.3.3",
74
+ "stylelint": "15.10.1",
75
75
  "stylelint-config-prettier": "9.0.5",
76
76
  "stylelint-config-recommended-scss": "5.0.2",
77
77
  "stylelint-order": "5.0.0",
@@ -79,31 +79,34 @@
79
79
  "ts-jest": "27.1.5",
80
80
  "tsc-alias": "1.8.6",
81
81
  "typescript": "4.9.5",
82
- "vanilla-framework": "3.14.0",
82
+ "vanilla-framework": "3.15.1",
83
83
  "wait-on": "5.3.0",
84
- "webpack": "5.81.0"
84
+ "webpack": "5.88.0"
85
85
  },
86
86
  "dependencies": {
87
87
  "@types/jest": "27.5.2",
88
- "@types/node": "18.16.3",
89
- "@types/react": "18.2.0",
90
- "@types/react-dom": "17.0.20",
88
+ "@types/node": "18.16.18",
89
+ "@types/react": "18.2.14",
90
+ "@types/react-dom": "18.2.6",
91
91
  "@types/react-table": "7.7.14",
92
92
  "classnames": "2.3.2",
93
93
  "nanoid": "3.3.6",
94
94
  "prop-types": "15.8.1",
95
+ "react-router-dom": "6.6.1",
95
96
  "react-table": "7.8.0",
96
97
  "react-useportal": "1.0.18"
97
98
  },
98
99
  "resolutions": {
99
- "@types/react": "18.2.0",
100
- "@types/react-dom": "17.0.20",
100
+ "@types/react": "18.2.14",
101
+ "@types/react-dom": "18.2.6",
101
102
  "postcss": "^8.3.11"
102
103
  },
103
104
  "peerDependencies": {
105
+ "@types/react": "^17.0.2 || ^18.0.0",
106
+ "@types/react-dom": "^17.0.2 || ^18.0.0",
104
107
  "react": "^17.0.2 || ^18.0.0",
105
108
  "react-dom": "^17.0.2 || ^18.0.0",
106
- "vanilla-framework": "3.14.0"
109
+ "vanilla-framework": "3.15.1"
107
110
  },
108
111
  "scripts": {
109
112
  "build": "rm -rf dist && yarn build-local; yarn build-declaration",