@rh-support/components 2.1.29 → 2.4.10-beta.6

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 (92) hide show
  1. package/README.md +0 -2
  2. package/lib/cjs/CustomTextInput/CustomTextInput.d.ts +0 -2
  3. package/lib/cjs/CustomTextInput/CustomTextInput.d.ts.map +1 -1
  4. package/lib/cjs/CustomTextInput/CustomTextInput.js +2 -4
  5. package/lib/cjs/DropDownList/DropDownList.js +10 -10
  6. package/lib/cjs/DropDownList/DropdownWrapper.js +2 -2
  7. package/lib/cjs/DropDownList/SearchableList.js +5 -5
  8. package/lib/cjs/DropDownList/SelectList.js +4 -4
  9. package/lib/cjs/DropDownList/dropdownList.css +5 -10
  10. package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +1 -1
  11. package/lib/cjs/ErrorBoundary/ErrorBoundaryFallbackComponent.js +3 -2
  12. package/lib/cjs/InlineEdit/NewInlineEdit.js +1 -1
  13. package/lib/cjs/InlineEdit/newInlineEdit.css +3 -3
  14. package/lib/cjs/LoadingDots/LoadingDots.js +1 -1
  15. package/lib/cjs/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
  16. package/lib/cjs/MarkdownEditor/MarkdownEditor.js +10 -11
  17. package/lib/cjs/MarkdownEditor/markdownEditor.css +1 -3
  18. package/lib/cjs/PaginationCompact/PaginationCompact.js +4 -4
  19. package/lib/cjs/PaginationCompact/paginationCompact.css +1 -1
  20. package/lib/cjs/PhoneInput/PhoneInput.d.ts.map +1 -1
  21. package/lib/cjs/PhoneInput/PhoneInput.js +7 -10
  22. package/lib/cjs/PhoneInput/PhoneInput.scss +1 -1
  23. package/lib/cjs/SupportFeedbackForm/SupportFeedbackModal.js +12 -12
  24. package/lib/cjs/Table/PFTable.d.ts +1 -2
  25. package/lib/cjs/Table/PFTable.d.ts.map +1 -1
  26. package/lib/cjs/Table/PFTable.js +7 -7
  27. package/lib/cjs/Table/TablePagination.d.ts.map +1 -1
  28. package/lib/cjs/Table/TablePagination.js +1 -3
  29. package/lib/cjs/Table/columnSelector.css +1 -1
  30. package/lib/cjs/TermsAndConditions/AcceptTermsModal.d.ts.map +1 -1
  31. package/lib/cjs/TermsAndConditions/AcceptTermsModal.js +5 -6
  32. package/lib/cjs/TextAreaResizable/TextAreaResizable.d.ts.map +1 -1
  33. package/lib/cjs/TextAreaResizable/TextAreaResizable.js +1 -1
  34. package/lib/cjs/ToastNotification/toastNotification.css +1 -1
  35. package/lib/cjs/TopContentSearch/TopContentSearch.d.ts.map +1 -1
  36. package/lib/cjs/TopContentSearch/TopContentSearch.js +5 -6
  37. package/lib/cjs/helperFunctions/errorMessage.js +2 -2
  38. package/lib/cjs/helperFunctions/errorMessage.scss +1 -1
  39. package/lib/cjs/hooks/index.d.ts +0 -1
  40. package/lib/cjs/hooks/index.d.ts.map +1 -1
  41. package/lib/cjs/hooks/index.js +0 -1
  42. package/lib/cjs/hooks/useBreakpoint.d.ts.map +1 -1
  43. package/lib/cjs/hooks/useBreakpoint.js +0 -1
  44. package/lib/esm/CustomTextInput/CustomTextInput.d.ts +0 -2
  45. package/lib/esm/CustomTextInput/CustomTextInput.d.ts.map +1 -1
  46. package/lib/esm/CustomTextInput/CustomTextInput.js +2 -4
  47. package/lib/esm/DropDownList/DropDownList.js +10 -10
  48. package/lib/esm/DropDownList/DropdownWrapper.js +2 -2
  49. package/lib/esm/DropDownList/SearchableList.js +5 -5
  50. package/lib/esm/DropDownList/SelectList.js +4 -4
  51. package/lib/esm/DropDownList/dropdownList.css +5 -10
  52. package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +1 -1
  53. package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.js +4 -3
  54. package/lib/esm/InlineEdit/NewInlineEdit.js +1 -1
  55. package/lib/esm/InlineEdit/newInlineEdit.css +3 -3
  56. package/lib/esm/LoadingDots/LoadingDots.js +1 -1
  57. package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
  58. package/lib/esm/MarkdownEditor/MarkdownEditor.js +8 -9
  59. package/lib/esm/MarkdownEditor/markdownEditor.css +1 -3
  60. package/lib/esm/PaginationCompact/PaginationCompact.js +4 -4
  61. package/lib/esm/PaginationCompact/paginationCompact.css +1 -1
  62. package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
  63. package/lib/esm/PhoneInput/PhoneInput.js +7 -10
  64. package/lib/esm/PhoneInput/PhoneInput.scss +1 -1
  65. package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.js +13 -13
  66. package/lib/esm/Table/PFTable.d.ts +1 -2
  67. package/lib/esm/Table/PFTable.d.ts.map +1 -1
  68. package/lib/esm/Table/PFTable.js +6 -6
  69. package/lib/esm/Table/TablePagination.d.ts.map +1 -1
  70. package/lib/esm/Table/TablePagination.js +2 -4
  71. package/lib/esm/Table/columnSelector.css +1 -1
  72. package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts.map +1 -1
  73. package/lib/esm/TermsAndConditions/AcceptTermsModal.js +6 -7
  74. package/lib/esm/TextAreaResizable/TextAreaResizable.d.ts.map +1 -1
  75. package/lib/esm/TextAreaResizable/TextAreaResizable.js +1 -1
  76. package/lib/esm/ToastNotification/toastNotification.css +1 -1
  77. package/lib/esm/TopContentSearch/TopContentSearch.d.ts.map +1 -1
  78. package/lib/esm/TopContentSearch/TopContentSearch.js +5 -6
  79. package/lib/esm/helperFunctions/errorMessage.js +2 -2
  80. package/lib/esm/helperFunctions/errorMessage.scss +1 -1
  81. package/lib/esm/hooks/index.d.ts +0 -1
  82. package/lib/esm/hooks/index.d.ts.map +1 -1
  83. package/lib/esm/hooks/index.js +0 -1
  84. package/lib/esm/hooks/useBreakpoint.d.ts.map +1 -1
  85. package/lib/esm/hooks/useBreakpoint.js +0 -1
  86. package/package.json +14 -12
  87. package/lib/cjs/hooks/useSelectKeyboardNavigator.d.ts +0 -13
  88. package/lib/cjs/hooks/useSelectKeyboardNavigator.d.ts.map +0 -1
  89. package/lib/cjs/hooks/useSelectKeyboardNavigator.js +0 -58
  90. package/lib/esm/hooks/useSelectKeyboardNavigator.d.ts +0 -13
  91. package/lib/esm/hooks/useSelectKeyboardNavigator.d.ts.map +0 -1
  92. package/lib/esm/hooks/useSelectKeyboardNavigator.js +0 -54
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSelectKeyboardNavigator.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSelectKeyboardNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,UAAU,MAAM;IACZ,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,0BAA0B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,MAAM;4BAiCrD,mBAAmB,CAAC,gBAAgB,CAAC;;EAuBvE"}
@@ -1,54 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- export function useSelectKeyboardNavigator({ list, isOpen, setIsOpen, onSelect }) {
3
- const [focusedItemIndex, setFocusedItemIndex] = useState(null);
4
- useEffect(() => {
5
- setFocusedItemIndex(null);
6
- }, [list.length]);
7
- const handleMenuArrowKeys = (key) => {
8
- let indexToFocus;
9
- if (isOpen) {
10
- if (key === 'ArrowUp') {
11
- // When no index is set or at the first index, focus to the last, otherwise decrement focus index
12
- if (focusedItemIndex === null || focusedItemIndex === 0) {
13
- indexToFocus = list.length - 1;
14
- }
15
- else {
16
- indexToFocus = focusedItemIndex - 1;
17
- }
18
- }
19
- if (key === 'ArrowDown') {
20
- // When no index is set or at the last index, focus to the first, otherwise increment focus index
21
- if (focusedItemIndex === null || focusedItemIndex === list.length - 1) {
22
- indexToFocus = 0;
23
- }
24
- else {
25
- indexToFocus = focusedItemIndex + 1;
26
- }
27
- }
28
- setFocusedItemIndex(indexToFocus);
29
- }
30
- };
31
- const onInputKeyDown = (event) => {
32
- const focusedItem = focusedItemIndex !== null ? list[focusedItemIndex] : null;
33
- switch (event.key) {
34
- // Select the first available option
35
- case 'Enter':
36
- if (!isOpen) {
37
- setIsOpen((pre) => !pre);
38
- }
39
- else if (isOpen && focusedItem !== null) {
40
- onSelect(focusedItem);
41
- }
42
- break;
43
- case 'Escape':
44
- setIsOpen(false);
45
- break;
46
- case 'ArrowUp':
47
- case 'ArrowDown':
48
- event.preventDefault();
49
- handleMenuArrowKeys(event.key);
50
- break;
51
- }
52
- };
53
- return { onInputKeyDown, focusedItemIndex };
54
- }