@rh-support/components 2.5.25 → 2.5.27

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 (44) hide show
  1. package/lib/esm/ConfirmationModal/ConfirmationDialog.d.ts.map +1 -1
  2. package/lib/esm/ConfirmationModal/ConfirmationDialog.js +5 -5
  3. package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.d.ts.map +1 -1
  4. package/lib/esm/ErrorBoundary/ErrorBoundaryFallbackComponent.js +2 -16
  5. package/lib/esm/FeedbackForm/FeedbackForm.js +8 -8
  6. package/lib/esm/InlineEdit/NewInlineEdit.js +1 -1
  7. package/lib/esm/InlineEdit/inlineEdit.css +0 -1
  8. package/lib/esm/InlineEdit/newInlineEdit.css +26 -3
  9. package/lib/esm/LanguageSelector/LanguageSelector.d.ts.map +1 -1
  10. package/lib/esm/LanguageSelector/languageSelector.css +1 -1
  11. package/lib/esm/LoadingDots/LoadingDots.js +1 -1
  12. package/lib/esm/LoginModal/LoginModal.d.ts.map +1 -1
  13. package/lib/esm/LoginModal/LoginModal.js +7 -5
  14. package/lib/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
  15. package/lib/esm/MarkdownEditor/MarkdownEditor.js +53 -57
  16. package/lib/esm/MarkdownEditor/markdownEditor.css +5 -5
  17. package/lib/esm/PaginationCompact/PaginationCompact.d.ts.map +1 -1
  18. package/lib/esm/PaginationCompact/PaginationCompact.js +6 -8
  19. package/lib/esm/PaginationCompact/paginationCompact.css +1 -1
  20. package/lib/esm/PhoneInput/PhoneInput.d.ts.map +1 -1
  21. package/lib/esm/PhoneInput/PhoneInput.js +50 -32
  22. package/lib/esm/PhoneInput/PhoneInput.scss +1 -1
  23. package/lib/esm/SingleSelectDropdown/SingleSelectDropdown.d.ts +6 -2
  24. package/lib/esm/SingleSelectDropdown/SingleSelectDropdown.d.ts.map +1 -1
  25. package/lib/esm/SingleSelectDropdown/SingleSelectDropdown.js +33 -14
  26. package/lib/esm/SubscriptionAbuse/SubscriptionAbuseModal.js +6 -6
  27. package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.d.ts.map +1 -1
  28. package/lib/esm/SupportFeedbackForm/SupportFeedbackModal.js +13 -15
  29. package/lib/esm/Table/PFTable.d.ts +15 -9
  30. package/lib/esm/Table/PFTable.d.ts.map +1 -1
  31. package/lib/esm/Table/PFTable.js +131 -120
  32. package/lib/esm/TagsSelector/TagsSelector.d.ts.map +1 -1
  33. package/lib/esm/TagsSelector/TagsSelector.js +6 -8
  34. package/lib/esm/TagsSelector/tagSelector.css +2 -2
  35. package/lib/esm/TermsAndConditions/AcceptTermsModal.d.ts.map +1 -1
  36. package/lib/esm/TermsAndConditions/AcceptTermsModal.js +30 -24
  37. package/lib/esm/ToastNotification/toastNotification.css +1 -1
  38. package/lib/esm/TopContentSearch/TopContentSearch.js +1 -1
  39. package/lib/esm/TypeaheadDropdown/TypeaheadDropdown.d.ts.map +1 -1
  40. package/lib/esm/TypeaheadDropdown/TypeaheadDropdown.js +2 -3
  41. package/lib/esm/ValueChangedIcon/ValueChangedIcon.js +1 -1
  42. package/lib/esm/helperFunctions/errorMessage.js +2 -2
  43. package/lib/esm/helperFunctions/errorMessage.scss +1 -1
  44. package/package.json +12 -12
@@ -1,10 +1,9 @@
1
1
  import './PhoneInput.scss';
2
- import { InputGroup, InputGroupItem, Spinner, TextInput } from '@patternfly/react-core';
3
- import { Select, SelectOption, SelectVariant } from '@patternfly/react-core/deprecated';
2
+ import { Divider, InputGroup, InputGroupItem, Menu, MenuContainer, MenuContent, MenuList, MenuSearch, MenuSearchInput, MenuToggle, SearchInput, Spinner, TextInput, } from '@patternfly/react-core';
4
3
  import isEmpty from 'lodash/isEmpty';
