@rh-support/components 2.1.28 → 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 -55
  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 -51
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSelectKeyboardNavigator.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSelectKeyboardNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,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;4BA6BrD,mBAAmB,CAAC,gBAAgB,CAAC;;EAuBvE"}
@@ -1,51 +0,0 @@
1
- import { useState } from 'react';
2
- export function useSelectKeyboardNavigator({ list, isOpen, setIsOpen, onSelect }) {
3
- const [focusedItemIndex, setFocusedItemIndex] = useState(null);
4
- const handleMenuArrowKeys = (key) => {
5
- let indexToFocus;
6
- if (isOpen) {
7
- if (key === 'ArrowUp') {
8
- // When no index is set or at the first index, focus to the last, otherwise decrement focus index
9
- if (focusedItemIndex === null || focusedItemIndex === 0) {
10
- indexToFocus = list.length - 1;
11
- }
12
- else {
13
- indexToFocus = focusedItemIndex - 1;
14
- }
15
- }
16
- if (key === 'ArrowDown') {
17
- // When no index is set or at the last index, focus to the first, otherwise increment focus index
18
- if (focusedItemIndex === null || focusedItemIndex === list.length - 1) {
19
- indexToFocus = 0;
20
- }
21
- else {
22
- indexToFocus = focusedItemIndex + 1;
23
- }
24
- }
25
- setFocusedItemIndex(indexToFocus);
26
- }
27
- };
28
- const onInputKeyDown = (event) => {
29
- const focusedItem = focusedItemIndex ? list[focusedItemIndex] : list[0];
30
- switch (event.key) {
31
- // Select the first available option
32
- case 'Enter':
33
- if (!isOpen) {
34
- setIsOpen((pre) => !pre);
35
- }
36
- else if (isOpen) {
37
- onSelect(focusedItem);
38
- }
39
- break;
40
- case 'Escape':
41
- setIsOpen(false);
42
- break;
43
- case 'ArrowUp':
44
- case 'ArrowDown':
45
- event.preventDefault();
46
- handleMenuArrowKeys(event.key);
47
- break;
48
- }
49
- };
50
- return { onInputKeyDown, focusedItemIndex };
51
- }