@carbon/ibm-products 2.43.2-canary.1 → 2.43.2-canary.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (361) hide show
  1. package/css/index-full-carbon.css +428 -143
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +218 -9
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +248 -105
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +349 -129
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/ActionBar/ActionBarItem.js +1 -1
  18. package/es/components/Coachmark/Coachmark.d.ts +6 -1
  19. package/es/components/Coachmark/Coachmark.js +47 -11
  20. package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
  21. package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
  22. package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
  23. package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
  24. package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
  25. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +76 -55
  26. package/es/components/ConditionBuilder/ConditionBuilder.js +82 -25
  27. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  28. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +154 -0
  29. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
  30. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +29 -13
  31. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
  32. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +30 -8
  33. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +14 -9
  34. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
  35. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
  36. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +75 -62
  37. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
  38. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
  39. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
  40. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +35 -24
  41. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +40 -36
  42. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
  43. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +98 -40
  45. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
  46. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
  47. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +27 -9
  48. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  49. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +114 -0
  50. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  51. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +71 -38
  52. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
  53. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +22 -9
  54. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  55. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
  56. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +121 -40
  57. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  58. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +45 -19
  59. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
  60. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -40
  61. package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
  62. package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
  63. package/es/components/ConditionBuilder/utils/util.d.ts +6 -4
  64. package/es/components/ConditionBuilder/utils/util.js +42 -17
  65. package/es/components/CreateFullPage/CreateFullPage.js +2 -2
  66. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
  67. package/es/components/DataSpreadsheet/DataSpreadsheet.js +140 -54
  68. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +25 -1
  69. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +50 -9
  70. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +16 -0
  71. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +32 -8
  72. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  73. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
  74. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
  75. package/es/components/DataSpreadsheet/types/index.d.ts +2 -1
  76. package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  77. package/es/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
  78. package/es/components/Datagrid/Datagrid/Datagrid.js +4 -9
  79. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  80. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
  81. package/es/components/Datagrid/Datagrid/DatagridRow.js +21 -8
  82. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
  83. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
  84. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
  85. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  86. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  87. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  88. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
  89. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  90. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +54 -17
  91. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
  92. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +75 -12
  93. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  94. package/es/components/Datagrid/types/index.d.ts +61 -9
  95. package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
  96. package/es/components/Datagrid/useActionsColumn.js +7 -6
  97. package/es/components/Datagrid/useColumnCenterAlign.d.ts +8 -1
  98. package/es/components/Datagrid/useColumnCenterAlign.js +1 -1
  99. package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  100. package/es/components/Datagrid/useColumnRightAlign.js +4 -3
  101. package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  102. package/es/components/Datagrid/useCustomizeColumns.js +4 -3
  103. package/es/components/Datagrid/useDefaultStringRenderer.js +0 -1
  104. package/es/components/Datagrid/useDisableSelectRows.d.ts +2 -1
  105. package/es/components/Datagrid/useDisableSelectRows.js +27 -22
  106. package/es/components/Datagrid/useInlineEdit.d.ts +8 -1
  107. package/es/components/Datagrid/useInlineEdit.js +13 -3
  108. package/es/components/Datagrid/useNestedRowExpander.js +1 -3
  109. package/es/components/Datagrid/useNestedRows.js +32 -13
  110. package/es/components/Datagrid/useRowExpander.js +1 -3
  111. package/es/components/Datagrid/useSelectRows.js +2 -1
  112. package/es/components/Datagrid/useStickyColumn.d.ts +8 -1
  113. package/es/components/Datagrid/useStickyColumn.js +12 -9
  114. package/es/components/Decorator/Decorator.js +2 -1
  115. package/es/components/DecoratorBase/DecoratorBase.js +3 -5
  116. package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  117. package/es/components/DecoratorLink/DecoratorLink.js +2 -1
  118. package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  119. package/es/components/EditInPlace/EditInPlace.d.ts +4 -0
  120. package/es/components/EditInPlace/EditInPlace.js +21 -10
  121. package/es/components/EditTearsheet/EditTearsheet.d.ts +7 -2
  122. package/es/components/EditTearsheet/EditTearsheet.js +44 -10
  123. package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  124. package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
  125. package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  126. package/es/components/EmptyStates/EmptyStateV2.js +2 -1
  127. package/es/components/FullPageError/FullPageError.d.ts +36 -2
  128. package/es/components/FullPageError/FullPageError.js +0 -3
  129. package/es/components/GetStartedCard/GetStartedCard.d.ts +61 -2
  130. package/es/components/GetStartedCard/GetStartedCard.js +9 -8
  131. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  132. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  133. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  134. package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
  135. package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
  136. package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
  137. package/es/components/Nav/NavItem.js +12 -3
  138. package/es/components/OptionsTile/OptionsTile.js +11 -6
  139. package/es/components/PageHeader/PageHeader.js +1 -0
  140. package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
  141. package/es/components/RemoveModal/RemoveModal.js +7 -1
  142. package/es/components/SearchBar/SearchBar.d.ts +1 -1
  143. package/es/components/SearchBar/SearchBar.js +2 -2
  144. package/es/components/SidePanel/SidePanel.js +17 -21
  145. package/es/components/SidePanel/motion/variants.d.ts +4 -6
  146. package/es/components/SidePanel/motion/variants.js +10 -11
  147. package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
  148. package/es/components/StringFormatter/StringFormatter.js +14 -3
  149. package/es/components/StringFormatter/utils/enums.d.ts +20 -1
  150. package/es/components/StringFormatter/utils/enums.js +22 -2
  151. package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
  152. package/es/components/TagOverflow/TagOverflow.js +47 -64
  153. package/es/components/TagOverflow/TagOverflowModal.js +4 -6
  154. package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  155. package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
  156. package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
  157. package/es/components/Tearsheet/Tearsheet.js +9 -1
  158. package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  159. package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
  160. package/es/components/Tearsheet/TearsheetShell.d.ts +11 -1
  161. package/es/components/Tearsheet/TearsheetShell.js +28 -7
  162. package/es/components/Toolbar/ToolbarButton.js +1 -1
  163. package/es/components/WebTerminal/WebTerminal.js +10 -12
  164. package/es/components/index.d.ts +1 -1
  165. package/es/global/js/hooks/useFocus.d.ts +1 -0
  166. package/es/global/js/hooks/useFocus.js +5 -2
  167. package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
  168. package/es/global/js/package-settings.d.ts +1 -1
  169. package/es/global/js/package-settings.js +1 -1
  170. package/es/index.js +1 -0
  171. package/es/node_modules/@carbon/icon-helpers/es/index.js +49 -62
  172. package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
  173. package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
  174. package/es/settings.d.ts +1 -1
  175. package/lib/components/ActionBar/ActionBarItem.js +1 -1
  176. package/lib/components/Coachmark/Coachmark.d.ts +6 -1
  177. package/lib/components/Coachmark/Coachmark.js +46 -10
  178. package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
  179. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
  180. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
  181. package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
  182. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
  183. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +74 -53
  184. package/lib/components/ConditionBuilder/ConditionBuilder.js +82 -25
  185. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  186. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +163 -0
  187. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
  188. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +28 -11
  189. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
  190. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +29 -7
  191. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +12 -7
  192. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
  193. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
  194. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +73 -60
  195. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
  196. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
  197. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
  198. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +34 -24
  199. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +40 -36
  200. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
  201. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
  202. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +96 -38
  203. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
  204. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
  205. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +28 -10
  206. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  207. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +122 -0
  208. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  209. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +68 -35
  210. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
  211. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +21 -8
  212. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  213. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
  214. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +118 -37
  215. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  216. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +44 -17
  217. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
  218. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -39
  219. package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
  220. package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
  221. package/lib/components/ConditionBuilder/utils/util.d.ts +6 -4
  222. package/lib/components/ConditionBuilder/utils/util.js +44 -16
  223. package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
  224. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
  225. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +140 -54
  226. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +25 -1
  227. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +50 -9
  228. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +16 -0
  229. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +32 -8
  230. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  231. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
  232. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
  233. package/lib/components/DataSpreadsheet/types/index.d.ts +2 -1
  234. package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  235. package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
  236. package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -9
  237. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  238. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
  239. package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -8
  240. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
  241. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
  242. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
  243. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  244. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  245. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  246. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
  247. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  248. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +53 -16
  249. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
  250. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
  251. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  252. package/lib/components/Datagrid/types/index.d.ts +61 -9
  253. package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
  254. package/lib/components/Datagrid/useActionsColumn.js +7 -6
  255. package/lib/components/Datagrid/useColumnCenterAlign.d.ts +8 -1
  256. package/lib/components/Datagrid/useColumnCenterAlign.js +1 -1
  257. package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  258. package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
  259. package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  260. package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
  261. package/lib/components/Datagrid/useDefaultStringRenderer.js +0 -1
  262. package/lib/components/Datagrid/useDisableSelectRows.d.ts +2 -1
  263. package/lib/components/Datagrid/useDisableSelectRows.js +27 -22
  264. package/lib/components/Datagrid/useInlineEdit.d.ts +8 -1
  265. package/lib/components/Datagrid/useInlineEdit.js +13 -3
  266. package/lib/components/Datagrid/useNestedRowExpander.js +1 -3
  267. package/lib/components/Datagrid/useNestedRows.js +32 -13
  268. package/lib/components/Datagrid/useRowExpander.js +1 -3
  269. package/lib/components/Datagrid/useSelectRows.js +2 -1
  270. package/lib/components/Datagrid/useStickyColumn.d.ts +8 -1
  271. package/lib/components/Datagrid/useStickyColumn.js +12 -9
  272. package/lib/components/Decorator/Decorator.js +2 -1
  273. package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
  274. package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  275. package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
  276. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  277. package/lib/components/EditInPlace/EditInPlace.d.ts +4 -0
  278. package/lib/components/EditInPlace/EditInPlace.js +21 -10
  279. package/lib/components/EditTearsheet/EditTearsheet.d.ts +7 -2
  280. package/lib/components/EditTearsheet/EditTearsheet.js +43 -9
  281. package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  282. package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
  283. package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  284. package/lib/components/EmptyStates/EmptyStateV2.js +2 -1
  285. package/lib/components/FullPageError/FullPageError.d.ts +36 -2
  286. package/lib/components/FullPageError/FullPageError.js +0 -3
  287. package/lib/components/GetStartedCard/GetStartedCard.d.ts +61 -2
  288. package/lib/components/GetStartedCard/GetStartedCard.js +8 -7
  289. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  290. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  291. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  292. package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
  293. package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
  294. package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
  295. package/lib/components/Nav/NavItem.js +10 -1
  296. package/lib/components/OptionsTile/OptionsTile.js +11 -6
  297. package/lib/components/PageHeader/PageHeader.js +1 -0
  298. package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
  299. package/lib/components/RemoveModal/RemoveModal.js +7 -1
  300. package/lib/components/SearchBar/SearchBar.d.ts +1 -1
  301. package/lib/components/SearchBar/SearchBar.js +2 -2
  302. package/lib/components/SidePanel/SidePanel.js +16 -20
  303. package/lib/components/SidePanel/motion/variants.d.ts +4 -6
  304. package/lib/components/SidePanel/motion/variants.js +10 -11
  305. package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
  306. package/lib/components/StringFormatter/StringFormatter.js +13 -2
  307. package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
  308. package/lib/components/StringFormatter/utils/enums.js +23 -1
  309. package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
  310. package/lib/components/TagOverflow/TagOverflow.js +46 -63
  311. package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
  312. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  313. package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
  314. package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
  315. package/lib/components/Tearsheet/Tearsheet.js +9 -1
  316. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  317. package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
  318. package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -1
  319. package/lib/components/Tearsheet/TearsheetShell.js +26 -5
  320. package/lib/components/Toolbar/ToolbarButton.js +1 -1
  321. package/lib/components/WebTerminal/WebTerminal.js +10 -12
  322. package/lib/components/index.d.ts +1 -1
  323. package/lib/global/js/hooks/useFocus.d.ts +1 -0
  324. package/lib/global/js/hooks/useFocus.js +5 -1
  325. package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
  326. package/lib/global/js/package-settings.d.ts +1 -1
  327. package/lib/global/js/package-settings.js +1 -1
  328. package/lib/index.js +5 -0
  329. package/lib/node_modules/@carbon/icon-helpers/es/index.js +49 -62
  330. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
  331. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
  332. package/lib/settings.d.ts +1 -1
  333. package/package.json +9 -8
  334. package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
  335. package/scss/components/Coachmark/_coachmark.scss +5 -4
  336. package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
  337. package/scss/components/ConditionBuilder/_condition-builder.scss +5 -1
  338. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +20 -3
  339. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +32 -3
  340. package/scss/components/CreateModal/_create-modal.scss +0 -4
  341. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +17 -2
  342. package/scss/components/Datagrid/_datagrid.scss +0 -4
  343. package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
  344. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
  345. package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
  346. package/scss/components/HTTPErrors/_http-errors.scss +77 -0
  347. package/scss/components/OptionsTile/_options-tile.scss +6 -6
  348. package/scss/components/SidePanel/_side-panel.scss +1 -1
  349. package/scss/components/StatusIcon/_status-icon.scss +4 -4
  350. package/scss/components/StringFormatter/_string-formatter.scss +2 -2
  351. package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
  352. package/scss/components/_index-released-only.scss +1 -0
  353. package/telemetry.yml +32 -19
  354. package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  355. package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
  356. package/es/global/js/utils/window.d.ts +0 -2
  357. package/es/global/js/utils/window.js +0 -12
  358. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  359. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
  360. package/lib/global/js/utils/window.d.ts +0 -2
  361. package/lib/global/js/utils/window.js +0 -16
