@pega/cosmos-react-build 8.8.0 → 9.0.0-build.10.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 (316) hide show
  1. package/lib/components/AuthoringPanel/AuthoringPanel.d.ts +7 -0
  2. package/lib/components/AuthoringPanel/AuthoringPanel.d.ts.map +1 -0
  3. package/lib/components/AuthoringPanel/AuthoringPanel.js +49 -0
  4. package/lib/components/AuthoringPanel/AuthoringPanel.js.map +1 -0
  5. package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts +18 -0
  6. package/lib/components/AuthoringPanel/AuthoringPanel.styles.d.ts.map +1 -0
  7. package/lib/components/AuthoringPanel/AuthoringPanel.styles.js +133 -0
  8. package/lib/components/AuthoringPanel/AuthoringPanel.styles.js.map +1 -0
  9. package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.d.ts +2 -0
  10. package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.d.ts.map +1 -0
  11. package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.js +16 -0
  12. package/lib/components/AuthoringPanel/AuthoringPanel.test-ids.js.map +1 -0
  13. package/lib/components/AuthoringPanel/AuthoringPanel.types.d.ts +81 -0
  14. package/lib/components/AuthoringPanel/AuthoringPanel.types.d.ts.map +1 -0
  15. package/lib/components/AuthoringPanel/AuthoringPanel.types.js +2 -0
  16. package/lib/components/AuthoringPanel/AuthoringPanel.types.js.map +1 -0
  17. package/lib/components/AuthoringPanel/AuthoringPanelHeader.d.ts +6 -0
  18. package/lib/components/AuthoringPanel/AuthoringPanelHeader.d.ts.map +1 -0
  19. package/lib/components/AuthoringPanel/AuthoringPanelHeader.js +41 -0
  20. package/lib/components/AuthoringPanel/AuthoringPanelHeader.js.map +1 -0
  21. package/lib/components/AuthoringPanel/index.d.ts +4 -0
  22. package/lib/components/AuthoringPanel/index.d.ts.map +1 -0
  23. package/lib/components/AuthoringPanel/index.js +3 -0
  24. package/lib/components/AuthoringPanel/index.js.map +1 -0
  25. package/lib/components/Automation/Automation.d.ts +7 -0
  26. package/lib/components/Automation/Automation.d.ts.map +1 -0
  27. package/lib/components/Automation/Automation.js +113 -0
  28. package/lib/components/Automation/Automation.js.map +1 -0
  29. package/lib/components/Automation/Automation.styles.d.ts +12 -0
  30. package/lib/components/Automation/Automation.styles.d.ts.map +1 -0
  31. package/lib/components/Automation/Automation.styles.js +68 -0
  32. package/lib/components/Automation/Automation.styles.js.map +1 -0
  33. package/lib/components/Automation/Automation.test-ids.d.ts +3 -0
  34. package/lib/components/Automation/Automation.test-ids.d.ts.map +1 -0
  35. package/lib/components/Automation/Automation.test-ids.js +21 -0
  36. package/lib/components/Automation/Automation.test-ids.js.map +1 -0
  37. package/lib/components/Automation/Automation.types.d.ts +95 -0
  38. package/lib/components/Automation/Automation.types.d.ts.map +1 -0
  39. package/lib/components/Automation/Automation.types.js +18 -0
  40. package/lib/components/Automation/Automation.types.js.map +1 -0
  41. package/lib/components/Automation/Automation.utils.d.ts +109 -0
  42. package/lib/components/Automation/Automation.utils.d.ts.map +1 -0
  43. package/lib/components/Automation/Automation.utils.js +208 -0
  44. package/lib/components/Automation/Automation.utils.js.map +1 -0
  45. package/lib/components/Automation/AutomationContext.d.ts +4 -0
  46. package/lib/components/Automation/AutomationContext.d.ts.map +1 -0
  47. package/lib/components/Automation/AutomationContext.js +9 -0
  48. package/lib/components/Automation/AutomationContext.js.map +1 -0
  49. package/lib/components/Automation/RuleStep.d.ts +7 -0
  50. package/lib/components/Automation/RuleStep.d.ts.map +1 -0
  51. package/lib/components/Automation/RuleStep.js +151 -0
  52. package/lib/components/Automation/RuleStep.js.map +1 -0
  53. package/lib/components/Automation/index.d.ts +5 -0
  54. package/lib/components/Automation/index.d.ts.map +1 -0
  55. package/lib/components/Automation/index.js +4 -0
  56. package/lib/components/Automation/index.js.map +1 -0
  57. package/lib/components/DynamicInput/BooleanControl.d.ts +2 -2
  58. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
  59. package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
  60. package/lib/components/DynamicInput/ConstantControl.d.ts +61 -0
  61. package/lib/components/DynamicInput/ConstantControl.d.ts.map +1 -0
  62. package/lib/components/DynamicInput/ConstantControl.js +58 -0
  63. package/lib/components/DynamicInput/ConstantControl.js.map +1 -0
  64. package/lib/components/DynamicInput/DynamicInput.d.ts +2 -2
  65. package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
  66. package/lib/components/DynamicInput/DynamicInput.js +13 -63
  67. package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
  68. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +0 -1
  69. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
  70. package/lib/components/DynamicInput/DynamicInput.styles.js +48 -41
  71. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
  72. package/lib/components/DynamicInput/DynamicInput.types.d.ts +26 -81
  73. package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
  74. package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
  75. package/lib/components/DynamicInput/index.d.ts +2 -0
  76. package/lib/components/DynamicInput/index.d.ts.map +1 -1
  77. package/lib/components/DynamicInput/index.js +1 -0
  78. package/lib/components/DynamicInput/index.js.map +1 -1
  79. package/lib/components/DynamicInput/utils.d.ts.map +1 -1
  80. package/lib/components/DynamicInput/utils.js +3 -2
  81. package/lib/components/DynamicInput/utils.js.map +1 -1
  82. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.d.ts +34 -0
  83. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.d.ts.map +1 -0
  84. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.js +55 -0
  85. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.js.map +1 -0
  86. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.d.ts +2 -0
  87. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.d.ts.map +1 -0
  88. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.js +10 -0
  89. package/lib/components/EmptyRuleTemplate/EmptyRuleTemplate.test-ids.js.map +1 -0
  90. package/lib/components/EmptyRuleTemplate/index.d.ts +3 -0
  91. package/lib/components/EmptyRuleTemplate/index.d.ts.map +1 -0
  92. package/lib/components/EmptyRuleTemplate/index.js +2 -0
  93. package/lib/components/EmptyRuleTemplate/index.js.map +1 -0
  94. package/lib/components/Expression/Expression.d.ts.map +1 -1
  95. package/lib/components/Expression/Expression.js +8 -7
  96. package/lib/components/Expression/Expression.js.map +1 -1
  97. package/lib/components/Expression/Expression.styles.d.ts +5 -1
  98. package/lib/components/Expression/Expression.styles.d.ts.map +1 -1
  99. package/lib/components/Expression/Expression.styles.js +15 -3
  100. package/lib/components/Expression/Expression.styles.js.map +1 -1
  101. package/lib/components/Expression/Expression.test-ids.d.ts +1 -0
  102. package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -1
  103. package/lib/components/Expression/Expression.test-ids.js +6 -0
  104. package/lib/components/Expression/Expression.test-ids.js.map +1 -1
  105. package/lib/components/Expression/ExpressionBuilderModal.d.ts +6 -0
  106. package/lib/components/Expression/ExpressionBuilderModal.d.ts.map +1 -0
  107. package/lib/components/Expression/ExpressionBuilderModal.js +53 -0
  108. package/lib/components/Expression/ExpressionBuilderModal.js.map +1 -0
  109. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  110. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +1 -0
  111. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  112. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  113. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +3 -2
  114. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  115. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +4 -2
  116. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  117. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +66 -25
  118. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  119. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +18 -2
  120. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  121. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +80 -13
  122. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -1
  123. package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.d.ts +5 -0
  124. package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.d.ts.map +1 -0
  125. package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.js +22 -0
  126. package/lib/components/ExpressionBuilder/ExpressionBuilder.test-ids.js.map +1 -0
  127. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +33 -5
  128. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  129. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  130. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +4 -2
  131. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
  132. package/lib/components/ExpressionBuilder/ExpressionDetails.js +6 -4
  133. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
  134. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +4 -2
  135. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -1
  136. package/lib/components/ExpressionBuilder/ExpressionItem.js +8 -6
  137. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -1
  138. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +4 -2
  139. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
  140. package/lib/components/ExpressionBuilder/ExpressionList.js +17 -5
  141. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
  142. package/lib/components/ExpressionBuilder/index.d.ts +1 -0
  143. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  144. package/lib/components/ExpressionBuilder/index.js +1 -0
  145. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  146. package/lib/components/FieldReference/FieldReference.types.d.ts +16 -2
  147. package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
  148. package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
  149. package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
  150. package/lib/components/FieldReference/FieldReferenceInput.js +5 -5
  151. package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
  152. package/lib/components/FieldReference/helpers.d.ts +7 -1
  153. package/lib/components/FieldReference/helpers.d.ts.map +1 -1
  154. package/lib/components/FieldReference/helpers.js +31 -1
  155. package/lib/components/FieldReference/helpers.js.map +1 -1
  156. package/lib/components/FieldReference/index.d.ts +2 -2
  157. package/lib/components/FieldReference/index.d.ts.map +1 -1
  158. package/lib/components/FieldReference/index.js +1 -1
  159. package/lib/components/FieldReference/index.js.map +1 -1
  160. package/lib/components/IconTile/iconUtils.d.ts +2 -1
  161. package/lib/components/IconTile/iconUtils.d.ts.map +1 -1
  162. package/lib/components/IconTile/iconUtils.js +94 -1
  163. package/lib/components/IconTile/iconUtils.js.map +1 -1
  164. package/lib/components/IconTile/index.d.ts +1 -0
  165. package/lib/components/IconTile/index.d.ts.map +1 -1
  166. package/lib/components/IconTile/index.js +1 -0
  167. package/lib/components/IconTile/index.js.map +1 -1
  168. package/lib/components/LifeCycle/Category.d.ts +0 -1
  169. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  170. package/lib/components/LifeCycle/Category.js +16 -56
  171. package/lib/components/LifeCycle/Category.js.map +1 -1
  172. package/lib/components/LifeCycle/LifeCycle.js +2 -2
  173. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  174. package/lib/components/LifeCycle/LifeCycle.types.d.ts +37 -2
  175. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  176. package/lib/components/LifeCycle/LifeCycle.types.js +9 -9
  177. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  178. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -1
  179. package/lib/components/LifeCycle/LifeCycleDragDropList.js +25 -3
  180. package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -1
  181. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  182. package/lib/components/LifeCycle/Stage.js +20 -11
  183. package/lib/components/LifeCycle/Stage.js.map +1 -1
  184. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  185. package/lib/components/LifeCycle/Step.js +1 -0
  186. package/lib/components/LifeCycle/Step.js.map +1 -1
  187. package/lib/components/LifeCycle/Task.d.ts +7 -1
  188. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  189. package/lib/components/LifeCycle/Task.js +19 -10
  190. package/lib/components/LifeCycle/Task.js.map +1 -1
  191. package/lib/components/LifeCycle/TaskGroup.d.ts +23 -0
  192. package/lib/components/LifeCycle/TaskGroup.d.ts.map +1 -0
  193. package/lib/components/LifeCycle/TaskGroup.js +92 -0
  194. package/lib/components/LifeCycle/TaskGroup.js.map +1 -0
  195. package/lib/components/LifeCycle/index.d.ts +1 -1
  196. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  197. package/lib/components/LifeCycle/index.js +1 -1
  198. package/lib/components/LifeCycle/index.js.map +1 -1
  199. package/lib/components/LifeCycle/utils.d.ts +6 -1
  200. package/lib/components/LifeCycle/utils.d.ts.map +1 -1
  201. package/lib/components/LifeCycle/utils.js +129 -0
  202. package/lib/components/LifeCycle/utils.js.map +1 -1
  203. package/lib/components/ObjectSelect/InputTree/InputTree.d.ts +21 -0
  204. package/lib/components/ObjectSelect/InputTree/InputTree.d.ts.map +1 -0
  205. package/lib/components/ObjectSelect/InputTree/InputTree.js +20 -0
  206. package/lib/components/ObjectSelect/InputTree/InputTree.js.map +1 -0
  207. package/lib/components/ObjectSelect/InputTree/InputTree.styles.d.ts +10 -0
  208. package/lib/components/ObjectSelect/InputTree/InputTree.styles.d.ts.map +1 -0
  209. package/lib/components/ObjectSelect/InputTree/InputTree.styles.js +82 -0
  210. package/lib/components/ObjectSelect/InputTree/InputTree.styles.js.map +1 -0
  211. package/lib/components/ObjectSelect/InputTree/index.d.ts +3 -0
  212. package/lib/components/ObjectSelect/InputTree/index.d.ts.map +1 -0
  213. package/lib/components/ObjectSelect/InputTree/index.js +2 -0
  214. package/lib/components/ObjectSelect/InputTree/index.js.map +1 -0
  215. package/lib/components/ObjectSelect/ObjectPicker.d.ts +11 -5
  216. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  217. package/lib/components/ObjectSelect/ObjectPicker.js +24 -15
  218. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  219. package/lib/components/ObjectSelect/ObjectSelect.d.ts +2 -29
  220. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -1
  221. package/lib/components/ObjectSelect/ObjectSelect.js +80 -23
  222. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
  223. package/lib/components/ObjectSelect/ObjectSelect.types.d.ts +53 -0
  224. package/lib/components/ObjectSelect/ObjectSelect.types.d.ts.map +1 -0
  225. package/lib/components/ObjectSelect/ObjectSelect.types.js +2 -0
  226. package/lib/components/ObjectSelect/ObjectSelect.types.js.map +1 -0
  227. package/lib/components/ObjectSelect/index.d.ts +1 -1
  228. package/lib/components/ObjectSelect/index.d.ts.map +1 -1
  229. package/lib/components/ObjectSelect/index.js.map +1 -1
  230. package/lib/components/ObjectSelect/useCreateModal.d.ts +6 -2
  231. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
  232. package/lib/components/ObjectSelect/useCreateModal.js +7 -4
  233. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
  234. package/lib/components/PageBanner/PageBanner.d.ts +6 -4
  235. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
  236. package/lib/components/PageBanner/PageBanner.js +10 -9
  237. package/lib/components/PageBanner/PageBanner.js.map +1 -1
  238. package/lib/components/PageBanner/PageBanner.test-ids.d.ts +2 -0
  239. package/lib/components/PageBanner/PageBanner.test-ids.d.ts.map +1 -0
  240. package/lib/components/PageBanner/PageBanner.test-ids.js +9 -0
  241. package/lib/components/PageBanner/PageBanner.test-ids.js.map +1 -0
  242. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.d.ts +12 -0
  243. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.d.ts.map +1 -0
  244. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.js +158 -0
  245. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.js.map +1 -0
  246. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.d.ts +5 -0
  247. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.d.ts.map +1 -0
  248. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.js +17 -0
  249. package/lib/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.js.map +1 -0
  250. package/lib/components/PageTemplates/GalleryPage.d.ts +14 -4
  251. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  252. package/lib/components/PageTemplates/GalleryPage.js +57 -12
  253. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  254. package/lib/components/PageTemplates/HeaderActionButtons.d.ts +5 -0
  255. package/lib/components/PageTemplates/HeaderActionButtons.d.ts.map +1 -0
  256. package/lib/components/PageTemplates/HeaderActionButtons.js +14 -0
  257. package/lib/components/PageTemplates/HeaderActionButtons.js.map +1 -0
  258. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.d.ts +8 -0
  259. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.d.ts.map +1 -0
  260. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.js +23 -0
  261. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.js.map +1 -0
  262. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.d.ts +5 -0
  263. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.d.ts.map +1 -0
  264. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.js +10 -0
  265. package/lib/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.js.map +1 -0
  266. package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.d.ts +5 -0
  267. package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.d.ts.map +1 -0
  268. package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.js +10 -0
  269. package/lib/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.js.map +1 -0
  270. package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.d.ts +21 -0
  271. package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.d.ts.map +1 -0
  272. package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.js +22 -0
  273. package/lib/components/PageTemplates/OverviewPageTemplate/PageBanner.js.map +1 -0
  274. package/lib/components/PageTemplates/PageTemplate.styles.d.ts +16 -0
  275. package/lib/components/PageTemplates/PageTemplate.styles.d.ts.map +1 -0
  276. package/lib/components/PageTemplates/PageTemplate.styles.js +167 -0
  277. package/lib/components/PageTemplates/PageTemplate.styles.js.map +1 -0
  278. package/lib/components/PageTemplates/PageTemplate.types.d.ts +114 -0
  279. package/lib/components/PageTemplates/PageTemplate.types.d.ts.map +1 -0
  280. package/lib/components/PageTemplates/PageTemplate.types.js +2 -0
  281. package/lib/components/PageTemplates/PageTemplate.types.js.map +1 -0
  282. package/lib/components/PageTemplates/PageTemplates.d.ts +16 -12
  283. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  284. package/lib/components/PageTemplates/PageTemplates.js +12 -12
  285. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  286. package/lib/components/PageTemplates/PageTemplates.test-ids.d.ts +4 -0
  287. package/lib/components/PageTemplates/PageTemplates.test-ids.d.ts.map +1 -0
  288. package/lib/components/PageTemplates/PageTemplates.test-ids.js +25 -0
  289. package/lib/components/PageTemplates/PageTemplates.test-ids.js.map +1 -0
  290. package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
  291. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
  292. package/lib/components/PageTemplates/ShowcasePage.js +5 -6
  293. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
  294. package/lib/components/PageTemplates/index.d.ts +6 -1
  295. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  296. package/lib/components/PageTemplates/index.js +5 -1
  297. package/lib/components/PageTemplates/index.js.map +1 -1
  298. package/lib/components/RulePicker/RulePicker.d.ts +4 -0
  299. package/lib/components/RulePicker/RulePicker.d.ts.map +1 -0
  300. package/lib/components/RulePicker/RulePicker.js +81 -0
  301. package/lib/components/RulePicker/RulePicker.js.map +1 -0
  302. package/lib/index.d.ts +5 -1
  303. package/lib/index.d.ts.map +1 -1
  304. package/lib/index.js +5 -1
  305. package/lib/index.js.map +1 -1
  306. package/lib/utils/typeIconMapping.js +1 -1
  307. package/lib/utils/typeIconMapping.js.map +1 -1
  308. package/package.json +4 -4
  309. package/lib/utils/index.d.ts +0 -2
  310. package/lib/utils/index.d.ts.map +0 -1
  311. package/lib/utils/index.js +0 -2
  312. package/lib/utils/index.js.map +0 -1
  313. package/lib/utils/utils.d.ts +0 -14
  314. package/lib/utils/utils.d.ts.map +0 -1
  315. package/lib/utils/utils.js +0 -13
  316. package/lib/utils/utils.js.map +0 -1
