@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
@@ -8,10 +8,10 @@ Two-column layout template that splits children into two responsive grid columns
8
8
 
9
9
  ## Component Purpose
10
10
 
11
- Renders two child components side by side in a responsive grid. Column widths are driven by the `templateCol` prop (e.g., `'1fr 1fr'`, `'2fr 1fr'`). On mobile (`xs`), both columns collapse to full width. Three closely related sub-variants share this same layout logic:
11
+ Renders two child components side by side in a responsive grid. Column widths are driven by the `templateCol` input (e.g., `'1fr 1fr'`, `'2fr 1fr'`). On mobile, both columns collapse to full width. Three closely related sub-variants share this same layout logic:
12
12
 
13
13
  - **`TwoColumn`** — core layout, used inside forms and views
14
- - **`TwoColumnPage`** — thin wrapper that delegates to `TwoColumn` via the component registry
14
+ - **`TwoColumnPage`** — thin wrapper that delegates to `TwoColumn` via the project's component registry
15
15
  - **`TwoColumnTab`** — identical layout implementation used inside tab contexts
16
16
 
17
17
  ## Pega Metadata
@@ -22,97 +22,54 @@ Renders two child components side by side in a responsive grid. Column widths ar
22
22
  | TwoColumnPage | `TwoColumnPage` |
23
23
  | TwoColumnTab | `TwoColumnTab` |
24
24
 
25
- All three extend `PConnProps`. Children are received as React `children` (not via `getPConnect().getChildren()`).
25
+ All three extend the project's base component interface. Children are received via the framework's content projection mechanism (not via `getPConnect().getChildren()`).
26
26
 
27
- ## Component Skeletons
27
+ ## Implementation Structure
28
28
 
29
29
  ### TwoColumn (core)
30
30
 
31
- ```typescript
32
- import type { PropsWithChildren, ReactElement } from 'react';
33
- import type { GridSize } from '@mui/material/Grid';
34
- import type { PConnProps } from '@pega/sdk-react';
35
-
36
- interface TwoColumnProps extends PConnProps {
37
- templateCol?: string;
38
- }
39
-
40
- export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
41
- const { children, templateCol = '1fr 1fr' } = props;
42
- const childrenToRender = children as ReactElement[];
43
-
44
- if (childrenToRender.length !== 2) {
45
- console.error(`TwoColumn sees ${childrenToRender.length} children (expected 2)`);
46
- }
47
-
48
- // Parse templateCol to compute column sizes (12-grid)
49
- const colAArray = templateCol.replaceAll(/[a-z]+/g, '').split(/\s/).map(Number);
50
- const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
51
- const ratio = 12 / totalCols;
52
- const aSize = (ratio * colAArray[0]) as GridSize;
53
- const bSize = (ratio * colAArray[1]) as GridSize;
54
-
55
- return (
56
- <GridContainer spacing={1}>
57
- <GridItem xs={12} md={aSize} className="col-styles">{childrenToRender[0]}</GridItem>
58
- <GridItem xs={12} md={bSize} className="col-styles">{childrenToRender[1]}</GridItem>
59
- </GridContainer>
60
- );
61
- }
62
- // CSS: .col-styles { display: grid; gap: 1rem; align-content: baseline; }
63
- ```
31
+ **Module Setup:** Define the input contract as an extension of the project's base component interface, adding an optional `templateCol` string field and accepting children.
64
32
 
65
- ### TwoColumnPage
66
-
67
- ```typescript
68
- const TwoColumn = getComponentFromRegistry('TwoColumn');
69
- return <TwoColumn {...props} />;
70
- ```
71
-
72
- ### TwoColumnTab
73
-
74
- Identical implementation to `TwoColumn` — same `templateCol` parsing, same grid output.
75
-
76
- ## Props
33
+ **Main Component Logic** — steps in order:
77
34
 