@@ -26,7 +26,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
26
26
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
27
27
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
28
28
 
29
- var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold", "getOptions", "initialState", "getConditionState", "variant"];
29
+ var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold", "getOptions", "initialState", "getConditionState", "getActionsState", "variant", "actions", "translateWithId"];
30
30
 
31
31
  // Carbon and package components we use.
32
32
  /* TODO: @import(s) of carbon components and other package components. */
@@ -61,18 +61,24 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
61
61
  getOptions = _ref.getOptions,
62
62
  initialState = _ref.initialState,
63
63
  getConditionState = _ref.getConditionState,
64
- variant = _ref.variant,
64
+ getActionsState = _ref.getActionsState,
65
+ _ref$variant = _ref.variant,
66
+ variant = _ref$variant === void 0 ? 'sentence' : _ref$variant,
67
+ actions = _ref.actions,
68
+ translateWithId = _ref.translateWithId,
65
69
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
66
70
  var localRef = React.useRef();
67
71
  var conditionBuilderRef = ref || localRef;
68
72
  var handleKeyDownHandler = function handleKeyDownHandler(evt) {
69
- handleKeyboardEvents.handleKeyDown(evt, conditionBuilderRef);
73
+ handleKeyboardEvents.handleKeyDown(evt, conditionBuilderRef, variant);
70
74
  };