@@ -0,0 +1,158 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState, useLayoutEffect, useCallback } from 'react';
3
+ import { Text, Flex, useTestIds, withTestIds, useElement, Tooltip, Button, ShowMoreLess, StyledStackedFieldValue, StyledLabel, StyledFieldName, FieldValueList, AdditionalInfo, useI18n, useChToPxConversionFactor } from '@pega/cosmos-react-core';
4
+ import IconTile from '../../IconTile';
5
+ import { getPageHeaderTestIds } from '../PageTemplates.test-ids';
6
+ import HeaderActionButtons from '../HeaderActionButtons';
7
+ import { StyledText, StyledDescription, StyledPrimaryMetaButton, StyledHeader, StyledTitleContainer } from '../PageTemplate.styles';
8
+ export const PrimaryHeaderText = ({ type: { href, onClick, name }, testId }) => {
9
+ if (href || onClick) {
10
+ return (_jsx(Button, { variant: 'link', href: href, onClick: onClick, "data-testid": testId, children: name }));
11
+ }
12
+ return _jsx(StyledText, { variant: 'secondary', children: name });
13
+ };
14
+ const ConstructPageHeader = ({ testId, title, primaryAction, additionalActions = [], metadata = { additional: [] }, visual, type, description, secondaryAction, progress }) => {
15
+ // States
16
+ const [countOfSecondaryMetaToShow, setCountOfSecondaryMetaToShow] = useState(metadata?.secondary?.length ?? 0);
17
+ const [countOfPrimaryMetaToShow, setCountOfPrimaryMetaToShow] = useState(metadata.primary?.length ?? 0);
18
+ const [showSecondaryAction, setShowSecondaryAction] = useState(true);
19
+ const [pageTitleEl, setPageTitleEl] = useElement();
20
+ const [primaryMetaEl, setPrimaryMetaEl] = useElement();
21
+ // Hooks
22
+ const chToPxConversionFactor = useChToPxConversionFactor();
23
+ const testIds = useTestIds(testId, getPageHeaderTestIds);
24
+ const t = useI18n();
25
+ // Refs
26
+ const headerRef = useRef(null);
27
+ const pageTitleContainerRef = useRef(null);
28
+ const actionsContainerRef = useRef(null);
29
+ const secondaryMetaDataRef = useRef(null);
30
+ const primaryMetaDataRef = useRef(null);
31
+ const observerRef = useRef();
32
+ const primaryMetaLengths = useRef([]);
33
+ const secondaryMetaLengths = useRef([]);
34
+ // Memos
35
+ const secondaryActionWidth = useMemo(() => (secondaryAction ? secondaryAction.primary.length * chToPxConversionFactor + 44 : 0), [secondaryAction]);
36
+ // Page actions component
37
+ const actions = useMemo(() => {
38
+ const additionalActionsData = [...additionalActions];
39
+ const secondaryActionsData = showSecondaryAction || additionalActionsData.length === 0 ? secondaryAction : undefined;
40
+ if (additionalActionsData.length > 0 && secondaryAction && !showSecondaryAction) {
41
+ additionalActionsData.unshift(secondaryAction);
42
+ }
43
+ return (_jsx(HeaderActionButtons, { additionalActions: additionalActionsData, primaryAction: primaryAction, secondaryAction: secondaryActionsData, testIds: testIds, progress: progress, animatePrimaryButton: true }));
44
+ }, [showSecondaryAction, primaryAction, secondaryAction, additionalActions]);
45
+ // CB to be run on resize observer
46
+ const showOrHideElements = useCallback(() => {
47
+ // Logic to show or hide primary metadata
48
+ const headerWidth = headerRef.current?.offsetWidth ?? 0;
49
+ const titleWidth = pageTitleContainerRef.current?.offsetWidth ?? 0;
50
+ let actionsWidth = actionsContainerRef.current?.offsetWidth ?? 0;
51
+ let newCountOfPrimaryMetaToShow = countOfPrimaryMetaToShow;
52
+ let newCountOfSecondaryMetaToShow = countOfSecondaryMetaToShow;
53
+ if (primaryMetaLengths.current.length > 0 && primaryMetaDataRef.current) {
54
+ if (countOfSecondaryMetaToShow === 0) {
55
+ const availableSpace = headerWidth - titleWidth - actionsWidth - 48;
56
+ const closestIndex = primaryMetaLengths.current.findIndex(i => i > availableSpace);
57
+ newCountOfPrimaryMetaToShow =
58
+ closestIndex === -1 ? primaryMetaLengths.current.length : closestIndex;
59
+ }
60
+ else {
61
+ newCountOfPrimaryMetaToShow = primaryMetaLengths.current.length;
62
+ }
63
+ }
64
+ // Logic to show and hide secondary metadata items
65
+ if (secondaryMetaLengths.current.length !== 0 &&
66
+ secondaryMetaDataRef.current &&
67
+ primaryMetaDataRef.current &&
68
+ primaryMetaLengths.current.length === newCountOfPrimaryMetaToShow) {
69
+ const availableSpace = primaryMetaDataRef.current.offsetWidth -
70
+ (primaryMetaLengths.current[primaryMetaLengths.current.length - 1] ?? 0);
71
+ if (availableSpace > secondaryMetaLengths.current[secondaryMetaLengths.current.length - 1]) {
72
+ newCountOfSecondaryMetaToShow = secondaryMetaLengths.current.length;
73
+ }
74
+ else if (availableSpace < secondaryMetaLengths.current[0]) {
75
+ newCountOfSecondaryMetaToShow = 0;
76
+ }
77
+ else {
78
+ const closestIndex = secondaryMetaLengths.current.findIndex(i => i > availableSpace);
79
+ newCountOfSecondaryMetaToShow =
80
+ closestIndex === -1 ? secondaryMetaLengths.current.length : closestIndex;
81
+ }
82
+ }
83
+ // Logic to show or hide secondary action
84
+ actionsWidth =
85
+ secondaryAction && showSecondaryAction ? actionsWidth : actionsWidth + secondaryActionWidth;
86
+ setShowSecondaryAction(!!secondaryAction && headerWidth >= titleWidth + actionsWidth + 25);
87
+ setCountOfPrimaryMetaToShow(newCountOfPrimaryMetaToShow);
88
+ setCountOfSecondaryMetaToShow(newCountOfSecondaryMetaToShow);
89
+ if (!headerRef.current?.offsetWidth) {
90
+ setCountOfPrimaryMetaToShow(primaryMetaLengths.current.length);
91
+ setShowSecondaryAction(!!secondaryAction);
92
+ setCountOfSecondaryMetaToShow(secondaryMetaLengths.current.length);
93
+ }
94
+ }, [
95
+ countOfSecondaryMetaToShow,
96
+ secondaryMetaLengths,
97
+ showSecondaryAction,
98
+ primaryMetaLengths,
99
+ countOfPrimaryMetaToShow
100
+ ]);
101
+ useLayoutEffect(() => {
102
+ primaryMetaLengths.current = [];
103
+ secondaryMetaLengths.current = [];
104
+ const primaryMetaDataLength = metadata.primary?.length ?? 0;
105
+ primaryMetaDataRef.current?.querySelectorAll('div:has(>dt)').forEach((el, index) => {
106
+ if (index < primaryMetaDataLength) {
107
+ primaryMetaLengths.current.push((index === 0 ? el.clientWidth : el.clientWidth + primaryMetaLengths.current[index - 1]) +
108
+ 16);
109
+ }
110
+ else {
111
+ secondaryMetaLengths.current.push((index === primaryMetaDataLength
112
+ ? el.clientWidth
113
+ : el.clientWidth + secondaryMetaLengths.current[index - primaryMetaDataLength - 1]) + 16);
114
+ }
115
+ });
116
+ }, [metadata.primary, metadata.secondary]);
117
+ // Resize observer for header
118
+ useLayoutEffect(() => {
119
+ if (observerRef.current) {
120
+ observerRef.current.disconnect();
121
+ }
122
+ if (headerRef.current) {
123
+ observerRef.current = new ResizeObserver(() => showOrHideElements());
124
+ observerRef.current.observe(headerRef.current);
125
+ }
126
+ return () => observerRef.current?.disconnect();
127
+ }, [showOrHideElements]);
128
+ // Run CB once on mount incase if component is mounted initially on resized screen
129
+ useLayoutEffect(() => {
130
+ showOrHideElements();
131
+ }, []);
132
+ return (_jsxs(Flex, { as: StyledHeader, container: {
133
+ direction: 'column',
134
+ rowGap: 1
135
+ }, children: [_jsxs(Flex, { container: {
136
+ direction: 'row',
137
+ alignItems: 'center',
138
+ colGap: countOfPrimaryMetaToShow > 0 ? 3 : 1.5
139
+ }, ref: headerRef, children: [_jsxs(Flex, { ref: pageTitleContainerRef, container: { direction: 'row', colGap: 1, alignItems: 'center' }, item: { shrink: showSecondaryAction || countOfPrimaryMetaToShow > 0 ? 0 : 1 }, children: [visual && _jsx(IconTile, { testId: testIds.visual, ...visual, size: 'xl' }), _jsxs(Flex, { as: StyledTitleContainer, container: {
140
+ alignItems: 'start',
141
+ direction: 'column',
142
+ wrap: 'wrap'
143
+ }, children: [type.name && _jsx(PrimaryHeaderText, { type: type, testId: testIds.type }), _jsx(StyledText, { showEllipsis: !showSecondaryAction && countOfPrimaryMetaToShow === 0, "data-testid": testIds.title, variant: 'h1', ref: setPageTitleEl, children: title }), _jsx(Tooltip, { target: pageTitleEl, smart: true, showDelay: 'none', hideDelay: 'none', children: title })] })] }), _jsxs(Flex, { container: {
144
+ direction: 'row',
145
+ colGap: countOfSecondaryMetaToShow > 0 || countOfPrimaryMetaToShow > 1 ? 3 : 0,
146
+ alignItems: 'center'
147
+ }, item: { grow: 1, shrink: 1 }, ref: primaryMetaDataRef, as: 'dl', children: [metadata.primary?.slice(0, countOfPrimaryMetaToShow).map(metaItem => (_jsxs(Flex, { as: StyledStackedFieldValue, container: { direction: 'column' }, item: { shrink: 0 }, "data-testid": testIds.primaryMetaData, children: [_jsx(StyledLabel, { as: StyledFieldName, children: metaItem.name }), metaItem.onClick ? (_jsx("dd", { children: _jsx(StyledPrimaryMetaButton, { ref: setPrimaryMetaEl, variant: 'link', onClick: metaItem.onClick, "data-testid": testId, children: metaItem.value }) })) : (_jsx(StyledText, { ref: setPrimaryMetaEl, variant: 'h1', forwardedAs: 'dd', children: metaItem.value })), _jsx(Tooltip, { target: primaryMetaEl, smart: true, showDelay: 'none', hideDelay: 'none', children: metaItem.value })] }, metaItem.name))), metadata.secondary && (_jsx(Flex, { container: { direction: 'row', colGap: 2, justify: 'end' }, item: { grow: 1, shrink: 1 }, ref: secondaryMetaDataRef, "data-testid": testIds.secondaryMetaData, children: metadata.secondary.slice(0, countOfSecondaryMetaToShow).map(metaItem => (_jsxs(Flex, { as: StyledStackedFieldValue, item: { shrink: 0 }, children: [_jsx(StyledLabel, { as: StyledFieldName, children: metaItem.name }), _jsx(StyledText, { as: 'dd', children: metaItem.value })] }, metaItem.name))) }))] }), _jsxs(Flex, { ref: actionsContainerRef, container: {
148
+ direction: 'row',
149
+ colGap: 2,
150
+ justify: 'center'
151
+ }, item: { alignSelf: 'center', shrink: 0 }, children: [metadata.additional.length > 0 && (_jsx(Flex, { container: { direction: 'row', colGap: 2, alignItems: 'center' }, children: _jsx(AdditionalInfo, { "data-testid": testIds.additionalInfoIcon, heading: title, children: _jsxs(Flex, { container: {
152
+ direction: 'column',
153
+ alignItems: 'start',
154
+ gap: 1
155
+ }, item: { grow: 1, alignSelf: 'stretch' }, children: [_jsx(FieldValueList, { fields: metadata.additional, variant: 'inline', testId: testIds.metaData }), description && (_jsxs(StyledStackedFieldValue, { children: [_jsx(StyledLabel, { as: StyledFieldName, children: t('description') }), _jsx(ShowMoreLess, { lines: 3, children: description })] }))] }) }) })), actions] })] }), description && (_jsx(StyledDescription, { children: _jsx(ShowMoreLess, { lines: 1, children: _jsx(Text, { children: description }) }) }))] }));
156
+ };
157
+ export default withTestIds(ConstructPageHeader, getPageHeaderTestIds);
158
+ //# sourceMappingURL=ConstructPageHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstructPageHeader.js","sourceRoot":"","sources":["../../../../src/components/PageTemplates/ConstructPageTemplate/ConstructPageHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,MAAM,EACN,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,OAAO,EACP,yBAAyB,EAE1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAMhC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAC7B,MAAM,EAIP,EAAE,EAAE;IACH,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;QACpB,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,iBAAe,MAAM,YACrE,IAAI,GACE,CACV,CAAC;IACJ,CAAC;IACD,OAAO,KAAC,UAAU,IAAC,OAAO,EAAC,WAAW,YAAE,IAAI,GAAc,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,EAC3B,MAAM,EACN,KAAK,EACL,aAAa,EACb,iBAAiB,GAAG,EAAE,EACtB,QAAQ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,kBAAkB,EAAE,OAAO,EAAE,KAAK,YACrE,MAAC,IAAI,IACH,SAAS,EAAE;4CACT,SAAS,EAAE,QAAQ;4CACnB,UAAU,EAAE,OAAO;4CACnB,GAAG,EAAE,CAAC;yCACP,EACD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,aAEvC,KAAC,cAAc,IACb,MAAM,EAAE,QAAQ,CAAC,UAAU,EAC3B,OAAO,EAAC,QAAQ,EAChB,MAAM,EAAE,OAAO,CAAC,QAAQ,GACxB,EACD,WAAW,IAAI,CACd,MAAC,uBAAuB,eACtB,KAAC,WAAW,IAAC,EAAE,EAAE,eAAe,YAAG,CAAC,CAAC,aAAa,CAAC,GAAe,EAClE,KAAC,YAAY,IAAC,KAAK,EAAE,CAAC,YAAG,WAAW,GAAgB,IAC5B,CAC3B,IACI,GACQ,GACZ,CACR,EAEA,OAAO,IACH,IACF,EAEN,WAAW,IAAI,CACd,KAAC,iBAAiB,cAChB,KAAC,YAAY,IAAC,KAAK,EAAE,CAAC,YACpB,KAAC,IAAI,cAAE,WAAW,GAAQ,GACb,GACG,CACrB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useMemo, useRef, useState, useLayoutEffect, useCallback } from 'react';\n\nimport {\n Text,\n Flex,\n useTestIds,\n withTestIds,\n useElement,\n Tooltip,\n Button,\n ShowMoreLess,\n StyledStackedFieldValue,\n StyledLabel,\n StyledFieldName,\n FieldValueList,\n AdditionalInfo,\n useI18n,\n useChToPxConversionFactor,\n type TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport IconTile from '../../IconTile';\nimport { getPageHeaderTestIds } from '../PageTemplates.test-ids';\nimport type { ConstructPageTemplateProps, PageTemplateProps } from '../PageTemplate.types';\nimport HeaderActionButtons from '../HeaderActionButtons';\nimport {\n StyledText,\n StyledDescription,\n StyledPrimaryMetaButton,\n StyledHeader,\n StyledTitleContainer\n} from '../PageTemplate.styles';\n\ntype ConstructPageHeaderProps = ConstructPageTemplateProps['header'] &\n Pick<PageTemplateProps, 'progress'> &\n TestIdProp;\n\nexport const PrimaryHeaderText = ({\n type: { href, onClick, name },\n testId\n}: {\n type: ConstructPageHeaderProps['type'];\n testId?: TestIdProp['testId'];\n}) => {\n if (href || onClick) {\n return (\n <Button variant='link' href={href} onClick={onClick} data-testid={testId}>\n {name}\n </Button>\n );\n }\n return <StyledText variant='secondary'>{name}</StyledText>;\n};\n\nconst ConstructPageHeader = ({\n testId,\n title,\n primaryAction,\n additionalActions = [],\n metadata = { additional: [] },\n visual,\n type,\n description,\n secondaryAction,\n progress\n}: ConstructPageHeaderProps) => {\n // States\n const [countOfSecondaryMetaToShow, setCountOfSecondaryMetaToShow] = useState<number>(\n metadata?.secondary?.length ?? 0\n );\n const [countOfPrimaryMetaToShow, setCountOfPrimaryMetaToShow] = useState<number>(\n metadata.primary?.length ?? 0\n );\n const [showSecondaryAction, setShowSecondaryAction] = useState(true);\n const [pageTitleEl, setPageTitleEl] = useElement();\n const [primaryMetaEl, setPrimaryMetaEl] = useElement();\n\n // Hooks\n const chToPxConversionFactor = useChToPxConversionFactor();\n const testIds = useTestIds(testId, getPageHeaderTestIds);\n const t = useI18n();\n\n // Refs\n const headerRef = useRef<HTMLDivElement>(null);\n const pageTitleContainerRef = useRef<HTMLDivElement>(null);\n const actionsContainerRef = useRef<HTMLDivElement>(null);\n const secondaryMetaDataRef = useRef<HTMLDivElement>(null);\n const primaryMetaDataRef = useRef<HTMLDivElement>(null);\n const observerRef = useRef<ResizeObserver>();\n const primaryMetaLengths = useRef<number[]>([]);\n const secondaryMetaLengths = useRef<number[]>([]);\n\n // Memos\n const secondaryActionWidth = useMemo(\n () => (secondaryAction ? secondaryAction.primary.length * chToPxConversionFactor + 44 : 0),\n [secondaryAction]\n );\n\n // Page actions component\n const actions = useMemo(() => {\n const additionalActionsData = [...additionalActions];\n const secondaryActionsData =\n showSecondaryAction || additionalActionsData.length === 0 ? secondaryAction : undefined;\n if (additionalActionsData.length > 0 && secondaryAction && !showSecondaryAction) {\n additionalActionsData.unshift(secondaryAction);\n }\n\n return (\n <HeaderActionButtons\n additionalActions={additionalActionsData}\n primaryAction={primaryAction}\n secondaryAction={secondaryActionsData}\n testIds={testIds}\n progress={progress}\n animatePrimaryButton\n />\n );\n }, [showSecondaryAction, primaryAction, secondaryAction, additionalActions]);\n\n // CB to be run on resize observer\n const showOrHideElements = useCallback(() => {\n // Logic to show or hide primary metadata\n const headerWidth = headerRef.current?.offsetWidth ?? 0;\n const titleWidth = pageTitleContainerRef.current?.offsetWidth ?? 0;\n let actionsWidth = actionsContainerRef.current?.offsetWidth ?? 0;\n let newCountOfPrimaryMetaToShow = countOfPrimaryMetaToShow;\n let newCountOfSecondaryMetaToShow = countOfSecondaryMetaToShow;\n\n if (primaryMetaLengths.current.length > 0 && primaryMetaDataRef.current) {\n if (countOfSecondaryMetaToShow === 0) {\n const availableSpace = headerWidth - titleWidth - actionsWidth - 48;\n const closestIndex = primaryMetaLengths.current.findIndex(i => i > availableSpace);\n newCountOfPrimaryMetaToShow =\n closestIndex === -1 ? primaryMetaLengths.current.length : closestIndex;\n } else {\n newCountOfPrimaryMetaToShow = primaryMetaLengths.current.length;\n }\n }\n\n // Logic to show and hide secondary metadata items\n if (\n secondaryMetaLengths.current.length !== 0 &&\n secondaryMetaDataRef.current &&\n primaryMetaDataRef.current &&\n primaryMetaLengths.current.length === newCountOfPrimaryMetaToShow\n ) {\n const availableSpace =\n primaryMetaDataRef.current.offsetWidth -\n (primaryMetaLengths.current[primaryMetaLengths.current.length - 1] ?? 0);\n if (availableSpace > secondaryMetaLengths.current[secondaryMetaLengths.current.length - 1]) {\n newCountOfSecondaryMetaToShow = secondaryMetaLengths.current.length;\n } else if (availableSpace < secondaryMetaLengths.current[0]) {\n newCountOfSecondaryMetaToShow = 0;\n } else {\n const closestIndex = secondaryMetaLengths.current.findIndex(i => i > availableSpace);\n newCountOfSecondaryMetaToShow =\n closestIndex === -1 ? secondaryMetaLengths.current.length : closestIndex;\n }\n }\n\n // Logic to show or hide secondary action\n actionsWidth =\n secondaryAction && showSecondaryAction ? actionsWidth : actionsWidth + secondaryActionWidth;\n setShowSecondaryAction(!!secondaryAction && headerWidth >= titleWidth + actionsWidth + 25);\n setCountOfPrimaryMetaToShow(newCountOfPrimaryMetaToShow);\n setCountOfSecondaryMetaToShow(newCountOfSecondaryMetaToShow);\n\n if (!headerRef.current?.offsetWidth) {\n setCountOfPrimaryMetaToShow(primaryMetaLengths.current.length);\n setShowSecondaryAction(!!secondaryAction);\n setCountOfSecondaryMetaToShow(secondaryMetaLengths.current.length);\n }\n }, [\n countOfSecondaryMetaToShow,\n secondaryMetaLengths,\n showSecondaryAction,\n primaryMetaLengths,\n countOfPrimaryMetaToShow\n ]);\n\n useLayoutEffect(() => {\n primaryMetaLengths.current = [];\n secondaryMetaLengths.current = [];\n const primaryMetaDataLength = metadata.primary?.length ?? 0;\n primaryMetaDataRef.current?.querySelectorAll('div:has(>dt)').forEach((el, index) => {\n if (index < primaryMetaDataLength) {\n primaryMetaLengths.current.push(\n (index === 0 ? el.clientWidth : el.clientWidth + primaryMetaLengths.current[index - 1]) +\n 16\n );\n } else {\n secondaryMetaLengths.current.push(\n (index === primaryMetaDataLength\n ? el.clientWidth\n : el.clientWidth + secondaryMetaLengths.current[index - primaryMetaDataLength - 1]) + 16\n );\n }\n });\n }, [metadata.primary, metadata.secondary]);\n\n // Resize observer for header\n useLayoutEffect(() => {\n if (observerRef.current) {\n observerRef.current.disconnect();\n }\n if (headerRef.current) {\n observerRef.current = new ResizeObserver(() => showOrHideElements());\n observerRef.current.observe(headerRef.current);\n }\n return () => observerRef.current?.disconnect();\n }, [showOrHideElements]);\n\n // Run CB once on mount incase if component is mounted initially on resized screen\n useLayoutEffect(() => {\n showOrHideElements();\n }, []);\n\n return (\n <Flex\n as={StyledHeader}\n container={{\n direction: 'column',\n rowGap: 1\n }}\n >\n <Flex\n container={{\n direction: 'row',\n alignItems: 'center',\n colGap: countOfPrimaryMetaToShow > 0 ? 3 : 1.5\n }}\n ref={headerRef}\n >\n <Flex\n ref={pageTitleContainerRef}\n container={{ direction: 'row', colGap: 1, alignItems: 'center' }}\n item={{ shrink: showSecondaryAction || countOfPrimaryMetaToShow > 0 ? 0 : 1 }}\n >\n {visual && <IconTile testId={testIds.visual} {...visual} size='xl' />}\n <Flex\n as={StyledTitleContainer}\n container={{\n alignItems: 'start',\n direction: 'column',\n wrap: 'wrap'\n }}\n >\n {type.name && <PrimaryHeaderText type={type} testId={testIds.type} />}\n <StyledText\n showEllipsis={!showSecondaryAction && countOfPrimaryMetaToShow === 0}\n data-testid={testIds.title}\n variant='h1'\n ref={setPageTitleEl}\n >\n {title}\n </StyledText>\n <Tooltip target={pageTitleEl} smart showDelay='none' hideDelay='none'>\n {title}\n </Tooltip>\n </Flex>\n </Flex>\n\n <Flex\n container={{\n direction: 'row',\n colGap: countOfSecondaryMetaToShow > 0 || countOfPrimaryMetaToShow > 1 ? 3 : 0,\n alignItems: 'center'\n }}\n item={{ grow: 1, shrink: 1 }}\n ref={primaryMetaDataRef}\n as='dl'\n >\n {metadata.primary?.slice(0, countOfPrimaryMetaToShow).map(metaItem => (\n <Flex\n key={metaItem.name}\n as={StyledStackedFieldValue}\n container={{ direction: 'column' }}\n item={{ shrink: 0 }}\n data-testid={testIds.primaryMetaData}\n >\n <StyledLabel as={StyledFieldName}>{metaItem.name}</StyledLabel>\n {metaItem.onClick ? (\n <dd>\n <StyledPrimaryMetaButton\n ref={setPrimaryMetaEl}\n variant='link'\n onClick={metaItem.onClick}\n data-testid={testId}\n >\n {metaItem.value}\n </StyledPrimaryMetaButton>\n </dd>\n ) : (\n <StyledText ref={setPrimaryMetaEl} variant='h1' forwardedAs='dd'>\n {metaItem.value}\n </StyledText>\n )}\n <Tooltip target={primaryMetaEl} smart showDelay='none' hideDelay='none'>\n {metaItem.value}\n </Tooltip>\n </Flex>\n ))}\n\n {metadata.secondary && (\n <Flex\n container={{ direction: 'row', colGap: 2, justify: 'end' }}\n item={{ grow: 1, shrink: 1 }}\n ref={secondaryMetaDataRef}\n data-testid={testIds.secondaryMetaData}\n >\n {metadata.secondary.slice(0, countOfSecondaryMetaToShow).map(metaItem => (\n <Flex as={StyledStackedFieldValue} item={{ shrink: 0 }} key={metaItem.name}>\n <StyledLabel as={StyledFieldName}>{metaItem.name}</StyledLabel>\n <StyledText as='dd'>{metaItem.value}</StyledText>\n </Flex>\n ))}\n </Flex>\n )}\n </Flex>\n\n <Flex\n ref={actionsContainerRef}\n container={{\n direction: 'row',\n colGap: 2,\n justify: 'center'\n }}\n item={{ alignSelf: 'center', shrink: 0 }}\n >\n {metadata.additional.length > 0 && (\n <Flex container={{ direction: 'row', colGap: 2, alignItems: 'center' }}>\n <AdditionalInfo data-testid={testIds.additionalInfoIcon} heading={title}>\n <Flex\n container={{\n direction: 'column',\n alignItems: 'start',\n gap: 1\n }}\n item={{ grow: 1, alignSelf: 'stretch' }}\n >\n <FieldValueList\n fields={metadata.additional}\n variant='inline'\n testId={testIds.metaData}\n />\n {description && (\n <StyledStackedFieldValue>\n <StyledLabel as={StyledFieldName}>{t('description')}</StyledLabel>\n <ShowMoreLess lines={3}>{description}</ShowMoreLess>\n </StyledStackedFieldValue>\n )}\n </Flex>\n </AdditionalInfo>\n </Flex>\n )}\n\n {actions}\n </Flex>\n </Flex>\n\n {description && (\n <StyledDescription>\n <ShowMoreLess lines={1}>\n <Text>{description}</Text>\n </ShowMoreLess>\n </StyledDescription>\n )}\n </Flex>\n );\n};\n\nexport default withTestIds(ConstructPageHeader, getPageHeaderTestIds);\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
2
+ import type { ConstructPageTemplateProps } from '../PageTemplate.types';
3
+ declare const ConstructPageTemplate: ForwardRefForwardPropsComponent<ConstructPageTemplateProps>;
4
+ export default ConstructPageTemplate;
5
+ //# sourceMappingURL=ConstructPageTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstructPageTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/ConstructPageTemplate/ConstructPageTemplate.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAKxE,QAAA,MAAM,qBAAqB,EAAE,+BAA+B,CAAC,0BAA0B,CAqDpF,CAAC;AAEJ,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useMemo } from 'react';
3
+ import { Banner, OneColumnPage, TabbedPage } from '@pega/cosmos-react-core';
4
+ import { StyledPage } from '../PageTemplates';
5
+ import ConstructPageHeader from './ConstructPageHeader';
6
+ const ConstructPageTemplate = forwardRef(({ content, tabs, errorBanner, header, progress = false, testId, isPreview = false, ...restProps }, ref) => {
7
+ const pageHeader = useMemo(() => !isPreview ? (_jsx(ConstructPageHeader, { ...header, progress: progress, testId: testId })) : undefined, [isPreview, header, progress, testId]);
8
+ if (tabs) {
9
+ return (_jsx(TabbedPage, { ...restProps, title: !isPreview ? header.title : '', as: StyledPage, header: pageHeader, tabs: tabs, ref: ref, banners: errorBanner && _jsx(Banner, { testId: testId, ...errorBanner }), scrollContent: true }));
10
+ }
11
+ if (content) {
12
+ return (_jsx(OneColumnPage, { ...restProps, title: !isPreview ? header.title : '', as: StyledPage, header: pageHeader, a: content, ref: ref, banners: errorBanner && _jsx(Banner, { testId: testId, ...errorBanner }), scrollContent: true }));
13
+ }
14
+ return null;
15
+ });
16
+ export default ConstructPageTemplate;
17
+ //# sourceMappingURL=ConstructPageTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstructPageTemplate.js","sourceRoot":"","sources":["../../../../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,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EACrC,EAAE,EAAE,UAAU,EACd,MAAM,EAAE,UAAU,EAClB,CAAC,EAAE,OAAO,EACV,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,WAAW,IAAI,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,KAAM,WAAW,GAAI,EACnE,aAAa,SACb,CACH,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEJ,eAAe,qBAAqB,CAAC","sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport type { Ref, PropsWithoutRef } from 'react';\n\nimport { Banner, OneColumnPage, TabbedPage } from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\n\nimport type { ConstructPageTemplateProps } from '../PageTemplate.types';\nimport { StyledPage } from '../PageTemplates';\n\nimport ConstructPageHeader from './ConstructPageHeader';\n\nconst ConstructPageTemplate: ForwardRefForwardPropsComponent<ConstructPageTemplateProps> =\n forwardRef(\n (\n {\n content,\n tabs,\n errorBanner,\n header,\n progress = false,\n testId,\n isPreview = false,\n ...restProps\n }: PropsWithoutRef<ConstructPageTemplateProps>,\n ref: Ref<HTMLDivElement>\n ) => {\n const pageHeader = useMemo(\n () =>\n !isPreview ? (\n <ConstructPageHeader {...header} progress={progress} testId={testId} />\n ) : undefined,\n [isPreview, header, progress, testId]\n );\n if (tabs) {\n return (\n <TabbedPage\n {...restProps}\n title={!isPreview ? header.title : ''}\n as={StyledPage}\n header={pageHeader}\n tabs={tabs}\n ref={ref}\n banners={errorBanner && <Banner testId={testId} {...errorBanner} />}\n scrollContent\n />\n );\n }\n if (content) {\n return (\n <OneColumnPage\n {...restProps}\n title={!isPreview ? header.title : ''}\n as={StyledPage}\n header={pageHeader}\n a={content}\n ref={ref}\n banners={errorBanner && <Banner testId={testId} {...errorBanner} />}\n scrollContent\n />\n );\n }\n\n return null;\n }\n );\n\nexport default ConstructPageTemplate;\n"]}
@@ -1,12 +1,12 @@
1
1
  import type { Ref, MouseEvent } from 'react';
