@carbon/ibm-products 2.70.1 → 2.71.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 (175) hide show
  1. package/css/carbon.css +317 -216
  2. package/css/carbon.css.map +1 -1
  3. package/css/index-full-carbon.css +546 -270
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +387 -43
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +229 -54
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +242 -56
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/_virtual/_commonjsHelpers.js +1 -3
  20. package/es/_virtual/index2.js +2 -6
  21. package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
  22. package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
  23. package/es/components/APIKeyModal/APIKeyModal.js +1 -1
  24. package/es/components/ActionSet/ActionSet.d.ts +4 -0
  25. package/es/components/ActionSet/ActionSet.js +46 -44
  26. package/es/components/AddSelect/AddSelectBody.js +1 -1
  27. package/es/components/Card/Card.d.ts +1 -0
  28. package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
  29. package/es/components/Coachmark/CoachmarkTagline.js +2 -2
  30. package/es/components/Coachmark/utils/context.d.ts +28 -2
  31. package/es/components/Coachmark/utils/context.js +1 -1
  32. package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
  33. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
  34. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  35. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
  36. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
  37. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
  38. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
  39. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
  40. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
  41. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
  42. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
  43. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
  44. package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
  45. package/es/components/ConditionBuilder/utils/util.js +11 -4
  46. package/es/components/CreateModal/CreateModal.d.ts +4 -7
  47. package/es/components/CreateModal/CreateModal.js +4 -19
  48. package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
  49. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
  50. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
  51. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
  52. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
  53. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
  54. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
  55. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
  56. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
  57. package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
  58. package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
  59. package/es/components/EmptyStates/EmptyState.js +0 -1
  60. package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
  61. package/es/components/FilterSummary/FilterSummary.js +2 -1
  62. package/es/components/Guidebanner/Guidebanner.js +4 -20
  63. package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
  64. package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
  65. package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
  66. package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
  67. package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
  68. package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
  69. package/es/components/InterstitialScreen/index.d.ts +4 -1
  70. package/es/components/Nav/NavItemLink.js +1 -4
  71. package/es/components/PageHeader/PageHeaderTitle.js +1 -1
  72. package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
  73. package/es/components/PageHeader/next/PageHeader.js +475 -0
  74. package/es/components/PageHeader/next/index.d.ts +8 -0
  75. package/es/components/ScrollGradient/ScrollGradient.js +4 -4
  76. package/es/components/SidePanel/SidePanel.js +25 -20
  77. package/es/components/StringFormatter/StringFormatter.js +3 -0
  78. package/es/components/Tearsheet/Tearsheet.js +4 -7
  79. package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
  80. package/es/components/Tearsheet/TearsheetShell.js +1 -1
  81. package/es/components/UserAvatar/UserAvatar.js +5 -7
  82. package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
  83. package/es/components/UserProfileImage/UserProfileImage.js +12 -6
  84. package/es/components/index.d.ts +1 -0
  85. package/es/global/js/package-settings.js +1 -1
  86. package/es/index.js +3 -0
  87. package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
  88. package/es/node_modules/prop-types/index.js +1 -1
  89. package/lib/_virtual/_commonjsHelpers.js +0 -3
  90. package/lib/_virtual/index2.js +2 -8
  91. package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
  92. package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
  93. package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
  94. package/lib/components/ActionSet/ActionSet.d.ts +4 -0
  95. package/lib/components/ActionSet/ActionSet.js +46 -43
  96. package/lib/components/AddSelect/AddSelectBody.js +1 -1
  97. package/lib/components/Card/Card.d.ts +1 -0
  98. package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
  99. package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
  100. package/lib/components/Coachmark/utils/context.d.ts +28 -2
  101. package/lib/components/Coachmark/utils/context.js +1 -1
  102. package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
  103. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
  104. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
  105. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
  106. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
  107. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
  108. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
  109. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
  110. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
  111. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
  112. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
  113. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
  114. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
  115. package/lib/components/ConditionBuilder/utils/util.js +11 -4
  116. package/lib/components/CreateModal/CreateModal.d.ts +4 -7
  117. package/lib/components/CreateModal/CreateModal.js +4 -19
  118. package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
  119. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
  120. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
  121. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
  122. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
  123. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
  124. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
  125. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
  126. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
  127. package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
  128. package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
  129. package/lib/components/EmptyStates/EmptyState.js +0 -1
  130. package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
  131. package/lib/components/FilterSummary/FilterSummary.js +2 -1
  132. package/lib/components/Guidebanner/Guidebanner.js +4 -20
  133. package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
  134. package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
  135. package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
  136. package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
  137. package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
  138. package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
  139. package/lib/components/InterstitialScreen/index.d.ts +4 -1
  140. package/lib/components/Nav/NavItemLink.js +1 -4
  141. package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
  142. package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
  143. package/lib/components/PageHeader/next/PageHeader.js +490 -0
  144. package/lib/components/PageHeader/next/index.d.ts +8 -0
  145. package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
  146. package/lib/components/SidePanel/SidePanel.js +26 -21
  147. package/lib/components/StringFormatter/StringFormatter.js +3 -0
  148. package/lib/components/Tearsheet/Tearsheet.js +4 -7
  149. package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
  150. package/lib/components/Tearsheet/TearsheetShell.js +1 -1
  151. package/lib/components/UserAvatar/UserAvatar.js +5 -7
  152. package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
  153. package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
  154. package/lib/components/index.d.ts +1 -0
  155. package/lib/global/js/package-settings.js +1 -1
  156. package/lib/index.js +5 -2
  157. package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
  158. package/lib/node_modules/prop-types/index.js +1 -1
  159. package/package.json +22 -30
  160. package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
  161. package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
  162. package/scss/components/PageHeader/_page-header.scss +198 -0
  163. package/scss/components/SidePanel/_side-panel.scss +2 -52
  164. package/scss/components/_index-released-only.scss +1 -0
  165. package/telemetry.yml +12 -13
  166. package/es/_virtual/index3.js +0 -10
  167. package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
  168. package/es/components/SidePanel/resizer/Resizer.js +0 -271
  169. package/es/node_modules/lodash.debounce/index.js +0 -367
  170. package/lib/_virtual/index3.js +0 -12
  171. package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
  172. package/lib/components/SidePanel/resizer/Resizer.js +0 -277
  173. package/lib/node_modules/lodash.debounce/index.js +0 -369
  174. /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
  175. /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -14,14 +14,26 @@ var _SelectItem, _SelectItem2;