71
75
  return /*#__PURE__*/React__default["default"].createElement(ConditionBuilderProvider.ConditionBuilderProvider, {
72
76
  inputConfig: inputConfig,
73
77
  popOverSearchThreshold: popOverSearchThreshold,
74
78
  getOptions: getOptions,
75
- variant: variant
79
+ variant: variant,
80
+ translateWithId: translateWithId,
81
+ conditionBuilderRef: conditionBuilderRef
76
82
  }, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
77
83
  className: cx__default["default"](DataConfigs.blockClass,
78
84
  // Apply the block class to the main HTML element
@@ -90,9 +96,10 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
90
96
  onKeyDown: handleKeyDownHandler
91
97
  }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderContent["default"], {
92
98
  startConditionLabel: startConditionLabel,
93
- conditionBuilderRef: conditionBuilderRef,
94
99
  getConditionState: getConditionState,
95
- initialState: initialState
100
+ getActionsState: getActionsState,
101
+ initialState: initialState,
102
+ actions: actions
96
103
  }))));
97
104
  });
98
105
 
@@ -108,27 +115,66 @@ exports.ConditionBuilder.displayName = componentName;
108
115
  // See https://www.npmjs.com/package/prop-types#usage.
109
116
  exports.ConditionBuilder.propTypes = {
110
117
  /**
111
- * Provide the contents of the ConditionBuilder.
118
+ * optional array of actions
112
119
  */
113
- //children: PropTypes.node.isRequired,
114
-
120
+ actions: index["default"].arrayOf(index["default"].shape({
121
+ id: index["default"].oneOfType([index["default"].string, index["default"].number]).isRequired,
122
+ label: index["default"].string.isRequired
123
+ })),
115
124
  /**
116
125
  * Provide an optional class to be applied to the containing node.
117
126
  */
118
127
  className: index["default"].string,
128
+ /**
129
+ * This is a callback that gives back the updated action state
130
+ */
131
+ getActionsState: index["default"].func,
132
+ /**
133
+ * This is a callback that gives back updated condition state
134
+ */
119
135
  getConditionState: index["default"].func.isRequired,
136
+ /**
137
+ * This is a callback that get triggered when you want to dynamically fetch options.
138
+ * Component call this when the option array is not passed against a property with type as option in the input config.
139
+ * This is an asynchronous callback that can return a promise , and you need to resolve the promise with options array in the valid format.
140
+ * You will receive the root condition state and current condition as the 2 arguments.
141
+ * eg: const getOptions = async (conditionState,condition) => {
142
+ switch (condition.property) {
143
+ case 'continent':
144
+ return new Promise((resolve) => {
145
+ const continents=[{
146
+ label: 'Africa',
147
+ id: 'Africa',
148
+ },...]
149
+ resolve(continents);
150
+ });
151
+ default:
152
+ return [];
153
+ }
154
+ };
155
+ */
120
156
  getOptions: index["default"].func,
157
+ /**
158
+ * Optional prop if you want to pass a saved condition state.
159
+ * This object should respect the structure of condition state that is available in getConditionState callback
160
+ */
121
161
  initialState: index["default"].shape({
122
162
  groups: index["default"].arrayOf(index["default"].shape({
123
- groupSeparateOperator: index["default"].string,
124
- groupOperator: index["default"].string,
125
- statement: index["default"].string,
126
- conditions: index["default"].arrayOf(index["default"].shape({
127
- property: index["default"].string,
128
- operator: index["default"].string,
129
- value: index["default"].string
130
- }))
131
- }))
163
+ groupOperator: index["default"].string.isRequired,
164
+ statement: index["default"].string.isRequired,
165
+ conditions: index["default"].arrayOf(index["default"].oneOfType([index["default"].shape({
166
+ property: index["default"].string.isRequired,
167
+ operator: index["default"].string.isRequired,
168
+ value: index["default"].oneOfType([index["default"].string, index["default"].arrayOf(index["default"].shape({
169
+ id: index["default"].string,
170
+ label: index["default"].string
171
+ })), index["default"].shape({
172
+ id: index["default"].string,
173
+ label: index["default"].string
174
+ })])
175
+ }), index["default"].object]))
176
+ })),
177
+ operator: index["default"].string
132
178
  }),