5
4
  import isEqual from 'lodash/isEqual';
6
5
  import isUndefined from 'lodash/isUndefined';
7
- import React, { useEffect, useState } from 'react';
6
+ import React, { useEffect, useRef, useState } from 'react';
8
7
  import { useTranslation } from 'react-i18next';
9
8
  import { COUNTRY_DATA } from './CountryData';
10
9
  import { FlagSvgs } from './FlagSvgs';
@@ -134,6 +133,10 @@ export function PhoneInput(props) {
134
133
  const [isOpen, setIsOpen] = useState(false);
135
134
  const [iso2, setIso2] = useState('');
136
135
  const [formattedNumber, setFormattedNumber] = useState('');
136
+ const [searchInput, setSearchInput] = useState('');
137
+ const [activeItem, setActiveItem] = useState(null);
138
+ const toggleRef = useRef(null);
139
+ const menuRef = useRef(null);
137
140
  const setLocalFormat = (phoneNumber) => {
138
141
  const localPhone = removeAllChars(phoneNumber);
139
142
  if (shouldNotSetCountryCode) {
@@ -173,41 +176,46 @@ export function PhoneInput(props) {
173
176
  onPhoneValueChange(phone === null || phone === void 0 ? void 0 : phone.slice(0, localFormat === null || localFormat === void 0 ? void 0 : localFormat.length));
174
177
  }
175
178
  };
176
- const onToggle = (isOpen) => {
177
- setIsOpen(isOpen);
178
- };
179
- const onCountrySelect = (event, selection) => {
179
+ const onCountrySelect = (_event, itemId) => {
180
180
  var _a, _b;
181
- const prevCountryCode = !shouldNotSetCountryCode // fetching previous country code to remove it from the phone
182
- ? trimAndReplacePlusFromPhone((_a = getPhoneObj(phoneValue)) === null || _a === void 0 ? void 0 : _a.countryCode)
183
- : '';
184
- const phoneWithoutCountryCode = (_b = removeAllChars(phoneValue)) === null || _b === void 0 ? void 0 : _b.replace(prevCountryCode, '');
185
- const formattedPhone = `${PREFIX}${selection.countryCode}${phoneWithoutCountryCode}`;
186
- const localFormattedPhone = setLocalFormat(formattedPhone);
187
- onPhoneValueChange(formatNumber(formattedPhone, localFormattedPhone));
188
- setIsOpen(!isOpen);
181
+ setSearchInput('');
182
+ if (typeof itemId === 'number') {
183
+ const filteredCountries = initializedCountries.filter((country) => !searchInput ||
184
+ `${country.name} (+${country.dialCode})`.toLowerCase().includes(searchInput.toLowerCase()));
185
+ const selection = filteredCountries[itemId];
186
+ if (selection) {
187
+ const prevCountryCode = !shouldNotSetCountryCode // fetching previous country code to remove it from the phone
188
+ ? trimAndReplacePlusFromPhone((_a = getPhoneObj(phoneValue)) === null || _a === void 0 ? void 0 : _a.countryCode)
189
+ : '';
190
+ const phoneWithoutCountryCode = (_b = removeAllChars(phoneValue)) === null || _b === void 0 ? void 0 : _b.replace(prevCountryCode, '');
191
+ const formattedPhone = `${PREFIX}${selection.countryCode}${phoneWithoutCountryCode}`;
192
+ const localFormattedPhone = setLocalFormat(formattedPhone);
193
+ onPhoneValueChange(formatNumber(formattedPhone, localFormattedPhone));
194
+ setIsOpen(false);
195
+ setActiveItem(itemId);
196
+ }
197
+ }
198
+ };
199
+ const handleSearchInputChange = (_event, value) => {
200
+ setSearchInput(value);
189
201
  };
190
- const getOptions = (options) => {
191
- return options.map((country) => (React.createElement(SelectOption, { key: country.iso2, value: country },
192
- React.createElement("div", { className: "pf-v5-u-display-inline-flex" },
202
+ const filteredCountries = initializedCountries.filter((country) => !searchInput || `${country.name} (+${country.dialCode})`.toLowerCase().includes(searchInput.toLowerCase()));
203
+ const menuItems = filteredCountries.map((country, index) => (React.createElement("div", { role: "menuitem", tabIndex: -1, className: "pf-v6-c-menu__item", onClick: (event) => onCountrySelect(event, index) },
204
+ React.createElement("div", { className: "pf-v6-c-menu__item-main" },
205
+ React.createElement("div", { className: "pf-v6-c-menu__item-text pf-v6-u-display-inline-flex" },
193
206
  React.createElement("svg", { className: "flag-class-select" },
194
207
  React.createElement("use", { xlinkHref: `#cc_${country.iso2}` })),
195
208
  country.name,
196
209
  " (+",
197
210
  country.dialCode,
198
- ")"))));
199
- };
200
- const onFilter = (_, value) => {
201
- if (!value)
202
- return getOptions(initializedCountries);
203
- const newOptions = initializedCountries.filter((country) => {
204
- const countryStr = `${country.name.toString()} (+${country.countryCode.toString()})`.toLowerCase();
205
- return countryStr.includes(value.toLowerCase());
206
- });
207
- return getOptions(newOptions);
208
- };
211
+ ")")))));
212
+ if (searchInput && menuItems.length === 0) {
213
+ menuItems.push(React.createElement("div", { key: "no-results", role: "menuitem", className: "pf-v6-c-menu__item pf-m-disabled", "aria-disabled": "true" },
214
+ React.createElement("div", { className: "pf-v6-c-menu__item-main" },
215
+ React.createElement("div", { className: "pf-v6-c-menu__item-text" }, t('No results found')))));
216
+ }
209
217
  const placeholder = (React.createElement("div", { className: "phone-number-select-placeholder" },
210
- React.createElement("div", { className: "pf-v5-u-display-inline-flex" },
218
+ React.createElement("div", { className: "pf-v6-u-display-inline-flex" },
211
219
  React.createElement("svg", { className: "flag-class-selected" },
212
220
  React.createElement("use", { xlinkHref: `#cc_${iso2}` })),
213
221
  iso2.toUpperCase())));
@@ -249,12 +257,22 @@ export function PhoneInput(props) {
249
257
  setFormattedNumber(_formattedNumber);
250
258
  // eslint-disable-next-line react-hooks/exhaustive-deps
251
259
  }, [shouldNotSetCountryCode]);
260
+ const toggle = (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen(!isOpen), isExpanded: isOpen, className: "phone-number-select", "data-tracking-id": "case-phone-number-country-code", isDisabled: props.isDisabled, "aria-label": "Country Code" }, iso2 && phoneValue !== '' ? placeholder : t('Country Code')));
261
+ const menu = (React.createElement(Menu, { ref: menuRef, onSelect: onCountrySelect, activeItemId: activeItem, isScrollable: true },
262
+ React.createElement(MenuSearch, null,
263
+ React.createElement(MenuSearchInput, null,
264
+ React.createElement(SearchInput, { value: searchInput, "aria-label": t('Search'), placeholder: t('Search'), onChange: handleSearchInputChange }))),
265
+ React.createElement(Divider, null),
266
+ React.createElement(MenuContent, { maxMenuHeight: "200px" },
267
+ React.createElement(MenuList, null, menuItems))));
252
268
  return (React.createElement(InputGroup, { className: "phone-number-input" },
253
269
  React.createElement(FlagSvgs, null),
254
270
  React.createElement(InputGroupItem, null,
255
271
  React.createElement("div", null,
256
- React.createElement(Select, { variant: SelectVariant.single, "data-tracking-id": "case-phone-number-country-code", className: "phone-number-select", onToggle: (_event, isOpen) => onToggle(isOpen), onSelect: onCountrySelect, isOpen: isOpen, placeholderText: iso2 && phoneValue !== '' ? placeholder : 'Country Code', onFilter: onFilter, hasInlineFilter: true, inlineFilterPlaceholderText: t('Search'), isDisabled: props.isDisabled, toggleAriaLabel: "Country Code" }, getOptions(initializedCountries)))),
272
+ React.createElement(MenuContainer, { menu: menu, menuRef: menuRef, toggle: toggle, toggleRef: toggleRef, isOpen: isOpen, onOpenChange: (open) => {
273
+ setIsOpen(open);
274
+ }, onOpenChangeKeys: ['Escape'] }))),
257
275
  React.createElement(InputGroupItem, { style: { width: '100%' } },
258
276
  React.createElement(TextInput, { id: "case-phone-number", "data-tracking-id": "case-phone-number", placeholder: "55-555-5555", value: formattedNumber ? formattedNumber : phoneValue, onChange: (_event, phone) => onPhoneChange(phone), validated: validations, isDisabled: props.isDisabled, "aria-label": "Case owner's phone number" })),
259
- props.isLoading && React.createElement(Spinner, { size: "lg", className: "pf-v5-u-ml-2xl pf-v5-u-mr-xl phone-spinner" })));
277
+ props.isLoading && React.createElement(Spinner, { size: "lg", className: "pf-v6-u-ml-2xl pf-v6-u-mr-xl phone-spinner" })));
260
278
  }