78
- | Prop | Type | Required | Description |
79
- | ------------- | ------------- | -------- | ------------------------------------------------------------------------------ |
80
- | `children` | `ReactNode[]` | Yes | Exactly 2 children (left column, right column) |
81
- | `templateCol` | `string` | No | Column width ratio string, e.g., `'1fr 1fr'`, `'2fr 1fr'`. Default `'1fr 1fr'` |
35
+ 1. Receive `children` and `templateCol` (default `'1fr 1fr'`) from inputs; treat `children` as an array of two child elements.
36
+ 2. If the child count isn't exactly 2, log a console error noting the actual count (still continue rendering).
37
+ 3. **Parse `templateCol` into 12-grid sizes:** strip unit suffixes (e.g., `'fr'`) via a regex replace (remove all lowercase letters), split on whitespace, and convert each token to a number, producing a column-values array; sum the array into `totalCols`; compute `ratio = 12 / totalCols`; derive `aSize = ratio * colArray[0]` and `bSize = ratio * colArray[1]` (both treated as grid column size values within a 12-column system).
38
+ 4. Render a grid container with spacing of 1 unit (≈ 8px) containing two grid items, each with full width at mobile breakpoint and the computed column size at medium+ breakpoint, both with a column-styles class: the first holds `children[0]`, the second holds `children[1]`.
82
39
 
83
- ## Sub-Variants
40
+ **Visual-only styling notes:** apply a column-styles class to each column with `display: grid; gap: 1rem; align-content: baseline`.
84
41
 
85
42
  ### TwoColumnPage
86
43
 
87
- Thin pass-through wrapper. Retrieves `TwoColumn` from the component registry and renders it with all props forwarded:
88
-
89
- ```typescript
90
- const TwoColumn = getComponentFromRegistry('TwoColumn');
91
- return <TwoColumn {...props} />;
92
- ```
44
+ A thin pass-through wrapper: resolve `TwoColumn` from the project's component registry and render it forwarding all inputs.
93
45
 
94
46
  ### TwoColumnTab
95
47
 
96
- Identical implementation to `TwoColumn` — same grid layout, same `templateCol` parsing, same column styles. Registered separately under `TwoColumnTab` key to support tab context rendering.
48
+ Identical implementation to `TwoColumn` — same `templateCol` parsing, same grid output. Registered separately under `TwoColumnTab` key to support tab context rendering.
49
+
50
+ ## Inputs
51
+
52
+ | Name | Type | Required | Description |
53
+ | ------------- | ------------------ | -------- | ------------------------------------------------------------------------------ |
54
+ | `children` | renderable content | Yes | Exactly 2 children (left column, right column) |
55
+ | `templateCol` | `string` | No | Column width ratio string, e.g., `'1fr 1fr'`, `'2fr 1fr'`. Default `'1fr 1fr'` |
97
56
 
98
57
  ## Behavioral Contract
99
58
 
100
59
  1. Accept exactly 2 children. If a different count is received, log an error (console only — still render).
101
- 2. Parse `templateCol` to compute MUI Grid column sizes:
102
- - Strip unit suffixes (e.g., `'fr'`) from each token using regex: `.replaceAll(/[a-z]+/g, '')`.
60
+ 2. Parse `templateCol` to compute grid column sizes within a 12-column system:
61
+ - Strip unit suffixes (e.g., `'fr'`) from each token using regex (remove lowercase letters).
103
62
  - Split on whitespace and convert to numbers.
104
63
  - Compute `totalCols = sum(colArray)`.
105
64
  - Compute `ratio = 12 / totalCols`.