133
179
  /**
134
180
  * This is a mandatory prop that defines the input to the condition builder.
@@ -136,17 +182,21 @@ exports.ConditionBuilder.propTypes = {
136
182
  */
137
183
  inputConfig: index["default"].shape({
138
184
  properties: index["default"].arrayOf(index["default"].shape({
139
- id: index["default"].string,
140
- label: index["default"].string,
185
+ id: index["default"].string.isRequired,
186
+ label: index["default"].string.isRequired,
141
187
  icon: index["default"].oneOfType([index["default"].func, index["default"].object]),
142
- type: index["default"].oneOf(['text', 'number', 'date', 'option', 'time']),
188
+ type: index["default"].oneOf(['text', 'textarea', 'number', 'date', 'option', 'time', 'custom']).isRequired,
143
189
  config: index["default"].shape({
144
190
  options: index["default"].arrayOf(index["default"].shape({
145
- id: index["default"].string,
146
- label: index["default"].string,
191
+ id: index["default"].string.isRequired,
192
+ label: index["default"].string.isRequired,
147
193
  icon: index["default"].oneOfType([index["default"].func, index["default"].object])
148
194
  })),
149
- includeSearch: index["default"].bool
195
+ component: index["default"].func,
196
+ operators: index["default"].arrayOf(index["default"].shape({
197
+ id: index["default"].string.isRequired,
198
+ label: index["default"].string.isRequired
199
+ }))
150
200
  })
151
201
  }))
152
202
  }).isRequired,