@@ -4,7 +4,7 @@
4
4
  }
5
5
 
6
6
  .phone-number-select {
7
- .pf-v5-c-select__menu {
7
+ .pf-v6-c-select__menu {
8
8
  min-width: 370px !important;
9
9
  }
10
10
  }
@@ -15,17 +15,21 @@ export interface SingleSelectDropdownProps {
15
15
  id?: string;
16
16
  ariaLabel?: string;
17
17
  placeholder?: string | JSX.Element;
18
+ badge?: ReactNode;
18
19
  isInvalid?: boolean;
19
20
  className?: string;
21
+ ariaLabelledBy?: string;
20
22
  toggleClassName?: string;
21
23
  dataTrackingId?: string;
22
24
  toggleDataTrackingId?: string;
23
25
  customToggleContent?: React.JSX.Element;
24
- onSelect?: (option: ISingleSelectDropdownOption) => void;
25
- onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
26
26
  isScrollable?: boolean;
27
27
  zIndex?: number;
28
28
  isModalOpen?: boolean;
29
+ hideToggleIcons?: boolean;
30
+ onClear?: () => void;
31
+ onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
32
+ onSelect?: (options: any) => void;
29
33
  }
30
34
  export declare function SingleSelectDropdown(props: SingleSelectDropdownProps): React.JSX.Element;
31
35
  //# sourceMappingURL=SingleSelectDropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SingleSelectDropdown.d.ts","sourceRoot":"","sources":["../../../src/SingleSelectDropdown/SingleSelectDropdown.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAC;AAEnE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACzD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAkGpE"}
1
+ {"version":3,"file":"SingleSelectDropdown.d.ts","sourceRoot":"","sources":["../../../src/SingleSelectDropdown/SingleSelectDropdown.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAC;AAInE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,OAAO,EAAE,2BAA2B,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,QAAQ,CAAC,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,CAAC;CAChC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAmIpE"}
@@ -1,35 +1,54 @@
1
1
  import { Flex, FlexItem, MenuToggle, Select, SelectList, SelectOption, Spinner, } from '@patternfly/react-core';
2
+ import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
2
3
  import isEqual from 'lodash/isEqual';
3
4
  import React, { useEffect, useState } from 'react';
5
+ import { useSelectKeyboardNavigator } from '../hooks/useSelectKeyboardNavigator';
4
6
  export function SingleSelectDropdown(props) {
5
- const { selected, options, isDisabled, isLoading, id, placeholder, isInvalid, className, toggleClassName, dataTrackingId, toggleDataTrackingId, onSelect, isScrollable, onBlur, ariaLabel, zIndex, isModalOpen, } = props;
7
+ const { badge, selected, options, isDisabled, isLoading, id, placeholder, isInvalid, className, toggleClassName, dataTrackingId, toggleDataTrackingId, isScrollable, ariaLabel, zIndex, ariaLabelledBy, isModalOpen, hideToggleIcons, onClear, onBlur, onSelect, } = props;
6
8
  const [isOpen, setIsOpen] = useState(false);
7
9
  const onToggleClick = () => {
8
10
  setIsOpen(!isOpen);
9
11
  };
12
+ const handleSelect = (selectedOption) => {
13
+ onSelect && onSelect(selectedOption);
14
+ setIsOpen(false);
15
+ };
16
+ const { focusedItemIndex, onInputKeyDown } = useSelectKeyboardNavigator({
17
+ list: options,
18
+ isOpen,
19
+ resetIndexOnClose: true,
20
+ isDisabled,
21
+ setIsOpen,
22
+ onSelect: handleSelect,
23
+ });
10
24
  useEffect(() => {
11
25
  if (isModalOpen) {
12
26
  setIsOpen(false);
13
27
  }
14
28
  // eslint-disable-next-line react-hooks/exhaustive-deps
15
29
  }, [isOpen]);
16
- const toggle = (toggleRef) => (React.createElement(MenuToggle, { className: toggleClassName || 'single-select-toggle-text', ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isDisabled: isDisabled, isFullWidth: true, status: isInvalid ? 'danger' : undefined, "data-tracking-id": toggleDataTrackingId || '' },
17
- React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
18
- React.createElement(FlexItem, null,
19
- " ",
20
- selected.label || placeholder),
30
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, { className: toggleClassName || 'single-select-toggle-text', ref: toggleRef, onClick: onToggleClick, onKeyDown: onInputKeyDown, isExpanded: isOpen, isDisabled: isDisabled, isFullWidth: true, status: isInvalid ? 'danger' : undefined, "data-tracking-id": toggleDataTrackingId || '', badge: badge },
31
+ hideToggleIcons && ((selected === null || selected === void 0 ? void 0 : selected.label) || placeholder),
32
+ !hideToggleIcons && (React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
33
+ React.createElement(FlexItem, null, (selected === null || selected === void 0 ? void 0 : selected.label) || placeholder),
21
34
  isLoading && (React.createElement(FlexItem, null,
22
- React.createElement(Spinner, { size: "md" }))))));
35
+ React.createElement(Spinner, { size: "md" }))),
36
+ selected.label && onClear && (React.createElement(FlexItem, { onClick: onClear, style: { opacity: 0.6 } },
37
+ React.createElement(TimesCircleIcon, { "aria-hidden": true })))))));
38
+ // This is the key fix - properly handle the selection from PatternFly
23
39
  const onLocalSelect = (event, value) => {
24
- onSelect && onSelect(value);
25
- setIsOpen(false);
40
+ // Ensure we're getting the correct value structure
41
+ const selectedOption = value;
42
+ handleSelect(selectedOption);
26
43
  };
