@pega/cosmos-react-build 8.0.0-build.9.1 → 8.0.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 (428) hide show
  1. package/lib/components/AppShell/AppShell.styles.d.ts +1 -1
  2. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.styles.js +1 -46
  4. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  5. package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
  6. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
  7. package/lib/components/AppShell/Header/AppHeader.js +4 -4
  8. package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
  9. package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
  10. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
  11. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
  12. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
  13. package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
  14. package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
  15. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
  16. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
  17. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
  18. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
  19. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
  20. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
  21. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
  22. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
  23. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
  24. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
  25. package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
  26. package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
  27. package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
  28. package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
  29. package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
  30. package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
  31. package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
  32. package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
  33. package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
  34. package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
  35. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
  36. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
  37. package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
  38. package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
  39. package/lib/components/BackgroundPicker/index.d.ts +3 -0
  40. package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
  41. package/lib/components/BackgroundPicker/index.js +2 -0
  42. package/lib/components/BackgroundPicker/index.js.map +1 -0
  43. package/lib/components/BackgroundPicker/utils.d.ts +24 -0
  44. package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
  45. package/lib/components/BackgroundPicker/utils.js +186 -0
  46. package/lib/components/BackgroundPicker/utils.js.map +1 -0
  47. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
  48. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  49. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  50. package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
  51. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
  52. package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
  53. package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
  54. package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
  55. package/lib/components/DynamicInput/DynamicInput.js +33 -33
  56. package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
  57. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
  58. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
  59. package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
  60. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
  61. package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
  62. package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
  63. package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
  64. package/lib/components/Expression/Expression.d.ts +6 -0
  65. package/lib/components/Expression/Expression.d.ts.map +1 -0
  66. package/lib/components/Expression/Expression.js +36 -0
  67. package/lib/components/Expression/Expression.js.map +1 -0
  68. package/lib/components/Expression/Expression.styles.d.ts +7 -0
  69. package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
  70. package/lib/components/Expression/Expression.styles.js +47 -0
  71. package/lib/components/Expression/Expression.styles.js.map +1 -0
  72. package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
  73. package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
  74. package/lib/components/Expression/Expression.test-ids.js +8 -0
  75. package/lib/components/Expression/Expression.test-ids.js.map +1 -0
  76. package/lib/components/Expression/Expression.types.d.ts +53 -0
  77. package/lib/components/Expression/Expression.types.d.ts.map +1 -0
  78. package/lib/components/Expression/Expression.types.js +2 -0
  79. package/lib/components/Expression/Expression.types.js.map +1 -0
  80. package/lib/components/Expression/index.d.ts +3 -0
  81. package/lib/components/Expression/index.d.ts.map +1 -0
  82. package/lib/components/Expression/index.js +2 -0
  83. package/lib/components/Expression/index.js.map +1 -0
  84. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
  85. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  86. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
  87. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  88. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
  89. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  90. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
  91. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  92. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
  93. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
  94. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
  95. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
  96. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
  97. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  98. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  99. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
  100. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
  101. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
  102. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
  103. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
  104. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
  105. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
  106. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
  107. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  108. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  109. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
  110. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  111. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
  112. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  113. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  114. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
  115. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
  116. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
  117. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
  118. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
  119. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
  120. package/lib/components/ExpressionBuilder/index.d.ts +1 -1
  121. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  122. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  123. package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
  124. package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
  125. package/lib/components/FieldReference/FieldReference.styles.js +45 -37
  126. package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
  127. package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
  128. package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
  129. package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
  130. package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
  131. package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
  132. package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
  133. package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
  134. package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
  135. package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
  136. package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
  137. package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
  138. package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
  139. package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
  140. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
  141. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
  142. package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
  143. package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
  144. package/lib/components/FieldReference/index.d.ts +2 -2
  145. package/lib/components/FieldReference/index.d.ts.map +1 -1
  146. package/lib/components/FieldReference/index.js +1 -1
  147. package/lib/components/FieldReference/index.js.map +1 -1
  148. package/lib/components/IconTile/IconTile.d.ts +7 -3
  149. package/lib/components/IconTile/IconTile.d.ts.map +1 -1
  150. package/lib/components/IconTile/IconTile.js +40 -4
  151. package/lib/components/IconTile/IconTile.js.map +1 -1
  152. package/lib/components/IconTile/IconTile.types.d.ts +17 -15
  153. package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
  154. package/lib/components/IconTile/IconTile.types.js.map +1 -1
  155. package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
  156. package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
  157. package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
  158. package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
  159. package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
  160. package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
  161. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
  162. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
  163. package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
  164. package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
  165. package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
  166. package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
  167. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
  168. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
  169. package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
  170. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
  171. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
  172. package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
  173. package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
  174. package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
  175. package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
  176. package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
  177. package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
  178. package/lib/components/IconTile/Tiles/Case.js.map +1 -1
  179. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
  180. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
  181. package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
  182. package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
  183. package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
  184. package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
  185. package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
  186. package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
  187. package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
  188. package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
  189. package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
  190. package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
  191. package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
  192. package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
  193. package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
  194. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
  195. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
  196. package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
  197. package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
  198. package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
  199. package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
  200. package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
  201. package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
  202. package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
  203. package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
  204. package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
  205. package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
  206. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
  207. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
  208. package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
  209. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
  210. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
  211. package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
  212. package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
  213. package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
  214. package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
  215. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
  216. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
  217. package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
  218. package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
  219. package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
  220. package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
  221. package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
  222. package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
  223. package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
  224. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
  225. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
  226. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
  227. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
  228. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
  229. package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
  230. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
  231. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
  232. package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
  233. package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
  234. package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
  235. package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
  236. package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
  237. package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
  238. package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
  239. package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
  240. package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
  241. package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
  242. package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
  243. package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
  244. package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
  245. package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
  246. package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
  247. package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
  248. package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
  249. package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
  250. package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
  251. package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
  252. package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
  253. package/lib/components/IconTile/Tiles/Task.js.map +1 -1
  254. package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
  255. package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
  256. package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
  257. package/lib/components/IconTile/iconUtils.d.ts +11 -0
  258. package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
  259. package/lib/components/IconTile/iconUtils.js +41 -0
  260. package/lib/components/IconTile/iconUtils.js.map +1 -0
  261. package/lib/components/IconTile/index.d.ts +1 -0
  262. package/lib/components/IconTile/index.d.ts.map +1 -1
  263. package/lib/components/IconTile/index.js.map +1 -1
  264. package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
  265. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  266. package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
  267. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  268. package/lib/components/LifeCycle/Category.d.ts +8 -6
  269. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  270. package/lib/components/LifeCycle/Category.js +53 -36
  271. package/lib/components/LifeCycle/Category.js.map +1 -1
  272. package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
  273. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  274. package/lib/components/LifeCycle/LifeCycle.js +113 -19
  275. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  276. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
  277. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
  278. package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
  279. package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
  280. package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
  281. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  282. package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
  283. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  284. package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
  285. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
  286. package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
  287. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
  288. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
  289. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
  290. package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
  291. package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
  292. package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
  293. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  294. package/lib/components/LifeCycle/LifeCycleList.js +20 -30
  295. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  296. package/lib/components/LifeCycle/Stage.d.ts +12 -7
  297. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  298. package/lib/components/LifeCycle/Stage.js +87 -72
  299. package/lib/components/LifeCycle/Stage.js.map +1 -1
  300. package/lib/components/LifeCycle/Step.d.ts +21 -14
  301. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  302. package/lib/components/LifeCycle/Step.js +75 -51
  303. package/lib/components/LifeCycle/Step.js.map +1 -1
  304. package/lib/components/LifeCycle/Task.d.ts +18 -7
  305. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  306. package/lib/components/LifeCycle/Task.js +119 -55
  307. package/lib/components/LifeCycle/Task.js.map +1 -1
  308. package/lib/components/LifeCycle/index.d.ts +2 -1
  309. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  310. package/lib/components/LifeCycle/index.js +1 -0
  311. package/lib/components/LifeCycle/index.js.map +1 -1
  312. package/lib/components/LifeCycle/utils.d.ts +14 -0
  313. package/lib/components/LifeCycle/utils.d.ts.map +1 -0
  314. package/lib/components/LifeCycle/utils.js +250 -0
  315. package/lib/components/LifeCycle/utils.js.map +1 -0
  316. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
  317. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  318. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  319. package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
  320. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  321. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  322. package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
  323. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  324. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  325. package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
  326. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  327. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  328. package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
  329. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
  330. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
  331. package/lib/components/RuleSelect/RuleSelect.js +3 -3
  332. package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
  333. package/lib/components/Workbench/Workbench.d.ts +2 -3
  334. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  335. package/lib/components/Workbench/Workbench.js.map +1 -1
  336. package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
  337. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  338. package/lib/index.d.ts +4 -2
  339. package/lib/index.d.ts.map +1 -1
  340. package/lib/index.js +4 -2
  341. package/lib/index.js.map +1 -1
  342. package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
  343. package/lib/utils/typeIconMapping.d.ts.map +1 -0
  344. package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
  345. package/lib/utils/typeIconMapping.js.map +1 -0
  346. package/package.json +16 -14
  347. package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
  348. package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
  349. package/lib/components/FlowModeller/AddNode.d.ts +0 -18
  350. package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
  351. package/lib/components/FlowModeller/AddNode.js +0 -86
  352. package/lib/components/FlowModeller/AddNode.js.map +0 -1
  353. package/lib/components/FlowModeller/Connector.d.ts +0 -6
  354. package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
  355. package/lib/components/FlowModeller/Connector.js +0 -69
  356. package/lib/components/FlowModeller/Connector.js.map +0 -1
  357. package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
  358. package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
  359. package/lib/components/FlowModeller/DeletePopover.js +0 -136
  360. package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
  361. package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
  362. package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
  363. package/lib/components/FlowModeller/FlowModeller.js +0 -317
  364. package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
  365. package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
  366. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
  367. package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
  368. package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
  369. package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
  370. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
  371. package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
  372. package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
  373. package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
  374. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
  375. package/lib/components/FlowModeller/Node/Node.types.js +0 -27
  376. package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
  377. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
  378. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
  379. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
  380. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
  381. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
  382. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
  383. package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
  384. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
  385. package/lib/components/FlowModeller/Node.d.ts +0 -5
  386. package/lib/components/FlowModeller/Node.d.ts.map +0 -1
  387. package/lib/components/FlowModeller/Node.js +0 -22
  388. package/lib/components/FlowModeller/Node.js.map +0 -1
  389. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
  390. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
  391. package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
  392. package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
  393. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
  394. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
  395. package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
  396. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
  397. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
  398. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
  399. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
  400. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
  401. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
  402. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
  403. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
  404. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
  405. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
  406. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
  407. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
  408. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
  409. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
  410. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
  411. package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
  412. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
  413. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
  414. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
  415. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
  416. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
  417. package/lib/components/FlowModeller/helper.d.ts +0 -39
  418. package/lib/components/FlowModeller/helper.d.ts.map +0 -1
  419. package/lib/components/FlowModeller/helper.js +0 -198
  420. package/lib/components/FlowModeller/helper.js.map +0 -1
  421. package/lib/components/FlowModeller/index.d.ts +0 -20
  422. package/lib/components/FlowModeller/index.d.ts.map +0 -1
  423. package/lib/components/FlowModeller/index.js +0 -12
  424. package/lib/components/FlowModeller/index.js.map +0 -1
  425. package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
  426. package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
  427. package/lib/components/IconTile/IconTile.styles.js +0 -68
  428. package/lib/components/IconTile/IconTile.styles.js.map +0 -1