106
- - `aSize = ratio * colArray[0]`, `bSize = ratio * colArray[1]` (both clamped to MUI's 1–12 GridSize range).
107
- 3. Render a Grid container with `spacing={1}`.
108
- 4. Render `children[0]` in the left column at `size={{ xs: 12, md: aSize }}`.
109
- 5. Render `children[1]` in the right column at `size={{ xs: 12, md: bSize }}`.
110
- 6. Apply `colStyles` class to each column: `display: grid; gap: 1rem; alignContent: baseline`.
65
+ - `aSize = ratio * colArray[0]`, `bSize = ratio * colArray[1]`.
66
+ 3. Render a grid container with spacing of 1 unit (≈ 8px).
67
+ 4. Render `children[0]` in the left column at full width on mobile, `aSize` on medium+ breakpoint.
68
+ 5. Render `children[1]` in the right column at full width on mobile, `bSize` on medium+ breakpoint.
69
+ 6. Apply column-styles to each column: `display: grid; gap: 1rem; align-content: baseline`.
111
70
 
112
71
  ## Visual Specifications
113
72
 
114
- Derived from `TwoColumn.tsx` and `TwoColumnTab.tsx` makeStyles:
115
-
116
73
  ### Column Style
117
74
 
118
75
  | Property | Value |
@@ -129,10 +86,10 @@ Derived from `TwoColumn.tsx` and `TwoColumnTab.tsx` makeStyles:
129
86
 
130
87
  ### Responsive Behavior
131
88
 
132
- | Breakpoint | Column A | Column B |
133
- | ------------- | ------------------ | -------------------------------- |
134
- | xs (mobile) | 12/12 (full width) | 12/12 (full width, stacks below) |
135
- | md+ (desktop) | `aSize`/12 | `bSize`/12 |
89
+ | Breakpoint | Column A | Column B |
90
+ | ---------- | ---------- | ------------------------- |
91
+ | Mobile | full width | full width (stacks below) |
92
+ | Medium+ | `aSize`/12 | `bSize`/12 |
136
93
 
137
94
  **Column ratio examples:**
138
95
 
@@ -145,7 +102,7 @@ Derived from `TwoColumn.tsx` and `TwoColumnTab.tsx` makeStyles:
145
102
 
146
103
  **CSS-only implementation notes:**
147
104
 
148
- - Column container: `display: grid; gap: 1rem; align-content: start`.
105
+ - Column container: `display: grid; gap: 1rem; align-content: baseline`.
149
106
  - Outer grid: `display: grid; grid-template-columns: <aFraction>fr <bFraction>fr; gap: 8px`.
150
107
  - Mobile: `grid-template-columns: 1fr` (single column stack).
151
108
  - Each column has `display: grid; gap: 1rem; align-content: baseline` for internal stacking.
@@ -154,29 +111,23 @@ Derived from `TwoColumn.tsx` and `TwoColumnTab.tsx` makeStyles:
154
111
 
155
112
  - Default `templateCol` is `'1fr 1fr'` (equal split) when not provided.
156
113
  - The `templateCol` parsing is regex-based — any non-numeric suffix is stripped. If only numbers are provided (e.g., `'6 6'`), it still works.
157
- - `TwoColumnPage` uses `getComponentFromRegistry('TwoColumn')` — if the registry returns an override, that override is used instead of the default `TwoColumn` implementation.
114
+ - `TwoColumnPage` uses the project's component registry to resolve `TwoColumn` — if an override exists, that override is used instead.
158
115
 
159
116
  ## Dependencies
160
117
 
161
- - `TwoColumnPage`: `getComponentFromRegistry` from `@pega/sdk-react` — to resolve the `TwoColumn` component at runtime
162
- - `TwoColumn` / `TwoColumnTab`: no special dependencies beyond layout
118
+ - `TwoColumnPage`: the project's component registry — to resolve the `TwoColumn` component at runtime.
119
+ - `TwoColumn` / `TwoColumnTab`: no special dependencies beyond layout.
163
120
 
164
121
  ## Design System Mapping
165
122
 
166
123
  **UI control type:** Responsive two-column grid layout.
167
124
 
168
- Listed design systems are examples only.
169
-
170
- | Design System | Recommended Component |
171
- | ------------------ | -------------------------------------------------------------------- |
172
- | Default (CSS only) | CSS Grid with `grid-template-columns: <a>fr <b>fr; gap: 8px` |
173
- | MUI | `<Grid container spacing={1}><Grid size={{ xs: 12, md: N }}>` |
174
- | Ant Design | `<Row gutter={8}><Col xs={24} md={N * 2}>` (Ant uses 24-column grid) |
175
- | Chakra UI | `<SimpleGrid columns={{ base: 1, md: 2 }} spacing={2}>` |
176
- | Shadcn/ui | Tailwind `grid grid-cols-1 md:grid-cols-[<a>fr_<b>fr] gap-2` |
125
+ When implementing in a specific design system, map the following:
177
126
 
178
- When implementing in a specific design system:
127
+ - **Grid container** → use the DS's grid/layout system with configurable column spans
128
+ - **Column sizing** → parse `templateCol` using the ratio algorithm (strip units, divide 12 by total) to compute column sizes
129
+ - **Responsive behavior** → full width on mobile, computed ratio on medium+ breakpoint
130
+ - **Column style** → apply `display: grid; gap: 1rem; align-content: baseline` so children within each column stack top-aligned
131
+ - **TwoColumnPage** → resolve via the project's component registry and delegate
179
132
 
180
- - Parse `templateCol` using the same ratio algorithm (strip units, divide 12 by total)
181
- - Apply `align-content: baseline` so children within each column stack top-aligned
182
133
  - Collapse to single column on mobile breakpoint
@@ -10,8 +10,8 @@ Asymmetric two-column layout with a wide left column (~67%) and a narrow right c
10
10
 
11
11
  Renders two children side by side with the left column wider than the right. Typically used when the main content occupies the left and a utility/sidebar panel sits on the right. Four sub-variants:
12
12
 
13
- - **`WideNarrow`** — core CSS-based layout, accepts either `a`/`b` slot props or React `children[0]`/`children[1]`
14
- - **`WideNarrowPage`** — wrapper that passes React children as `a` and `b` slot props to `WideNarrow`
13
+ - **`WideNarrow`** — core CSS-based layout, accepts either `a`/`b` slot inputs or `children[0]`/`children[1]`
14
+ - **`WideNarrowPage`** — wrapper that passes children as `a` and `b` slot inputs to `WideNarrow`
15
15
  - **`WideNarrowForm`** — simplified wrapper using only `children`
16
16
  - **`WideNarrowDetails`** — details read-only variant; sets children to DISPLAY_ONLY mode and supports highlighted data
17
17
 
@@ -26,39 +26,39 @@ Renders two children side by side with the left column wider than the right. Typ
26
26
  | WideNarrowForm | `WideNarrowForm` |
27
27
  | WideNarrowDetails | `WideNarrowDetails` |
28
28
 
29
- All extend `PConnProps`.
29
+ All extend the project's base component interface.
30
30
 
31
- ## Props
31
+ ## Inputs
32
32
 
33
33
  ### WideNarrow
34
34
 
35
- | Prop | Type | Required | Description |
36
- | ---------- | ------------- | -------- | ---------------------------------------------------------- |
37
- | `children` | `ReactNode[]` | No | Two children — `[0]` → wide (left), `[1]` → narrow (right) |
38
- | `a` | `any` | No | Wide (left) column content |
39
- | `b` | `any` | No | Narrow (right) column content |
40
- | `title` | `string` | No | Optional title (not rendered) |
41
- | `cols` | `string` | No | Column template (not rendered) |
42
- | `icon` | `string` | No | Icon name (not rendered) |
35
+ | Name | Type | Required | Description |
36
+ | ---------- | ------------------ | -------- | ---------------------------------------------------------- |
37
+ | `children` | renderable content | No | Two children — `[0]` → wide (left), `[1]` → narrow (right) |
38
+ | `a` | `any` | No | Wide (left) column content |
39
+ | `b` | `any` | No | Narrow (right) column content |
40
+ | `title` | `string` | No | Optional title (not rendered) |
41
+ | `cols` | `string` | No | Column template (not rendered) |
42
+ | `icon` | `string` | No | Icon name (not rendered) |
43
43
 
44
44
  ### WideNarrowPage
45
45
 
46
- | Prop | Type | Required | Description |
47
- | ------------- | ------------- | -------- | ----------------------------------------------------- |
48
- | `children` | `ReactNode[]` | Yes | Two children — `[0]` → wide slot, `[1]` → narrow slot |
49
- | `title` | `string` | Yes | Page title (passed to WideNarrow) |
50
- | `templateCol` | `string` | No | Column ratio (default `'1fr 1fr'`) |
51
- | `icon` | `string` | No | Icon name (strips `'pi pi-'` prefix) |
46
+ | Name | Type | Required | Description |
47
+ | ------------- | ------------------ | -------- | ----------------------------------------------------- |
48
+ | `children` | renderable content | Yes | Two children — `[0]` → wide slot, `[1]` → narrow slot |
49
+ | `title` | `string` | Yes | Page title (passed to WideNarrow) |
50
+ | `templateCol` | `string` | No | Column ratio (default `'1fr 1fr'`) |
51
+ | `icon` | `string` | No | Icon name (strips `'pi pi-'` prefix) |
52
52
 
53
53
  ### WideNarrowForm
54
54
 
55
- | Prop | Type | Required | Description |
56
- | ---------- | ------------- | -------- | ------------------------------------------ |
57
- | `children` | `ReactNode[]` | Yes | Two children rendered in wide/narrow slots |
55
+ | Name | Type | Required | Description |
56
+ | ---------- | ------------------ | -------- | ------------------------------------------ |
57
+ | `children` | renderable content | Yes | Two children rendered in wide/narrow slots |
58
58
 
59
59
  ### WideNarrowDetails
60
60
 
61
- | Prop | Type | Required | Description |
61
+ | Name | Type | Required | Description |
62
62
  | --------------------- | ---------- | -------- | ---------------------------------------------------------- |
63
63
  | `label` | `string` | No | Section label for FieldGroup |
64
64
  | `showLabel` | `boolean` | No | Whether to show the label. Default `true` |
@@ -75,9 +75,9 @@ All extend `PConnProps`.
75
75
 
76
76
  ### WideNarrowPage
77
77
 
78
- 1. Extract `childArray = Children.toArray(children)`.
79
- 2. Retrieve `WideNarrow` from the component registry.
80
- 3. Render `<WideNarrow a={childArray[0]} b={childArray[1]} title={title} cols={templateCol} icon={icon?.replace('pi pi-', '')} />`.
78
+ 1. Extract the children array from the content projection.
79
+ 2. Resolve `WideNarrow` from the project's component registry.
80
+ 3. Render `WideNarrow` with `a` set to `children[0]`, `b` set to `children[1]`, `title`, `cols` set to `templateCol`, and `icon` with the `'pi pi-'` prefix stripped.
81
81
 
82
82
  ### WideNarrowForm
83
83
 
@@ -86,7 +86,7 @@ All extend `PConnProps`.
86
86
  ### WideNarrowDetails
87
87
 
88
88
  1. Set `getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY')` and `setInheritedProp('readOnly', true)`.
89
- 2. Map `getPConnect().getChildren()` → `createElement(PConnectComponent, { ...configObject, key: index })`.
89
+ 2. Map `getPConnect().getChildren()` → render each child using the project's PConnect bridge utility with the config object and a unique key.
90
90
  3. If `showHighlightedData` is true, read `getRawMetadata().config.highlightedData`, set each field's `displayMode = 'STACKED_LARGE_VAL'`, mark `pyStatusWork` as `displayAsStatus=true`, and create components via `getPConnect().createComponent(field, '', 0, {})`.
91
91
  4. Wrap in `<FieldGroup name={theName}>` using `propsToUse.showLabel && propsToUse.label`.
92
92
  5. Layout: highlighted data in `Grid size={{ xs: COLUMN_WIDTHS[i] }}` where **`COLUMN_WIDTHS = [8, 4]`** (wide left, narrow right — reversed vs NarrowWideDetails).
@@ -123,30 +123,23 @@ Derived from `WideNarrow.css`:
123
123
  ## Edge Cases & Special Logic
124
124
 
125
125
  - `WideNarrowDetails` defaults `children` to empty (`= []`) — safe even if no children are provided.
126
- - Highlighted data guard: check `if (!theConfigObject) theConfigObject = {}` before creating PConnectComponent — prevents crash on null config objects.
126
+ - Highlighted data guard: check `if (!theConfigObject) theConfigObject = {}` before creating the PConnect bridge component — prevents crash on null config objects.
127
127
  - Icon cleanup in `WideNarrowPage`: strip `'pi pi-'` from icon string before passing to `WideNarrow`.
128
128
 
129
129
  ## Dependencies
130
130
 
131
- - `WideNarrowPage`: `getComponentFromRegistry` from `@pega/sdk-react`
132
- - `WideNarrowDetails`: `getComponentFromRegistry('FieldGroup')`, `PConnectComponent` from `@pega/sdk-react`
131
+ - `WideNarrowPage`: the project's component registry — to resolve `WideNarrow` at runtime.
132
+ - `WideNarrowDetails`: the project's component registry (to resolve `FieldGroup`) and the project's PConnect bridge utility.
133
133
 
134
134
  ## Design System Mapping
135
135
 
136
136
  **UI control type:** Asymmetric two-column layout (main content + sidebar).
137
137
 
138
- Listed design systems are examples only.
138
+ When implementing in a specific design system, map the following:
139
139
 
140
- | Design System | Recommended Component |
141
- | ------------------ | -------------------------------------------------------------------------------- |
142
- | Default (CSS only) | CSS Grid `grid-template-columns: 2fr 1fr; gap: 1rem` |
143
- | MUI | `<Grid container><Grid size={{ xs: 12, md: 8 }}><Grid size={{ xs: 12, md: 4 }}>` |
144
- | Ant Design | `<Row gutter={16}><Col xs={24} md={16}><Col xs={24} md={8}>` |
145
- | Chakra UI | `<Grid templateColumns={{ base: '1fr', md: '2fr 1fr' }} gap={4}>` |
146
- | Shadcn/ui | Tailwind `grid grid-cols-1 md:grid-cols-[2fr_1fr] gap-4` |
147
-
148
- When implementing in a specific design system:
149
-
150
- - Wide column ≈ 67% width (left side)
151
- - Narrow column ≈ 33% width (right side)
152
- - `WideNarrowDetails` forces DISPLAY_ONLY + readOnly on all children
140
+ - **Two-column grid** → use the DS's grid with `2fr 1fr` column ratio (wide left, narrow right)
141
+ - **Mobile** → collapse to single column (`1fr`), wide content on top
142
+ - **WideNarrowDetails** → forces DISPLAY_ONLY + readOnly on children via inherited inputs
143
+ - **WideNarrowPage** → resolve via the project's component registry and delegate
144
+ - **Wide column** ≈ 67% width (left side)
145
+ - **Narrow column** ≈ 33% width (right side)
@@ -12,13 +12,13 @@ Provides the top navigation bar for WSS (Web Self-Service) portals. Responsive:
12
12
 
13
13
  ## Pega Metadata
14
14
 
15
- - **Registration key:** `WssNavBar` (in `component-map.ts`)
15
+ - **Registration key:** `WssNavBar` (in the project's component map)
16
16
  - **Category:** Navigation template — WSS portal
17
- - **Extends:** `PConnProps`
17
+ - **Extends:** the project's base component interface
18
18
 
19
- ## Props
19
+ ## Inputs
20
20
 
21
- | Prop | Type | Required | Description |
21
+ | Input | Type | Required | Description |
22
22
  | ------------------- | ---------- | -------- | ----------------------------------------------------- |
23
23
  | `links` | `array` | Yes | Array of `{ label, url, id }` navigation link objects |
24
24
  | `navDisplayOptions` | `object` | No | `{ alignment: 'left' | 'right' | 'center', position: 'inline' | 'below' }` |
@@ -26,85 +26,26 @@ Provides the top navigation bar for WSS (Web Self-Service) portals. Responsive:
26
26
  | `operatorInfo` | `object` | No | `{ displayName: string }` — for avatar initials |
27
27
  | `getPConnect` | `function` | Yes | PConnect getter |
28
28
 
29
- ## Component Skeleton
30
-
31
- ```typescript
32
- import { useState } from 'react';
33
- import { logout } from '@pega/auth/lib/sdk-auth-manager';
34
- import type { PConnProps } from '@pega/sdk-react';
35
- import './WssNavBar.css';
36
-
37
- interface WssNavBarProps extends PConnProps {
38
- appInfo: any;
39
- navLinks: any[];
40
- operator: { currentUserInitials: string };
41
- navDisplayOptions: { alignment: string; position: string };
42
- portalName: string;
43
- imageSrc: string;
44
- fullImageSrc: string;
45
- appName: any;
46
- }
47
-
48
- export default function WssNavBar(props: WssNavBarProps) {
49
- const { appInfo, navLinks, operator, navDisplayOptions } = props;
50
- const { alignment, position } = navDisplayOptions;
51
-
52
- // 1. Menu state
53
- const [anchorElNav, setAnchorElNav] = useState(null); // hamburger menu
54
- const [anchorElUser, setAnchorElUser] = useState(null); // user menu
55
- const localizedVal = PCore.getLocaleUtils().getLocaleValue;
56
-
57
- // 2. Nav links content (hidden on mobile, shown on desktop)
58
- const navLinksContent = (
59
- <Box sx={{ display: { xs: 'none', md: 'flex' }, justifyContent: alignment }}>
60
- {navLinks.map(link => <Button key={link.text} onClick={link.onClick}>{link.text}</Button>)}
61
- </Box>
62
- );
63
-
64
- // 3. Render: AppBar > Toolbar > (logo + hamburger(mobile) + navLinks(desktop) + avatar)
65
- return (
66
- <AppBar position="static">
67
- <Toolbar>
68
- {/* App logo + name */}
69
- <Button onClick={appInfo.onClick}>
70
- <img src={appInfo.imageSrc} />
71
- <span>{appInfo.appName}</span>
72
- </Button>
73
-
74
- {/* Hamburger (mobile only) */}
75
- <HamburgerButton sx={{ display: { xs: 'flex', md: 'none' } }}
76
- onClick={e => setAnchorElNav(e.currentTarget)} />
77
- <MobileMenu anchorEl={anchorElNav} open={Boolean(anchorElNav)}
78
- onClose={() => setAnchorElNav(null)}>
79
- {navLinks.map(link => <MenuItem key={link.text} onClick={link.onClick}>{link.text}</MenuItem>)}
80
- </MobileMenu>
81
-
82
- {/* Nav links inline (position === 'inline') */}
83
- {position === 'inline' && navLinksContent}
84
-
85
- {/* Operator avatar + logout menu */}
86
- <Avatar onClick={e => setAnchorElUser(e.currentTarget)}>{operator.currentUserInitials}</Avatar>
87
- <UserMenu anchorEl={anchorElUser} open={Boolean(anchorElUser)}
88
- onClose={() => setAnchorElUser(null)}>
89
- <MenuItem onClick={logout}>{localizedVal('Log off', 'AppShell')}</MenuItem>
90
- </UserMenu>
91
- </Toolbar>
92
-
93
- {/* Nav links below (position === 'below') */}
94
- {position === 'below' && navLinksContent}
95
- </AppBar>
96
- );
97
- }
98
- ```
29
+ ## Implementation Structure
30
+
31
+ **Module Setup:** Use the project's base component interface for typing. Import the `logout` function from the SDK auth manager (`@pega/auth/lib/sdk-auth-manager`). Include a companion styles file for layout. Register the component under its key in the project's component map.
32
+
33
+ **Main Component Logic** — steps in order:
34
+
35
+ 1. Receive inputs: `appInfo`, `navLinks`, `operator`, and `navDisplayOptions`; further destructure `alignment` and `position` from `navDisplayOptions`.
36
+ 2. Declare local state for menu anchoring: one for the mobile hamburger menu, one for the user/avatar menu (both initialized to `null`). Bind `localizedVal` to `PCore.getLocaleUtils().getLocaleValue`.
37
+ 3. Build a reusable `navLinksContent` element — a container hidden on mobile and shown as a flex row on desktop (justified per `alignment`), containing one button per nav link that invokes the link's `onClick`.
38
+ 4. Render an app bar with static position, containing a toolbar with, in order: the app logo/name button (invoking `appInfo.onClick`, showing `appInfo.imageSrc` and `appInfo.appName`); a hamburger icon button shown only on mobile that opens the mobile menu; a mobile dropdown menu (anchored to the hamburger state, open when set, closing by resetting to `null`) listing each nav link as a menu item; the `navLinksContent` block rendered inline when `position === 'inline'`; and an avatar showing `operator.currentUserInitials` that opens a user menu containing a "Log off" menu item (localized via `localizedVal('Log off', 'AppShell')`) wired to the imported `logout` function.
39
+ 5. When `position === 'below'`, render the `navLinksContent` block again below the toolbar, still inside the app bar.
99
40
 
100
41
  ## Behavioral Contract
101
42
 
102
43
  ### Responsive Layout
103
44
 
104
- - **Mobile (xs breakpoint):** Hamburger menu button (`<MenuIcon>`) shown; nav links hidden.
105
- - On click: opens a `<Drawer>` or dropdown menu with nav links.
106
- - CSS: `display: { xs: 'flex', md: 'none' }` on hamburger; `display: { xs: 'none', md: 'flex' }` on nav links.
107
- - **Desktop (md+ breakpoint):** Nav links shown inline; hamburger hidden.
45
+ - **Mobile (narrow viewport):** Hamburger menu button shown; nav links hidden.
46
+ - On click: opens a dropdown or drawer with nav links.
47
+ - CSS approach: hide nav links at narrow breakpoint, show hamburger; reverse at wide breakpoint.
48
+ - **Desktop (wide viewport):** Nav links shown inline; hamburger hidden.
108
49
 
109
50
  ### Navigation Position
110
51
 
@@ -118,7 +59,7 @@ From `navDisplayOptions.position`:
118
59
  From `navDisplayOptions.alignment`:
119
60
 
120
61
  - `'left'` — links flush left.
121
- - `'right'` — links pushed to the right (flex with `ml: 'auto'`).
62
+ - `'right'` — links pushed to the right (e.g., flex with auto-margin on left side).
122
63
  - `'center'` — links centered.
123
64
 
124
65
  ### Operator Avatar
@@ -126,7 +67,7 @@ From `navDisplayOptions.alignment`:
126
67
  - Extract initials from `operatorInfo.displayName`:
127
68
  - Split by space, take first letter of first and last word.
128
69
  - E.g. `"John Smith"` → `"JS"`.
129
- - Render as `<Avatar>{initials}</Avatar>`.
70
+ - Render as a circular avatar element with initials text.
130
71
  - Clicking avatar opens a menu with a Logout option.
131
72
 
132
73
  ### Logout
@@ -136,27 +77,7 @@ From `navDisplayOptions.alignment`:
136
77
 
137
78
  ### Render Structure
138
79
 
139
- ```
140
- <AppBar position='static'>
141
- <Toolbar>
142
- {/* Logo */}
143
- {portalLogoUrl && <img src={portalLogoUrl} alt='logo' />}
144
-
145
- {/* Hamburger (mobile) */}
146
- <IconButton sx={{ display: { xs: 'flex', md: 'none' } }} onClick={openMobileMenu}>
147
- <MenuIcon />
148
- </IconButton>
149
-
150
- {/* Nav links (desktop) */}
151
- <Box sx={{ display: { xs: 'none', md: 'flex' }, ...alignmentStyles }}>
152
- {links.map(link => <Button key={link.id} href={link.url}>{link.label}</Button>)}
153
- </Box>
154
-
155
- {/* Operator avatar */}
156
- <Avatar onClick={openUserMenu}>{initials}</Avatar>
157
- </Toolbar>
158
- </AppBar>
159
- ```
80
+ An app bar (static position) containing a toolbar with, in order: the portal logo image (when `portalLogoUrl` is set); a hamburger icon button hidden on desktop that opens the mobile menu; a nav-links container hidden on mobile / shown on desktop applying the alignment styles, with one button per link (using `link.url` as the href and `link.label` as the text); and an avatar showing the operator initials that opens the user menu.
160
81
 
161
82
  ## Visual Specifications
162
83
 
@@ -181,29 +102,18 @@ From `navDisplayOptions.alignment`:
181
102
  - `portalLogoUrl` is async — show fallback text until resolved.
182
103
  - `operatorInfo.displayName` may be undefined — guard and show a default avatar (single letter or icon).
183
104
  - `navDisplayOptions` may be absent — default to `{ alignment: 'left', position: 'inline' }`.
184
- - Mobile drawer state must be managed separately from the user menu state.
105
+ - Mobile menu state must be managed separately from the user menu state.
185
106
 
186
107
  ## Dependencies
187
108
 
188
109
  - `logout` from `@pega/auth/lib/sdk-auth-manager` — logout handler
189
- - MUI: `<AppBar>`, `<Toolbar>`, `<IconButton>`, `<Avatar>`, `<Menu>`, `<MenuItem>`, `<Button>`, `<Box>`
190
- - MUI Icons: `<MenuIcon>`
110
+ - The project's design system components for app bar, toolbar, icon button, avatar, menu, and button elements
191
111
 
192
112
  ## Design System Mapping
193
113
 
194
114
  **UI control type:** Responsive application navigation bar with avatar and logout.
195
115
 
196
- Listed design systems are examples only.
197
-
198
- | Design System | App Bar | Avatar | Mobile Menu |
199
- | ------------------ | ------------------------ | ---------------------- | ------------------------ |
200
- | Default (CSS only) | `<header>` + CSS | `<div class='avatar'>` | CSS hamburger + dropdown |
201
- | MUI | `<AppBar>` + `<Toolbar>` | `<Avatar>` | `<Drawer>` or `<Menu>` |
202
- | Ant Design | `<Layout.Header>` | `<Avatar>` | `<Drawer>` |
203
- | Chakra UI | `<Box as='header'>` | `<Avatar>` | `<Drawer>` |
204
- | Shadcn/ui | Custom `<header>` | Custom initials avatar | `<Sheet>` (drawer) |
205
-
206
- When implementing in a specific design system:
116
+ When implementing, choose the design system's app bar, avatar, and mobile menu (drawer or dropdown) components that match the project's chosen library. All design systems must preserve:
207
117
 
208
118
  - `logout` from `@pega/auth/lib/sdk-auth-manager` is mandatory — always call the SDK logout, not a custom one
209
119
  - Responsive breakpoints for hamburger/nav visibility must be implemented