@@ -158,9 +208,16 @@ exports.ConditionBuilder.propTypes = {
158
208
  * Provide a label to the button that starts condition builder
159
209
  */
160
210
  startConditionLabel: index["default"].string.isRequired,
211
+ /**
212
+ * Optional prop, if you need to pass translations to the texts on the component instead of the defined defaults.
213
+ * This callback function will receive the message id and you need to return the corresponding text for that id.
214
+ * The message id will be one of [ "ifText","addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText","conditionRowGroupText","conditionBuilderText","actionSectionText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText", "invalidNumberWarnText"]
215
+ ]
216
+ */
217
+ translateWithId: index["default"].func,
161
218
  /* TODO: add types and DocGen for all props. */
162
219
  /**
163
220
  * Provide the condition builder variant: sentence/ tree
164
221
  */
165
- variant: index["default"].string.isRequired
222
+ variant: index["default"].oneOf(['tree', 'sentence'])
166
223
  };
@@ -0,0 +1,15 @@
1
+ export default ConditionBuilderActions;
2
+ declare function ConditionBuilderActions({ actions, className }: {
3
+ actions: any;
4
+ className: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ declare namespace ConditionBuilderActions {
7
+ namespace propTypes {
8
+ let actions: PropTypes.Requireable<(PropTypes.InferProps<{
9
+ id: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
10
+ label: PropTypes.Validator<string>;
11
+ }> | null | undefined)[]>;
12
+ let className: PropTypes.Requireable<string>;
13
+ }
14
+ }
15
+ import PropTypes from 'prop-types';
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var index = require('../../../node_modules/prop-types/index.js');
15
+ var cx = require('classnames');
16
+ var icons = require('@carbon/react/icons');
17
+ var react = require('@carbon/react');
18
+ var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
19
+ var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
20
+ var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
21
+ var ConditionBuilderAdd = require('../ConditionBuilderAdd/ConditionBuilderAdd.js');
22
+ var uuidv4 = require('../../../global/js/utils/uuidv4.js');
23
+ var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
24
+ var useTranslations = require('../utils/useTranslations.js');
25
+ var ItemOptionForValueField = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js');
26
+
27
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
28
+
29
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
30
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
31
+
32
+ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
33
+ var actions = _ref.actions,
34
+ className = _ref.className;
35
+ var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
36
+ actionState = _useContext.actionState,
37
+ setActionState = _useContext.setActionState;
38
+ var _useState = React.useState(-1),
39
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
40
+ showDeletionPreview = _useState2[0],
41
+ setShowDeletionPreview = _useState2[1];
42
+ var _useTranslations = useTranslations.useTranslations(['actionsText', 'then', 'and', 'removeActionText', 'addActionText', 'actionSectionText']),
43
+ _useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 6),
44
+ actionsText = _useTranslations2[0],
45
+ thenText = _useTranslations2[1],
46
+ andText = _useTranslations2[2],
47
+ removeActionText = _useTranslations2[3],
48
+ addActionText = _useTranslations2[4],
49
+ actionSectionText = _useTranslations2[5];
50
+ var addActionHandler = function addActionHandler() {
51
+ var action = {
52
+ id: uuidv4["default"](),
53
+ label: undefined,
54
+ popoverToOpen: 'valueField'
55
+ };
56
+ setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState), [action]));
57
+ };
58
+ var onchangeHandler = function onchangeHandler(selectedId, actionIndex) {
59
+ var action = actions.find(function (action) {
60
+ return action.id === selectedId;
61
+ }); //fetch the selected action from the input action array
62
+
63
+ // same actions can be added multiple times
64
+ var newAction = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, action), {}, {
65
+ id: actionState[actionIndex].id
66
+ });
67
+ setActionState([].concat(_rollupPluginBabelHelpers.toConsumableArray(actionState.slice(0, actionIndex)), [newAction], _rollupPluginBabelHelpers.toConsumableArray(actionState.slice(actionIndex + 1))));
68
+ };
69
+ var onRemove = function onRemove(selectedId) {
70
+ setActionState(actionState.filter(function (action) {
71
+ return action.id !== selectedId;
72
+ }));
73
+ };
74
+ var handleShowDeletionPreview = function handleShowDeletionPreview(index) {
75
+ setShowDeletionPreview(index);
76
+ };
77
+ var handleHideDeletionPreview = function handleHideDeletionPreview() {
78
+ setShowDeletionPreview(-1);
79
+ };
80
+ return /*#__PURE__*/React__default["default"].createElement("div", {
81
+ className: className
82
+ }, /*#__PURE__*/React__default["default"].createElement(react.Section, {
83
+ className: "".concat(DataConfigs.blockClass, "__heading"),
84
+ level: 4
85
+ }, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, actionsText)), /*#__PURE__*/React__default["default"].createElement("div", {
86
+ className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
87
+ role: "grid",
88
+ "aria-label": actionSectionText
89
+ }, actionState === null || actionState === void 0 ? void 0 : actionState.map(function (action, index) {
90
+ return /*#__PURE__*/React__default["default"].createElement("div", {
91
+ key: action.id,
92
+ role: "row",
93
+ className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block ").concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__condition__deletion-preview"), showDeletionPreview == index))
94
+ }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
95
+ className: "".concat(DataConfigs.blockClass, "__statement-button"),
96
+ tabIndex: 0,
97
+ popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
98
+ label: index === 0 ? thenText : andText
99
+ }), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
100
+ label: action.label,
101
+ title: actionsText,
102
+ condition: action,
103
+ "data-name": "valueField",
104
+ type: "option"
105
+ }, /*#__PURE__*/React__default["default"].createElement(ItemOptionForValueField.ItemOptionForValueField, {
106
+ conditionState: {
107
+ value: action.label
108
+ },
109
+ onChange: function onChange(selection) {
110
+ return onchangeHandler(selection.id, index);
111
+ },
112
+ config: {
113
+ options: actions
114
+ }
115
+ })), /*#__PURE__*/React__default["default"].createElement("span", {
116
+ role: "gridcell",
117
+ "aria-label": removeActionText
118
+ }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
119
+ hideLabel: true,
120
+ label: removeActionText,
121
+ onClick: function onClick() {
122
+ return onRemove(action.id);
123
+ },
124
+ onMouseEnter: function onMouseEnter() {
125
+ return handleShowDeletionPreview(index);
126
+ },
127
+ onMouseLeave: handleHideDeletionPreview,
128
+ onFocus: function onFocus() {
129
+ return handleShowDeletionPreview(index);
130
+ },
131
+ onBlur: handleHideDeletionPreview,
132
+ renderIcon: icons.Close,
133
+ className: "".concat(DataConfigs.blockClass, "__close-condition"),
134
+ "data-name": "closeCondition"
135
+ })), actionState.length === index + 1 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
136
+ onClick: addActionHandler,
137
+ className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left"),
138
+ buttonLabel: addActionText,
139
+ tabIndex: 0
140
+ }));
141
+ }), actionState.length === 0 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
142
+ onClick: addActionHandler,
143
+ className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left"),
144
+ buttonLabel: addActionText,
145
+ tabIndex: 0
146
+ })));
147
+ };
148
+ var ConditionBuilderActions$1 = ConditionBuilderActions;
149
+ ConditionBuilderActions.propTypes = {
150
+ /**
151
+ * optional array of object that give the list of actions.
152
+ */
153
+ actions: index["default"].arrayOf(index["default"].shape({
154
+ id: index["default"].oneOfType([index["default"].string, index["default"].number]).isRequired,
155
+ label: index["default"].string.isRequired
156
+ })),
157
+ /**
158
+ * Provide an optional class to be applied to the containing node.
159
+ */
160
+ className: index["default"].string
161
+ };
162
+
163
+ exports["default"] = ConditionBuilderActions$1;
@@ -1,5 +1,5 @@
1
1
  export default ConditionBuilderAdd;