@@ -1 +1 @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CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,eAAe,CAAC,OAAO,GAAG,iBAAiB,CAAC;YAC5C,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACnC,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CACL,MAAC,IAAI,OACC,SAAS,EACb,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EACjD,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,IAAI,CAAC,EAAE,gBACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,aAE7D,KAAK,IAAI,KAAC,cAAc,IAAC,IAAI,EAAC,YAAY,GAAG,EAC9C,KAAC,IAAI,IACH,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,OAAO,EAAE,YAAY,YAErB,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,gBAAc,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,YACtF,KAAK,GACY,GACf,EACP,KAAC,kBAAkB,cAChB,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,SAAG,GAClD,IAChB,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithChildren, Ref, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Actions,\n defaultThemeProp,\n useDirection,\n StyledButton,\n Icon,\n useI18n,\n readableColor\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\n\nimport type {\n LifeCycleAction,\n LifeCycleActionParam,\n StageInfo,\n StageItemProps,\n StageProps\n} from './LifeCycle.types';\n\nexport interface StageComponentProps extends BaseProps, StageProps {\n ref?: Ref<HTMLDivElement>;\n /** Pass text for the task. */\n value: string;\n /** unique id of the component */\n id: string;\n /** Controls the styling of the stage. */\n stageInfo: StageInfo;\n /** Full data object which can be passed to the callback */\n item: StageItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n}\n\nexport const StyledWrapper = styled.div`\n overflow: hidden;\n`;\n\nStyledWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStageButton = styled.button<{\n error: string | undefined;\n}>(({ error, theme }) => {\n return css`\n height: ${theme.components.button.height};\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n margin-inline-start: ${theme.base.spacing};\n\n ${error &&\n css`\n margin-inline-start: 0;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n `;\n});\n\nStyledStageButton.defaultProps = defaultThemeProp;\n\nexport const StyledStageActions = styled.div`\n z-index: 2;\n`;\n\nStyledStageActions.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n margin-inline: calc(0.5 * ${theme.base.spacing});\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledStage = styled.div<\n Pick<StageComponentProps, 'stageInfo'> & {\n status: boolean;\n error: string;\n }\n>(({ stageInfo, theme, status, error }) => {\n const {\n visual: { bgColor, tailPointed, headPointed }\n } = stageInfo;\n\n const { rtl } = useDirection();\n const contrastColor = readableColor(bgColor);\n const roundedEndsStyles = css`\n content: '';\n position: absolute;\n display: block;\n width: calc(3 * ${theme.base.spacing});\n height: calc(3 * ${theme.base.spacing});\n top: calc(1 * ${theme.base.spacing});\n border: 0;\n border-inline-end: 0.0625rem solid transparent;\n `;\n\n return css`\n position: relative;\n padding: calc(0.5 * ${theme.base.spacing});\n background: ${bgColor};\n border: 0.0625rem solid transparent;\n width: 100%;\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus-within {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n\n ${headPointed &&\n css`\n &::after {\n border-inline-end: 0.0625rem solid ${theme.base.palette.interactive};\n ${rtl\n ? css`\n border-block-start: 0.0625rem solid ${theme.base.palette.interactive};\n `\n : css`\n border-block-end: 0.0625rem solid ${theme.base.palette.interactive};\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n &::before {\n border-inline-end: 0.0625rem solid ${theme.base.palette.interactive};\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid ${theme.base.palette.interactive};\n `\n : css`\n border-block-start: 0.0625rem solid ${theme.base.palette.interactive};\n `}\n }\n `}\n }\n\n ${headPointed &&\n css`\n &::after {\n ${roundedEndsStyles}\n z-index: 1;\n background: inherit;\n transform: rotateZ(-45deg) skew(-15deg, -15deg);\n inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);\n border-block-end: 0.0625rem solid transparent;\n ${rtl\n ? css`\n border-radius: calc(0.75 * ${theme.base['border-radius']}) 0.1rem 0.1rem 0.1rem;\n `\n : css`\n border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base['border-radius']})\n 0.0625rem;\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n ${!error &&\n css`\n ${StyledStageButton} {\n margin-inline-start: calc(1.5 * ${theme.base.spacing});\n }\n `}\n\n ${error &&\n css`\n ${StyledWarnIcon} {\n margin-inline-start: ${theme.base.spacing};\n }\n `}\n\n &::before {\n ${roundedEndsStyles}\n background: ${theme.base.palette['app-background']};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n inset-inline-start: calc(-1.6 * ${theme.base.spacing});\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid transparent;\n border-radius: 0.0625rem 1rem 0.0625rem calc(0.75 * ${theme.base['border-radius']});\n `\n : css`\n border-block-start: 0.0625rem solid transparent;\n border-radius: 0.0625rem calc(0.75 * ${theme.base['border-radius']}) 0.0625rem 1rem;\n `}\n }\n `}\n\n ${StyledWarnIcon} {\n color: ${contrastColor};\n }\n\n ${StyledStageActions} {\n & > ${StyledButton} {\n color: ${contrastColor};\n }\n }\n\n ${StyledStageButton} {\n color: ${contrastColor};\n ${!status &&\n css`\n background: ${bgColor};\n `}\n }\n `;\n});\n\nStyledStage.defaultProps = defaultThemeProp;\n\nconst Stage: FunctionComponent<StageComponentProps & ForwardProps> = forwardRef(function Stage(\n {\n value,\n actions,\n stageInfo,\n onClick,\n id,\n item,\n error,\n ...restProps\n }: PropsWithChildren<StageComponentProps>,\n ref: StageComponentProps['ref']\n) {\n const t = useI18n();\n\n const onStageClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n stage: item,\n type: 'Stage'\n };\n onClick?.(actionParam, e);\n };\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n stage: item\n };\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList?.forEach((actionItem: LifeCycleAction) => {\n if (actionItem.id === actionId) {\n actionItem.onClick?.(param, e);\n }\n });\n }\n };\n\n // Deep copy of actions object is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n return (\n <Flex\n {...restProps}\n container={{ inline: true, alignItems: 'center' }}\n as={StyledStage}\n ref={ref}\n error={error}\n stageInfo={stageInfo}\n id={item.id}\n aria-label={error ? t('stage_name_error', [value]) : undefined}\n >\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n as={StyledWrapper}\n container={{ inline: true }}\n item={{ grow: 1 }}\n onClick={onStageClick}\n >\n <StyledStageButton error={error} aria-label={error ? undefined : t('stage_name', [value])}>\n {value}\n </StyledStageButton>\n </Flex>\n <StyledStageActions>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </StyledStageActions>\n </Flex>\n );\n});\n\nexport default Stage;\n"]}
1
+ {"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAQhD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,gBAAgB,EAAE,EAA8B,MAAM,oBAAoB,CAAC;AAiBlF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAG3C,CAAC,EAAE,KAAK,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,eAAe,CAAC,CAAC","sourcesContent":["import { forwardRef, useContext } from 'react';\nimport type { PropsWithChildren, Ref, MouseEvent, RefCallback } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Actions,\n defaultThemeProp,\n useDirection,\n StyledButton,\n Icon,\n useI18n,\n readableColor,\n useTestIds,\n withTestIds,\n useElement,\n Tooltip,\n readableHue\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, Action, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport { DragHandle, StyledDragHandle } from '@pega/cosmos-react-dnd';\n\nimport { generateDynamicTestId } from './utils';\nimport type {\n LifeCycleAction,\n LifeCycleActionParam,\n StageInfo,\n StageItemProps,\n StageProps\n} from './LifeCycle.types';\nimport { getStageTestIds } from './LifeCycle.test-ids';\nimport LifeCycleContext, { type LifeCycleContextValue } from './LifeCycleContext';\n\nexport interface StageComponentProps extends BaseProps, StageProps {\n ref?: Ref<HTMLDivElement>;\n /** Pass text for the task. */\n value: string;\n /** unique id of the component */\n id: string;\n /** Controls the styling of the stage. */\n stageInfo: StageInfo;\n /** Full data object which can be passed to the callback */\n item: StageItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n dragRef?: RefCallback<HTMLElement>;\n}\n\nexport const StyledStageButton = styled.button<{\n error: string | undefined;\n dragEnabled?: LifeCycleContextValue['dragEnabled'];\n}>(({ error, dragEnabled, theme }) => {\n return css`\n height: ${theme.components.button.height};\n outline: none;\n border: none;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n margin-inline-start: calc(${dragEnabled ? 0.25 : 0.5} * ${theme.base.spacing});\n padding-inline: calc(${dragEnabled ? 0.25 : 0.5} * ${theme.base.spacing});\n background: transparent;\n z-index: 2;\n\n ${error &&\n css`\n margin-inline-start: 0;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n `;\n});\n\nStyledStageButton.defaultProps = defaultThemeProp;\n\nexport const StyledStageActions = styled.div(({ theme }) => {\n return css`\n z-index: 2;\n margin-inline-end: calc(0.875 * ${theme.base.spacing});\n `;\n});\n\nStyledStageActions.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n margin-inline: calc(0.5 * ${theme.base.spacing});\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledStage = styled.div<\n Pick<StageComponentProps, 'stageInfo'> & {\n error: string;\n dragEnabled?: LifeCycleContextValue['dragEnabled'];\n dragging?: boolean;\n } & Pick<StageItemProps, 'transitionType'>\n>(({ stageInfo, theme, error, dragEnabled, dragging, transitionType }) => {\n const {\n visual: { bgColor, tailPointed, headPointed }\n } = stageInfo;\n\n const { rtl } = useDirection();\n const contrastColor = readableColor(bgColor);\n const borderRadius = 'border-radius';\n const roundedEndsStyles = css`\n content: '';\n position: absolute;\n display: block;\n width: calc(3 * ${theme.base.spacing});\n height: calc(3 * ${theme.base.spacing});\n top: calc(1 * ${theme.base.spacing});\n border: 0;\n border-inline-end: 0.0625rem solid transparent;\n `;\n const spacing = `calc(0.5 * ${theme.base.spacing})`;\n\n return css`\n position: relative;\n padding: ${spacing};\n background: ${bgColor};\n border: 0.0625rem solid transparent;\n width: 100%;\n height: '${theme.base.spacing}';\n &:hover {\n cursor: pointer;\n }\n ${transitionType === 'resolution' &&\n stageInfo.id === 'alternate' &&\n css`\n border: none;\n box-shadow: inset 0 -0.5rem 0 0 ${readableHue(theme.base.colors.green.medium, theme.base.palette.light)};\n\n /* adding 0.0625rem to padding since 0.0625rem border is removed. */\n padding: calc(${spacing} + 0.0625rem);\n `}\n\n ${headPointed &&\n !dragging &&\n css`\n &::after {\n ${roundedEndsStyles}\n z-index: 1;\n background: inherit;\n transform: rotateZ(-45deg) skew(-15deg, -15deg);\n inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);\n border-block-end: 0.0625rem solid transparent;\n ${rtl\n ? css`\n border-radius: calc(0.75 * ${theme.base[borderRadius]}) 0.1rem 0.1rem 0.1rem;\n `\n : css`\n border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base[borderRadius]}) 0.0625rem;\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n ${!error &&\n !dragEnabled &&\n css`\n ${StyledStageButton} {\n margin-inline-start: calc(1.5 * ${theme.base.spacing});\n }\n `}\n\n ${error &&\n css`\n ${StyledWarnIcon} {\n margin-inline-start: ${theme.base.spacing};\n }\n `}\n\n ${!dragging &&\n css`\n &::before {\n ${roundedEndsStyles}\n background: ${theme.base.palette['app-background']};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n inset-inline-start: calc(-1.6 * ${theme.base.spacing});\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid transparent;\n border-radius: 0.0625rem 1rem 0.0625rem calc(0.75 * ${theme.base[borderRadius]});\n `\n : css`\n border-block-start: 0.0625rem solid transparent;\n border-radius: 0.0625rem calc(0.75 * ${theme.base[borderRadius]}) 0.0625rem 1rem;\n `}\n }\n `}\n `}\n\n ${StyledWarnIcon} {\n color: ${contrastColor};\n margin-inline-start: calc(${dragEnabled ? 0.5 : 1.25} * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n }\n\n ${StyledStageActions} {\n & > ${StyledButton} {\n color: ${contrastColor};\n }\n }\n\n ${StyledStageButton} {\n color: ${contrastColor};\n }\n\n ${StyledDragHandle} {\n color: ${contrastColor};\n margin-inline-start: ${theme.base.spacing};\n }\n `;\n});\n\nStyledStage.defaultProps = defaultThemeProp;\n\nconst Stage: ForwardRefForwardPropsComponent<StageComponentProps> = forwardRef(\n (\n {\n value,\n actions,\n stageInfo,\n onClick,\n id,\n item,\n error,\n dragRef,\n ...restProps\n }: PropsWithChildren<StageComponentProps>,\n ref: StageComponentProps['ref']\n ) => {\n const { dragDropConfig, dragEnabled, draggedItem } = useContext(LifeCycleContext);\n const [stageButtonEl, setStageButtonEl] = useElement();\n const t = useI18n();\n let accessibilityLabel: string;\n const stageTestID = generateDynamicTestId([value]);\n const testIds = useTestIds(stageTestID, getStageTestIds);\n\n const onStageClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n stage: item,\n type: 'Stage'\n };\n onClick?.(actionParam, e);\n };\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>,\n menuButtonEl?: HTMLButtonElement\n ) => {\n const param: LifeCycleActionParam = {\n stage: item\n };\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList?.forEach((actionItem: LifeCycleAction) => {\n if (actionItem.id === actionId) {\n actionItem.onClick?.(param, e, menuButtonEl);\n }\n });\n }\n };\n\n // Deep copy of actions object is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push({\n ...actionCloneItem\n });\n return actionItem;\n });\n }\n if (item.transitionType === 'resolution') {\n accessibilityLabel = `${t('wait_for_user_action', [t('stage_name', [value])])}`;\n } else if (item.transitionType === 'wait') {\n accessibilityLabel = `${t('resolve_case', [t('stage_name', [value])])}`;\n } else {\n accessibilityLabel = t('stage_name', [value]);\n }\n\n const stageDragEnabled =\n dragEnabled && dragDropConfig[item.alternate ? 'alternate-stage' : 'stage'].enabled;\n\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n container={{ inline: true, alignItems: 'center' }}\n as={StyledStage}\n ref={ref}\n error={error}\n dragEnabled={stageDragEnabled}\n dragging={draggedItem?.type === 'stage'}\n stageInfo={stageInfo}\n aria-label={error ? t('stage_name_error', [value]) : undefined}\n transitionType={item.transitionType}\n >\n {stageDragEnabled && (\n <DragHandle itemId={id} ref={dragRef} onClick={e => e.stopPropagation()} />\n )}\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex container={{ inline: true }} item={{ grow: 1 }} onClick={onStageClick}>\n <StyledStageButton\n error={error}\n dragEnabled={stageDragEnabled}\n aria-label={error ? undefined : accessibilityLabel}\n ref={setStageButtonEl}\n >\n {value}\n </StyledStageButton>\n {stageButtonEl && (\n <Tooltip target={stageButtonEl} smart>\n {value}\n </Tooltip>\n )}\n </Flex>\n <StyledStageActions>\n {actionsClone && (\n <Actions\n items={actionsClone}\n menuAt={2}\n iconOnly\n contextualLabel={t('stage_name', [value])}\n />\n )}\n </StyledStageActions>\n </Flex>\n );\n }\n);\n\nexport default withTestIds(Stage, getStageTestIds);\n"]}
@@ -1,8 +1,14 @@
1
- import type { FunctionComponent } from 'react';
1
+ import type { FunctionComponent, RefCallback } from 'react';
2
2
  import type { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
3
- import type { ColorName } from '../../utils';
3
+ import type { IconTileProps } from '../IconTile/IconTile.types';
4
4
  import type { TaskItemProps, StepItemProps, StageItemProps, CategoryItemProps, StepProps } from './LifeCycle.types';
5
- interface StepComponentProps extends BaseProps, StepProps {
5
+ interface CategoryLabelProp {
6
+ categoryLabel?: string;
7
+ }
8
+ export interface VisualStepItemProps extends Omit<IconTileProps, 'size'> {
9
+ imgSrc: string;
10
+ }
11
+ export interface StepComponentProps extends BaseProps, StepProps {
6
12
  /** Pass text for the step. */
7
13
  value: string;
8
14
  /** unique id of step */
@@ -10,12 +16,7 @@ interface StepComponentProps extends BaseProps, StepProps {
10
16
  /** Determines the visual for icon, color and label to render.
11
17
  * This color is passed as a variant and accessible colors are used to display.
12
18
  * Icon and label are passed as normal string */
13
- visual: {
14
- imgurl: string;
15
- color: ColorName;
16
- icon: string;
17
- title: string;
18
- };
19
+ visual: VisualStepItemProps;
19
20
  /** Determines the variant and label for the badges */
20
21
  badge?: StepItemProps['status'];
21
22
  /** The status is used to show the input error status and the info on tooltip in case of error */
@@ -24,17 +25,23 @@ interface StepComponentProps extends BaseProps, StepProps {
24
25
  item: StepItemProps;
25
26
  stageItem: StageItemProps;
26
27
  taskItem: TaskItemProps;
27
- categoryItem: CategoryItemProps;
28
+ categoryItem: CategoryItemProps & CategoryLabelProp;
29
+ dragRef?: RefCallback<HTMLElement>;
30
+ previewRef?: RefCallback<HTMLElement>;
28
31
  }
29
32
  export declare const StyledStepType: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<StepComponentProps, "visual">, never>;
30
33
  export declare const StyledStepBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
31
- export declare const StyledStepWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
34
+ export declare const StyledStepWrapper: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {
32
35
  hasFocus: boolean;
33
36
  selected: boolean;
34
37
  }, never>;
35
38
  export declare const StyledStep: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
36
- export declare const StyledStepButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
39
+ export declare const StyledStepButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
40
+ $wrap?: StepComponentProps["wrap"];
41
+ }, never>;
37
42
  export declare const StyledWarnIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {}, never>;
38
- declare const Step: FunctionComponent<StepComponentProps & ForwardProps>;
39
- export default Step;
43
+ declare const _default: FunctionComponent<StepComponentProps & ForwardProps> & {
44
+ getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly string[]>;
45
+ };
46
+ export default _default;
40
47
  //# sourceMappingURL=Step.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAgB5E,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAU,MAAM,yBAAyB,CAAC;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EAEjB,SAAS,EACV,MAAM,mBAAmB,CAAC;AAG3B,UAAU,kBAAmB,SAAQ,SAAS,EAAE,SAAS;IACvD,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX;;oDAEgD;IAChD,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,SAAS,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,sDAAsD;IACtD,KAAK,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,cAAc,CAAC;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,yIAkB1B,CAAC;AAIF,eAAO,MAAM,eAAe,yGAa1B,CAAC;AAIH,eAAO,MAAM,iBAAiB;cAClB,OAAO;cACP,OAAO;SAuBjB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAUrB,CAAC;AAYH,eAAO,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C,CAAC;IACnC,UAAU,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CACvC;AAED,eAAO,MAAM,cAAc,yIAY1B,CAAC;AAIF,eAAO,MAAM,eAAe,yGAa1B,CAAC;AAIH,eAAO,MAAM,iBAAiB;cAClB,OAAO;cACP,OAAO;SA0BjB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAcrB,CAAC;AAaH,eAAO,MAAM,gBAAgB;YAA2B,kBAAkB,CAAC,MAAM,CAAC;SAgCjF,CAAC;AAIF,eAAO,MAAM,cAAc,0LAUzB,CAAC;;;;AA4KH,wBAAiD"}
@@ -1,24 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState, useContext } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Flex, defaultThemeProp, Icon, Status, Actions, useI18n, Avatar, useUID, Tooltip, useElement, readableColor } from '@pega/cosmos-react-core';
5
- import { colorMap } from '../../utils';
4
+ import { Flex, defaultThemeProp, Icon, Status, Actions, useI18n, Avatar, useUID, useTestIds, VisuallyHiddenText, withTestIds, Tooltip, useElement } from '@pega/cosmos-react-core';
5
+ import { DragHandle, StyledDragHandle } from '@pega/cosmos-react-dnd';
6
+ import IconTile from '../IconTile';
7
+ import { generateDynamicTestId } from './utils';
6
8
  import LifeCycleContext from './LifeCycleContext';
9
+ import { getStepTestIds } from './LifeCycle.test-ids';
10
+ const borderRadius = 'border-radius';
7
11
  export const StyledStepType = styled.div(({ visual, theme }) => {
8
- const bgColor = colorMap[visual.color];
9
- const contrastColor = readableColor(bgColor);
10
- return visual.imgurl
12
+ return visual?.imgSrc
11
13
  ? css `
12
14
  height: 2rem;
13
15
  padding-inline-end: calc(0.25 * ${theme.base.spacing});
14
16
  `
15
17
  : css `
16
- background: ${bgColor};
17
18
  margin: calc(0.5 * ${theme.base.spacing});
18
- padding: 0 calc(0.5 * ${theme.base.spacing});
19
- color: ${contrastColor};
20
- text-align: center;
21
- border-radius: calc(0.25 * ${theme.base['border-radius']});
19
+ border-radius: calc(0.25 * ${theme.base[borderRadius]});
22
20
  `;
23
21
  });
24
22
  StyledStepType.defaultProps = defaultThemeProp;
@@ -37,12 +35,15 @@ export const StyledStepBadge = styled.div(({ theme }) => {
37
35
  `;
38
36
  });
39
37
  StyledStepBadge.defaultProps = defaultThemeProp;
40
- export const StyledStepWrapper = styled.div(({ hasFocus, theme, selected }) => {
38
+ export const StyledStepWrapper = styled.li(({ hasFocus, theme, selected }) => {
41
39
  return css `
42
40
  width: 100%;
43
- margin: 0 0 calc(0.5 * ${theme.base.spacing});
44
41
  border: 0.125rem solid transparent;
45
- border-radius: calc(0.5 * ${theme.base['border-radius']});
42
+ border-radius: calc(0.5 * ${theme.base[borderRadius]});
43
+
44
+ &:not(:last-of-type) {
45
+ margin: 0 0 calc(0.5 * ${theme.base.spacing});
46
+ }
46
47
 
47
48
  ${hasFocus &&
48
49
  css `
@@ -65,57 +66,87 @@ export const StyledStep = styled.div(({ theme }) => {
65
66
  return css `
66
67
  background: ${theme.base.palette['secondary-background']};
67
68
  border: 0.125rem solid transparent;
68
- border-radius: calc(0.5 * ${theme.base['border-radius']});
69
+ border-radius: calc(0.5 * ${theme.base[borderRadius]});
69
70
 
70
71
  &:hover {
71
72
  cursor: pointer;
72
73
  }
74
+
75
+ ${StyledDragHandle} {
76
+ margin-block: calc(0.5 * ${theme.base.spacing});
77
+ }
73
78
  `;
74
79
  });
75
80
  StyledStep.defaultProps = defaultThemeProp;
76
81
  const StyledStepButtonWrapper = styled.div(({ theme }) => {
77
82
  return css `
78
- border-radius: calc(0.5 * ${theme.base['border-radius']});
83
+ border-radius: calc(0.5 * ${theme.base[borderRadius]});
84
+ margin-inline: calc(0.5 * ${theme.base.spacing});
79
85
  `;
80
86
  });
81
87
  StyledStepButtonWrapper.defaultProps = defaultThemeProp;
82
- export const StyledStepButton = styled.button(({ theme }) => {
88
+ export const StyledStepButton = styled.button(({ theme, $wrap }) => {
83
89
  return css `
84
- border: none;
85
- height: ${theme.components.button.height};
86
- overflow: hidden;
87
- text-overflow: ellipsis;
88
- white-space: nowrap;
89
- text-align: start;
90
- background: ${theme.base.palette['secondary-background']};
90
+ border: none;
91
+ height: ${theme.components.button.height};
92
+ overflow: hidden;
93
+ text-align: start;
94
+ background: ${theme.base.palette['secondary-background']};
91
95
 
92
- &:hover {
93
- cursor: pointer;
94
- }
96
+ ${$wrap
97
+ ? css `
98
+ height: fit-content;
99
+ line-height: 1.2;
100
+ min-height: ${theme.components.button.height};
101
+ word-break: break-word;
102
+ padding-block: calc(0.5 * ${theme.base.spacing});
103
+ padding-inline-end: calc(0.5 * ${theme.base.spacing});
104
+ `
105
+ : css `
106
+ white-space: nowrap;
107
+ text-overflow: ellipsis;
108
+ `}
95
109
 
96
- &:focus {
97
- outline: none;
98
- }
99
- `;
110
+ &:hover {
111
+ cursor: pointer;
112
+ }
113
+
114
+ &:focus {
115
+ outline: none;
116
+ }
117
+ `;
100
118
  });
101
119
  StyledStepButton.defaultProps = defaultThemeProp;
102
120
  export const StyledWarnIcon = styled(Icon)(({ theme }) => {
103
121
  return css `
104
122
  color: ${theme.base.palette.urgent};
105
- margin-inline: ${theme.base.spacing};
106
-
123
+ margin: calc(0.5 * ${theme.base.spacing});
124
+ height: 1.5rem;
125
+ flex-shrink: 0;
107
126
  &:hover {
108
127
  cursor: pointer;
109
128
  }
110
129
  `;
111
130
  });
112
131
  StyledWarnIcon.defaultProps = defaultThemeProp;
113
- const Step = ({ value, id, visual, actions, badge, error, categoryItem, item, stageItem, taskItem, onClick, ...restProps }) => {
132
+ const Step = ({ value, id, visual, actions, badge, error, wrap, categoryItem, item, stageItem, taskItem, onClick, dragRef, previewRef, ...restProps }) => {
114
133
  const t = useI18n();
115
- const { selectedItemId } = useContext(LifeCycleContext);
134
+ const { selectedItemId, dragDropConfig, dragEnabled } = useContext(LifeCycleContext);
116
135
  const [stepHasFocus, setStepHasFocus] = useState(false);
136
+ const [stepButtonEl, setStepButtonEl] = useElement();
137
+ const stepButtonDescriptionId = useUID();
138
+ const errorId = useUID();
139
+ // Deep copy of actions is required to provide consistent callback objects on actions
140
+ const actionsClone = [];
141
+ const stepTestID = generateDynamicTestId([
142
+ stageItem.label,
143
+ categoryItem.categoryLabel,
144
+ taskItem.label,
145
+ value
146
+ ]);
147
+ const testIds = useTestIds(stepTestID, getStepTestIds);
117
148
  // Need to check the value with statusProps
118
- const onActionItemClick = (actionId, e) => {
149
+ const onActionItemClick = (actionId, e, menuButtonEl) => {
119
150
  e.stopPropagation();
120
151
  const param = {
121
152
  task: taskItem,
@@ -125,13 +156,10 @@ const Step = ({ value, id, visual, actions, badge, error, categoryItem, item, st
125
156
  };
126
157
  actions?.forEach(actionItem => {
127
158
  if (actionItem.id === actionId) {
128
- actionItem.onClick(param, e);
159
+ actionItem.onClick(param, e, menuButtonEl);
129
160
  }
130
161
  });
131
162
  };
132
- // Deep copy of actions is required to provide consistent callback objects on actions
133
- const actionsClone = [];
134
- const buttonDescriptionId = useUID();
135
163
  if (actions) {
136
164
  actions.forEach(actionItem => {
137
165
  const actionCloneItem = {};
@@ -139,10 +167,7 @@ const Step = ({ value, id, visual, actions, badge, error, categoryItem, item, st
139
167
  actionCloneItem[key] = actionItem[key];
140
168
  });
141
169
  actionCloneItem.onClick = onActionItemClick;
142
- if (error)
143
- actionsClone.push(actionCloneItem);
144
- else
145
- actionsClone.push({ ...actionCloneItem, 'aria-describedby': buttonDescriptionId });
170
+ actionsClone.push(actionCloneItem);
146
171
  return actionItem;
147
172
  });
148
173
  }
@@ -158,12 +183,11 @@ const Step = ({ value, id, visual, actions, badge, error, categoryItem, item, st
158
183
  };
159
184
  onClick?.(actionParam, e);
160
185
  };
161
- const [stepLabelEl, setStepLabelEl] = useElement(null);
162
- return (_jsxs(Flex, { as: StyledStepWrapper, id: `${id}-stepWrapper`, container: { inline: true, alignItems: 'center' }, "aria-current": selectedItemId === id ? 'step' : undefined, hasFocus: stepHasFocus && selectedItemId !== id, selected: selectedItemId === id, children: [error && _jsx(StyledWarnIcon, { name: 'warn-solid' }), _jsxs(Flex, { as: StyledStep, container: { inline: true }, id: id, item: { grow: 1 }, onClick: onStepClick, children: [_jsxs(StyledStepType, { visual: visual, children: [visual.imgurl.length > 0 && (_jsx(Avatar, { name: visual.title, imageSrc: visual?.imgurl, shape: 'squircle', size: 'm' })), !visual.imgurl && _jsx(Icon, { name: visual.icon })] }), _jsxs(Flex, { as: StyledStepButtonWrapper, item: { grow: 1 }, container: { inline: true, alignItems: 'center', justify: 'between' }, id: buttonDescriptionId, children: [_jsxs(StyledStepButton, { ...restProps, onFocus: () => {
163
- setStepHasFocus(true);
164
- }, onBlur: () => {
165
- setStepHasFocus(false);
166
- }, "aria-label": t(error ? 'step_name_error' : 'step_name', [value]), ref: setStepLabelEl, children: [value, _jsx(Tooltip, { smart: true, target: stepLabelEl, showDelay: 'none', hideDelay: 'none', children: value })] }), badge?.type && (_jsx(Flex, { as: StyledStepBadge, container: { inline: true, alignItems: 'center' }, children: _jsx(Status, { variant: badge?.type || 'success', children: badge?.label }) }))] }), actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true })] })] }));
186
+ return (_jsx(Flex, { id: id, ref: previewRef, "data-testid": testIds.root, as: StyledStepWrapper, container: { inline: true, alignItems: 'center' }, "aria-current": selectedItemId === id ? 'step' : undefined, hasFocus: stepHasFocus && selectedItemId !== id, selected: selectedItemId === id, children: _jsxs(Flex, { as: StyledStep, container: { inline: true, alignItems: 'start' }, item: { grow: 1 }, onClick: onStepClick, children: [dragEnabled && dragDropConfig[item.alternate ? 'alternate-step' : 'step'].enabled && (_jsx(DragHandle, { itemId: id, ref: dragRef, onClick: e => e.stopPropagation() })), error && (_jsxs(_Fragment, { children: [_jsx(VisuallyHiddenText, { id: errorId, children: error }), _jsx(StyledWarnIcon, { name: 'warn-solid' })] })), _jsx(Flex, { as: StyledStepType, visual: visual, container: { inline: true, alignItems: 'center', justify: 'center' }, children: visual?.label && visual?.imgSrc ? (_jsx(Avatar, { name: visual.label, imageSrc: visual.imgSrc, shape: 'squircle', size: 'm' })) : (_jsx(IconTile, { name: visual?.name, category: visual?.category, label: visual?.label, inverted: visual?.inverted })) }), _jsxs(Flex, { as: StyledStepButtonWrapper, item: { grow: 1 }, container: { inline: true, alignItems: 'center', justify: 'between' }, id: stepButtonDescriptionId, children: [_jsx(StyledStepButton, { ...restProps, "$wrap": wrap, onFocus: () => {
187
+ setStepHasFocus(true);
188
+ }, onBlur: () => {
189
+ setStepHasFocus(false);
190
+ }, "aria-label": t('step_name', [value]), "aria-describedby": error ? errorId : '', ref: setStepButtonEl, children: value }), stepButtonEl && (_jsx(Tooltip, { target: stepButtonEl, smart: true, children: value })), badge?.type && (_jsx(Flex, { as: StyledStepBadge, container: { inline: true, alignItems: 'center' }, children: _jsx(Status, { variant: badge?.type || 'success', children: badge?.label }) }))] }), actionsClone && (_jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true, menuButtonProps: { onClick: e => e.stopPropagation() }, contextualLabel: t('step_name', [value]) }))] }) }));
167
191
  };
168
- export default Step;
192
+ export default withTestIds(Step, getStepTestIds);
169
193
  //# sourceMappingURL=Step.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,aAAa,EACd,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAWvC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AAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC1E,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,YAAG,KAAK,EAAE,KAAK,GAAU,GAC7D,CACR,IACI,EACN,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,SAAG,IAChE,IACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { useState, useContext } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n Icon,\n Status,\n Actions,\n useI18n,\n Avatar,\n useUID,\n Tooltip,\n useElement,\n readableColor\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\n\nimport { colorMap } from '../../utils';\nimport type { ColorName } from '../../utils';\n\nimport type {\n TaskItemProps,\n StepItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\n\ninterface StepComponentProps extends BaseProps, StepProps {\n /** Pass text for the step. */\n value: string;\n /** unique id of step */\n id: string;\n /** Determines the visual for icon, color and label to render.\n * This color is passed as a variant and accessible colors are used to display.\n * Icon and label are passed as normal string */\n visual: {\n imgurl: string;\n color: ColorName;\n icon: string;\n title: string;\n };\n /** Determines the variant and label for the badges */\n badge?: StepItemProps['status'];\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Data of the steps which can be used to send the full info back */\n item: StepItemProps;\n stageItem: StageItemProps;\n taskItem: TaskItemProps;\n categoryItem: CategoryItemProps;\n}\n\nexport const StyledStepType = styled.div<Pick<StepComponentProps, 'visual'>>(\n ({ visual, theme }) => {\n const bgColor = colorMap[visual.color];\n const contrastColor = readableColor(bgColor);\n return visual.imgurl\n ? css`\n height: 2rem;\n padding-inline-end: calc(0.25 * ${theme.base.spacing});\n `\n : css`\n background: ${bgColor};\n margin: calc(0.5 * ${theme.base.spacing});\n padding: 0 calc(0.5 * ${theme.base.spacing});\n color: ${contrastColor};\n text-align: center;\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n }\n);\n\nStyledStepType.defaultProps = defaultThemeProp;\n\nexport const StyledStepBadge = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n justify-content: flex-end;\n width: auto;\n max-width: calc(50% - ${theme.base.spacing});\n\n > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n `;\n});\n\nStyledStepBadge.defaultProps = defaultThemeProp;\n\nexport const StyledStepWrapper = styled.div<{\n hasFocus: boolean;\n selected: boolean;\n}>(({ hasFocus, theme, selected }) => {\n return css`\n width: 100%;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n ${selected &&\n css`\n &[aria-current='step'] {\n border-color: ${theme.base.palette.interactive};\n }\n `}\n `;\n});\n\nStyledStepWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.div(({ theme }) => {\n return css`\n background: ${theme.base.palette['secondary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nconst StyledStepButtonWrapper = styled.div<{ error: string }>(({ theme }) => {\n return css`\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n `;\n});\n\nStyledStepButtonWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStepButton = styled.button(({ theme }) => {\n return css`\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n background: ${theme.base.palette['secondary-background']};\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledStepButton.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Step: FunctionComponent<StepComponentProps & ForwardProps> = ({\n value,\n id,\n visual,\n actions,\n badge,\n error,\n categoryItem,\n item,\n stageItem,\n taskItem,\n onClick,\n ...restProps\n}: PropsWithoutRef<StepComponentProps>) => {\n const t = useI18n();\n const { selectedItemId } = useContext(LifeCycleContext);\n const [stepHasFocus, setStepHasFocus] = useState(false);\n\n // Need to check the value with statusProps\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n e.stopPropagation();\n const param: LifeCycleActionParam = {\n task: taskItem,\n stage: stageItem,\n step: item,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n const buttonDescriptionId: string = useUID();\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n if (error) actionsClone.push(actionCloneItem);\n else actionsClone.push({ ...actionCloneItem, 'aria-describedby': buttonDescriptionId });\n return actionItem;\n });\n }\n\n const onStepClick = (e: MouseEvent) => {\n e.stopPropagation();\n const actionParam: LifeCycleActionParam = {\n value,\n step: item,\n task: taskItem,\n category: categoryItem,\n stage: stageItem,\n type: 'Step'\n };\n onClick?.(actionParam, e);\n };\n\n const [stepLabelEl, setStepLabelEl] = useElement<HTMLSpanElement>(null);\n\n return (\n <Flex\n as={StyledStepWrapper}\n id={`${id}-stepWrapper`}\n container={{ inline: true, alignItems: 'center' }}\n aria-current={selectedItemId === id ? 'step' : undefined}\n hasFocus={stepHasFocus && selectedItemId !== id}\n selected={selectedItemId === id}\n >\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n as={StyledStep}\n container={{ inline: true }}\n id={id}\n item={{ grow: 1 }}\n onClick={onStepClick}\n >\n <StyledStepType visual={visual}>\n {visual.imgurl.length > 0 && (\n <Avatar name={visual.title} imageSrc={visual?.imgurl} shape='squircle' size='m' />\n )}\n {!visual.imgurl && <Icon name={visual.icon} />}\n </StyledStepType>\n\n <Flex\n as={StyledStepButtonWrapper}\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center', justify: 'between' }}\n id={buttonDescriptionId}\n >\n <StyledStepButton\n {...restProps}\n onFocus={() => {\n setStepHasFocus(true);\n }}\n onBlur={() => {\n setStepHasFocus(false);\n }}\n aria-label={t(error ? 'step_name_error' : 'step_name', [value])}\n ref={setStepLabelEl}\n >\n {value}\n <Tooltip smart target={stepLabelEl} showDelay='none' hideDelay='none'>\n {value}\n </Tooltip>\n </StyledStepButton>\n {badge?.type && (\n <Flex as={StyledStepBadge} container={{ inline: true, alignItems: 'center' }}>\n <Status variant={badge?.type || 'success'}>{badge?.label}</Status>\n </Flex>\n )}\n </Flex>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n </Flex>\n );\n};\n\nexport default Step;\n"]}
1
+ {"version":3,"file":"Step.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EAC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OAAO,IAAC,MAAM,EAAE,YAAY,EAAE,KAAK,kBACjC,KAAK,GACE,CACX,EACA,KAAK,EAAE,IAAI,IAAI,CACd,KAAC,IAAI,IAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC1E,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,YAAG,KAAK,EAAE,KAAK,GAAU,GAC7D,CACR,IACI,EACN,YAAY,IAAI,CACf,KAAC,OAAO,IACN,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,CAAC,EACT,QAAQ,QACR,eAAe,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,EACtD,eAAe,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,GACxC,CACH,IACI,GACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { useState, useContext } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, MouseEvent, RefCallback } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n Icon,\n Status,\n Actions,\n useI18n,\n Avatar,\n useUID,\n useTestIds,\n VisuallyHiddenText,\n withTestIds,\n Tooltip,\n useElement\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\nimport { DragHandle, StyledDragHandle } from '@pega/cosmos-react-dnd';\n\nimport IconTile from '../IconTile';\nimport type { IconTileProps } from '../IconTile/IconTile.types';\n\nimport { generateDynamicTestId } from './utils';\nimport type {\n TaskItemProps,\n StepItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\nimport { getStepTestIds } from './LifeCycle.test-ids';\n\nconst borderRadius = 'border-radius';\ninterface CategoryLabelProp {\n categoryLabel?: string;\n}\nexport interface VisualStepItemProps extends Omit<IconTileProps, 'size'> {\n imgSrc: string;\n}\nexport interface StepComponentProps extends BaseProps, StepProps {\n /** Pass text for the step. */\n value: string;\n /** unique id of step */\n id: string;\n /** Determines the visual for icon, color and label to render.\n * This color is passed as a variant and accessible colors are used to display.\n * Icon and label are passed as normal string */\n visual: VisualStepItemProps;\n /** Determines the variant and label for the badges */\n badge?: StepItemProps['status'];\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Data of the steps which can be used to send the full info back */\n item: StepItemProps;\n stageItem: StageItemProps;\n taskItem: TaskItemProps;\n categoryItem: CategoryItemProps & CategoryLabelProp;\n dragRef?: RefCallback<HTMLElement>;\n previewRef?: RefCallback<HTMLElement>;\n}\n\nexport const StyledStepType = styled.div<Pick<StepComponentProps, 'visual'>>(\n ({ visual, theme }) => {\n return visual?.imgSrc\n ? css`\n height: 2rem;\n padding-inline-end: calc(0.25 * ${theme.base.spacing});\n `\n : css`\n margin: calc(0.5 * ${theme.base.spacing});\n border-radius: calc(0.25 * ${theme.base[borderRadius]});\n `;\n }\n);\n\nStyledStepType.defaultProps = defaultThemeProp;\n\nexport const StyledStepBadge = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n justify-content: flex-end;\n width: auto;\n max-width: calc(50% - ${theme.base.spacing});\n\n > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n `;\n});\n\nStyledStepBadge.defaultProps = defaultThemeProp;\n\nexport const StyledStepWrapper = styled.li<{\n hasFocus: boolean;\n selected: boolean;\n}>(({ hasFocus, theme, selected }) => {\n return css`\n width: 100%;\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base[borderRadius]});\n\n &:not(:last-of-type) {\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n }\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n ${selected &&\n css`\n &[aria-current='step'] {\n border-color: ${theme.base.palette.interactive};\n }\n `}\n `;\n});\n\nStyledStepWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.div(({ theme }) => {\n return css`\n background: ${theme.base.palette['secondary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base[borderRadius]});\n\n &:hover {\n cursor: pointer;\n }\n\n ${StyledDragHandle} {\n margin-block: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nconst StyledStepButtonWrapper = styled.div<{ error: string }>(({ theme }) => {\n return css`\n border-radius: calc(0.5 * ${theme.base[borderRadius]});\n margin-inline: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledStepButtonWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStepButton = styled.button<{ $wrap?: StepComponentProps['wrap'] }>(\n ({ theme, $wrap }) => {\n return css`\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-align: start;\n background: ${theme.base.palette['secondary-background']};\n\n ${$wrap\n ? css`\n height: fit-content;\n line-height: 1.2;\n min-height: ${theme.components.button.height};\n word-break: break-word;\n padding-block: calc(0.5 * ${theme.base.spacing});\n padding-inline-end: calc(0.5 * ${theme.base.spacing});\n `\n : css`\n white-space: nowrap;\n text-overflow: ellipsis;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n }\n);\n\nStyledStepButton.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin: calc(0.5 * ${theme.base.spacing});\n height: 1.5rem;\n flex-shrink: 0;\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Step: FunctionComponent<StepComponentProps & ForwardProps> = ({\n value,\n id,\n visual,\n actions,\n badge,\n error,\n wrap,\n categoryItem,\n item,\n stageItem,\n taskItem,\n onClick,\n dragRef,\n previewRef,\n ...restProps\n}: PropsWithoutRef<StepComponentProps>) => {\n const t = useI18n();\n const { selectedItemId, dragDropConfig, dragEnabled } = useContext(LifeCycleContext);\n const [stepHasFocus, setStepHasFocus] = useState(false);\n const [stepButtonEl, setStepButtonEl] = useElement();\n const stepButtonDescriptionId: string = useUID();\n const errorId: string = useUID();\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n const stepTestID = generateDynamicTestId([\n stageItem.label,\n categoryItem.categoryLabel,\n taskItem.label,\n value\n ]);\n const testIds = useTestIds(stepTestID, getStepTestIds);\n\n // Need to check the value with statusProps\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>,\n menuButtonEl?: HTMLButtonElement\n ) => {\n e.stopPropagation();\n const param: LifeCycleActionParam = {\n task: taskItem,\n stage: stageItem,\n step: item,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e, menuButtonEl);\n }\n });\n };\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n const onStepClick = (e: MouseEvent) => {\n e.stopPropagation();\n const actionParam: LifeCycleActionParam = {\n value,\n step: item,\n task: taskItem,\n category: categoryItem,\n stage: stageItem,\n type: 'Step'\n };\n onClick?.(actionParam, e);\n };\n\n return (\n <Flex\n id={id}\n ref={previewRef}\n data-testid={testIds.root}\n as={StyledStepWrapper}\n container={{ inline: true, alignItems: 'center' }}\n aria-current={selectedItemId === id ? 'step' : undefined}\n hasFocus={stepHasFocus && selectedItemId !== id}\n selected={selectedItemId === id}\n >\n <Flex\n as={StyledStep}\n container={{ inline: true, alignItems: 'start' }}\n item={{ grow: 1 }}\n onClick={onStepClick}\n >\n {dragEnabled && dragDropConfig[item.alternate ? 'alternate-step' : 'step'].enabled && (\n <DragHandle itemId={id} ref={dragRef} onClick={e => e.stopPropagation()} />\n )}\n {error && (\n <>\n <VisuallyHiddenText id={errorId}>{error}</VisuallyHiddenText>\n <StyledWarnIcon name='warn-solid' />\n </>\n )}\n <Flex\n as={StyledStepType}\n visual={visual}\n container={{ inline: true, alignItems: 'center', justify: 'center' }}\n >\n {visual?.label && visual?.imgSrc ? (\n <Avatar name={visual.label} imageSrc={visual.imgSrc} shape='squircle' size='m' />\n ) : (\n <IconTile\n name={visual?.name}\n category={visual?.category}\n label={visual?.label}\n inverted={visual?.inverted}\n />\n )}\n </Flex>\n\n <Flex\n as={StyledStepButtonWrapper}\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center', justify: 'between' }}\n id={stepButtonDescriptionId}\n >\n <StyledStepButton\n {...restProps}\n $wrap={wrap}\n onFocus={() => {\n setStepHasFocus(true);\n }}\n onBlur={() => {\n setStepHasFocus(false);\n }}\n aria-label={t('step_name', [value])}\n aria-describedby={error ? errorId : ''}\n ref={setStepButtonEl}\n >\n {value}\n </StyledStepButton>\n {stepButtonEl && (\n <Tooltip target={stepButtonEl} smart>\n {value}\n </Tooltip>\n )}\n {badge?.type && (\n <Flex as={StyledStepBadge} container={{ inline: true, alignItems: 'center' }}>\n <Status variant={badge?.type || 'success'}>{badge?.label}</Status>\n </Flex>\n )}\n </Flex>\n {actionsClone && (\n <Actions\n items={actionsClone}\n menuAt={2}\n iconOnly\n menuButtonProps={{ onClick: e => e.stopPropagation() }}\n contextualLabel={t('step_name', [value])}\n />\n )}\n </Flex>\n </Flex>\n );\n};\n\nexport default withTestIds(Step, getStepTestIds);\n"]}
@@ -1,12 +1,15 @@
1
1
  import type { FunctionComponent } from 'react';
2
2
  import type { BaseProps, ForwardProps } from '@pega/cosmos-react-core';
3
3
  import type { TaskItemProps, StageItemProps, CategoryItemProps, StepProps, TaskProps } from './LifeCycle.types';
4
- interface TaskComponentProps extends BaseProps, TaskProps {
4
+ interface CategoryLabelProp {
5
+ categoryLabel?: string;
6
+ }
7
+ export interface TaskComponentProps extends BaseProps, TaskProps {
5
8
  /** Pass text for the task. */
6
9
  value: string;
7
10
  /** support for an Avatar, Icon, or other supporting visual. */
8
11
  visual: {
9
- imgurl: string;
12
+ imgSrc: string;
10
13
  };
11
14
  /** Pass task data */
12
15
  item: TaskItemProps;
@@ -17,18 +20,26 @@ interface TaskComponentProps extends BaseProps, TaskProps {
17
20
  /** Stage data to pass it as callback */
18
21
  stageItem: StageItemProps;
19
22
  /** Category data to pass it as callback */
20
- categoryItem: CategoryItemProps;
23
+ categoryItem: CategoryItemProps & CategoryLabelProp;
21
24
  /** unique id of task */
22
25
  id: string;
23
26
  }
24
27
  export declare const StyledTaskList: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
25
28
  export declare const StyledCardHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
26
- export declare const StyledCardContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
27
- export declare const StyledTaskButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
29
+ export declare const StyledAddCustomStepButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {}, never>;
30
+ export declare const StyledAddStepButton: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").ButtonProps>, import("styled-components").DefaultTheme, {}, never>;
31
+ export declare const StyledCardContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
32
+ hasSteps?: boolean;
33
+ }, never>;
34
+ export declare const StyledTaskButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, Pick<TaskComponentProps, "visual">, never>;
28
35
  export declare const StyledTask: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, {
29
36
  hasFocus: boolean;
37
+ hasSteps?: boolean;
38
+ dragEnabled?: boolean;
30
39
  }, never>;
31
40
  export declare const StyledWarnIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {}, never>;
32
- declare const Task: FunctionComponent<TaskComponentProps & ForwardProps>;
33
- export default Task;
41
+ declare const _default: FunctionComponent<TaskComponentProps & ForwardProps> & {
42
+ getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly string[]>;
43
+ };
44
+ export default _default;
34
45
  //# sourceMappingURL=Task.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAe9E,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAU,MAAM,yBAAyB,CAAC;AAM/E,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EAEd,iBAAiB,EAEjB,SAAS,EACT,SAAS,EACV,MAAM,mBAAmB,CAAC;AAG3B,UAAU,kBAAmB,SAAQ,SAAS,EAAE,SAAS;IACvD,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,qBAAqB;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,wCAAwC;IACxC,SAAS,EAAE,cAAc,CAAC;IAC1B,2CAA2C;IAC3C,YAAY,EAAE,iBAAiB,C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