27
- const onLocalBlur = (event, value) => {
28
- !!onBlur && onBlur(value);
44
+ const onLocalBlur = (event) => {
45
+ !!onBlur && onBlur(event);
29
46
  };
30
- return (React.createElement(Select, { id: id || '', className: className || '', "data-tracking-id": dataTrackingId, isOpen: isOpen, selected: selected, onSelect: onLocalSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, shouldFocusToggleOnSelect: true, popperProps: { direction: 'down', enableFlip: false }, isScrollable: isScrollable, shouldFocusFirstItemOnOpen: false, onBlur: () => onLocalBlur, "aria-label": ariaLabel, zIndex: zIndex },
31
- React.createElement(SelectList, null, options.map((option) => {
47
+ return (React.createElement(Select, { id: id || '', className: className || '', "data-tracking-id": dataTrackingId, isOpen: isOpen, selected: selected, onSelect: onLocalSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, shouldFocusToggleOnSelect: true, popperProps: { direction: 'down', enableFlip: false }, isScrollable: isScrollable, shouldFocusFirstItemOnOpen: false, onBlur: onLocalBlur, "aria-label": ariaLabel, zIndex: zIndex, "aria-labelledby": ariaLabelledBy },
48
+ React.createElement(SelectList, null, options.map((option, index) => {
32
49
  var _a;
33
- return (React.createElement(SelectOption, { key: option.value, value: option, description: option.description || '', isSelected: isEqual(selected.label, option.label), isDisabled: option.disabled, title: (option === null || option === void 0 ? void 0 : option.title) || option.label }, (_a = option === null || option === void 0 ? void 0 : option.element) !== null && _a !== void 0 ? _a : option.label));
50
+ return (React.createElement(SelectOption, { key: option.value, value: option, description: option.description || '',
51
+ // Fix the comparison to compare the entire objects or at least their values
52
+ isSelected: isEqual(selected === null || selected === void 0 ? void 0 : selected.value, option.value), isDisabled: option.disabled, isFocused: focusedItemIndex === index, title: (option === null || option === void 0 ? void 0 : option.title) || option.label }, (_a = option === null || option === void 0 ? void 0 : option.element) !== null && _a !== void 0 ? _a : option.label));
34
53
  }))));
35
54
  }
@@ -1,13 +1,13 @@
1
- import { Button, ButtonVariant, Modal, ModalVariant } from '@patternfly/react-core';
1
+ import { Button, ButtonVariant, Modal, ModalFooter, ModalVariant } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { Trans, useTranslation } from 'react-i18next';
4
4
  import { SubscriptionAbuseModalText, SubscriptionAbuseModalTitle } from './const';
5
5
  export function SubscriptionAbuseModal(props) {
6
6
  const { t } = useTranslation();
7
- return (React.createElement(Modal, { id: "subscription-abuse-confirmation", title: t(SubscriptionAbuseModalTitle), isOpen: props.isOpen, variant: ModalVariant.small, onClose: props.onConfirm, actions: [
8
- React.createElement(Button, { key: "confirm", variant: ButtonVariant.primary, onClick: props.onConfirm, "data-tracking-id": "subscription-abuse-close-cases-confirm" },
9
- React.createElement(Trans, null, "I understand")),
10
- ] },
7
+ return (React.createElement(Modal, { id: "subscription-abuse-confirmation", title: t(SubscriptionAbuseModalTitle), isOpen: props.isOpen, variant: ModalVariant.small, onClose: props.onConfirm },
11
8
  React.createElement("p", null,
12
- React.createElement(Trans, null, SubscriptionAbuseModalText))));
9
+ React.createElement(Trans, null, SubscriptionAbuseModalText)),
10
+ React.createElement(ModalFooter, null,
11
+ React.createElement(Button, { key: "confirm", variant: ButtonVariant.primary, onClick: props.onConfirm, "data-tracking-id": "subscription-abuse-close-cases-confirm" },
12
+ React.createElement(Trans, null, "I understand")))));
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SupportFeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/SupportFeedbackForm/SupportFeedbackModal.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAanD,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAMD,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBA0Q1C;kBA1QQ,oBAAoB;;;AA6Q7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"SupportFeedbackModal.d.ts","sourceRoot":"","sources":["../../../src/SupportFeedbackForm/SupportFeedbackModal.tsx"],"names":[],"mappings":"AAUA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAanD,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAMD,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,qBAsQ1C;kBAtQQ,oBAAoB;;;AAyQ7B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
- import { Button, Icon, Modal, ModalVariant } from '@patternfly/react-core';
11
+ import { Button, Icon, Modal, ModalFooter, ModalVariant } from '@patternfly/react-core';
12
12
  import OutlinedFrownIcon from '@patternfly/react-icons/dist/js/icons/outlined-frown-icon';
13
13
  import OutlinedFrownOpenIcon from '@patternfly/react-icons/dist/js/icons/outlined-frown-open-icon';
14
14
  import OutlinedGrinIcon from '@patternfly/react-icons/dist/js/icons/outlined-grin-icon';
@@ -138,14 +138,14 @@ function SupportFeedbackModal(props) {
138
138
  function renderModalBody() {
139
139
  return (React.createElement(React.Fragment, null,
140
140
  React.createElement("form", { className: "support-feedback-form", action: "", onSubmit: handleSubmit },
141
- React.createElement("fieldset", { className: "form-group radios feedback-satisfaction pf-v5-u-mb-sm", role: "radiogroup", "aria-labelledby": "feedback-satisfaction-label" },
142
- React.createElement("legend", { id: "feedback-satisfaction-label", className: "pf-v5-u-mb-md" },
141
+ React.createElement("fieldset", { className: "form-group radios feedback-satisfaction pf-v6-u-mb-sm", role: "radiogroup", "aria-labelledby": "feedback-satisfaction-label" },
142
+ React.createElement("legend", { id: "feedback-satisfaction-label", className: "pf-v6-u-mb-md" },
143
143
  props.isCaseSummary ? (React.createElement(Trans, null, "How satisfied are you with generated AI case summary ?")) : (React.createElement(Trans, null, "How satisfied are you with customer support\u2019s web experience?")),
144
144
  React.createElement("span", { className: "form-required", "aria-hidden": "true" }, "*"),
145
145
  ' '),
146
146
  React.createElement("div", { className: "satisfaction-values-wrapper" }, sentiments.map((sentiment) => {
147
- return (React.createElement("label", { className: `${sentiment.id} sentiment-label pf-v5-u-ml-md pf-v5-u-mr-md ${values.levelOfSatisfied === sentiment.label ? 'sentiment-selected' : ''}`, htmlFor: sentiment.id, key: sentiment.id },
148
- React.createElement("input", { type: "radio", id: sentiment.id, "aria-label": t(sentiment.label), disabled: isFetching, name: "levelOfSatisfied", value: sentiment.label, checked: values.levelOfSatisfied === sentiment.label, "aria-checked": values.levelOfSatisfied === sentiment.label, required: true, className: "feedback_button_values pf-v5-u-mb-sm pf-screen-reader", onChange: handleSentimentChange }),
147
+ return (React.createElement("label", { className: `${sentiment.id} sentiment-label pf-v6-u-ml-md pf-v6-u-mr-md ${values.levelOfSatisfied === sentiment.label ? 'sentiment-selected' : ''}`, htmlFor: sentiment.id, key: sentiment.id },
148
+ React.createElement("input", { type: "radio", id: sentiment.id, "aria-label": t(sentiment.label), disabled: isFetching, name: "levelOfSatisfied", value: sentiment.label, checked: values.levelOfSatisfied === sentiment.label, "aria-checked": values.levelOfSatisfied === sentiment.label, required: true, className: "feedback_button_values pf-v6-u-mb-sm pf-screen-reader", onChange: handleSentimentChange }),
149
149
  ' ',
150
150
  React.createElement(Icon, { size: "lg" }, sentiment.icon),
151
151
  React.createElement(Trans, null, sentiment.label)));
@@ -153,7 +153,7 @@ function SupportFeedbackModal(props) {
153
153
  isSubmitDisabled && (React.createElement("div", null,
154
154
  React.createElement("p", { className: "form-instructions form-invalid" },
155
155
  React.createElement(Trans, null, "Please select a value"))))),
156
- React.createElement("div", { className: "form-group pf-v5-u-mb-md" },
156
+ React.createElement("div", { className: "form-group pf-v6-u-mb-md" },
157
157
  React.createElement("label", { htmlFor: "moreFeedback" },
158
158
  React.createElement(Trans, null, "How can we improve?")),
159
159
  React.createElement(TextAreaAutosize, { name: "moreInfo", id: "moreFeedback", placeholder: t('i18nDescribeSuggestionDetail', 'Describe your suggestion in detail'), disabled: isFetching, value: values.moreInfo, className: "form-control", onChange: handleFeedbackTextChange, rowsMin: 3 })),
@@ -163,16 +163,14 @@ function SupportFeedbackModal(props) {
163
163
  React.createElement("a", { href: "https://www.redhat.com/en/about/privacy-policy", target: "_blank", rel: "noopener noreferrer" },
164
164
  React.createElement("u", null, "Red Hat Privacy Statement.")))) : (React.createElement(Trans, null, "Feedback is sent to the web team working on this application, not the support associate working on your case."))))));
165
165
  }
166
- function returnModalAction() {
167
- return [
168
- React.createElement(Button, { key: "confirm", onClick: handleSubmit, variant: "primary", isDisabled: isSubmitDisabled || isFetching, className: "pf-v5-u-ml-xs", spinnerAriaValueText: isFetching ? 'Loading' : undefined, isLoading: isFetching, "data-tracking-id": "app-feedback-submit", "aria-label": t('Send feedback') },
169
- React.createElement(Trans, null, isFetching ? 'Sending feedback' : 'Send feedback')),
170
- React.createElement("button", { key: "cancel", onClick: handleModalToggle, className: "btn btn-app btn-link", "data-tracking-id": "app-feedback-cancel", "aria-label": "Cancel", disabled: isFetching, type: "button" },
171
- React.createElement(Trans, null, "Cancel")),
172
- ];
173
- }
174
166
  return (React.createElement(React.Fragment, null,
175
- React.createElement(Modal, { id: "feedback-modal", title: t('i18nSendUsFeedback', 'Send us your feedback\n'), description: t('i18nFeedbackFormFoundBug', 'Let us know if you found a bug or if you have a suggestion to improve the web experience.'), "aria-describedby": "Feedback Form", isOpen: props.isModalOpen, variant: ModalVariant.large, onClose: handleModalToggle, actions: returnModalAction() }, renderModalBody())));
167
+ React.createElement(Modal, { id: "feedback-modal", title: t('i18nSendUsFeedback', 'Send us your feedback\n'), "aria-describedby": "Feedback Form", isOpen: props.isModalOpen, variant: ModalVariant.large, onClose: handleModalToggle },
168
+ React.createElement("p", null, t('i18nFeedbackFormFoundBug', 'Let us know if you found a bug or if you have a suggestion to improve the web experience.')),
169
+ renderModalBody(),
170
+ React.createElement(ModalFooter, null,
171
+ React.createElement(Button, { key: "confirm", onClick: handleSubmit, variant: "primary", isDisabled: isSubmitDisabled || isFetching, className: "pf-v6-u-ml-xs", spinnerAriaValueText: isFetching ? 'Loading' : undefined, isLoading: isFetching, "data-tracking-id": "app-feedback-submit", "aria-label": t('Send feedback') },
172
+ React.createElement(Trans, null, isFetching ? 'Sending feedback' : 'Send feedback')),
173
+ React.createElement("button", { key: "cancel", onClick: handleModalToggle, className: "btn btn-app btn-link", "data-tracking-id": "app-feedback-cancel", "aria-label": "Cancel" }, "Cancel")))));
176
174
  }
177
175
  SupportFeedbackModal.defaultProps = defaultProps;
178
176
  export { SupportFeedbackModal };
@@ -1,5 +1,4 @@
1
- import { IExtraData, IRow, IRowData } from '@patternfly/react-table';
2
- import { TableProps } from '@patternfly/react-table/deprecated';
1
+ import { ISortBy, TableVariant } from '@patternfly/react-table';
3
2
  import React, { ReactNode } from 'react';
4
3
  interface IColumn {
5
4
  id: string;
@@ -20,21 +19,28 @@ interface ISortInfo {
20
19
  direction: 'asc' | 'desc';
21
20
  column: string;
22
21
  }
23
- interface ISortBy {
24
- index: number;
25
- direction: 'asc' | 'desc';
22
+ interface IEmptyStateRow {
23
+ heightAuto: boolean;
24
+ colSpan: number;
25
+ content: ReactNode;
26
26
  }
27
- interface IProps extends Omit<TableProps, 'sortBy' | 'cells' | 'onSort' | 'rows'> {
27
+ interface IProps {
28
+ className?: string;
28
29
  pagination: boolean;
29
30
  onRowClick?: (event: any, row: any, props: any) => void;
30
31
  onSortChange?: (column: IColumn, direction: 'asc' | 'desc') => any;
31
- emptyStateRow?: IRow[];
32
- loadingRow?: IRow[];
32
+ emptyStateRow?: IEmptyStateRow;
33
+ loadingRow?: IEmptyStateRow;
33
34
  sortInfo?: ISortInfo;
34
35
  isLoading?: boolean;
35
36
  keepPageNumberOnDataChange?: boolean;
37
+ onSelect?: (event: any, isSelected: any, rowIndex: any, rowData: any, extraData: any) => void;
38
+ actionResolver?: (rowData: any, extraData: any) => any[];
39
+ actions?: any[];
40
+ areActionsDisabled?: (rowData: any, extraData: any) => boolean;
41
+ variant?: TableVariant;
36
42
  }
37
43
  export declare const defaultTableSortMethod: (a: any, b: any) => 0 | 1 | -1;
38
44
  declare function PFTable(props: IProps): React.JSX.Element;
39
- export { IRowData, IExtraData, PFTable, IProps, ISortBy, ISortInfo, IColumn };
45
+ export { PFTable, IProps, ISortBy, ISortInfo, IColumn };
40
46
  //# sourceMappingURL=PFTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PFTable.d.ts","sourceRoot":"","sources":["../../../src/Table/PFTable.tsx"],"names":[],"mappings":"AASA,OAAO,EAGH,UAAU,EACV,IAAI,EACJ,QAAQ,EAKX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAiC,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAC;AA8C3E,UAAU,OAAO;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAA,KAAK,GAAG,CAAC;IACzB,UAAU,CAAC,EAAE,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,EAAE,aAAa,CAAC,KAAA,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAElD;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,IAAI,KAAA,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;I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