2
- declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, }: {
2
+ declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupHandler, showConditionSubGroupPreviewHandler, hideConditionSubGroupPreviewHandler, showConditionPreviewHandler, hideConditionPreviewHandler, enableSubGroup, buttonLabel, tabIndex, }: {
3
3
  className: any;
4
4
  onClick: any;
5
5
  addConditionSubGroupHandler: any;
@@ -9,6 +9,7 @@ declare function ConditionBuilderAdd({ className, onClick, addConditionSubGroupH
9
9
  hideConditionPreviewHandler: any;
10
10
  enableSubGroup: any;
11
11
  buttonLabel: any;
12
+ tabIndex: any;
12
13
  }): import("react/jsx-runtime").JSX.Element;
13
14
  declare namespace ConditionBuilderAdd {
14
15
  namespace propTypes {
@@ -21,6 +22,7 @@ declare namespace ConditionBuilderAdd {
21
22
  let onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
23
  let showConditionPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
23
24
  let showConditionSubGroupPreviewHandler: PropTypes.Requireable<(...args: any[]) => any>;
25
+ let tabIndex: PropTypes.Requireable<number>;
24
26
  }
25
27
  }
26
28
  import PropTypes from 'prop-types';
@@ -11,14 +11,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
13
  var React = require('react');
14
+ var cx = require('classnames');
14
15
  var icons = require('@carbon/react/icons');
15
16
  var ConditionBuilderButton = require('../ConditionBuilderButton/ConditionBuilderButton.js');
16
17
  var index = require('../../../node_modules/prop-types/index.js');
17
18
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
19
+ var useTranslations = require('../utils/useTranslations.js');
18
20
 
19
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
22
 
21
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
22
25
 
23
26
  var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
24
27
  var className = _ref.className,
@@ -29,11 +32,17 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
29
32
  showConditionPreviewHandler = _ref.showConditionPreviewHandler,
30
33
  hideConditionPreviewHandler = _ref.hideConditionPreviewHandler,
31
34
  enableSubGroup = _ref.enableSubGroup,
32
- buttonLabel = _ref.buttonLabel;
35
+ buttonLabel = _ref.buttonLabel,
36
+ tabIndex = _ref.tabIndex;
33
37
  var _useState = React.useState(false),
34
38
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
35
39
  isAddSubgroup = _useState2[0],
36
40
  setIsAddSubgroup = _useState2[1];
41
+ var _useTranslations = useTranslations.useTranslations(['addConditionText', 'addConditionRowText', 'addSubgroupText']),
42
+ _useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 3),
43
+ addConditionText = _useTranslations2[0],
44
+ addConditionRowText = _useTranslations2[1],
45
+ addSubgroupText = _useTranslations2[2];
37
46
  var showAddSubGroup = function showAddSubGroup() {
38
47
  setIsAddSubgroup(true);
39
48
  };
@@ -60,14 +69,16 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
60
69
  onBlur: hideConditionSubGroupPreviewHandler
61
70
  };