2
- import type { NoChildrenProp } from '@pega/cosmos-react-core';
2
+ import type { NoChildrenProp, TestIdProp, ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
3
3
  import type { SummaryCardProps } from '../SummaryCard';
4
4
  import type { PageBannerProps } from '../PageBanner';
5
- interface EmptyStateProps {
5
+ interface EmptyStateProps extends TestIdProp {
6
6
  heading: string;
7
7
  description?: string;
8
8
  }
9
- export interface GalleryPageProps extends NoChildrenProp, PageBannerProps {
9
+ export interface GalleryPageProps extends NoChildrenProp, PageBannerProps, TestIdProp {
10
10
  /** Props to render the empty state content. */
11
11
  emptyState: EmptyStateProps;
12
12
  /** A list of cards to render as a grid. */
@@ -15,9 +15,19 @@ export interface GalleryPageProps extends NoChildrenProp, PageBannerProps {
15
15
  onItemClick: (id: SummaryCardProps['id'], e: MouseEvent<HTMLDivElement>) => void;
16
16
  /** Ref for the wrapping element. */
17
17
  ref?: Ref<HTMLDivElement>;
18
+ /** Items which are filtered from list and shouldn't be rendered */
19
+ filteredItems?: string[];
20
+ /** Callback function that is fired when filter is applied */
21
+ onFilterChange?: (selectedItems: string[]) => void;
22
+ /** Flag to show all items */
23
+ isShowAllItemsEnabled?: boolean;
24
+ /** Callback function that is fired when show all toggle is changed */
25
+ onShowAllItemsToggleChange?: () => void;
26
+ /** Flag to hide filter options */
27
+ hideFilterOptions?: boolean;
18
28
  }
19
29
  export declare const StyledGalleryPage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
30
  export declare const StyledContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
- declare const GalleryPage: import("react").ForwardRefExoticComponent<Omit<GalleryPageProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
31
+ declare const GalleryPage: ForwardRefForwardPropsComponent<GalleryPageProps>;
22
32
  export default GalleryPage;
23
33
  //# sourceMappingURL=GalleryPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuB,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAclE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,eAAe;IACvE,+CAA+C;IAC/C,UAAU,EAAE,eAAe,CAAC;IAC5B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,EAAE,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACjF,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,yGAE7B,CAAC;AAEF,eAAO,MAAM,aAAa,yGAMxB,CAAC;AA+CH,QAAA,MAAM,WAAW,0HA+Cf,CAAC;AAEH,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"GalleryPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAuB,MAAM,OAAO,CAAC;AAkBlE,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EAGV,+BAA+B,EAChC,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,UAAU,eAAgB,SAAQ,UAAU;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,eAAe,EAAE,UAAU;IACnF,+CAA+C;IAC/C,UAAU,EAAE,eAAe,CAAC;IAC5B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,EAAE,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACjF,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAK1B,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,6BAA6B;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sEAAsE;IACtE,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;IACxC,kCAAkC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,iBAAiB,yGAE7B,CAAC;AAEF,eAAO,MAAM,aAAa,yGAIxB,CAAC;AAqDH,QAAA,MAAM,WAAW,EAAE,+BAA+B,CAAC,gBAAgB,CAsIlE,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,17 +1,16 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useEffect } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useState, useMemo } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Flex, Grid, Button, ShowMoreLess, Text, defaultThemeProp, useConfiguration, focusHeadingOrContainer, useConsolidatedRef } from '@pega/cosmos-react-core';
4
+ import { Flex, Grid, Button, ShowMoreLess, Text, defaultThemeProp, useConfiguration, focusHeadingOrContainer, useConsolidatedRef, useTestIds, ComboBox, Switch, menuHelpers } from '@pega/cosmos-react-core';
5
5
  import SummaryCard from '../SummaryCard';
6
6
  import PageBanner from '../PageBanner';
7
+ import { getGalleryPageEmptyStateTestIds } from './PageTemplates.test-ids';
7
8
  export const StyledGalleryPage = styled.div `
8
9
  min-height: inherit;
9
10
  `;
10
11
  export const StyledContent = styled.div(({ theme }) => {
11
12
  return css `
12
- padding-block: calc(3 * ${theme.base.spacing});
13
- padding-inline: calc(4 * ${theme.base.spacing});
14
- min-height: 100%;
13
+ padding: calc(3 * ${theme.base.spacing});
15
14
  `;
16
15
  });
17
16
  StyledContent.defaultProps = defaultThemeProp;
@@ -20,19 +19,57 @@ const SummaryCardList = ({ items, onItemClick }) => {
20
19
  cols: 'repeat(auto-fill, minmax(18.75rem, 1fr))',
21
20
  autoRows: '10rem',
22
21
  gap: 2
23
- }, children: items && items.map(item => _jsx(SummaryCard, { ...item, onClick: onItemClick }, item.id)) }));
22
+ }, children: items?.map(item => _jsx(SummaryCard, { ...item, onClick: onItemClick }, item.id)) }));
24
23
  };
