@pega/sdk 0.0.5 → 0.0.6

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 (266) hide show
  1. package/README.md +10 -3
  2. package/dist/index.js +764 -165
  3. package/package.json +1 -1
  4. package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
  5. package/templates/react-native-sdk-reference/.prettierignore +17 -0
  6. package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
  7. package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
  8. package/templates/react-native-sdk-reference/AGENTS.md +3 -0
  9. package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
  10. package/templates/react-native-sdk-reference/README.md +56 -0
  11. package/templates/react-native-sdk-reference/app.json +40 -5
  12. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
  13. package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
  14. package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
  15. package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
  16. package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
  17. package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
  18. package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
  19. package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
  20. package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
  21. package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
  22. package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
  23. package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
  24. package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
  25. package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
  26. package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
  27. package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
  28. package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
  29. package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
  30. package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
  31. package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
  32. package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
  33. package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
  34. package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
  35. package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
  36. package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
  37. package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
  38. package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
  39. package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
  40. package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
  41. package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
  42. package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
  43. package/templates/react-native-sdk-reference/package.json +59 -14
  44. package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
  45. package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  46. package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
  47. package/templates/react-native-sdk-reference/sdk-config.json +31 -9
  48. package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
  49. package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
  50. package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
  51. package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
  52. package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
  53. package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
  54. package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
  55. package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
  56. package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
  57. package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
  58. package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
  59. package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
  60. package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
  61. package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
  62. package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
  63. package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
  64. package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
  65. package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
  66. package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
  67. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
  68. package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
  69. package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
  70. package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
  71. package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
  72. package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
  73. package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
  74. package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
  75. package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
  76. package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
  77. package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
  78. package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
  79. package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
  80. package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
  81. package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
  82. package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
  83. package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
  84. package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
  85. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
  86. package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
  87. package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
  88. package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
  89. package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
  90. package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
  91. package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
  92. package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
  93. package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
  94. package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
  95. package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
  96. package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
  97. package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
  98. package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
  99. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
  100. package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
  101. package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
  102. package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
  103. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
  104. package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
  105. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
  106. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
  107. package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
  108. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
  109. package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
  110. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
  111. package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
  112. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
  113. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
  114. package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
  115. package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
  116. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
  117. package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
  118. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
  119. package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
  120. package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
  121. package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
  122. package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
  123. package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
  124. package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
  125. package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
  126. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
  127. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
  128. package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
  129. package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
  130. package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
  131. package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
  132. package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
  133. package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
  134. package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
  135. package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
  136. package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
  137. package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
  138. package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
  139. package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
  140. package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
  141. package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
  142. package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
  143. package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
  144. package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
  145. package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
  146. package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
  147. package/templates/react-native-sdk-reference/tsconfig.json +9 -8
  148. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
  149. package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
  150. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
  151. package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
  152. package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
  153. package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
  154. package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
  155. package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
  156. package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
  157. package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
  158. package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
  159. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
  160. package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
  161. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
  162. package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
  163. package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
  164. package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
  165. package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
  166. package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
  167. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
  168. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
  169. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
  170. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
  171. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
  172. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
  173. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
  174. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
  175. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
  176. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
  177. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
  178. package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
  179. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
  180. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
  181. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
  182. package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
  183. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
  184. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
  185. package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
  186. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
  187. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
  188. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
  189. package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
  190. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
  191. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
  192. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
  193. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
  194. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
  195. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
  196. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
  197. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
  198. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
  199. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
  200. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
  201. package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
  202. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
  203. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
  204. package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
  205. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
  206. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
  207. package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
  208. package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
  209. package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
  210. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
  211. package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
  212. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
  213. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
  214. package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
  215. package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
  216. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
  217. package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
  218. package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
  219. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
  220. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
  221. package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
  222. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
  223. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
  224. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
  225. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
  226. package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
  227. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
  228. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
  229. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
  230. package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
  231. package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
  232. package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
  233. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
  234. package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
  235. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
  236. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
  237. package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
  238. package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
  239. package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
  240. package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
  241. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
  242. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
  243. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
  244. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
  245. package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
  246. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
  247. package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
  248. package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
  249. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
  250. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
  251. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
  252. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
  253. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
  254. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
  255. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
  256. package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
  257. package/templates/react-sdk-reference/package.json +1 -1
  258. package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
  259. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  260. package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
  261. package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
  262. package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
  263. package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
  264. package/templates/react-native-sdk-reference/App.tsx +0 -49
  265. package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
  266. package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