62
71
  };
72
+ var getAriaLabel = function getAriaLabel() {
73
+ return buttonLabel ? buttonLabel : !enableSubGroup ? addConditionRowText : undefined;
74
+ };
63
75
  var wrapperProps = enableSubGroup ? {
64
- role: 'gridcell',
65
- 'aria-label': DataConfigs.translateWithId('add-condition')
76
+ role: 'gridcell'
66
77
  } : {};
67
78
  return /*#__PURE__*/React__default["default"].createElement("div", {
68
79
  className: "".concat(className, " ").concat(DataConfigs.blockClass, "__add-button-wrapper"),
69
80
  role: !enableSubGroup ? 'gridcell' : 'none',
70
- "aria-label": !enableSubGroup ? DataConfigs.translateWithId('add_condition_row') : undefined,
81
+ "aria-label": getAriaLabel(),
71
82
  onMouseEnter: showAddSubGroup,
72
83
  onMouseLeave: hideAddSubGroup,
73
84
  onFocus: showAddSubGroup,
@@ -76,18 +87,20 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
76
87
  renderIcon: icons.AddAlt,
77
88
  onClick: onClickHandler
78
89
  }, previewHandlers(), {
90
+ wrapperProps: wrapperProps,
79
91
  className: "".concat(DataConfigs.blockClass, "__add-button"),
80
92
  hideLabel: true,
81
93
  "data-name": "addButton",
82
- label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : DataConfigs.translateWithId('add-condition'),
83
- wrapperProps: wrapperProps
84
- })), isAddSubgroup && enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
94
+ label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : addConditionText,
95
+ tabIndex: tabIndex
96
+ })), enableSubGroup && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers["extends"]({
85
97
  renderIcon: icons.TextNewLine,
86
98
  onClick: addConditionSubGroupHandler,
87
- className: "".concat(DataConfigs.blockClass, "__add-condition-group ").concat(DataConfigs.blockClass, "__gap-left"),
99
+ className: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group ").concat(DataConfigs.blockClass, "__gap-left")),
88
100
  hideLabel: true,
89
- label: DataConfigs.translateWithId('add-condition'),
90
- wrapperProps: wrapperProps
101
+ label: addSubgroupText,
102
+ wrapperProps: wrapperProps,
103
+ wrapperClassName: cx__default["default"]("".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__add-condition-sub-group-wrapper--show"), isAddSubgroup))
91
104
  }, previewHandlersForSubgroup())));
92
105
  };
93
106
  var ConditionBuilderAdd$1 = ConditionBuilderAdd;
@@ -122,10 +135,14 @@ ConditionBuilderAdd.propTypes = {
122
135
  */
123
136
  onClick: index["default"].func,
124
137
  showConditionPreviewHandler: index["default"].func,
125
- showConditionSubGroupPreviewHandler: index["default"].func
138
+ showConditionSubGroupPreviewHandler: index["default"].func,
126
139
  /**
127
140
  * handler for hiding sub group preview
128
141
  */
142
+ /**
143
+ * Tab index
144
+ */
145
+ tabIndex: index["default"].number
129
146
  };
130
147
 
131
148
  exports["default"] = ConditionBuilderAdd$1;