25
- const EmptyState = ({ heading, description, actions }) => {
26
- return (_jsxs(Flex, { container: { direction: 'column', alignItems: 'center', justify: 'center', rowGap: 2 }, item: { grow: 1 }, children: [_jsx(Text, { variant: 'h2', children: heading }), description && (_jsx(ShowMoreLess, { lines: 2, children: _jsx(Text, { as: 'p', children: description }) })), !!actions?.length &&
24
+ const EmptyState = ({ testId, heading, description, actions }) => {
25
+ const testIds = useTestIds(testId, getGalleryPageEmptyStateTestIds);
26
+ return (_jsxs(Flex, { container: { direction: 'column', alignItems: 'center', justify: 'center', rowGap: 2 }, item: { grow: 1 }, children: [_jsx(Text, { "data-testid": testIds.heading, variant: 'h2', children: heading }), description && (_jsx(ShowMoreLess, { lines: 2, children: _jsx(Text, { "data-testid": testIds.description, as: 'p', children: description }) })), !!actions?.length &&
27
27
  actions.map(action => (_jsx(Button, { variant: 'primary', onClick: action.onClick, children: action.label }, action.label)))] }));
28
28
  };
29
- const GalleryPage = forwardRef(function GalleryPage({ title, description, image, items, onItemClick, emptyState, actions, link }, ref) {
29
+ const GalleryPage = forwardRef(({ testId, title, description, image, items, onItemClick, emptyState, actions, link,
30
+ /*
31
+ This change is temporary until LASA is completed.
32
+ It will provide the provider success team with a feature to hide apps before demoing to customers.
33
+ */
34
+ filteredItems = [], onFilterChange, isShowAllItemsEnabled = true, onShowAllItemsToggleChange, hideFilterOptions = true }, ref) => {
30
35
  const { loadedRef } = useConfiguration();
31
36
  const pageRef = useConsolidatedRef(ref);
37
+ const list = items?.map(item => ({
38
+ id: item.id,
39
+ primary: item.title,
40
+ secondary: [item.description],
41
+ selected: filteredItems?.includes(item.id)
42
+ })) || [];
43
+ const [comboBoxItems, setComboBoxItems] = useState(menuHelpers.mapTree(list, item => ({
44
+ id: item.id,
45
+ primary: item.primary,
46
+ selected: item.selected
47
+ })));
48
+ const selected = useMemo(() => {
49
+ return menuHelpers.getSelected(comboBoxItems).map(item => ({
50
+ text: item.primary,
51
+ id: item.id
52
+ }));
53
+ }, [comboBoxItems]);
54
+ const toggleItem = (id) => {
55
+ setComboBoxItems(cur => menuHelpers.toggleSelected(cur, id, 'multi-select'));
56
+ };
57
+ const itemsToRender = useMemo(() => {
58
+ const mappedItems = menuHelpers.mapTree(comboBoxItems, item => ({
59
+ ...item,
60
+ selected: item.items ? undefined : !!item.selected
61
+ }));
62
+ if (items?.length) {
63
+ const selectedItems = menuHelpers.getSelected(mappedItems).map(item => item.id);
64
+ onFilterChange?.(selectedItems);
65
+ }
66
+ return mappedItems;
67
+ }, [comboBoxItems]);
32
68
  // Focus heading on initial mount
33
69
  useEffect(() => {
34
- if (!pageRef.current)
70
+ if (!pageRef.current) {
35
71
  return;
72
+ }
36
73
  if (loadedRef.current) {
37
74
  focusHeadingOrContainer(pageRef.current, title);
38
75
  }
@@ -41,7 +78,15 @@ const GalleryPage = forwardRef(function GalleryPage({ title, description, image,
41
78
  }
42
79
  }, [title]);
43
80
  const noItems = !items || items.length === 0;
44
- return (_jsxs(StyledGalleryPage, { ref: pageRef, children: [_jsx(PageBanner, { title: title, description: description, actions: noItems ? undefined : actions, link: link, image: image }), _jsx(StyledContent, { children: noItems ? (_jsx(EmptyState, { ...emptyState, actions: actions })) : (_jsx(SummaryCardList, { items: items, onItemClick: onItemClick })) })] }));
81
+ return (_jsxs(StyledGalleryPage, { ref: pageRef, children: [_jsx(PageBanner, { testId: testId, title: title, description: description, actions: noItems ? undefined : actions, link: link, image: image }), _jsx(StyledContent, { children: noItems ? (_jsx(EmptyState, { testId: testId, ...emptyState, actions: actions })) : (_jsxs(_Fragment, { children: [!hideFilterOptions && (_jsxs(Flex, { container: { justify: 'between', pad: [0, 0, 2, 0] }, children: [_jsx(ComboBox, { mode: 'multi-select', labelHidden: true, selected: {
82
+ items: selected,
83
+ onRemove: toggleItem
84
+ }, menu: {
85
+ items: itemsToRender,
86
+ onItemClick: toggleItem
87
+ } }), _jsx(Switch, { label: 'Show hidden apps', on: isShowAllItemsEnabled, onChange: onShowAllItemsToggleChange })] })), _jsx(SummaryCardList, { items: isShowAllItemsEnabled
88
+ ? items
89
+ : items.filter(item => filteredItems.includes(item.id)), onItemClick: onItemClick })] })) })] }));
45
90
  });
46
91
  export default GalleryPage;
47
92
  //# sourceMappingURL=GalleryPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryPage.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,MAAM,EAAE,EAAE,GAAG,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C,GAAG,EAAE,OAAO,aAC7B,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EACtC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,GACZ,EACF,KAAC,aAAa,cACX,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,UAAU,OAAK,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,CACjD,CAAC,CAAC,CAAC,CACF,KAAC,eAAe,IAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,GAAI,CAC5D,GACa,IACE,CACrB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport type { FC, PropsWithoutRef, Ref, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Grid,\n Button,\n ShowMoreLess,\n Text,\n defaultThemeProp,\n useConfiguration,\n focusHeadingOrContainer,\n useConsolidatedRef\n} from '@pega/cosmos-react-core';\nimport type { NoChildrenProp } from '@pega/cosmos-react-core';\n\nimport SummaryCard from '../SummaryCard';\nimport type { SummaryCardProps } from '../SummaryCard';\nimport PageBanner from '../PageBanner';\nimport type { PageBannerProps } from '../PageBanner';\n\ninterface EmptyStateProps {\n heading: string;\n description?: string;\n}\n\nexport interface GalleryPageProps extends NoChildrenProp, PageBannerProps {\n /** Props to render the empty state content. */\n emptyState: EmptyStateProps;\n /** A list of cards to render as a grid. */\n items?: SummaryCardProps[];\n /** Callback function that is fired when an item is clicked. */\n onItemClick: (id: SummaryCardProps['id'], e: MouseEvent<HTMLDivElement>) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledGalleryPage = styled.div`\n min-height: inherit;\n`;\n\nexport const StyledContent = styled.div(({ theme }) => {\n return css`\n padding-block: calc(3 * ${theme.base.spacing});\n padding-inline: calc(4 * ${theme.base.spacing});\n min-height: 100%;\n `;\n});\n\nStyledContent.defaultProps = defaultThemeProp;\n\nconst SummaryCardList: FC<{\n items: GalleryPageProps['items'];\n onItemClick: GalleryPageProps['onItemClick'];\n}> = ({ items, onItemClick }) => {\n return (\n <Grid\n container={{\n cols: 'repeat(auto-fill, minmax(18.75rem, 1fr))',\n autoRows: '10rem',\n gap: 2\n }}\n >\n {items && items.map(item => <SummaryCard key={item.id} {...item} onClick={onItemClick} />)}\n </Grid>\n );\n};\n\nconst EmptyState: FC<EmptyStateProps & Pick<GalleryPageProps, 'actions'>> = ({\n heading,\n description,\n actions\n}) => {\n return (\n <Flex\n container={{ direction: 'column', alignItems: 'center', justify: 'center', rowGap: 2 }}\n item={{ grow: 1 }}\n >\n <Text variant='h2'>{heading}</Text>\n {description && (\n <ShowMoreLess lines={2}>\n <Text as='p'>{description}</Text>\n </ShowMoreLess>\n )}\n {!!actions?.length &&\n actions.map(action => (\n <Button key={action.label} variant='primary' onClick={action.onClick}>\n {action.label}\n </Button>\n ))}\n </Flex>\n );\n};\n\nconst GalleryPage = forwardRef(function GalleryPage(\n {\n title,\n description,\n image,\n items,\n onItemClick,\n emptyState,\n actions,\n link\n }: PropsWithoutRef<GalleryPageProps>,\n ref: GalleryPageProps['ref']\n) {\n const { loadedRef } = useConfiguration();\n const pageRef = useConsolidatedRef(ref);\n\n // Focus heading on initial mount\n useEffect(() => {\n if (!pageRef.current) return;\n\n if (loadedRef.current) {\n focusHeadingOrContainer(pageRef.current, title);\n } else {\n loadedRef.current = true;\n }\n }, [title]);\n\n const noItems = !items || items.length === 0;\n\n return (\n <StyledGalleryPage ref={pageRef}>\n <PageBanner\n title={title}\n description={description}\n actions={noItems ? undefined : actions}\n link={link}\n image={image}\n />\n <StyledContent>\n {noItems ? (\n <EmptyState {...emptyState} actions={actions} />\n ) : (\n <SummaryCardList items={items} onItemClick={onItemClick} />\n )}\n </StyledContent>\n </StyledGalleryPage>\n );\n});\n\nexport default GalleryPage;\n"]}
1
+ {"version":3,"file":"GalleryPage.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,MAAM,EACN,WAAW,EACZ,MAAM,yBAAyB,CAAC;AASjC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,UAAU,MAAM,eAAe,CAAC;AAGvC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAgC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE1C,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO;GACvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,eAAe,GAGhB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;IAC9B,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE;YACT,IAAI,EAAE,0CAA0C;YAChD,QAAQ,EAAE,OAAO;YACjB,GAAG,EAAE,CAAC;SACP,YAEA,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAC,WAAW,OAAmB,IAAI,EAAE,OAAO,EAAE,WAAW,IAAvC,IAA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AO,CAAC,CAAC,CAAC,CACT,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,KAAM,UAAU,EAAE,OAAO,EAAE,OAAO,GAAI,CACjE,CAAC,CAAC,CAAC,CACF,8BAIG,CAAC,iBAAiB,IAAI,CACrB,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,aACxD,KAAC,QAAQ,IACP,IAAI,EAAC,cAAc,EACnB,WAAW,QACX,QAAQ,EAAE;wCACR,KAAK,EAAE,QAAQ;wCACf,QAAQ,EAAE,UAAU;qCACrB,EACD,IAAI,EAAE;wCACJ,KAAK,EAAE,aAAa;wCACpB,WAAW,EAAE,UAAU;qCACxB,GACD,EACF,KAAC,MAAM,IACL,KAAK,EAAC,kBAAkB,EACxB,EAAE,EAAE,qBAAqB,EACzB,QAAQ,EAAE,0BAA0B,GACpC,IACG,CACR,EACD,KAAC,eAAe,IACd,KAAK,EACH,qBAAqB;gCACnB,CAAC,CAAC,KAAK;gCACP,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAE3D,WAAW,EAAE,WAAW,GACxB,IACD,CACJ,GACa,IACE,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, useEffect, useState, useMemo } from 'react';\nimport type { Ref, MouseEvent, FC, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Grid,\n Button,\n ShowMoreLess,\n Text,\n defaultThemeProp,\n useConfiguration,\n focusHeadingOrContainer,\n useConsolidatedRef,\n useTestIds,\n ComboBox,\n Switch,\n menuHelpers\n} from '@pega/cosmos-react-core';\nimport type {\n NoChildrenProp,\n TestIdProp,\n MenuProps,\n MenuItemProps,\n ForwardRefForwardPropsComponent\n} from '@pega/cosmos-react-core';\n\nimport SummaryCard from '../SummaryCard';\nimport type { SummaryCardProps } from '../SummaryCard';\nimport PageBanner from '../PageBanner';\nimport type { PageBannerProps } from '../PageBanner';\n\nimport { getGalleryPageEmptyStateTestIds } from './PageTemplates.test-ids';\n\ninterface EmptyStateProps extends TestIdProp {\n heading: string;\n description?: string;\n}\n\nexport interface GalleryPageProps extends NoChildrenProp, PageBannerProps, TestIdProp {\n /** Props to render the empty state content. */\n emptyState: EmptyStateProps;\n /** A list of cards to render as a grid. */\n items?: SummaryCardProps[];\n /** Callback function that is fired when an item is clicked. */\n onItemClick: (id: SummaryCardProps['id'], e: MouseEvent<HTMLDivElement>) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n /*\n This change is temporary until LASA is completed.\n It will provide the provider success team with a feature to hide apps before demoing to customers.\n */\n /** Items which are filtered from list and shouldn't be rendered */\n filteredItems?: string[];\n /** Callback function that is fired when filter is applied */\n onFilterChange?: (selectedItems: string[]) => void;\n /** Flag to show all items */\n isShowAllItemsEnabled?: boolean;\n /** Callback function that is fired when show all toggle is changed */\n onShowAllItemsToggleChange?: () => void;\n /** Flag to hide filter options */\n hideFilterOptions?: boolean;\n}\n\nexport const StyledGalleryPage = styled.div`\n min-height: inherit;\n`;\n\nexport const StyledContent = styled.div(({ theme }) => {\n return css`\n padding: calc(3 * ${theme.base.spacing});\n `;\n});\n\nStyledContent.defaultProps = defaultThemeProp;\n\nconst SummaryCardList: FC<{\n items: GalleryPageProps['items'];\n onItemClick: GalleryPageProps['onItemClick'];\n}> = ({ items, onItemClick }) => {\n return (\n <Grid\n container={{\n cols: 'repeat(auto-fill, minmax(18.75rem, 1fr))',\n autoRows: '10rem',\n gap: 2\n }}\n >\n {items?.map(item => <SummaryCard key={item.id} {...item} onClick={onItemClick} />)}\n </Grid>\n );\n};\n\nconst EmptyState: FC<EmptyStateProps & Pick<GalleryPageProps, 'actions'>> = ({\n testId,\n heading,\n description,\n actions\n}) => {\n const testIds = useTestIds(testId, getGalleryPageEmptyStateTestIds);\n return (\n <Flex\n container={{ direction: 'column', alignItems: 'center', justify: 'center', rowGap: 2 }}\n item={{ grow: 1 }}\n >\n <Text data-testid={testIds.heading} variant='h2'>\n {heading}\n </Text>\n {description && (\n <ShowMoreLess lines={2}>\n <Text data-testid={testIds.description} as='p'>\n {description}\n </Text>\n </ShowMoreLess>\n )}\n {!!actions?.length &&\n actions.map(action => (\n <Button key={action.label} variant='primary' onClick={action.onClick}>\n {action.label}\n </Button>\n ))}\n </Flex>\n );\n};\n\nconst GalleryPage: ForwardRefForwardPropsComponent<GalleryPageProps> = forwardRef(\n (\n {\n testId,\n title,\n description,\n image,\n items,\n onItemClick,\n emptyState,\n actions,\n link,\n /*\n This change is temporary until LASA is completed.\n It will provide the provider success team with a feature to hide apps before demoing to customers.\n */\n filteredItems = [],\n onFilterChange,\n isShowAllItemsEnabled = true,\n onShowAllItemsToggleChange,\n hideFilterOptions = true\n }: PropsWithoutRef<GalleryPageProps>,\n ref: GalleryPageProps['ref']\n ) => {\n const { loadedRef } = useConfiguration();\n const pageRef = useConsolidatedRef(ref);\n\n const list: MenuProps['items'] =\n items?.map(item => ({\n id: item.id,\n primary: item.title,\n secondary: [item.description],\n selected: filteredItems?.includes(item.id)\n })) || [];\n\n const [comboBoxItems, setComboBoxItems] = useState<MenuProps['items']>(\n menuHelpers.mapTree(list, item => ({\n id: item.id,\n primary: item.primary,\n selected: item.selected\n }))\n );\n\n const selected = useMemo(() => {\n return menuHelpers.getSelected(comboBoxItems).map(item => ({\n text: item.primary,\n id: item.id\n }));\n }, [comboBoxItems]);\n\n const toggleItem = (id: MenuItemProps['id']) => {\n setComboBoxItems(cur => menuHelpers.toggleSelected(cur, id, 'multi-select'));\n };\n\n const itemsToRender = useMemo(() => {\n const mappedItems = menuHelpers.mapTree(comboBoxItems, item => ({\n ...item,\n selected: item.items ? undefined : !!item.selected\n }));\n if (items?.length) {\n const selectedItems = menuHelpers.getSelected(mappedItems).map(item => item.id);\n onFilterChange?.(selectedItems);\n }\n return mappedItems;\n }, [comboBoxItems]);\n\n // Focus heading on initial mount\n useEffect(() => {\n if (!pageRef.current) {\n return;\n }\n\n if (loadedRef.current) {\n focusHeadingOrContainer(pageRef.current, title);\n } else {\n loadedRef.current = true;\n }\n }, [title]);\n\n const noItems = !items || items.length === 0;\n\n return (\n <StyledGalleryPage ref={pageRef}>\n <PageBanner\n testId={testId}\n title={title}\n description={description}\n actions={noItems ? undefined : actions}\n link={link}\n image={image}\n />\n <StyledContent>\n {noItems ? (\n <EmptyState testId={testId} {...emptyState} actions={actions} />\n ) : (\n <>\n {/* This change is temporary until LASA is completed.\n It will provide the provider success team with a feature to hide apps before demoing to customers.\n This feature is behind a toggle and will not impact anyone who is unaware of how to enable it. */}\n {!hideFilterOptions && (\n <Flex container={{ justify: 'between', pad: [0, 0, 2, 0] }}>\n <ComboBox\n mode='multi-select'\n labelHidden\n selected={{\n items: selected,\n onRemove: toggleItem\n }}\n menu={{\n items: itemsToRender,\n onItemClick: toggleItem\n }}\n />\n <Switch\n label='Show hidden apps'\n on={isShowAllItemsEnabled}\n onChange={onShowAllItemsToggleChange}\n />\n </Flex>\n )}\n <SummaryCardList\n items={\n isShowAllItemsEnabled\n ? items\n : items.filter(item => filteredItems.includes(item.id))\n }\n onItemClick={onItemClick}\n />\n </>\n )}\n </StyledContent>\n </StyledGalleryPage>\n );\n }\n);\n\nexport default GalleryPage;\n"]}
@@ -0,0 +1,5 @@
1
+ import type { FC } from 'react';
2
+ import type { ActionButtonProps } from './PageTemplate.types';
3
+ declare const ActionButtons: FC<ActionButtonProps>;
4
+ export default ActionButtons;
5
+ //# sourceMappingURL=HeaderActionButtons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderActionButtons.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/HeaderActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,sBAAsB,CAAC;AASrF,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,iBAAiB,CAoDxC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { isValidElement } from 'react';
3
+ import { Button, Flex, MenuButton, useI18n } from '@pega/cosmos-react-core';
4
+ import { StyledPrimaryActionWrapper } from './PageTemplate.styles';
5
+ const isButtonConfig = (action) => {
6
+ return !!(action && typeof action === 'object' && !isValidElement(action) && 'onClick' in action);
7
+ };
8
+ const ActionButtons = ({ primaryAction, progress, testIds, secondaryAction, additionalActions, animatePrimaryButton }) => {
9
+ const t = useI18n();
10
+ return (_jsxs(Flex, { container: true, children: [primaryAction &&
11
+ (isButtonConfig(primaryAction) ? (_jsx(Button, { variant: primaryAction.variant, onClick: primaryAction.onClick, disabled: progress || primaryAction.disabled, "data-testid": testIds.primaryAction, animate: animatePrimaryButton, children: primaryAction.primary })) : (_jsx(StyledPrimaryActionWrapper, { hasAdditionalAction: !!additionalActions, children: primaryAction }))), secondaryAction && (_jsx(Button, { variant: 'secondary', onClick: secondaryAction.onClick, disabled: progress || secondaryAction.disabled, "data-testid": testIds.secondaryAction, children: secondaryAction.primary })), additionalActions && additionalActions.length > 0 && (_jsx(MenuButton, { testId: testIds.additionalActions, text: t('actions'), "aria-label": t('actions'), disabled: progress, iconOnly: true, icon: 'more', menu: { items: additionalActions } }))] }));
12
+ };
13
+ export default ActionButtons;
14
+ //# sourceMappingURL=HeaderActionButtons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderActionButtons.js","sourceRoot":"","sources":["../../../src/components/PageTemplates/HeaderActionButtons.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,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U,IACT,MAAM,EAAE,OAAO,CAAC,iBAAiB,EACjC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,gBACN,CAAC,CAAC,SAAS,CAAC,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,QACR,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAClC,CACH,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { FC } from 'react';\nimport { isValidElement } from 'react';\n\nimport { Button, Flex, MenuButton, useI18n, type ButtonProps } from '@pega/cosmos-react-core';\n\nimport type { ActionButtonProps, HeaderActionItemProps } from './PageTemplate.types';\nimport { StyledPrimaryActionWrapper } from './PageTemplate.styles';\n\nconst isButtonConfig = (\n action: ActionButtonProps['primaryAction']\n): action is HeaderActionItemProps & { variant?: ButtonProps['variant'] } => {\n return !!(action && typeof action === 'object' && !isValidElement(action) && 'onClick' in action);\n};\n\nconst ActionButtons: FC<ActionButtonProps> = ({\n primaryAction,\n progress,\n testIds,\n secondaryAction,\n additionalActions,\n animatePrimaryButton\n}) => {\n const t = useI18n();\n\n return (\n <Flex container>\n {/* Primary Action */}\n {primaryAction &&\n (isButtonConfig(primaryAction) ? (\n <Button\n variant={primaryAction.variant}\n onClick={primaryAction.onClick}\n disabled={progress || primaryAction.disabled}\n data-testid={testIds.primaryAction}\n animate={animatePrimaryButton}\n >\n {primaryAction.primary}\n </Button>\n ) : (\n <StyledPrimaryActionWrapper hasAdditionalAction={!!additionalActions}>\n {primaryAction}\n </StyledPrimaryActionWrapper>\n ))}\n {secondaryAction && (\n <Button\n variant='secondary'\n onClick={secondaryAction.onClick}\n disabled={progress || secondaryAction.disabled}\n data-testid={testIds.secondaryAction}\n >\n {secondaryAction.primary}\n </Button>\n )}\n {additionalActions && additionalActions.length > 0 && (\n <MenuButton\n testId={testIds.additionalActions}\n text={t('actions')}\n aria-label={t('actions')}\n disabled={progress}\n iconOnly\n icon='more'\n menu={{ items: additionalActions }}\n />\n )}\n </Flex>\n );\n};\n\nexport default ActionButtons;\n"]}
@@ -0,0 +1,8 @@
1
+ import { type TestIdProp } from '@pega/cosmos-react-core';
2
+ import type { InventoryPageTemplateProps, PageTemplateProps } from '../PageTemplate.types';
3
+ type InventoryPageHeaderProps = InventoryPageTemplateProps['header'] & Pick<PageTemplateProps, 'progress'> & TestIdProp;
4
+ declare const _default: (({ testId, title, primaryAction, secondaryAction, additionalActions, description, progress }: InventoryPageHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
5
+ getTestIds: (testIdProp?: TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["title", "status", "edit-details", "additional-info-icon", "type", "meta-data", "primary-meta-data", "secondary-meta-data", "visual", "primary-action", "secondary-action", "additional-actions", "banner-description", "banner-link", "banner-actions", "banner-image"]>;
6
+ };
7
+ export default _default;
8
+ //# sourceMappingURL=InventoryPageHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InventoryPageHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,UAAU,EAOhB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAQ3F,KAAK,wBAAwB,GAAG,0BAA0B,CAAC,QAAQ,CAAC,GAClE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GACnC,UAAU,CAAC;uHAUV,wBAAwB;;;AA8D3B,wBAAsE"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef } from 'react';
3
+ import { Flex, useTestIds, withTestIds, useElement, Tooltip, useBreakpoint, Text, SummaryItem, ShowMoreLess } from '@pega/cosmos-react-core';
4
+ import { getPageHeaderTestIds } from '../PageTemplates.test-ids';
5
+ import { StyledInventoryPageTitleWrapper, StyledDescription, StyledTextWithEllipsis } from '../PageTemplate.styles';
6
+ import HeaderActionButtons from '../HeaderActionButtons';
7
+ const InventoryPageHeader = ({ testId, title, primaryAction, secondaryAction, additionalActions = [], description, progress }) => {
8
+ const testIds = useTestIds(testId, getPageHeaderTestIds);
9
+ const headerRef = useRef(null);
10
+ const isMediumOrAbove = useBreakpoint('md', { breakpointRef: headerRef });
11
+ const [el, setEl] = useElement();
12
+ const actions = useMemo(() => {
13
+ return (_jsx(HeaderActionButtons, { additionalActions: additionalActions, primaryAction: primaryAction, secondaryAction: secondaryAction, testIds: testIds, progress: progress }));
14
+ }, [primaryAction?.variant, progress, isMediumOrAbove]);
15
+ return (_jsxs(Flex, { container: {
16
+ direction: 'column'
17
+ }, children: [_jsxs(Flex, { container: {
18
+ alignItems: 'start',
19
+ justify: 'between'
20
+ }, ref: headerRef, children: [_jsx(Flex, { container: { direction: 'column', rowGap: 1.5 }, as: StyledInventoryPageTitleWrapper, children: _jsx(SummaryItem, { container: { colGap: 1 }, item: { grow: 1, shrink: 1 }, testId: testIds.root, primary: _jsxs(_Fragment, { children: [_jsx(StyledTextWithEllipsis, { "data-testid": testIds.title, variant: 'h1', ref: setEl, children: title }), _jsx(Tooltip, { target: el, smart: true, showDelay: 'none', hideDelay: 'none', children: title })] }) }) }), actions] }), description && (_jsx(StyledDescription, { children: _jsx(ShowMoreLess, { lines: 1, children: _jsx(Text, { children: description }) }) }))] }));
21
+ };
22
+ export default withTestIds(InventoryPageHeader, getPageHeaderTestIds);
23
+ //# sourceMappingURL=InventoryPageHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InventoryPageHeader.js","sourceRoot":"","sources":["../../../../src/components/PageTemplates/InventoryPageTemplate/InventoryPageHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,I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AEd,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,+BAA+B,YACxF,KAAC,WAAW,IACV,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACxB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAC5B,MAAM,EAAE,OAAO,CAAC,IAAI,EACpB,OAAO,EACL,8BACE,KAAC,sBAAsB,mBAAc,OAAO,CAAC,KAAK,EAAE,OAAO,EAAC,IAAI,EAAC,GAAG,EAAE,KAAK,YACxE,KAAK,GACiB,EACzB,KAAC,OAAO,IAAC,MAAM,EAAE,EAAE,EAAE,KAAK,QAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YACzD,KAAK,GACE,IACT,GAEL,GACG,EACN,OAAO,IACH,EACN,WAAW,IAAI,CACd,KAAC,iBAAiB,cAChB,KAAC,YAAY,IAAC,KAAK,EAAE,CAAC,YACpB,KAAC,IAAI,cAAE,WAAW,GAAQ,GACb,GACG,CACrB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { useMemo, useRef } from 'react';\n\nimport {\n Flex,\n useTestIds,\n withTestIds,\n type TestIdProp,\n useElement,\n Tooltip,\n useBreakpoint,\n Text,\n SummaryItem,\n ShowMoreLess\n} from '@pega/cosmos-react-core';\n\nimport { getPageHeaderTestIds } from '../PageTemplates.test-ids';\nimport type { InventoryPageTemplateProps, PageTemplateProps } from '../PageTemplate.types';\nimport {\n StyledInventoryPageTitleWrapper,\n StyledDescription,\n StyledTextWithEllipsis\n} from '../PageTemplate.styles';\nimport HeaderActionButtons from '../HeaderActionButtons';\n\ntype InventoryPageHeaderProps = InventoryPageTemplateProps['header'] &\n Pick<PageTemplateProps, 'progress'> &\n TestIdProp;\n\nconst InventoryPageHeader = ({\n testId,\n title,\n primaryAction,\n secondaryAction,\n additionalActions = [],\n description,\n progress\n}: InventoryPageHeaderProps) => {\n const testIds = useTestIds(testId, getPageHeaderTestIds);\n const headerRef = useRef<HTMLDivElement>(null);\n const isMediumOrAbove = useBreakpoint('md', { breakpointRef: headerRef });\n\n const [el, setEl] = useElement();\n\n const actions = useMemo(() => {\n return (\n <HeaderActionButtons\n additionalActions={additionalActions}\n primaryAction={primaryAction}\n secondaryAction={secondaryAction}\n testIds={testIds}\n progress={progress}\n />\n );\n }, [primaryAction?.variant, progress, isMediumOrAbove]);\n\n return (\n <Flex\n container={{\n direction: 'column'\n }}\n >\n <Flex\n container={{\n alignItems: 'start',\n justify: 'between'\n }}\n ref={headerRef}\n >\n <Flex container={{ direction: 'column', rowGap: 1.5 }} as={StyledInventoryPageTitleWrapper}>\n <SummaryItem\n container={{ colGap: 1 }}\n item={{ grow: 1, shrink: 1 }}\n testId={testIds.root}\n primary={\n <>\n <StyledTextWithEllipsis data-testid={testIds.title} variant='h1' ref={setEl}>\n {title}\n </StyledTextWithEllipsis>\n <Tooltip target={el} smart showDelay='none' hideDelay='none'>\n {title}\n </Tooltip>\n </>\n }\n />\n </Flex>\n {actions}\n </Flex>\n {description && (\n <StyledDescription>\n <ShowMoreLess lines={1}>\n <Text>{description}</Text>\n </ShowMoreLess>\n </StyledDescription>\n )}\n </Flex>\n );\n};\n\nexport default withTestIds(InventoryPageHeader, getPageHeaderTestIds);\n"]}
@@ -0,0 +1,5 @@
1
+ import { type ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
2
+ import type { InventoryPageTemplateProps } from '../PageTemplate.types';
3
+ declare const InventoryPageTemplate: ForwardRefForwardPropsComponent<InventoryPageTemplateProps>;
4
+ export default InventoryPageTemplate;
5
+ //# sourceMappingURL=InventoryPageTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InventoryPageTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAKxE,QAAA,MAAM,qBAAqB,EAAE,+BAA+B,CAAC,0BAA0B,CAyBpF,CAAC;AAEJ,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { OneColumnPage as CoreOneColumnPage, Banner } from '@pega/cosmos-react-core';
4
+ import { StyledInventoryPage } from '../PageTemplate.styles';
5
+ import InventoryPageHeader from './InventoryPageHeader';
6
+ const InventoryPageTemplate = forwardRef(({ content, errorBanner, header, testId, ...restProps }, ref) => {
7
+ return (_jsx(CoreOneColumnPage, { ...restProps, a: content, as: StyledInventoryPage, header: _jsx(InventoryPageHeader, { testId: testId, ...header }), scrollContent: true, title: header.title, banners: errorBanner && _jsx(Banner, { testId: testId, ...errorBanner }), ref: ref }));
8
+ });
9
+ export default InventoryPageTemplate;
10
+ //# sourceMappingURL=InventoryPageTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InventoryPageTemplate.js","sourceRoot":"","sources":["../../../../src/components/PageTemplates/InventoryPageTemplate/InventoryPageTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,MAAM,EAEP,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,MAAM,qBAAqB,GACzB,UAAU,CACR,CACE,EACE,OAAO,EACP,WAAW,EACX,MAAM,EACN,MAAM,EACN,GAAG,SAAS,EACgC,EAC9C,GAAwB,EACxB,EAAE;IACF,OAAO,CACL,KAAC,iBAAiB,OACZ,SAAS,EACb,CAAC,EAAE,OAAO,EACV,EAAE,EAAE,mBAAmB,EACvB,MAAM,EAAE,KAAC,mBAAmB,IAAC,MAAM,EAAE,MAAM,KAAM,MAAM,GAAI,EAC3D,aAAa,QACb,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,WAAW,IAAI,KAAC,MAAM,IAAC,MAAM,EAAE,MAAM,KAAM,WAAW,GAAI,EACnE,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,eAAe,qBAAqB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { Ref, PropsWithoutRef } from 'react';\n\nimport {\n OneColumnPage as CoreOneColumnPage,\n Banner,\n type ForwardRefForwardPropsComponent\n} from '@pega/cosmos-react-core';\n\nimport type { InventoryPageTemplateProps } from '../PageTemplate.types';\nimport { StyledInventoryPage } from '../PageTemplate.styles';\n\nimport InventoryPageHeader from './InventoryPageHeader';\n\nconst InventoryPageTemplate: ForwardRefForwardPropsComponent<InventoryPageTemplateProps> =\n forwardRef(\n (\n {\n content,\n errorBanner,\n header,\n testId,\n ...restProps\n }: PropsWithoutRef<InventoryPageTemplateProps>,\n ref: Ref<HTMLDivElement>\n ) => {\n return (\n <CoreOneColumnPage\n {...restProps}\n a={content}\n as={StyledInventoryPage}\n header={<InventoryPageHeader testId={testId} {...header} />}\n scrollContent\n title={header.title}\n banners={errorBanner && <Banner testId={testId} {...errorBanner} />}\n ref={ref}\n />\n );\n }\n );\n\nexport default InventoryPageTemplate;\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';
2
+ import type { OverviewPageTemplateProps } from '../PageTemplate.types';
3
+ declare const OverviewPageTemplate: ForwardRefForwardPropsComponent<OverviewPageTemplateProps>;
4
+ export default OverviewPageTemplate;
5
+ //# sourceMappingURL=OverviewPageTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverviewPageTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/PageTemplates/OverviewPageTemplate/OverviewPageTemplate.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAKvE,QAAA,MAAM,oBAAoB,EAAE,+BAA+B,CAAC,yBAAyB,CAiBpF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}