@@ -12,150 +12,189 @@ Renders a multi-step form where each section is a tab. Tabs display error badges
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `HierarchicalForm` (in `component-map.ts`)
15
+ - **Registration key:** `HierarchicalForm` (in the project's component map)
16
16
  - **Category:** Form template
17
- - **Extends:** `PConnProps`
18
-
19
- ## Props
20
-
21
- | Prop | Type | Required | Description |
22
- | -------------- | ------------- | -------- | --------------------------------------------- |
23
- | `children` | `ReactNode[]` | Yes | One child per tab section |
24
- | `instructions` | `string` | No | HTML instruction text shown above the tab bar |
25
- | `getPConnect` | `function` | Yes | PConnect getter |
26
-
27
- ## Component Skeleton
28
-
29
- ```typescript
30
- import { type PropsWithChildren } from 'react';
31
- import { useHierarchicalForm, type HierarchicalFormProps } from './hooks';
32
-
33
- export default function HierarchicalForm(props: PropsWithChildren<HierarchicalFormProps>) {
34
- // 1. Custom hook handles: active tab, tab click, error counts, instructions, processed tabs
35
- const { currentTabId, handleTabClick, processedTabs, instructions } = useHierarchicalForm(props);
36
-
37
- // 2. Guard: no visible tabs
38
- if (!currentTabId) return null;
39
-
40
- // 3. Render: instructions + TabContext + Tabs (with error badges) + TabPanels
41
- return (
42
- <FlexColumn>
43
- {instructions && <div dangerouslySetInnerHTML={{ __html: instructions }} />}
44
- <TabContext value={currentTabId.toString()}>
45
- <TabBar onChange={handleTabClick} value={currentTabId.toString()} variant="scrollable">
46
- {processedTabs.map(tab => {
47
- const tabLabel = tab.name || tab.label;
48
- return (
49
- <Tab key={tab.id} value={tab.id?.toString()} label={
50
- tab.errors
51
- ? <Tooltip title={`${tabLabel} has errors`}>
52
- <span>{tabLabel} <Badge badgeContent={tab.errors} color="error" /></span>
53
- </Tooltip>
54
- : tabLabel
55
- } />
56
- );
57
- })}
58
- </TabBar>
59
- {processedTabs.map(tab => (
60
- <TabPanel key={tab.id} value={tab.id?.toString()} tabIndex={+tab.id} keepMounted>
61
- {tab.content || 'No content exists'}
62
- </TabPanel>
63
- ))}
64
- </TabContext>
65
- </FlexColumn>
66
- );
67
- }
68
- ```
69
-
70
- > **Key implementation note:** All tab logic (active tab persistence, error counting, tab filtering) is encapsulated in the `useHierarchicalForm` hook. Implement that hook separately — it uses `PCore.getNavigationUtils()` for tab persistence and `useGetTabsCount` for error tracking.
17
+ - **Extends:** the project's base component interface
18
+
19
+ ## Inputs
20
+
21
+ | Input | Type | Required | Description |
22
+ | -------------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------------- |
23
+ | `children` | child element list | Yes | One child per tab section |
24
+ | `instructions` | string | No | HTML instruction text shown above the tab bar |
25
+ | `getPConnect` | function | Yes | PConnect getter |
26
+ | `tabsVisibility` | object | No | Record mapping tab index to boolean visibility |
27
+ | `template` | string | No | Template identifier passed to deferred tab loading |
28
+ | `lastUpdateCaseTime` | string or number | No | Timestamp of last case update (falls back to `getPConnect().getValue('caseInfo.lastUpdateTime')`) |
29
+
30
+ ## Implementation Structure
31
+
32
+ **Module Setup:** This component needs the project's base component interface for typing. The tab logic is encapsulated in a separate composable/helper module that handles active-tab persistence, tab-click handling, per-tab error counting, instructions extraction, and tab processing. Additionally, tab utility helpers (`getActiveTabId`, `getFirstVisibleTabId`, `tabClick`) and an instructions helper (`getInstructions`) are needed from the project's shared template utilities.
33
+
34
+ **Main Component Logic** — steps in order:
35
+
36
+ 1. Invoke the extracted tab-logic composable, passing the component's inputs. It returns `currentTabId`, `handleTabClick`, `processedTabs`, and `instructions`.
37
+ 2. Guard: if there is no `currentTabId` (no visible tabs), render nothing.
38
+ 3. Render a flex column containing (if present) the instructions HTML rendered as raw HTML content, followed by a tab context wrapping a scrollable tab bar and tab panels.
39
+ 4. Build each tab bar entry from `processedTabs`: the label is `tab.name || tab.label`; if `tab.errors` is truthy, wrap the label in a tooltip reading "`{label} has errors`" and append a badge showing the error count; otherwise render the plain label.
40
+ 5. Render one tab panel per processed tab (keeping content mounted), showing `tab.content` or a "No content exists" fallback.
41
+
42
+ > **Key implementation note:** All tab logic (active tab persistence, error counting, tab filtering, PubSub subscriptions) is encapsulated in the composable. It uses `PCore.getNavigationUtils()` for tab persistence, `PCore.getContextTreeManager().onViewMutate()` for field-level error tracking, and `PCore.getMessagingServiceManager()` for case refresh subscriptions.
71
43
 
72
44
  ## Behavioral Contract
73
45
 
74
- ### Hook: `useHierarchicalForm`
46
+ ### Tab Logic Composable
47
+
48
+ The extracted tab-logic composable accepts the component's inputs and returns:
49
+
50
+ - `currentTabId`: currently selected tab index (string, e.g. `'0'`)
51
+ - `handleTabClick`: cached callback for tab selection changes
52
+ - `processedTabs`: array of tab objects augmented with computed `errors` count
53
+ - `instructions`: sanitized HTML string (or empty)
75
54
 
76
- `useHierarchicalForm(getPConnect, numTabs)` returns:
55
+ Internally it manages:
77
56
 
78
- - `activeTabId`: currently selected tab index (string, e.g. `'0'`)
79
- - `setActiveTabId`: setter for `activeTabId`
80
- - `tabErrorCounts`: `Record<string, number>` — error count per tab index key
57
+ - Local state for `currentTabId` and `tabErrors` (record of per-field errors per tab)
58
+ - Instance references for `tabErrors` and `submitAttempted` (to avoid stale closures)
59
+ - Memoized computation for `navigationKey`, `tabItems` (visible tabs), and `processedTabs`
60
+ - Cached callbacks for `handleTabClick`, `updateTabErrorsOnViewMutate`, `navigateToFirstErrorTab`, and `highlightFirstErrorTab`
81
61
 
82
- Internally it calls `useGetTabsCount(getPConnect)` to compute `tabErrorCounts`.
62
+ ### Navigation Key Derivation
63
+
64
+ - `navigationKey` is built from: `{caseInfoId or landingPageViewName}-{metadataName}-HierarchicalForm`
65
+ - `getLandingPageViewName(contextName)`: strips the trailing segment from contextName, then uses `PCore.getContainerUtils().getActiveContainerItemName(target)` and `PCore.getContainerUtils().getContainerItemData(target, activeItemID)` to get `containerItemData.view.config.name`
66
+ - Must be stable across re-renders — derive it once via memoized computation.
83
67
 
84
68
  ### Active Tab Persistence
85
69
 
86
- - On mount, read persisted tab from `PCore.getNavigationUtils().getComponentState(navigationKey)` — use `getActiveTabId(componentState)` to extract the stored tab index, or fall back to `getFirstVisibleTabId(tabItems)`.
87
- - On tab change, persist via `PCore.getNavigationUtils().setComponentState(navigationKey, { activeTabId: newId })`.
88
- - `navigationKey` is derived from the component's fully-qualified context path.
70
+ - On initialization, read persisted tab from `PCore.getNavigationUtils().getComponentState(navigationKey)` — extract `activeTab` from the stored state, or fall back to `getFirstVisibleTabId(deferLoadedTabs)`.
71
+ - On tab change, persist via `PCore.getNavigationUtils().setComponentState(navigationKey, { activeTab: currentTabId })`.
72
+ - Also persist an `ActiveTab` key for the CaseView: `{caseInfoId}-CaseView-ActiveTab` → `{ id: currentTabId }`.
73
+ - On cleanup, if the context is a modal (`getContextName()` includes `/modal`), reset the stored tab to `firstTabId`.
74
+
75
+ ### Deferred Tab Loading
76
+
77
+ - The first child is a deferred-loaded tabs container. Set the inherited `template` on it via `deferLoadedTabs.getPConnect().setInheritedProp('template', template)`.
78
+ - `tabsFromChildren` is obtained from `deferLoadedTabs.getPConnect().getChildren()`.
79
+
80
+ ### Tab Visibility
81
+
82
+ - On initialization, iterate the deferred children; for each child whose raw config has a `visibility` property, store `tabsVisibility[index] = rawConfigProps.visibility`.
83
+ - Register additional inputs: `getPConnect().registerAdditionalProps({ tabsVisibility })` and `getPConnect().registerAdditionalProps({ lastUpdateCaseTime: '@P caseInfo.lastUpdateTime' })`.
84
+ - When `tabsVisibility` changes and all values are booleans, serialize them to a string key to trigger tab re-evaluation.
85
+
86
+ ### Case Refresh Subscription
87
+
88
+ - If `fullCaseId` is available: subscribe to case messages via `PCore.getMessagingServiceManager().getCaseSubscription(fullCaseId).subscribe({ caseId: fullCaseId }, handleCaseRefresh)`.
89
+ - `handleCaseRefresh`: if `message.subtype === 'tab'`, call `refreshTabData()`.
90
+ - On cleanup: unsubscribe from the case subscription.
91
+
92
+ ### Tab Data and Active Tab Sync
93
+
94
+ - Use a tab-count helper (from the project's SDK utilities) initialized with `(deferLoadedTabs, 'hierarchical', currentTabId, template)` to get `tabData` and `refreshTabData`.
95
+ - Refresh tab data when `lastUpdateCaseTime` changes.
96
+ - When `tabData` changes or tab visibility changes, re-evaluate the active tab via `getActiveTabId(tabData, currentTabId)` and update if changed.
97
+
98
+ ### Error Tracking
99
+
100
+ - `tabErrors`: a record mapping `tab.id` → `{ fieldName: messages[] }` — tracks per-field validation errors per tab.
101
+ - `updateTabErrorsOnViewMutate(messageObject, tab)`: called by `PCore.getContextTreeManager().onViewMutate()` for each tab's context. If the message type is `MESSAGES_TYPE_ERROR`, adds the field errors; otherwise removes them.
102
+ - Register `onViewMutate` callbacks for each visible tab item, using `tab.getPConnect().getContextName()`, `tab.getPConnect().getPageReference()`, and `tab.getPConnect()._rawConfig.config.name`.
103
+
104
+ ### Error Navigation on Submit
105
+
106
+ - Subscribe to `PCore.getConstants().PUB_SUB_EVENTS.ERROR_ON_FINISH_ASSIGNMENT`: when triggered, call `highlightFirstErrorTab()` which sets `submitAttempted` to true and navigates to the first tab with errors.
107
+ - Subscribe to `PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED`: when triggered, reset all tab errors and clear `submitAttempted`.
108
+ - When `tabErrors` changes and `submitAttempted` is true, re-navigate to the first error tab (handles late-arriving validation messages).
89
109
 
90
110
  ### Instructions
91
111
 
92
- - Call `getInstructions(getPConnect(), props.instructions)` to get sanitized HTML.
93
- - If non-empty, render `<div className='psdk-default-form-instruction-text' dangerouslySetInnerHTML={{ __html: instructions }} />` above the tabs.
112
+ - Call `getInstructions(getPConnect(), inputs.instructions)` to get sanitized HTML.
113
+ - If non-empty, render as raw HTML content above the tabs.
94
114
 
95
115
  ### Tab Items
96
116
 
97
- - Build `tabItems` from `children` — each entry has `{ id: index.toString(), name: child.label }`.
98
- - Filter to visible tabs via `getFirstVisibleTabId(tabItems)`.
117
+ - `tabItems`: memoized computation filtering `tabData` to only visible tabs (those where `tab.visibility()` returns true).
118
+ - Each tab has `id`, `name`/`label`, `content`, `errors`, and PConnect methods.
99
119
 
100
120
  ### Error Badge
101
121
 
102
- - For each tab, read `tabErrorCounts[tabIndex]`.
103
- - If `> 0`: wrap the tab label with `<Tooltip title={errorCountMsg}><Badge badgeContent={count} color='error'>{label}</Badge></Tooltip>`.
122
+ - `processedTabs`: memoized computation that augments each visible tab with an `errors` count — the total number of error messages across all fields in `tabErrors[tab.id]`.
123
+ - If `errors` is truthy: wrap the tab label with a tooltip reading "`{label} has errors`" and display a badge with the error count.
104
124
  - Else: render the label plain.
105
125
 
126
+ ### Tab Click
127
+
128
+ - `handleTabClick(event, id)`: cached callback that delegates to `tabClick(id, tabData, currentTabId, setCurrentTabId)` — a shared utility that handles tab selection logic.
129
+
106
130
  ### Render
107
131
 
108
- 1. Optional instruction block (above tabs).
109
- 2. `<TabContext value={activeTabId}>` wrapper.
110
- 3. `<Tabs onChange={handleTabChange} value={activeTabId}>` containing `<Tab>` per visible tab (with error badge label if applicable).
111
- 4. `<TabPanel value={tabId}>` per tab containing the corresponding child.
132
+ 1. Optional instruction block (rendered as raw HTML, above tabs).
133
+ 2. Tab context wrapper with value set to `currentTabId`.
134
+ 3. Scrollable tab bar containing one tab entry per `processedTabs` item (with error badge label if applicable, text-transform disabled).
135
+ 4. Tab panels (kept mounted) per processed tab containing `tab.content` or "No content exists" fallback.
112
136
 
113
137
  ## Visual Specifications
114
138
 
115
139
  ### Tab Bar
116
140
 
117
- | Property | Value |
118
- | ----------- | ------------------------------------------------------ |
119
- | Orientation | Horizontal |
120
- | Error badge | Red MUI Badge with tooltip showing error count message |
141
+ | Property | Value |
142
+ | ----------- | ----------------------------------------------------------- |
143
+ | Orientation | Horizontal, scrollable |
144
+ | Error badge | Red badge with tooltip showing error count message |
145
+ | Border | Bottom border on the tab bar container (1px, divider color) |
121
146
 
122
147
  **CSS-only implementation notes:**
123
148
 
124
- - Tab bar: same as `DetailsSubTabs` — `display: flex; border-bottom: 2px solid var(--divider)`.
125
- - Error badge: red circle badge overlaid top-right of the tab label text.
126
- - Instruction text: `padding: 0.5rem 0; margin-bottom: 0.5rem; font-size: 0.875rem`.
149
+ - Tab bar: `display: flex; border-bottom: 1px solid var(--divider)`.
150
+ - Error badge: red circle badge positioned inline next to the tab label text (not overlaid).
151
+ - Error badge and label wrapped in a flex container with `align-items: center; gap: 0.5rem`.
152
+ - Instruction text: rendered with bottom margin (approximately 0.5rem) above the tab bar.
153
+ - Tab panels: no horizontal padding (panel content fills available width).
154
+ - Tab labels: no text-transform applied (preserve original case).
127
155
 
128
156
  ## Edge Cases & Special Logic
129
157
 
130
- - `useGetTabsCount` is a custom hook specific to `HierarchicalForm` — it tracks validation errors per tab section.
131
- - `getActiveTabId` / `getFirstVisibleTabId` are helpers from `tabUtils` — they handle the case where the persisted tab is no longer visible.
132
- - `navigationKey` must be stable across re-renders — derive it once in `useMemo` from `getPConnect().getStateProps()` or equivalent.
133
- - If no visible tabs, render nothing (null).
158
+ - The tab-count helper tracks validation errors per tab section and must be refreshed on case updates.
159
+ - `getActiveTabId` / `getFirstVisibleTabId` are shared tab utilities — they handle the case where the persisted tab is no longer visible.
160
+ - `navigationKey` must be stable across re-renders — derive it once via memoized computation from the case ID (or landing page view name), metadata name, and the component name.
161
+ - If no visible tabs, render nothing.
162
+ - When the component is in a modal context, reset persisted tab state on cleanup to avoid stale navigation state.
163
+ - The `_rawConfig` property on PConnect is used to access the raw view config name for `onViewMutate` registration.
164
+ - Error navigation on submit attempts only occurs after `ERROR_ON_FINISH_ASSIGNMENT` fires — it does not proactively validate on tab switch.
165
+ - `CURRENT_ASSIGNMENT_UPDATED` clears all error state, preventing stale error badges from persisting across assignment transitions.
134
166
 
135
167
  ## Dependencies
136
168
 
137
- - `useHierarchicalForm`, `useGetTabsCount` from `./hooks`
138
- - `getActiveTabId`, `getFirstVisibleTabId`, `tabClick` from `../SubTabs/tabUtils`
139
- - `getInstructions` from `../../helpers/template-utils`
140
- - `TabContext`, `TabPanel` from `@mui/lab`
141
- - `Tab`, `Tabs`, `Badge`, `Tooltip` from `@mui/material`
169
+ - Tab-logic composable (custom extracted module) — encapsulates all tab state, persistence, and error tracking
170
+ - Tab utility helpers (`getActiveTabId`, `getFirstVisibleTabId`, `tabClick`) — shared tab navigation logic from the project's SubTabs utilities
171
+ - `getInstructions` — shared template utility for sanitizing instruction HTML
172
+ - Tab-count helper from the project's SDK utilities — for computing per-tab validation data
173
+ - `PCore.getNavigationUtils()` — for persisting and retrieving active tab state
174
+ - `PCore.getContextTreeManager().onViewMutate()` — for registering per-field validation error listeners
175
+ - `PCore.getMessagingServiceManager().getCaseSubscription()` — for subscribing to case refresh messages
176
+ - `PCore.getPubSubUtils()` — for subscribing to `ERROR_ON_FINISH_ASSIGNMENT` and `CURRENT_ASSIGNMENT_UPDATED` events
177
+ - `PCore.getContainerUtils()` — for deriving the landing page view name (used in navigation key)
178
+ - `PCore.getConstants()` — for PubSub event keys, message type constants, and case info constants
142
179
 
143
180
  ## Design System Mapping
144
181
 
145
182
  **UI control type:** Multi-step tabbed form with per-tab error indicators and persistent active tab.
146
183
 
147
- Listed design systems are examples only.
184
+ When implementing in a specific design system, map the following:
148
185
 
149
- | Design System | Recommended Component |
150
- | ------------------ | -------------------------------------------------------------- |
151
- | Default (CSS only) | Custom tab bar + CSS badge (red circle via pseudo-element) |
152
- | MUI | `<Tabs>` + `<Badge>` + `<Tooltip>` + `<TabContext>/<TabPanel>` |
153
- | Ant Design | `<Tabs>` with custom `tabBarExtraContent` for error badges |
154
- | Chakra UI | `<Tabs>` + `<Badge colorScheme='red'>` inside tab label |
155
- | Shadcn/ui | `<Tabs>` + custom badge overlay on tab trigger |
186
+ - **Tab bar container:** Use the design system's horizontal tab strip with scrollable overflow support and a bottom border divider.
187
+ - **Tab entries:** Use the design system's tab trigger component with no text-transform; label text should preserve original case.
188
+ - **Error badge:** Use the design system's inline badge component (red/error color) positioned next to the tab label text within a flex row. Wrap the badge-label group in a tooltip showing "`{label} has errors`".
189
+ - **Tab panels:** Use the design system's tab panel or content container that supports keep-mounted behavior (all panels remain in DOM, only one is visible).
190
+ - **Instruction block:** A block-level element rendering sanitized HTML, positioned above the tab bar with bottom margin spacing.
191
+ - **Layout:** A vertical flex column containing the optional instruction block, the tab bar with bottom border, and the tab panel area.
156
192
 
157
- When implementing in a specific design system:
193
+ Implementation constraints regardless of design system:
158
194
 
159
- - Error badge is mandatory — always show error counts when `tabErrorCounts[id] > 0`
195
+ - Error badge is mandatory — always show error counts when `processedTabs[i].errors > 0`
160
196
  - Active tab must be persisted via `PCore.getNavigationUtils()` for correct navigation behavior
161
197
  - Instructions HTML renders above the entire tab bar, not per-tab
198
+ - Tab panels must remain mounted (not destroyed on tab switch) to preserve form state
199
+ - On submit error (`ERROR_ON_FINISH_ASSIGNMENT`), automatically navigate to the first tab with errors
200
+ - On assignment update (`CURRENT_ASSIGNMENT_UPDATED`), clear all error badges
@@ -12,81 +12,52 @@ Renders an inline dashboard layout consisting of a title heading, a main content
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `InlineDashboard` (in `component-map.ts`)
15
+ - **Registration key:** `InlineDashboard` (in the project's component map)
16
16
  - **Category:** Page template — dashboard
17
- - **Extends:** `PConnProps`
18
-
19
- ## Props
20
-
21
- | Prop | Type | Required | Description |
22
- | ---------------- | ------------- | -------- | ----------------------------------------------------------------------------- |
23
- | `title` | `string` | No | Dashboard title displayed above the content area |
24
- | `filterPosition` | `string` | No | Filter panel position: `'block-start'` (above) or other (side). Default: side |
25
- | `children` | `ReactNode[]` | Yes | `children[0]` = main content, `children[1]` = filter panel |
26
- | `getPConnect` | `function` | Yes | PConnect getter |
27
-
28
- ## Component Skeleton
29
-
30
- ```typescript
31
- import type { PropsWithChildren, ReactElement } from 'react';
32
- import type { PConnProps } from '@pega/sdk-react';
33
-
34
- interface InlineDashboardProps extends PConnProps {
35
- title: string;
36
- filterPosition?: string;
37
- }
38
-
39
- export default function InlineDashboard(props: PropsWithChildren<InlineDashboardProps>) {
40
- const { children, title, filterPosition } = props;
41
- const childrenToRender = children as ReactElement[];
42
-
43
- // 1. Direction for side layout
44
- const direction = filterPosition === 'inline-start' ? 'row-reverse' : 'row';
45
-
46
- // 2. Render: title + layout based on filterPosition
47
- return (
48
- <>
49
- <Heading variant="h4">{title}</Heading>
50
-
51
- {filterPosition === 'block-start' ? (
52
- // Stacked: filter above content (column-reverse so filter renders visually above)
53
- <GridContainer direction="column-reverse">
54
- <GridItem xs={12}>{childrenToRender[0]}</GridItem>
55
- <GridItem id="filters" xs={12}>{childrenToRender[1]}</GridItem>
56
- </GridContainer>
57
- ) : (
58
- // Side: content left, filters right (or reversed if inline-start)
59
- <GridContainer direction={direction}>
60
- <GridItem xs={9}>{childrenToRender[0]}</GridItem>
61
- <GridItem id="filters" xs={3}>{childrenToRender[1]}</GridItem>
62
- </GridContainer>
63
- )}
64
- </>
65
- );
66
- }
67
- ```
17
+ - **Extends:** the project's base component interface
18
+
19
+ ## Inputs
20
+
21
+ | Input | Type | Required | Description |
22
+ | ---------------- | ---------------- | -------- | ----------------------------------------------------------------------------- |
23
+ | `title` | string | No | Dashboard title displayed above the content area |
24
+ | `filterPosition` | string | No | Filter panel position: `'block-start'` (above) or other (side). Default: side |
25
+ | `children` | child node array | Yes | `children[0]` = main content, `children[1]` = filter panel |
26
+ | `getPConnect` | function | Yes | PConnect getter |
27
+
28
+ ## Implementation Structure
29
+
30
+ **Module Setup:** The component requires the project's base component interface and companion styles for layout classes (header, container, column, filter container, and inline styles).
31
+
32
+ **Main Component Logic** — steps in order:
33
+
34
+ 1. Receive inputs: extract `children`, `title`, and `filterPosition`. Treat `children` as a renderable element array (`childrenToRender`).
35
+ 2. Compute the side-layout `direction`: `'row-reverse'` when `filterPosition === 'inline-start'`, otherwise `'row'`.
36
+ 3. Render a heading (level 4) showing `title`, followed by one of two grid layouts:
37
+ - **When `filterPosition === 'block-start'`:** a grid container with column-reverse direction (so the filter panel appears visually above the content even though it's declared second in the DOM), containing a full-width item for `childrenToRender[0]` (main content) and a full-width item with `id="filters"` for `childrenToRender[1]` (filter panel).
38
+ - **Otherwise (side layout):** a grid container with the computed `direction`, containing a 9-column-wide item for `childrenToRender[0]` (main content) and a 3-column-wide item with `id="filters"` for `childrenToRender[1]` (filter panel).
68
39
 
69
40
  ## Behavioral Contract
70
41
 
71
42
  ### Title
72
43
 
73
- - If `title` is non-empty, render `<Typography variant='h4'>{title}</Typography>` above the grid.
44
+ - If `title` is non-empty, render a level-4 heading with `title` above the grid.
74
45
 
75
46
  ### Filter Position: `'block-start'`
76
47
 
77
48
  Stacked layout — filter panel above main content:
78
49
 
79
- - `<Grid container direction='column-reverse'>` (reverse so filter renders visually above content).
80
- - Filter panel: `<Grid id='filters' size={{ xs: 12 }}>`.
81
- - Main content: `<Grid size={{ xs: 12 }}>`.
50
+ - Grid container with column-reverse direction (reverse so filter renders visually above content).
51
+ - Filter panel: full-width (12-column) grid item with `id='filters'`.
52
+ - Main content: full-width (12-column) grid item.
82
53
 
83
54
  ### Filter Position: Other (side)
84
55
 
85
56
  Side-by-side layout — main content left, filters right:
86
57
 
87
- - `<Grid container direction={...}>` (optionally `row-reverse` based on position value).
88
- - Main content: `<Grid size={{ xs: 9 }}>`.
89
- - Filter panel: `<Grid id='filters' size={{ xs: 3 }}>`.
58
+ - Grid container with computed row direction (optionally reversed based on position value).
59
+ - Main content: 9-column-wide grid item.
60
+ - Filter panel: 3-column-wide grid item with `id='filters'`.
90
61
 
91
62
  ### Children Assignment
92
63
 
@@ -97,16 +68,11 @@ Side-by-side layout — main content left, filters right:
97
68
 
98
69
  ### Block-Start Layout (filter above content)
99
70
 
100
- ```
101
- [Filter panel — xs:12]
102
- [Main content — xs:12]
103
- ```
71
+ A stacked layout: the filter panel occupies the full width above the main content, which also occupies the full width below it.
104
72
 
105
73
  ### Side Layout (filter to side)
106
74
 
107
- ```
108
- [Main content — xs:9] [Filters — xs:3]
109
- ```
75
+ A side-by-side layout: the main content occupies the majority width (75%) on one side, with the filters occupying the remaining width (25%) beside it.
110
76
 
111
77
  **CSS-only implementation notes:**
112
78
 
@@ -116,34 +82,29 @@ Side-by-side layout — main content left, filters right:
116
82
  - Filter panel: `id='filters'` — required for accessibility/selector targeting.
117
83
  - Responsive: collapse side layout to stacked on mobile.
118
84
 
85
+ **Companion styles** define classes for: header (font-weight 500, font-size 1.25rem), container (vertical margins), column (grid with gap and baseline alignment), filter container (7-column repeat grid), and inline (grid with gap, baseline alignment, top margin).
86
+
119
87
  ## Edge Cases & Special Logic
120
88
 
121
89
  - If `children[1]` is absent (no filters), render only the main content without the grid.
122
- - `direction='column-reverse'` in block-start mode — this is the MUI Grid direction prop; in plain CSS, use flexbox `column` direction with `order` property.
123
- - `title` is optional — if absent, skip the `<Typography h4>` entirely (no empty heading).
90
+ - Column-reverse direction in block-start mode — in plain CSS, use flexbox column direction with `order` property.
91
+ - `title` is optional — if absent, skip the heading entirely (no empty heading).
124
92
  - Filter grid always gets `id='filters'` — this is used by `PromotedFilters` for integration.
125
93
 
126
94
  ## Dependencies
127
95
 
128
- - MUI: `<Typography variant='h4'>`, `<Grid container>`, `<Grid>` (child)
129
- - `PConnectComponent` from `@pega/sdk-react`
96
+ - A design-system heading component (level 4) for the title
97
+ - A design-system grid/layout component for the responsive container
98
+ - Companion styles for spacing and alignment classes
130
99
 
131
100
  ## Design System Mapping
132
101
 
133
102
  **UI control type:** Dashboard layout with configurable title and filter panel position.
134
103
 
135
- Listed design systems are examples only.
136
-
137
- | Design System | Title | Content/Filter Grid |
138
- | ------------------ | ------------------------------ | ---------------------- |
139
- | Default (CSS only) | `<h2>` | CSS grid or flexbox |
140
- | MUI | `<Typography variant='h4'>` | `<Grid container>` |
141
- | Ant Design | `<Typography.Title level={2}>` | `<Row>/<Col>` |
142
- | Chakra UI | `<Heading>` | `<Grid>` or `<HStack>` |
143
- | Shadcn/ui | `<h2>` | Tailwind grid |
104
+ When implementing in a specific design system, map the following: a level-4 heading for the title; a responsive grid container supporting directional flow (row, row-reverse, column-reverse); grid items that accept column-span sizing (full-width for stacked, 9/3 split for side layout). In a CSS-only approach, use a native heading element and CSS grid or flexbox. Other design systems provide equivalent grid and typography primitives.
144
105
 
145
- When implementing in a specific design system:
106
+ When implementing:
146
107
 
147
- - `filterPosition === 'block-start'` requires stacked layout (12/12) — not side layout (9/3)
108
+ - `filterPosition === 'block-start'` requires stacked layout (full-width / full-width) — not side layout (9/3)
148
109
  - Filter panel must always have `id='filters'`
149
- - Title heading (`h4` level) is optional — only render when `title` is provided
110
+ - Title heading (level 4) is optional — only render when `title` is provided