14
14
  const ConditionBuilderItemTime = _ref => {
15
15
  let {
16
16
  onChange,
17
- config
17
+ config,
18
+ conditionState
18
19
  } = _ref;
19
- const [timeValue, setTimeValue] = useState('');
20
- const [dayZoneValue, setDayZoneValue] = useState('AM');
21
- const [timeZoneValue, setTimeZoneValue] = useState(config?.timeZones?.[0]);
20
+ const getInitialValue = itemType => {
21
+ const itemMap = {
22
+ time: 0,
23
+ dayZone: 1,
24
+ timeZone: 2
25
+ };
26
+ return conditionState.value !== 'INVALID' ? conditionState.value?.split(' ')[itemMap[itemType]] ?? undefined : undefined;
27
+ };
28
+ const initialTimeValue = getInitialValue('time');
29
+ const initialDayZone = getInitialValue('dayZone');
30
+ const initialTimeZone = getInitialValue('timeZone');
31
+ const [timeValue, setTimeValue] = useState(initialTimeValue);
32
+ const [dayZoneValue, setDayZoneValue] = useState(initialDayZone ?? 'AM');
33
+ const [timeZoneValue, setTimeZoneValue] = useState(initialTimeZone ?? config?.timeZones?.[0]);
22
34
  useEffect(() => {
23
35
  const timeToUpdate = `${timeValue ?? ''} ${dayZoneValue ?? ''} ${timeZoneValue ?? ''}`;
24
- onChange(timeValue ? timeToUpdate : undefined);
36
+ onChange(timeValue ? timeToUpdate : 'INVALID');
25
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
26
38
  }, [timeValue, dayZoneValue, timeZoneValue]);
27
39
  const setTimeZone = evt => {
@@ -36,11 +48,13 @@ const ConditionBuilderItemTime = _ref => {
36
48
  return /*#__PURE__*/React__default.createElement("div", {
37
49
  className: `${blockClass}__item-time`
38
50
  }, /*#__PURE__*/React__default.createElement(TimePicker, {
51
+ defaultValue: initialTimeValue,
39
52
  id: "time-picker",
40
53
  labelText: "Select a time",
41
54
  onChange: setTime
42
55
  }, /*#__PURE__*/React__default.createElement(TimePickerSelect, {
43
56
  id: "time-picker-day-zone",
57
+ defaultValue: initialDayZone,
44
58
  onChange: setDayZone
45
59
  }, _SelectItem || (_SelectItem = /*#__PURE__*/React__default.createElement(SelectItem, {
46
60
  value: "AM",
@@ -50,6 +64,7 @@ const ConditionBuilderItemTime = _ref => {
50
64
  text: "PM"
51
65
  }))), /*#__PURE__*/React__default.createElement(TimePickerSelect, {
52
66
  id: "time-picker-time-zone",
67
+ defaultValue: initialTimeZone,
53
68
  onChange: setTimeZone
54
69
  }, config?.timeZones?.map((timeZone, index) => /*#__PURE__*/React__default.createElement(SelectItem, {
55
70
  key: index,
@@ -58,6 +73,10 @@ const ConditionBuilderItemTime = _ref => {
58
73
  })))));
59
74
  };
60
75
  ConditionBuilderItemTime.propTypes = {
76
+ /**
77
+ * current condition object
78
+ */
79
+ conditionState: PropTypes.object,
61
80
  /**
62
81
  * current config object that this property is part of
63
82
  */
@@ -1,2 +1,2 @@
1
1
  export function handleKeyDown(evt: any, conditionBuilderRef: any, variant: any): void;
2
- export function handleKeyDownForPopover(evt: any, conditionBuilderRef: any, popoverRef: any): void;
2
+ export function handleKeyDownForPopover(evt: any, conditionBuilderRef: any, popoverRef: any, closePopover: any): void;
@@ -13,18 +13,18 @@ const handleKeyDown = (evt, conditionBuilderRef, variant) => {
13
13
  handleKeyPressForMainContent(evt, conditionBuilderRef, variant);
14
14
  }
15
15
  };
16
- const handleKeyDownForPopover = (evt, conditionBuilderRef, popoverRef) => {
16
+ const handleKeyDownForPopover = (evt, conditionBuilderRef, popoverRef, closePopover) => {
17
17
  if (excludeKeyPress(evt)) {
18
18
  return;
19
19
  }
20
- handleKeyPressForPopover(evt, popoverRef?.current, conditionBuilderRef);
20
+ handleKeyPressForPopover(evt, popoverRef?.current, conditionBuilderRef, closePopover);
21
21
  };
22
22
 
23
23
  //skipping keyboard handling for date and time fields to get take carbon's
24
24
  const excludeKeyPress = evt => {
25
25
  return !['Escape'].includes(evt.key) && evt.target.closest(`.${blockClass}__item-date`);
26
26
  };
27
- const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef) => {
27
+ const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef, closePopover) => {
28
28
  const key = evt.key;
29
29
  const isHoldingShiftKey = checkForHoldingKey(evt, 'shiftKey');
30
30
  const isMultiSelect = parentContainer.querySelector('ul')?.dataset.multiSelect;
@@ -32,6 +32,8 @@ const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef) =>
32
32
  let allItems = [];
33
33
  if (key === 'Escape') {
34
34
  //focus the corresponding field in which the popover is triggered from
35
+
36
+ closePopover?.();
35
37
  focusThisField(evt, conditionBuilderRef);
36
38
  evt.preventDefault();
37
39
  evt.stopPropagation();
@@ -88,8 +90,8 @@ const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef) =>
88
90
  if (key === 'Enter' && !isHoldingShiftKey) {
89
91
  if (document.activeElement.type !== 'button') {
90
92
  //for button , enter key is click which already handled by framework, else trigger click
93
+ closePopover?.();
91
94
  focusThisField(evt, conditionBuilderRef);
92
- document.activeElement?.click();
93
95
  }
94
96
  }
95
97
  }
@@ -10,4 +10,4 @@ export function checkIsValid(item: any): any;
10
10
  export function manageTabIndexAndFocus(currentElement: any, conditionBuilderRef: any): void;
11
11
  export function getValue(type: any, value: any, config: any): any;
12
12
  export function checkForMultiSelectOperator(condition: any, config: any): any;
13
- export function onKeyDownHandlerForSearch(evt: any, conditionBuilderRef: any): void;
13
+ export function onKeyDownHandlerForSearch(evt: any, conditionBuilderRef: any, closePopover: any): void;
@@ -12,10 +12,16 @@ const NON_HIERARCHICAL_VARIANT = 'Non-Hierarchical';
12
12
  const HIERARCHICAL_VARIANT = 'Hierarchical';
13
13
  const focusThisField = (evt, conditionBuilderRef) => {
14
14
  if (evt) {
15
+ const target = evt.target;
16
+ const itemRow = evt.target.closest('[role="row"]');
17
+ const buttonName = evt.target.closest('[role="gridcell"]')?.querySelector('button').dataset.name;
15
18
  setTimeout(() => {
16
- manageTabIndexAndFocus(evt.target.closest('[role="gridcell"]')?.querySelector('button'), conditionBuilderRef);
17
- evt.target.closest('[role="gridcell"]')?.querySelector('button')?.click();
18
- evt.target.closest('[role="gridcell"]')?.querySelector('button')?.focus();
19
+ const selector = itemRow.querySelector(`button[data-name="${buttonName}"]`);
20
+ manageTabIndexAndFocus(selector, conditionBuilderRef);
21
+ if (document.contains(target)) {
22
+ evt.target.closest('[role="gridcell"]')?.querySelector('button')?.click();
23
+ evt.target.closest('[role="gridcell"]')?.querySelector('button')?.focus();
24
+ }
19
25
  }, 0);
20
26
  }
21
27
  };
@@ -78,9 +84,10 @@ const checkForMultiSelectOperator = (condition, config) => {
78
84
  return condition?.operator === 'oneOf' || config?.operators?.find(operator => condition?.operator === operator.id && operator.isMultiSelect);
79
85
  };
80
86
  //this will close the popover on escape key on search box
81
- const onKeyDownHandlerForSearch = (evt, conditionBuilderRef) => {
87
+ const onKeyDownHandlerForSearch = (evt, conditionBuilderRef, closePopover) => {
82
88
  if (!evt.currentTarget.value && evt.key === 'Escape') {
83
89
  focusThisField(evt, conditionBuilderRef);
90
+ closePopover?.();
84
91
  }
85
92
  };
86
93
 
@@ -1,12 +1,11 @@
1
1
  /**
2
- * Copyright IBM Corp. 2021, 2024
2
+ * Copyright IBM Corp. 2021, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { ComposedModal } from '@carbon/react';
8
- import React, { ReactNode } from 'react';
9
- export interface CreateModalProps extends React.ComponentProps<typeof ComposedModal> {
7
+ import React, { PropsWithChildren, ReactNode } from 'react';
8
+ export interface CreateModalProps extends PropsWithChildren {
10
9
  /**
11
10
  * Specify an optional className to be applied to the modal root node
12
11
  */
@@ -65,6 +64,4 @@ resource. It is triggered by a user’s action, appears on top of the main page
65
64
  content, and is persistent until dismissed. The purpose of this modal should be
66
65
  immediately apparent to the user, with a clear and obvious path to completion.
67
66
  */
68
- export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps & {
69
- children?: ReactNode | undefined;
70
- } & React.RefAttributes<HTMLDivElement>>;
67
+ export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps & React.RefAttributes<HTMLDivElement>>;
@@ -16,27 +16,14 @@ import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
16
16
 
17
17
  const componentName = 'CreateModal';
18
18
  const blockClass = `${pkg.prefix}--create-modal`;
19
-
20
- // Custom PropType validator which checks and ensures that the children property has no more than 4 nodes
21
- const isValidChildren = () => _ref => {
22
- let {
23
- children
24
- } = _ref;
25
- if (children && children.length > 4) {
26
- throw new Error('The `CreateModal` component does not take more than 4 nodes as children. This is to ensure that the modal does not overflow. Please remove 1 or more nodes.');
27
- }
28
- return;
29
- };
30
19
  /**
31
20
  * The `CreateModal` component provides a way for a user to quickly generate a new
32
21
  resource. It is triggered by a user’s action, appears on top of the main page
33
22
  content, and is persistent until dismissed. The purpose of this modal should be
34
23
  immediately apparent to the user, with a clear and obvious path to completion.
35
24
  */
36
- let CreateModal = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
37
- let {
38
- // The component props, in alphabetical order (for consistency).
39
-
25
+ let CreateModal = /*#__PURE__*/React__default.forwardRef((props, ref) => {
26
+ const {
40
27
  className,
41
28
  children,
42
29
  onRequestClose,
@@ -50,9 +37,8 @@ let CreateModal = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
50
37
  primaryButtonText,
51
38
  disableSubmit,
52
39
  selectorPrimaryFocus,
53
- // Collect any other property values passed in.
54
40
  ...rest
55
- } = _ref2;
41
+ } = props;
56
42
  const renderPortalUse = usePortalTarget(portalTargetIn);
57
43
  return renderPortalUse(/*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, {
58
44
  selectorPrimaryFocus: selectorPrimaryFocus,
@@ -96,8 +82,7 @@ CreateModal.propTypes = {
96
82
  /**
97
83
  * Children refers to all form items within a form inside of the modal's body.
98
84
  */
99
- /**@ts-ignore*/
100
- children: isValidChildren(),
85
+ children: PropTypes.node,
101
86
  /**
102
87
  * Specify an optional className to be applied to the modal root node
103
88
  */
@@ -18,6 +18,9 @@ type fieldsetLegendTextProps = {
18
18
  * Otherwise, use CSS to hide/remove this label text.
19
19
  */
20
20
  fieldsetLegendText?: string;
21
+ /**
22
+ * This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
23
+ */
21
24
  fieldsetLegendId?: React.ReactNode;
22
25
  } | {
23
26
  /**
@@ -32,6 +35,9 @@ type fieldsetLegendTextProps = {
32
35
  * Otherwise, use CSS to hide/remove this label text.
33
36
  */
34
37
  fieldsetLegendText: string;
38
+ /**
39
+ * This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
40
+ */
35
41
  fieldsetLegendId: React.ReactNode;
36
42
  };
37
43
  interface CreateTearsheetStepBaseProps extends PropsWithChildren {
@@ -147,8 +147,16 @@ const DraggableItemsList = _ref => {
147
147
  strategy: verticalListSortingStrategy
148
148
  }, visibleCols.map(colDef => {
149
149
  const colHeaderTitle = getNodeTextContent(colDef.Header);
150
- const parts = colHeaderTitle.split(new RegExp(`(${filterString})`, 'gi'));
151
- const highlightedText = parts.map(part => part.toLowerCase() === filterString.toLowerCase() ? /*#__PURE__*/React__default.createElement("strong", null, part) : part);
150
+ // const parts = colHeaderTitle.split(
151
+ // new RegExp(`(${filterString})`, 'gi')
152
+ // );
153
+ // const highlightedText = parts.map((part) =>
154
+ // part.toLowerCase() === filterString.toLowerCase() ? (
155
+ // <strong>{part}</strong>
156
+ // ) : (
157
+ // part
158
+ // )
159
+ // );
152
160
  const isFrozenColumn = !!colDef.sticky;
153
161
  const isDisabled = colDef.disabled;
154
162
  const listContents = /*#__PURE__*/React__default.createElement(Checkbox, {
@@ -161,7 +169,8 @@ const DraggableItemsList = _ref => {
161
169
  return onSelectColumn(colDef, checked);
162
170
  },
163
171
  id: `${blockClass}__customization-column-${colDef.id}`,
164
- labelText: highlightedText,
172
+ labelText: colHeaderTitle //filterString ? highlightedText : colHeaderTitle
173
+ ,
165
174
  className: `${blockClass}__customize-columns-checkbox`,
166
175
  onKeyDown: event => handleCheckboxKeydown(event, colDef)
167
176
  });
@@ -1,21 +1,46 @@
1
- export const FilterContext: React.Context<any>;
2
- export function clearSingleFilter({ key, value, tableId }: {
1
+ /**
2
+ * Copyright IBM Corp. 2022, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import { SAVED_FILTERS } from './constants';
9
+ import { Filter } from '../../../../FilterSummary/FilterSummary';
10
+ type ActionType = typeof SAVED_FILTERS;
11
+ interface Action {
12
+ type: ActionType;
13
+ payload?: any;
14
+ }
15
+ export interface ContextType {
16
+ EventEmitter: any;
17
+ dispatch: React.Dispatch<Action>;
18
+ state: {
19
+ savedFilters: object[];
20
+ };
21
+ setPanelOpen: React.Dispatch<React.SetStateAction<boolean>>;
22
+ panelOpen: boolean;
23
+ tableId: string;
24
+ filterTags: Filter[];
25
+ }
26
+ export declare const FilterContext: React.Context<ContextType>;
27
+ export declare const clearSingleFilter: ({ key, value, tableId }: {
3
28
  key: any;
4
29
  value: any;
5
30
  tableId: any;
6
- }, setAllFilters: any, state: any, contextTableId: any): void;
7
- export function FilterProvider({ children, filters, filterProps, tableId }: {
8
- children: any;
9
- filters: any;
10
- filterProps: any;
11
- tableId: any;
12
- }): React.JSX.Element;
13
- export namespace FilterProvider {
14
- namespace propTypes {
15
- let children: any;
16
- let filterProps: any;
17
- let filters: any;
18
- let tableId: any;
19
- }
20
- }
21
- import React from 'react';
31
+ }, setAllFilters: any, state: any, contextTableId: any) => void;
32
+ export declare const FilterProvider: {
33
+ ({ children, filters, filterProps, tableId }: {
34
+ children: any;
35
+ filters: any;
36
+ filterProps: any;
37
+ tableId: any;
38
+ }): React.JSX.Element;
39
+ propTypes: {
40
+ children: any;
41
+ filterProps: any;
42
+ filters: any;
43
+ tableId: any;
44
+ };
45
+ };
46
+ export {};
@@ -9,7 +9,7 @@ import React__default, { useState, useReducer, createContext } from 'react';
9
9
  import PropTypes from '../../../../../_virtual/index.js';
10
10
  import { DROPDOWN, RADIO, NUMBER, DATE, CHECKBOX, MULTISELECT, SAVED_FILTERS, CLEAR_SINGLE_FILTER } from './constants.js';
11
11
 
12
- const FilterContext = /*#__PURE__*/createContext();
12
+ const FilterContext = /*#__PURE__*/createContext({});
13
13
  const EventEmitter = {
14
14
  events: {},
15
15
  dispatch: function (event, data) {
@@ -4,5 +4,5 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- declare const useFilterContext: () => any;
7
+ declare const useFilterContext: () => import("../FilterProvider").ContextType;
8
8
  export default useFilterContext;
@@ -12,8 +12,8 @@ const useFilterContext = () => {
12
12
  // get the context
13
13
  const context = useContext(FilterContext);
14
14
 
15
- // if `undefined`, throw an error
16
- if (context === undefined) {
15
+ // if empty object, throw an error
16
+ if (Object.entries(context).length === 0) {
17
17
  throw new Error('useFilterContext was used outside of its Provider');
18
18
  }
19
19
  return context;
@@ -1,4 +1,10 @@
1
- export const InlineEditContext: React.Context<any>;
1
+ export const InlineEditContext: React.Context<{
2
+ state: {};
3
+ dispatch: ({ type, payload }: {
4
+ type: any;
5
+ payload: any;
6
+ }) => void;
7
+ }>;
2
8
  export function InlineEditProvider({ children }: {
3
9
  children: any;
4
10
  }): React.JSX.Element;
@@ -10,7 +10,15 @@ import PropTypes from '../../../../../../_virtual/index.js';
10
10
  import { returnUpdatedActiveCell } from './returnUpdatedActiveCell.js';
11
11
  import { getCellIdAsObject } from './getCellIdAsObject.js';
12
12
 
13
- const InlineEditContext = /*#__PURE__*/createContext();
13
+ const InlineEditContext = /*#__PURE__*/createContext({
14
+ state: {},
15
+ dispatch: _ref => {
16
+ let {
17
+ type,
18
+ payload
19
+ } = _ref;
20
+ }
21
+ });
14
22
  const inlineEditReducer = (state, action) => {
15
23
  switch (action.type) {
16
24
  case 'ADD_GRID_ACTIVE_FOCUS':
@@ -87,10 +95,10 @@ const inlineEditReducer = (state, action) => {
87
95
  return state;
88
96
  }
89
97
  };
90
- const InlineEditProvider = _ref => {
98
+ const InlineEditProvider = _ref2 => {
91
99
  let {
92
100
  children
93
- } = _ref;
101
+ } = _ref2;
94
102
  const initialState = {};
95
103
  const [state, dispatch] = useReducer(inlineEditReducer, initialState);
96
104
  return /*#__PURE__*/React__default.createElement(InlineEditContext.Provider, {
@@ -11,10 +11,20 @@ import { RadioButtonGroup, RadioButton } from '@carbon/react';
11
11
  import { pkg } from '../../../../../settings.js';
12
12
 
13
13
  const blockClass = `${pkg.prefix}--datagrid__row-size`;
14
- const RowSizeRadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
15
- let {
16
- rowSizes,
17
- selectedOption,
14
+ const RowSizeRadioGroup = /*#__PURE__*/forwardRef((props, ref) => {
15
+ const {
16
+ rowSizes = [{
17
+ value: 'xl' // 64
18
+ }, {
19
+ value: 'lg' // 48
20
+ }, {
21
+ value: 'md' // 40
22
+ }, {
23
+ value: 'sm' // 32
24
+ }, {
25
+ value: 'xs' // 24
26
+ }],
27
+ selectedOption = 'lg',
18
28
  onChange,
19
29
  legendText,
20
30
  rowSizeLabels = {
@@ -25,7 +35,7 @@ const RowSizeRadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
25
35
  xs: 'Extra small'
26
36
  },
27
37
  tableId
28
- } = _ref;
38
+ } = props;
29
39
  return /*#__PURE__*/React__default.createElement("div", {
30
40
  className: `${blockClass}-dropdown`,
31
41
  role: "presentation",
@@ -63,20 +73,6 @@ const getBackwardCompatibleRowSize = rowSize => {
63
73
  };
64
74
  return rowSizeMap[rowSize] || rowSize;
65
75
  };
66
- RowSizeRadioGroup.defaultProps = {
67
- rowSizes: [{
68
- value: 'xl' // 64
69
- }, {
70
- value: 'lg' // 48
71
- }, {
72
- value: 'md' // 40
73
- }, {
74
- value: 'sm' // 32
75
- }, {
76
- value: 'xs' // 24
77
- }],
78
- selectedOption: 'lg'
79
- };
80
76
  RowSizeRadioGroup.propTypes = {
81
77
  legendText: PropTypes.string,
82
78
  onChange: PropTypes.func.isRequired,
@@ -36,9 +36,11 @@ interface EditTearsheetFormBaseProps {
36
36
  type EditTearsheetFormFieldsetTypes = {
37
37
  hasFieldset?: false;
38
38
  fieldsetLegendText: string;
39
+ fieldsetLegendId?: React.ReactNode;
39
40
  } | {
40
41
  hasFieldset: true;
41
42
  fieldsetLegendText: string;
43
+ fieldsetLegendId: React.ReactNode;
42
44
  };
43
45
  type EditTearsheetFormProps = EditTearsheetFormBaseProps & EditTearsheetFormFieldsetTypes;
44
46
  export declare let EditTearsheetForm: React.ForwardRefExoticComponent<EditTearsheetFormProps & React.RefAttributes<HTMLDivElement>>;
@@ -30,6 +30,7 @@ let EditTearsheetForm = /*#__PURE__*/forwardRef((_ref, ref) => {
30
30
  className,
31
31
  description,
32
32
  fieldsetLegendText,
33
+ fieldsetLegendId,
33
34
  hasFieldset = defaults.hasFieldset,
34
35
  subtitle,
35
36
  title,
@@ -56,7 +57,7 @@ let EditTearsheetForm = /*#__PURE__*/forwardRef((_ref, ref) => {
56
57
  sm: 4
57
58
  }, /*#__PURE__*/React__default.createElement("h4", {
58
59
  className: `${blockClass}--title`
59
- }, title), subtitle && /*#__PURE__*/React__default.createElement("h6", {
60
+ }, title), subtitle && /*#__PURE__*/React__default.createElement("h5", {
60
61
  className: `${blockClass}--subtitle`
61
62
  }, subtitle), description && /*#__PURE__*/React__default.createElement("p", {
62
63
  className: `${blockClass}--description`
@@ -64,7 +65,8 @@ let EditTearsheetForm = /*#__PURE__*/forwardRef((_ref, ref) => {
64
65
  span: 100
65
66
  }, hasFieldset ? /*#__PURE__*/React__default.createElement(FormGroup, {
66
67
  legendText: fieldsetLegendText,
67
- className: `${blockClass}--fieldset`
68
+ className: `${blockClass}--fieldset`,
69
+ legendId: fieldsetLegendId
68
70
  }, /*#__PURE__*/React__default.createElement(Grid, null, children)) : children))) : pconsole.warn(`You have tried using a ${componentName} component outside of a EditTearsheet. This is not allowed. ${componentName}s should always be children of the EditTearsheet`);
69
71
  });
70
72
 
@@ -83,16 +85,26 @@ EditTearsheetForm.propTypes = {
83
85
  * Sets an optional description on the form component
84
86
  */
85
87
  description: PropTypes.string,
88
+ /**
89
+ * This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
90
+ */
91
+ /**@ts-ignore */
92
+ fieldsetLegendId: PropTypes.node.isRequired.if(_ref2 => {
93
+ let {
94
+ hasFieldset
95
+ } = _ref2;
96
+ return !!hasFieldset;
97
+ }),
86
98
  /**
87
99
  * This is the required legend text that appears above a fieldset html element for accessibility purposes.
88
100
  * You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's form content.
89
101
  * Otherwise, use CSS to hide/remove this label text.
90
102
  */
91
103
  /**@ts-ignore */
92
- fieldsetLegendText: PropTypes.string.isRequired.if(_ref2 => {
104
+ fieldsetLegendText: PropTypes.string.isRequired.if(_ref3 => {
93
105
  let {
94
106
  hasFieldset
95
- } = _ref2;
107
+ } = _ref3;
96
108
  return !!hasFieldset;
97
109
  }),
98
110
  /**
@@ -42,7 +42,6 @@ let EmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
42
42
  v2 = false,
43
43
  ...props
44
44
  } = _ref;
45
- // todo: deprecate v1
46
45
  if (v2) {
47
46
  return /*#__PURE__*/React__default.createElement(EmptyStateV2, props);
48
47
  }
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  export interface Filter {
9
9
  key: string;
10
10
  value: string;
11
+ onClose?: () => void;
11
12
  }
12
13
  export interface FilterSummaryProps {
13
14
  className?: string;
@@ -51,9 +51,10 @@ const FilterSummary = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
51
51
  const localRef = filterSummaryRef || ref;
52
52
  const [overflowCount, setOverflowCount] = useState(0);
53
53
  const [multiline, setMultiline] = useState(false);
54
+ // @ts-ignore
54
55
  const previousState = usePreviousValue({
55
56
  multiline
56
- }) || {};
57
+ }) ?? {};
57
58
  const handleViewAll = () => {
58
59
  if (overflowCount === 0) {
59
60
  setMultiline(false);
@@ -38,8 +38,8 @@ const defaults = {
38
38
  * The guide banner sits at the top of a page, or page-level tab,
39
39
  * to introduce foundational concepts related to the page's content.
40
40
  */
41
- let Guidebanner = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
42
- let {
41
+ let Guidebanner = /*#__PURE__*/React__default.forwardRef((props, ref) => {
42
+ const {
43
43
  children,
44
44
  className,
45
45
  collapsible = defaults.collapsible,
@@ -53,7 +53,7 @@ let Guidebanner = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
53
53
  previousIconDescription = defaults.previousIconDescription,
54
54
  title,
55
55
  ...rest
56
- } = _ref;
56
+ } = props;
57
57
  const scrollRef = useRef(null);
58
58
  const toggleRef = useRef(null);
59
59
  const [scrollPosition, setScrollPosition] = useState(0);
@@ -154,23 +154,7 @@ Guidebanner.propTypes = {
154
154
  * Provide the contents of the Guidebanner.
155
155
  * One or more GuidebannerElement components are required.
156
156
  */
157
- children: (props, propName) => {
158
- let error;
159
- const prop = props[propName];
160
- if (!prop) {
161
- error = new Error('`Guidebanner` requires one or more children of type `GuidebannerElement`.');
162
- }
163
- React__default.Children.forEach(prop, child => {
164
- if (child.type.displayName !== 'GuidebannerElement') {
165
- // If child element is not `GuidebannerElement`, then show:
166
- // Carbon Products component's `displayName` (child.type.displayName) or
167
- // React component's `name` (child.type.name) or
168
- // HTML element's tag name (child.type).
169
- error = new Error(`\`Guidebanner\` only accepts children of type \`GuidebannerElement\`, found \`${child.type?.displayName || child.type?.name || child.type}\` instead.`);
170
- }
171
- });
172
- return error;
173
- },
157
+ children: PropTypes.node,
174
158
  /**
175
159
  * Provide an optional class to be applied to the containing node.
176
160
  */
@@ -8,6 +8,7 @@ import React, { ReactNode, RefObject } from 'react';
8
8
  import { InterstitialScreenHeaderProps } from './InterstitialScreenHeader';
9
9
  import { InterstitialScreenBodyProps } from './InterstitialScreenBody';
10
10
  import { InterstitialScreenFooterProps } from './InterstitialScreenFooter';
11
+ export declare const blockClass: string;
11
12
  export type ActionType = 'close' | 'start' | 'skip' | 'back' | 'next';
12
13
  export interface InterstitialScreenProps {
13
14
  /**
@@ -21,7 +22,7 @@ export interface InterstitialScreenProps {
21
22
  /**
22
23
  * The aria label applied to the Interstitial Screen component
23
24
  */
24
- interstitialAriaLabel?: string;
25
+ ariaLabel?: string;
25
26
  /**
26
27
  * Specifies whether the component is shown as a full-screen
27
28
  * experience, else it is shown as a modal by default.
@@ -30,7 +31,7 @@ export interface InterstitialScreenProps {
30
31
  /**
31
32
  * Specifies whether the component is currently open.
32
33
  */
33
- isOpen?: boolean;
34
+ open?: boolean;
34
35
  /**
35
36
  * Function to call when the close button is clicked.
36
37
  */
@@ -40,7 +41,7 @@ export interface InterstitialScreenProps {
40
41
  */
41
42
  launcherButtonRef?: RefObject<HTMLElement>;
42
43
  }
43
- type InterstitialScreenComponent = React.ForwardRefExoticComponent<InterstitialScreenProps & React.RefAttributes<HTMLDivElement>> & {
44
+ export type InterstitialScreenComponent = React.ForwardRefExoticComponent<InterstitialScreenProps & React.RefAttributes<HTMLDivElement>> & {
44
45
  Header: React.FC<InterstitialScreenHeaderProps>;
45
46
  Body: React.FC<InterstitialScreenBodyProps>;
46
47
  Footer: React.FC<InterstitialScreenFooterProps>;