@@ -1,4 +1,5 @@
1
- export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, }: {
1
+ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAlign, renderIcon: Icon, onClick, showToolTip, wrapperProps, onBlur, onFocus, onMouseEnter, onMouseLeave, isInvalid, wrapperClassName, tabIndex, ...rest }: {
2
+ [x: string]: any;
2
3
  className: any;
3
4
  label: any;
4
5
  hideLabel: any;
@@ -11,11 +12,15 @@ export function ConditionBuilderButton({ className, label, hideLabel, tooltipAli
11
12
  onFocus: any;
12
13
  onMouseEnter: any;
13
14
  onMouseLeave: any;
15
+ isInvalid: any;
16
+ wrapperClassName: any;
17
+ tabIndex: any;
14
18
  }): import("react/jsx-runtime").JSX.Element;
15
19
  export namespace ConditionBuilderButton {
16
20
  namespace propTypes {
17
21
  let className: PropTypes.Requireable<string>;
18
22
  let hideLabel: PropTypes.Requireable<boolean>;
23
+ let isInvalid: PropTypes.Requireable<boolean>;
19
24
  let label: PropTypes.Requireable<string>;
20
25
  let onBlur: PropTypes.Requireable<(...args: any[]) => any>;
21
26
  let onClick: PropTypes.Requireable<(...args: any[]) => any>;
@@ -24,7 +29,9 @@ export namespace ConditionBuilderButton {
24
29
  let onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
25
30
  let renderIcon: PropTypes.Requireable<object>;
26
31
  let showToolTip: PropTypes.Requireable<boolean>;
32
+ let tabIndex: PropTypes.Requireable<number>;
27
33
  let tooltipAlign: PropTypes.Requireable<string>;
34
+ let wrapperClassName: PropTypes.Requireable<string>;
28
35
  let wrapperProps: PropTypes.Requireable<object>;
29
36
  }
30
37
  }
@@ -15,12 +15,15 @@ var cx = require('classnames');
15
15
  var index = require('../../../node_modules/prop-types/index.js');
16
16
  var react = require('@carbon/react');
17
17
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
18
+ var icons = require('@carbon/react/icons');
18
19
 
19
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
21
 
21
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
23
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
23
24
 
25
+ var _WarningAltFilled;
26
+ var _excluded = ["className", "label", "hideLabel", "tooltipAlign", "renderIcon", "onClick", "showToolTip", "wrapperProps", "onBlur", "onFocus", "onMouseEnter", "onMouseLeave", "isInvalid", "wrapperClassName", "tabIndex"];
24
27
  var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
25
28
  var _Icon, _span;
26
29
  var className = _ref.className,
@@ -34,24 +37,31 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
34
37
  onBlur = _ref.onBlur,
35
38
  onFocus = _ref.onFocus,
36
39
  onMouseEnter = _ref.onMouseEnter,
37
- onMouseLeave = _ref.onMouseLeave;
40
+ onMouseLeave = _ref.onMouseLeave,
41
+ isInvalid = _ref.isInvalid,
42
+ wrapperClassName = _ref.wrapperClassName,
43
+ tabIndex = _ref.tabIndex,
44
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
38
45
  var Button = function Button() {
39
- return /*#__PURE__*/React__default["default"].createElement("button", {
46
+ var _rest$dataName;
47
+ var dataName = (_rest$dataName = rest['data-name']) !== null && _rest$dataName !== void 0 ? _rest$dataName : '';
48
+ return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
40
49
  // role={'gridcell'}
41
- tabIndex: -1,
42
- className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel)]),
50
+ tabIndex: tabIndex != undefined ? tabIndex : -1,
51
+ className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel && !isInvalid), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__invalid-input"), isInvalid)]),
43
52
  type: "button",
44
53
  onClick: onClick,
45
54
  onBlur: onBlur,
46
55
  onFocus: onFocus,
47
56
  onMouseEnter: onMouseEnter,
48
- onMouseLeave: onMouseLeave
49
- }, Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null, label))));
57
+ onMouseLeave: onMouseLeave,
58
+ "data-name": dataName
59
+ }, rest), Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null, label))), isInvalid && (_WarningAltFilled || (_WarningAltFilled = /*#__PURE__*/React__default["default"].createElement(icons.WarningAltFilled, null))));
50
60
  };
51
61
  return hideLabel || showToolTip ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, _rollupPluginBabelHelpers["extends"]({
52
62
  label: label,
53
63
  align: tooltipAlign,
54
- className: "".concat(DataConfigs.blockClass, "__con-tooltip")
64
+ className: "".concat(wrapperClassName)
55
65
  }, wrapperProps), Button()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, Button());
56
66
  };
57
67
  ConditionBuilderButton.propTypes = {
@@ -63,6 +73,10 @@ ConditionBuilderButton.propTypes = {
63
73
  * decides if label and tooltip to be hidden
64
74
  */
65
75
  hideLabel: index["default"].bool,
76
+ /**
77
+ * boolean to know the updated value in not valid
78
+ */
79
+ isInvalid: index["default"].bool,
66
80
  /**
67
81
  * label of the button
68
82
  */
@@ -88,10 +102,18 @@ ConditionBuilderButton.propTypes = {
88
102
  *decides if tooltip to be shown
89
103
  */
90
104
  showToolTip: index["default"].bool,
105
+ /**
106
+ * Tab index
107
+ */
108
+ tabIndex: index["default"].number,
91
109
  /**
92
110
  * tooltip position
93
111
  */
94
112
  tooltipAlign: index["default"].string,
113
+ /**
114
+ * classname applies to the wrapper of popover
115
+ */
116
+ wrapperClassName: index["default"].string,
95
117
  /**
96
118
  * optional props for tree grid to add role and aria-label to wrapper span
97
119
  */