@pega/sdk 0.0.2 → 0.0.3

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 (222) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
  3. package/templates/react-sdk-reference/.claude/instructions/component-map.md +38 -0
  4. package/templates/react-sdk-reference/.claude/instructions/dse-component.md +75 -0
  5. package/templates/react-sdk-reference/.claude/instructions/field-component.md +71 -0
  6. package/templates/react-sdk-reference/.claude/instructions/template-component.md +92 -0
  7. package/templates/react-sdk-reference/.claude/instructions/widget-component.md +87 -0
  8. package/templates/react-sdk-reference/.claude/prompts/add-component.md +144 -0
  9. package/templates/react-sdk-reference/.claude/prompts/component-manifest.json +111 -0
  10. package/templates/react-sdk-reference/.claude/prompts/generate-all-components.md +149 -0
  11. package/templates/react-sdk-reference/.claude/prompts/generate-dse-components.md +126 -0
  12. package/templates/react-sdk-reference/.claude/prompts/generate-field-components.md +139 -0
  13. package/templates/react-sdk-reference/.claude/prompts/generate-template-components.md +151 -0
  14. package/templates/react-sdk-reference/.claude/prompts/generate-widget-components.md +124 -0
  15. package/templates/react-sdk-reference/.claude/prompts/identify-components.md +105 -0
  16. package/templates/react-sdk-reference/.claude/prompts/replace-design-system.md +519 -0
  17. package/templates/react-sdk-reference/.claude/skills/component-contracts.md +140 -0
  18. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/AlertBanner.md +135 -0
  19. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Banner.md +149 -0
  20. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
  21. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/DetailsFields.md +144 -0
  22. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroup.md +131 -0
  23. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroupList.md +111 -0
  24. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldValueList.md +115 -0
  25. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Operator.md +149 -0
  26. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Pulse.md +83 -0
  27. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/RichTextEditor.md +206 -0
  28. package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
  29. package/templates/react-sdk-reference/.claude/skills/design-system-extension.md +289 -0
  30. package/templates/react-sdk-reference/.claude/skills/field-components.md +294 -0
  31. package/templates/react-sdk-reference/.claude/skills/field-skills/AutoComplete.md +112 -0
  32. package/templates/react-sdk-reference/.claude/skills/field-skills/CancelAlert.md +203 -0
  33. package/templates/react-sdk-reference/.claude/skills/field-skills/Checkbox.md +158 -0
  34. package/templates/react-sdk-reference/.claude/skills/field-skills/Currency.md +106 -0
  35. package/templates/react-sdk-reference/.claude/skills/field-skills/Date.md +99 -0
  36. package/templates/react-sdk-reference/.claude/skills/field-skills/DateTime.md +103 -0
  37. package/templates/react-sdk-reference/.claude/skills/field-skills/Decimal.md +98 -0
  38. package/templates/react-sdk-reference/.claude/skills/field-skills/Dropdown.md +114 -0
  39. package/templates/react-sdk-reference/.claude/skills/field-skills/Email.md +107 -0
  40. package/templates/react-sdk-reference/.claude/skills/field-skills/Group.md +90 -0
  41. package/templates/react-sdk-reference/.claude/skills/field-skills/Integer.md +87 -0
  42. package/templates/react-sdk-reference/.claude/skills/field-skills/Location.md +136 -0
  43. package/templates/react-sdk-reference/.claude/skills/field-skills/Multiselect.md +164 -0
  44. package/templates/react-sdk-reference/.claude/skills/field-skills/ObjectReference.md +164 -0
  45. package/templates/react-sdk-reference/.claude/skills/field-skills/Percentage.md +92 -0
  46. package/templates/react-sdk-reference/.claude/skills/field-skills/Phone.md +110 -0
  47. package/templates/react-sdk-reference/.claude/skills/field-skills/RadioButtons.md +146 -0
  48. package/templates/react-sdk-reference/.claude/skills/field-skills/RichText.md +138 -0
  49. package/templates/react-sdk-reference/.claude/skills/field-skills/ScalarList.md +124 -0
  50. package/templates/react-sdk-reference/.claude/skills/field-skills/SelectableCard.md +216 -0
  51. package/templates/react-sdk-reference/.claude/skills/field-skills/SemanticLink.md +148 -0
  52. package/templates/react-sdk-reference/.claude/skills/field-skills/TextArea.md +96 -0
  53. package/templates/react-sdk-reference/.claude/skills/field-skills/TextContent.md +101 -0
  54. package/templates/react-sdk-reference/.claude/skills/field-skills/TextInput.md +104 -0
  55. package/templates/react-sdk-reference/.claude/skills/field-skills/Time.md +88 -0
  56. package/templates/react-sdk-reference/.claude/skills/field-skills/URL.md +85 -0
  57. package/templates/react-sdk-reference/.claude/skills/field-skills/UserReference.md +180 -0
  58. package/templates/react-sdk-reference/.claude/skills/run-and-verify.md +68 -0
  59. package/templates/react-sdk-reference/.claude/skills/template-components.md +322 -0
  60. package/templates/react-sdk-reference/.claude/skills/template-skills/AdvancedSearch.md +144 -0
  61. package/templates/react-sdk-reference/.claude/skills/template-skills/AppShell.md +122 -0
  62. package/templates/react-sdk-reference/.claude/skills/template-skills/BannerPage.md +83 -0
  63. package/templates/react-sdk-reference/.claude/skills/template-skills/CaseSummary.md +100 -0
  64. package/templates/react-sdk-reference/.claude/skills/template-skills/CaseView.md +131 -0
  65. package/templates/react-sdk-reference/.claude/skills/template-skills/CaseViewActionsMenu.md +126 -0
  66. package/templates/react-sdk-reference/.claude/skills/template-skills/Confirmation.md +107 -0
  67. package/templates/react-sdk-reference/.claude/skills/template-skills/DataReference.md +120 -0
  68. package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultForm.md +102 -0
  69. package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultPage.md +110 -0
  70. package/templates/react-sdk-reference/.claude/skills/template-skills/Details.md +88 -0
  71. package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsSubTabs.md +95 -0
  72. package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsThreeColumn.md +78 -0
  73. package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsTwoColumn.md +78 -0
  74. package/templates/react-sdk-reference/.claude/skills/template-skills/DynamicTabs.md +101 -0
  75. package/templates/react-sdk-reference/.claude/skills/template-skills/FieldGroupTemplate.md +109 -0
  76. package/templates/react-sdk-reference/.claude/skills/template-skills/HierarchicalForm.md +113 -0
  77. package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboard.md +104 -0
  78. package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboardPage.md +85 -0
  79. package/templates/react-sdk-reference/.claude/skills/template-skills/ListPage.md +68 -0
  80. package/templates/react-sdk-reference/.claude/skills/template-skills/ListView.md +139 -0
  81. package/templates/react-sdk-reference/.claude/skills/template-skills/MultiReferenceReadOnly.md +80 -0
  82. package/templates/react-sdk-reference/.claude/skills/template-skills/NarrowWide.md +141 -0
  83. package/templates/react-sdk-reference/.claude/skills/template-skills/OneColumn.md +109 -0
  84. package/templates/react-sdk-reference/.claude/skills/template-skills/PromotedFilters.md +124 -0
  85. package/templates/react-sdk-reference/.claude/skills/template-skills/SelfServiceCaseView.md +135 -0
  86. package/templates/react-sdk-reference/.claude/skills/template-skills/SimpleTable.md +127 -0
  87. package/templates/react-sdk-reference/.claude/skills/template-skills/SingleReferenceReadOnly.md +103 -0
  88. package/templates/react-sdk-reference/.claude/skills/template-skills/SubTabs.md +79 -0
  89. package/templates/react-sdk-reference/.claude/skills/template-skills/TwoColumn.md +131 -0
  90. package/templates/react-sdk-reference/.claude/skills/template-skills/WideNarrow.md +150 -0
  91. package/templates/react-sdk-reference/.claude/skills/template-skills/WssNavBar.md +135 -0
  92. package/templates/react-sdk-reference/.claude/skills/widget-components.md +271 -0
  93. package/templates/react-sdk-reference/.claude/skills/widget-skills/AppAnnouncement.md +82 -0
  94. package/templates/react-sdk-reference/.claude/skills/widget-skills/Attachment.md +146 -0
  95. package/templates/react-sdk-reference/.claude/skills/widget-skills/CaseHistory.md +107 -0
  96. package/templates/react-sdk-reference/.claude/skills/widget-skills/FileUtility.md +200 -0
  97. package/templates/react-sdk-reference/.claude/skills/widget-skills/Followers.md +99 -0
  98. package/templates/react-sdk-reference/.claude/skills/widget-skills/QuickCreate.md +114 -0
  99. package/templates/react-sdk-reference/.claude/skills/widget-skills/SummaryItem.md +167 -0
  100. package/templates/react-sdk-reference/.claude/skills/widget-skills/ToDo.md +190 -0
  101. package/templates/react-sdk-reference/.cursor/rules/component-map.mdrules +41 -0
  102. package/templates/react-sdk-reference/.cursor/rules/dse-component.mdrules +78 -0
  103. package/templates/react-sdk-reference/.cursor/rules/field-component.mdrules +74 -0
  104. package/templates/react-sdk-reference/.cursor/rules/pega-sdk.mdrules +247 -0
  105. package/templates/react-sdk-reference/.cursor/rules/prompts/add-component.mdrules +149 -0
  106. package/templates/react-sdk-reference/.cursor/rules/prompts/component-manifest.json +111 -0
  107. package/templates/react-sdk-reference/.cursor/rules/prompts/generate-all-components.mdrules +154 -0
  108. package/templates/react-sdk-reference/.cursor/rules/prompts/generate-dse-components.mdrules +131 -0
  109. package/templates/react-sdk-reference/.cursor/rules/prompts/generate-field-components.mdrules +144 -0
  110. package/templates/react-sdk-reference/.cursor/rules/prompts/generate-template-components.mdrules +156 -0
  111. package/templates/react-sdk-reference/.cursor/rules/prompts/generate-widget-components.mdrules +129 -0
  112. package/templates/react-sdk-reference/.cursor/rules/prompts/identify-components.mdrules +110 -0
  113. package/templates/react-sdk-reference/.cursor/rules/prompts/replace-design-system.mdrules +524 -0
  114. package/templates/react-sdk-reference/.cursor/rules/skills/component-contracts.mdrules +145 -0
  115. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/AlertBanner.mdrules +140 -0
  116. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Banner.mdrules +154 -0
  117. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/CaseSummaryFields.mdrules +159 -0
  118. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/DetailsFields.mdrules +149 -0
  119. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroup.mdrules +136 -0
  120. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroupList.mdrules +116 -0
  121. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldValueList.mdrules +120 -0
  122. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Operator.mdrules +154 -0
  123. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Pulse.mdrules +88 -0
  124. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/RichTextEditor.mdrules +211 -0
  125. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/WssQuickCreate.mdrules +140 -0
  126. package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension.mdrules +294 -0
  127. package/templates/react-sdk-reference/.cursor/rules/skills/field-components.mdrules +299 -0
  128. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/AutoComplete.mdrules +117 -0
  129. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/CancelAlert.mdrules +208 -0
  130. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Checkbox.mdrules +163 -0
  131. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Currency.mdrules +111 -0
  132. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Date.mdrules +104 -0
  133. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/DateTime.mdrules +108 -0
  134. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Decimal.mdrules +103 -0
  135. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Dropdown.mdrules +119 -0
  136. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Email.mdrules +112 -0
  137. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Group.mdrules +95 -0
  138. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Integer.mdrules +92 -0
  139. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Location.mdrules +141 -0
  140. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Multiselect.mdrules +169 -0
  141. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ObjectReference.mdrules +169 -0
  142. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Percentage.mdrules +97 -0
  143. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Phone.mdrules +115 -0
  144. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RadioButtons.mdrules +151 -0
  145. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RichText.mdrules +143 -0
  146. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ScalarList.mdrules +129 -0
  147. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SelectableCard.mdrules +221 -0
  148. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SemanticLink.mdrules +153 -0
  149. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextArea.mdrules +101 -0
  150. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextContent.mdrules +106 -0
  151. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextInput.mdrules +109 -0
  152. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Time.mdrules +93 -0
  153. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/URL.mdrules +90 -0
  154. package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/UserReference.mdrules +185 -0
  155. package/templates/react-sdk-reference/.cursor/rules/skills/run-and-verify.mdrules +73 -0
  156. package/templates/react-sdk-reference/.cursor/rules/skills/template-components.mdrules +327 -0
  157. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AdvancedSearch.mdrules +149 -0
  158. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AppShell.mdrules +127 -0
  159. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/BannerPage.mdrules +88 -0
  160. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseSummary.mdrules +105 -0
  161. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseView.mdrules +136 -0
  162. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseViewActionsMenu.mdrules +131 -0
  163. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Confirmation.mdrules +112 -0
  164. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DataReference.mdrules +125 -0
  165. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultForm.mdrules +107 -0
  166. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultPage.mdrules +115 -0
  167. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Details.mdrules +93 -0
  168. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsSubTabs.mdrules +100 -0
  169. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsThreeColumn.mdrules +83 -0
  170. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsTwoColumn.mdrules +83 -0
  171. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DynamicTabs.mdrules +106 -0
  172. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/FieldGroupTemplate.mdrules +114 -0
  173. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/HierarchicalForm.mdrules +118 -0
  174. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboard.mdrules +109 -0
  175. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboardPage.mdrules +90 -0
  176. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListPage.mdrules +73 -0
  177. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListView.mdrules +144 -0
  178. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/MultiReferenceReadOnly.mdrules +85 -0
  179. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/NarrowWide.mdrules +146 -0
  180. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/OneColumn.mdrules +114 -0
  181. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/PromotedFilters.mdrules +129 -0
  182. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SelfServiceCaseView.mdrules +140 -0
  183. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SimpleTable.mdrules +132 -0
  184. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SingleReferenceReadOnly.mdrules +108 -0
  185. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SubTabs.mdrules +84 -0
  186. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/TwoColumn.mdrules +136 -0
  187. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WideNarrow.mdrules +155 -0
  188. package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WssNavBar.mdrules +140 -0
  189. package/templates/react-sdk-reference/.cursor/rules/skills/widget-components.mdrules +276 -0
  190. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/AppAnnouncement.mdrules +87 -0
  191. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Attachment.mdrules +151 -0
  192. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/CaseHistory.mdrules +112 -0
  193. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/FileUtility.mdrules +205 -0
  194. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Followers.mdrules +104 -0
  195. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/QuickCreate.mdrules +119 -0
  196. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/SummaryItem.mdrules +172 -0
  197. package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/ToDo.mdrules +195 -0
  198. package/templates/react-sdk-reference/.cursor/rules/template-component.mdrules +95 -0
  199. package/templates/react-sdk-reference/.cursor/rules/widget-component.mdrules +90 -0
  200. package/templates/react-sdk-reference/.github/copilot-instructions.md +58 -0
  201. package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +144 -16
  202. package/templates/react-sdk-reference/.github/prompts/generate-all-components.prompt.md +154 -0
  203. package/templates/react-sdk-reference/.github/prompts/generate-dse-components.prompt.md +131 -0
  204. package/templates/react-sdk-reference/.github/prompts/generate-field-components.prompt.md +144 -0
  205. package/templates/react-sdk-reference/.github/prompts/generate-template-components.prompt.md +156 -0
  206. package/templates/react-sdk-reference/.github/prompts/generate-widget-components.prompt.md +129 -0
  207. package/templates/react-sdk-reference/.github/skills/design-system-extension.md +58 -18
  208. package/templates/react-sdk-reference/.github/skills/field-components.md +55 -23
  209. package/templates/react-sdk-reference/.github/skills/template-components.md +48 -11
  210. package/templates/react-sdk-reference/.github/skills/widget-components.md +49 -12
  211. package/templates/react-sdk-reference/AGENTS.md +217 -29
  212. package/templates/react-sdk-reference/package.json +1 -1
  213. package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
  214. package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
  215. package/templates/react-sdk-reference/sdk-config.json +1 -1
  216. package/templates/react-sdk-reference/vite.config.ts +1 -1
  217. package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +0 -48
  218. package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +0 -81
  219. package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +0 -41
  220. package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +0 -49
  221. package/templates/react-sdk-reference/.github/skills/swap-design-system.md +0 -105
  222. package/templates/react-sdk-reference/pega-constellationjs-0.26.2.tgz +0 -0
@@ -51,12 +51,14 @@ interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
51
51
 
52
52
  ### Data-Fetching Widget
53
53
 
54
- Widgets typically fetch data from Pega data pages on mount:
54
+ Widgets typically fetch data from Pega data pages on mount. This pattern is design-system agnostic. The `// [DS RENDER]` section must be replaced with your design system's presentation primitives (card, list, table, etc.) — see "Design System Adaptation" below.
55
55
 
56
56
  ```typescript
57
57
  import { useState, useEffect } from 'react';
58
- import { Card, CardHeader, CardContent, List, ListItem } from '@mui/material';
59
- import type { PConnProps } from '../../../types/PConnProps';
58
+ // Import your design system components here:
59
+ // e.g. import { Card, List } from 'antd';
60
+ // e.g. import { Card, UnorderedList } from '@chakra-ui/react';
61
+ import type { PConnProps } from '@pega/sdk-react';
60
62
 
61
63
  interface MyWidgetProps extends PConnProps {
62
64
  datasource?: any;
@@ -70,8 +72,9 @@ export default function MyWidget(props: MyWidgetProps) {
70
72
  const [data, setData] = useState<any[]>([]);
71
73
  const [loading, setLoading] = useState(true);
72
74
 
75
+ // 1. Fetch data from a Pega data page on mount
76
+ // This block is always the same regardless of design system
73
77
  useEffect(() => {
74
- // Fetch data from a Pega data page
75
78
  const context = pConn.getContextName();
76
79
  PCore.getDataPageUtils()
77
80
  .getDataAsync(
@@ -89,23 +92,57 @@ export default function MyWidget(props: MyWidgetProps) {
89
92
  .catch(() => setLoading(false));
90
93
  }, []);
91
94
 
95
+ // 2. Loading state — replace with your DS loading indicator if available
92
96
  if (loading) return <div>Loading...</div>;
93
97
 
98
+ // 3. [DS RENDER] — replace with your design system's card/list/table primitives
99
+ // See "Design System Adaptation" section below for guidance
94
100
  return (
95
- <Card>
96
- <CardHeader title={headerText} />
97
- <CardContent>
98
- <List>
101
+ <YourDesignSystemCard>
102
+ <YourDesignSystemCardHeader title={headerText} />
103
+ <YourDesignSystemCardContent>
104
+ <YourDesignSystemList>
99
105
  {data.map((item, i) => (
100
- <ListItem key={i}>{item.pyLabel}</ListItem>
106
+ <YourDesignSystemListItem key={i}>{item.pyLabel}</YourDesignSystemListItem>
101
107
  ))}
102
- </List>
103
- </CardContent>
104
- </Card>
108
+ </YourDesignSystemList>
109
+ </YourDesignSystemCardContent>
110
+ </YourDesignSystemCard>
105
111
  );
106
112
  }
107
113
  ```
108
114
 
115
+ ---
116
+
117
+ ## Design System Adaptation
118
+
119
+ The PCore data-fetching logic (all `PCore.*` calls) is always identical regardless of design system. Only the `// [DS RENDER]` section changes.
120
+
121
+ **1. Check the component-specific skill file** — `.github/skills/widget-skills/<ComponentName>.md` contains a **Design System Mapping** table where available. Use it as a starting point.
122
+
123
+ **2. If the chosen design system is not listed** — use the component purpose description to identify the appropriate DS primitives (card, list, table, button, badge, etc.).
124
+
125
+ **3. Discover the API from installed packages** — confirm component names and props from `.d.ts` before writing JSX:
126
+ ```bash
127
+ find node_modules/<ds-package> -name "*.d.ts" | xargs grep -l "Card\|List\|Table" | head -5
128
+ grep -A 30 "interface.*Props" <path-to-file>
129
+ ```
130
+
131
+ **4. Common widget UI primitive mapping:**
132
+
133
+ | Widget pattern | Typical DS equivalent |
134
+ |---|---|
135
+ | Container with title | `Card` + header/title prop, or `Panel`, `Box` |
136
+ | Item list | `List`, `UnorderedList`, or `Table` rows |
137
+ | Loading indicator | `Spinner`, `Skeleton`, `Loading` |
138
+ | Action button | `Button` with `onClick` |
139
+ | Status badge | `Badge`, `Tag`, `Chip` |
140
+ | Empty state | DS empty/placeholder component or plain `<div>` |
141
+
142
+ **5. Icons** — if the DS has a companion icon package, read its exports before using any icon name. Never guess icon names.
143
+
144
+ ---
145
+
109
146
  ### Action Widget (opens assignments/cases)
110
147
 
111
148
  ```typescript
@@ -1,59 +1,247 @@
1
- # Agents
1
+ # AGENTS — React SDK Reference
2
2
 
3
- AI assistant guide for React SDK Reference application.
3
+ > Claude Code instructions for the Pega React SDK reference application.
4
+ > Skill files and workflow prompts are in `.claude/skills/` and `.claude/prompts/`. Read them when asked to generate or replace components.
4
5
 
5
- For complete rules, see [`.github/copilot-instructions.md`](.github/copilot-instructions.md).
6
+
7
+ You are assisting developers in a React reference application that demonstrates the Pega Infinity SDK. Customers clone this repo and **replace the sample UI components with their own design system** (MUI, Chakra, Radix, Shadcn, Ant Design, or any other).
8
+
9
+ ---
10
+
11
+ ## 1. Repository Purpose
12
+
13
+ This is a **reference implementation** — not a framework. The UI components (fields, templates, widgets) are intentionally simple MUI-based implementations meant to be swapped out. The SDK wiring (bootstrap, PConnect bridge, component registry) is reusable infrastructure that should NOT be modified.
6
14
 
7
15
  ---
8
16
 
9
- ## Purpose
17
+ ## 2. What Is Replaceable vs. Infrastructure
18
+
19
+ ### Replaceable (customer modifies these)
20
+
21
+ | Directory | Purpose |
22
+ | --------------------------------------- | ----------------------------------------------------------- |
23
+ | `src/components/field/` | Form field components (TextInput, Dropdown, Date, etc.) |
24
+ | `src/components/template/` | Layout templates (OneColumn, TwoColumn, Details, etc.) |
25
+ | `src/components/widget/` | Data widgets (ToDo, Attachment, CaseHistory, etc.) |
26
+ | `src/components/designSystemExtension/` | Extended UI (AlertBanner, FieldGroup, RichTextEditor, etc.) |
27
+
28
+ ### Infrastructure (do NOT modify unless you know what you're doing)
10
29
 
11
- This is a **reference app** for Pega Infinity SDK. Customers clone it and replace the MUI-based sample components with their own design system. The SDK wiring (`@pega/sdk-react`, bootstrap, PConnect bridge) is infrastructure — only the UI layer is meant to be customized.
30
+ | File/Directory | Purpose |
31
+ | --------------------------------------- | --------------------------------------------------------- |
32
+ | `src/MashupApp.tsx` | Auth + bootstrap + root rendering |
33
+ | `src/components/component-map.ts` | Registry wiring (only add/remove entries) |
34
+ | `src/components/infra/` | Infrastructure components (ActionButtons, Stages, NavBar) |
35
+ | `src/components/helpers/event-utils.ts` | PConnect event handler utility |
36
+ | `@pega/sdk-react` | SDK bridge — never modify |
12
37
 
13
38
  ---
14
39
 
15
- ## Replaceable Component Directories
40
+ ## 3. Component Architecture
41
+
42
+ ### The PConnect Bridge
43
+
44
+ Every component receives `getPConnect` as a prop. This is the bridge to the Pega platform:
45
+
46
+ ```typescript
47
+ const pConn = getPConnect();
48
+ const actions = pConn.getActionsApi(); // For field updates
49
+ const propName = (pConn.getStateProps() as any).value; // Property path
50
+ ```
51
+
52
+ ### Event Handling Pattern
53
+
54
+ All field components use this pattern for two-way binding:
55
+
56
+ ```typescript
57
+ import handleEvent from '../../helpers/event-utils';
16
58
 
59
+ // On change (local state only):
60
+ function handleChange(event) {
61
+ setInputValue(event.target.value);
62
+ }
63
+
64
+ // On blur (push to platform):
65
+ function handleBlur() {
66
+ handleEvent(actions, 'changeNblur', propName, inputValue);
67
+ }
17
68
  ```
18
- src/components/
19
- ├── field/ ← Form inputs (TextInput, Dropdown, Date, etc.)
20
- ├── template/ ← Layouts (OneColumn, TwoColumn, Details, etc.)
21
- ├── widget/ ← Data widgets (ToDo, Attachment, CaseHistory, etc.)
22
- └── designSystemExtension/ ← Extended UI (AlertBanner, FieldGroup, etc.)
69
+
70
+ ### Display Mode Handling
71
+
72
+ Field components must handle `displayMode` prop:
73
+
74
+ - `undefined` → render editable input
75
+ - `'DISPLAY_ONLY'` → render read-only value via `FieldValueList`
76
+ - `'STACKED_LARGE_VAL'` → render stacked read-only via `FieldValueList` with `variant='stacked'`
77
+
78
+ ### Component Registry
79
+
80
+ Components are registered by name in `src/components/component-map.ts`:
81
+
82
+ ```typescript
83
+ import { sdkComponents } from '@pega/sdk-react';
84
+
85
+ function getSampleComponentMap() {
86
+ return {
87
+ ...sdkComponents, // Infrastructure (View, Region, FlowContainer, etc.)
88
+ TextInput, // Your field components
89
+ Dropdown,
90
+ // ...
91
+ };
92
+ }
23
93
  ```
24
94
 
25
- ## Do Not Modify
95
+ To add a new component: add the import + add to the map object.
96
+ To replace a component: change the import to point to your new implementation.
26
97
 
98
+ ---
99
+
100
+ ## 4. Props Interfaces
101
+
102
+ ### Field Components (`PConnFieldProps`)
103
+
104
+ ```typescript
105
+ import type { PConnFieldProps } from '@pega/sdk-react';
106
+
107
+ interface PConnFieldProps {
108
+ getPConnect: () => typeof PConnect;
109
+ label: string;
110
+ required: boolean;
111
+ disabled: boolean;
112
+ value?: string;
113
+ validatemessage: string;
114
+ status?: string; // 'error' | 'warning' | undefined
115
+ onChange: any;
116
+ onBlur?: any;
117
+ readOnly: boolean;
118
+ testId: string;
119
+ helperText: string;
120
+ displayMode?: string; // 'DISPLAY_ONLY' | 'STACKED_LARGE_VAL'
121
+ hideLabel: boolean;
122
+ placeholder?: string;
123
+ }
27
124
  ```
28
- src/MashupApp.tsx ← Bootstrap/auth flow
29
- src/components/component-map.ts ← Only add/remove entries, don't restructure
30
- src/components/infra/ ← SDK infrastructure
31
- src/components/helpers/ ← Shared utilities (event-utils, formatters)
125
+
126
+ ### Template/Widget Components (`PConnProps`)
127
+
128
+ ```typescript
129
+ import type { PConnProps } from '@pega/sdk-react';
130
+
131
+ interface PConnProps {
132
+ getPConnect: () => typeof PConnect;
133
+ }
32
134
  ```
33
135
 
34
136
  ---
35
137
 
36
- ## Quick Commands
138
+ ## 5. Rules for Replacing Components
139
+
140
+ 1. **Keep the same default export name** — the component-map references it.
141
+ 2. **Keep `getPConnect` wiring intact** — extract props, call `handleEvent` on blur.
142
+ 3. **Handle `displayMode`** — return `FieldValueList` for read-only modes.
143
+ 4. **Handle validation** — show `validatemessage` when `status === 'error'`.
144
+ 5. **Preserve `data-test-id`** — pass `testId` to the root interactive element.
145
+ 6. **Use `getComponentFromRegistry`** to render sub-components (e.g., `FieldValueList`) — don't hardcode imports for components that might also be replaced.
146
+
147
+ ---
148
+
149
+ ## 6. Build & Dev Commands
37
150
 
38
151
  ```bash
39
- npm run dev # Vite dev server (port 3500)
40
- npm run build # Production build
152
+ # From monorepo root (if developing locally with source packages):
153
+ npm run build # Build all packages + samples
154
+ npm run dev:react # Build + dev server
155
+
156
+ # From this directory (standalone):
157
+ npm run dev # Vite dev server (port 3500)
158
+ npm run build # Production build
159
+ ```
160
+
161
+ ---
162
+
163
+ ## 7. Key Imports
164
+
165
+ ```typescript
166
+ // From SDK (never modify these)
167
+ import {
168
+ PConnectComponent,
169
+ PegaStoreContext,
170
+ registerComponentCreator,
171
+ getComponentFromRegistry,
172
+ sdkComponents,
173
+ } from '@pega/sdk-react';
174
+ import type { PConnProps, PConnFieldProps } from '@pega/sdk-react';
175
+
176
+ // Event utility (preserve this)
177
+ import handleEvent from '../../helpers/event-utils';
41
178
  ```
42
179
 
43
180
  ---
44
181
 
45
- ## Key Pattern
182
+ ## 8. Do NOT
46
183
 
47
- Every replaceable component receives `getPConnect()` prop extracts field state renders UI → calls `handleEvent(actions, 'changeNblur', propName, value)` on blur to push changes back to Pega.
184
+ - Modify `MashupApp.tsx` bootstrap flow when replacing design system components.
185
+ - Import from `@pega/sdk-react/src/...` — use the package entry point only.
186
+ - Hardcode component references — use `getComponentFromRegistry('Name')` for components that may be overridden.
187
+ - Remove the `...sdkComponents` spread from `component-map.ts`.
188
+ - Use `any` without justification — prefer `unknown` and narrow.
189
+ - Add `@ts-ignore` — use `@ts-expect-error` with explanation if truly needed.
48
190
 
49
191
  ---
50
192
 
51
- ## Reference
193
+ ## 9. Component Generation Workflow — Single Component
194
+
195
+ When the user asks to generate, create, add, or replace **a single UI component** (e.g., "generate an AutoComplete component", "add a Dropdown using Chakra UI"),
196
+ read the full contents of `.claude/prompts/add-component.md` and
197
+ execute every step in order before writing any code.
198
+ Do not skip steps or proceed without reading the required skill files first.
199
+
200
+ > For generating **multiple field components** at once, see Section 10.
201
+
202
+ ---
203
+
204
+ ## 10. Batch Field Component Generation
205
+
206
+ When the user asks to generate, create, or replace **multiple field components** or **all field components** with a design system (e.g., "generate field components with Ant Design", "replace all fields with Chakra UI", "generate all field components using Radix"),
207
+ read the full contents of `.claude/prompts/generate-field-components.md` and
208
+ execute every step in order before writing any code.
209
+ Do not skip steps or proceed without reading the required skill files first.
210
+
211
+ ---
212
+
213
+ ## 11. Batch Template Component Generation
214
+
215
+ When the user asks to generate, create, or replace **multiple template components** or **all template components** with a design system (e.g., "generate template components with Ant Design", "replace all templates with Chakra UI", "generate layout templates using Radix"),
216
+ read the full contents of `.claude/prompts/generate-template-components.md` and
217
+ execute every step in order before writing any code.
218
+ Do not skip steps or proceed without reading the required skill files first.
219
+
220
+ ---
221
+
222
+ ## 12. Batch Widget Component Generation
223
+
224
+ When the user asks to generate, create, or replace **multiple widget components** or **all widget components** with a design system (e.g., "generate widget components with Ant Design", "replace all widgets with Chakra UI", "generate widgets using Carbon"),
225
+ read the full contents of `.claude/prompts/generate-widget-components.md` and
226
+ execute every step in order before writing any code.
227
+ Do not skip steps or proceed without reading the required skill files first.
228
+
229
+ ---
230
+
231
+ ## 13. Batch Design System Extension Component Generation
232
+
233
+ When the user asks to generate, create, or replace **multiple design system extension components** or **all DSE components** with a design system (e.g., "generate DSE components with Ant Design", "replace design system extension components with Chakra UI", "generate designSystemExtension components using Carbon"),
234
+ read the full contents of `.claude/prompts/generate-dse-components.md` and
235
+ execute every step in order before writing any code.
236
+ Do not skip steps or proceed without reading the required skill files first.
237
+
238
+ ---
239
+
240
+ ## 14. Generate All Components (Multi-Type)
241
+
242
+ When the user asks to generate, create, or replace components across **multiple types** or **all component types** at once (e.g., "generate all components with Ant Design", "replace everything with Chakra UI", "generate field and widget components using Carbon", "regenerate all components"),
243
+ read the full contents of `.claude/prompts/generate-all-components.md` and
244
+ execute every step in order before writing any code.
245
+ Do not skip steps or proceed without reading the required skill files first.
52
246
 
53
- | Topic | File |
54
- |-------|------|
55
- | Full instructions | `.github/copilot-instructions.md` |
56
- | Field component skill | `.github/skills/field-components.md` |
57
- | Template component skill | `.github/skills/template-components.md` |
58
- | Widget component skill | `.github/skills/widget-components.md` |
59
- | DSE component skill | `.github/skills/design-system-extension.md` |
247
+ > Use this section when the request spans more than one component type. For a single type, use Sections 10–13.
@@ -17,7 +17,7 @@
17
17
  "@mui/styles": "^6.5.0",
18
18
  "@mui/x-date-pickers": "^9.2.0",
19
19
  "@pega/auth": "file:pega-auth-0.2.42.tgz",
20
- "@pega/constellationjs": "file:pega-constellationjs-0.26.2.tgz",
20
+ "@pega/constellationjs": "file:pega-constellationjs-0.26.3-local.tgz",
21
21
  "@pega/sdk-react": "file:pega-sdk-react-0.1.0.tgz",
22
22
  "@pega/sdk-types": "file:pega-sdk-types-0.1.0.tgz",
23
23
  "@react-google-maps/api": "^2.20.8",
@@ -3,7 +3,7 @@
3
3
  "infinityRestServerUrl": "https://lab-16027-us-east-1.internal.pegalabs.io/prweb",
4
4
  "appAlias": "MediaCo",
5
5
  "sdkContentServerUrl": "",
6
- "appPortal": "MediaCoSelfService",
6
+ "appPortal": "",
7
7
  "appMashupCaseType": "DIXL-MediaCo-Work-NewService",
8
8
  "excludePortals": [
9
9
  "pxExpress",
@@ -59,7 +59,7 @@ export default defineConfig({
59
59
  }),
60
60
  ],
61
61
  server: {
62
- port: 3500,
62
+ port: 3502,
63
63
  open: true,
64
64
  },
65
65
  });
@@ -1,48 +0,0 @@
1
- ---
2
- agent: agent
3
- description: Replace ALL field components with a new design system
4
- ---
5
-
6
- Replace ALL field components in `src/components/field/` with equivalents from **{{designSystem}}**.
7
-
8
- ## Step 1: Replace all field components using subagents
9
-
10
- For each of the following field components, run a subagent using the `replace-field` prompt with `fieldName` set to the component directory name and `designSystem` set to **{{designSystem}}**:
11
-
12
- - TextInput
13
- - TextArea
14
- - Dropdown
15
- - Checkbox
16
- - RadioButtons
17
- - Date
18
- - DateTime
19
- - Time
20
- - Currency
21
- - Decimal
22
- - Integer
23
- - Percentage
24
- - Email
25
- - Phone
26
- - URL
27
- - AutoComplete
28
- - Multiselect
29
- - RichText
30
- - ScalarList
31
- - SelectableCard
32
- - Group
33
- - Location
34
- - ObjectReference
35
- - SemanticLink
36
- - UserReference
37
- - CancelAlert
38
- - TextContent
39
-
40
- Run subagents in parallel batches of 5 to maximize throughput.
41
-
42
- ## Step 2: Replace FieldValueList
43
-
44
- Run a subagent to replace `FieldValueList` in `src/components/designSystemExtension/FieldValueList/` with a {{designSystem}} equivalent. Every field component depends on it for display modes.
45
-
46
- ## Step 3: Verify
47
-
48
- After all subagents complete, run `npm run build` to verify everything compiles correctly.
@@ -1,81 +0,0 @@
1
- ---
2
- agent: agent
3
- description: Replace a single non-field component with your design system equivalent
4
- ---
5
-
6
- Replace the **{{componentName}}** component (located in `src/components/{{componentPath}}`) with an equivalent implementation using **{{designSystem}}**.
7
-
8
- Category: **{{componentCategory}}**
9
-
10
- ---
11
-
12
- ## Instructions
13
-
14
- 1. Read ALL files in `src/components/{{componentPath}}` to understand the current implementation
15
- 2. **If a `.css` file exists in the directory, read it before writing anything.** For every CSS class, note its visual intent — spacing, sizing, colors, borders, layout, visibility tricks. The replacement must replicate the same visual appearance as the original.
16
- 3. **Read the installed package before choosing components:**
17
- - `cat node_modules/{{designSystem}}/README.md` — correct import paths and usage patterns for the installed version
18
- - `grep "^export" node_modules/{{designSystem}}/dist/index.d.ts 2>/dev/null || grep -rl "^export" node_modules/{{designSystem}} --include="index.d.ts" | head -3 | xargs grep "^export"` — every component actually exported by the installed version
19
- - **For every component you plan to use, read its TypeScript prop interface** from the installed `.d.ts` to discover all available styling props (e.g. `size`, `kind`, `hideLabel`, `helperText`, `orientation`). Find the file with: `find node_modules/{{designSystem}} -name "ComponentName.d.ts" | head -3`, then `grep -A 40 "interface.*Props"` on the result.
20
- - Only use component names and prop names confirmed in those files. Do not rely on training knowledge of the API.
21
- 4. Identify every `@mui/material`, `@mui/icons-material`, `@mui/styles`, and `@mui/x-date-pickers` import
22
- 5. Replace each MUI component/utility with the {{designSystem}} equivalent, preserving the original visual output. **Styling priority — apply in this order, stop at the first that works:**
23
- 1. **{{designSystem}} component props/variants** — always prefer built-in props (`size`, `kind`, `orientation`, etc.) over any custom styling
24
- 2. **Retaining the existing `.css` file** and its class names where they don't conflict with {{designSystem}}
25
- 3. **{{designSystem}} design tokens via CSS custom properties** in `style` props — use design system token variables; never hardcode hex colors or pixel values
26
- 4. **Inline `style` props with raw values** — only as a last resort when no prop or token covers the need
27
- 5. Convert any `makeStyles` usage to the approach above — map each class to an equivalent style, do NOT silently drop styles
28
- 6. Replace MUI icons with {{designSystem}}'s icon system (or inline SVG if unavailable)
29
- 7. **Before writing, discover the design system's own conventions — do not assume:**
30
- - Check the README or exports for **layout primitive components** (grid, stack, flex wrappers) — prefer them over raw `<div style={{ display: 'flex' }}>` or `<div style={{ display: 'grid' }}>`
31
- - Check the README or exports for a **form layout wrapper component** (one that groups label + input + helper text) — if one exists, use it instead of manual margins
32
- - Check the README or `.d.ts` props for **size/density/variant and button kind/intent conventions** — use documented props rather than adding manual padding or color overrides
33
- - For **built-in slots** (helper text, validation messages, label visibility): check the component's `.d.ts` — if a prop handles it natively, use that prop instead of rendering separate elements
34
- - Check whether the design system has a **companion icons package** — read its exports/index before importing any icon name; do not guess icon names
35
- - For **spacing in `style` props**, check `node_modules/{{designSystem}}` for a `tokens` or `css` directory — use design system CSS custom properties if available; otherwise use relative units (`rem`/`em`), never raw `px`
36
-
37
- ---
38
-
39
- ## Category-specific rules
40
-
41
- ### If `{{componentCategory}}` is `template`:
42
-
43
- - Replace MUI `Grid`/`Box`/`Stack` with {{designSystem}} layout primitives
44
- - Replace MUI `Tabs`/`Tab` with {{designSystem}} tab components
45
- - Replace MUI `Table`/`TableRow`/`TableCell` with {{designSystem}} table components
46
- - KEEP: children rendering logic (React children or PConnect child iteration)
47
- - KEEP: `templateCol` parsing for column width ratios
48
- - If the directory contains multiple variants (e.g., OneColumn, OneColumnPage, OneColumnTab), replace ALL of them
49
-
50
- ### If `{{componentCategory}}` is `widget`:
51
-
52
- - Replace MUI visual components (Card, List, Button, Dialog, etc.) with {{designSystem}} equivalents
53
- - NEVER modify `PCore.*` API calls (getDataPageUtils, getMashupApi, getPubSubUtils, etc.)
54
- - KEEP: all data fetching logic, pub/sub subscriptions, platform interactions
55
- - KEEP: loading states and error handling
56
-
57
- ### If `{{componentCategory}}` is `designSystemExtension`:
58
-
59
- - KEEP: same exported prop interfaces (other components depend on them)
60
- - If the component wraps a third-party editor (e.g., draft-js, Quill), replace only MUI wrappers — keep the editor
61
- - KEEP: same behavior and prop contract
62
-
63
- ### If `{{componentCategory}}` is `infra`:
64
-
65
- - KEEP: `onButtonPress` callback pattern in ActionButtons
66
- - KEEP: `PCore.getLocaleUtils().getLocaleValue` calls for i18n
67
- - KEEP: all platform interaction logic
68
- - If the directory contains multiple variants (e.g., VerticalTabs, LeftAlignVerticalTabs), replace ALL of them
69
-
70
- ---
71
-
72
- ## Universal rules (all categories)
73
-
74
- 1. KEEP the same default export function name
75
- 2. KEEP `data-test-id` attributes on interactive elements
76
- 3. KEEP all `PCore.*` API calls unchanged
77
- 4. KEEP `getPConnect()` prop extraction if present
78
- 5. Do NOT modify `src/components/component-map.ts`
79
- 6. Do NOT change the file path — only change file content
80
- 7. Do NOT add new dependencies beyond {{designSystem}} and its documented peer deps
81
- 8. Do NOT remove any TypeScript interfaces/types — update them if needed for new props
@@ -1,41 +0,0 @@
1
- ---
2
- agent: agent
3
- description: Replace a single field component with your design system equivalent
4
- ---
5
-
6
- Replace the `{{fieldName}}` field component (located in `src/components/field/{{fieldName}}/`) with an equivalent implementation using **{{designSystem}}**.
7
-
8
- **Before writing anything:** read ALL files in the component directory, including any `.css` file. For every CSS class, note its visual intent — spacing, sizing, colors, borders, layout. The replacement must produce the same visual appearance as the original.
9
-
10
- **Styling priority — apply in this order, stop at the first that works:**
11
- 1. **{{designSystem}} component props/variants** — always prefer built-in props (`size`, `kind`, `hideLabel`, `orientation`, etc.) over any custom styling
12
- 2. **Retaining the existing `.css` file** and its class names where they don't conflict with {{designSystem}}
13
- 3. **{{designSystem}} design tokens via CSS custom properties** in `style` props — use design system token variables; never hardcode hex colors or pixel values
14
- 4. **Inline `style` props with raw values** — only as a last resort when no prop or token covers the need
15
-
16
- **Before choosing {{designSystem}} components, read the installed package:**
17
- 1. `cat node_modules/{{designSystem}}/README.md` — note the correct import path and usage patterns for the installed version.
18
- 2. `grep "^export" node_modules/{{designSystem}}/dist/index.d.ts 2>/dev/null || grep -rl "^export" node_modules/{{designSystem}} --include="index.d.ts" | head -3 | xargs grep "^export"` — lists every component actually exported by the installed version.
19
- 3. **For every component you plan to use, read its TypeScript prop interface** from the installed `.d.ts` to discover all available styling props (e.g. `size`, `kind`, `hideLabel`, `helperText`, `orientation`). Find the file with: `find node_modules/{{designSystem}} -name "ComponentName.d.ts" | head -3`, then `grep -A 40 "interface.*Props"` on the result.
20
- 4. Only use component names and prop names confirmed in those files. Do not rely on training knowledge of the API.
21
-
22
- **Before writing, discover the design system's own conventions — do not assume:**
23
- - Check the README or exports for a **form layout wrapper component** (one that groups label + input + helper text) — if one exists, use it instead of manual margins
24
- - Check the README or `.d.ts` props for **size/density/variant conventions** — use whatever compact-form prop is documented rather than adding manual padding
25
- - For **built-in slots** (helper text, validation messages, label visibility): check the component's `.d.ts` — if a prop handles it natively, use that prop instead of rendering separate elements
26
- - Check whether the design system has a **companion icons package** — read its exports/index before importing any icon name; do not guess icon names
27
- - For **spacing in `style` props**, check `node_modules/{{designSystem}}` for a `tokens` or `css` directory — use design system CSS custom properties if available; otherwise use relative units (`rem`/`em`), never raw `px`
28
- - For **layout primitives**, check the exports list first — prefer design system stack/grid components over raw `<div style={{ display: 'flex' }}>`
29
-
30
- Requirements:
31
-
32
- 1. Keep the same default export function name
33
- 2. Import and use `PConnFieldProps` from `@pega/sdk-react`
34
- 3. Keep the `handleEvent(actions, 'changeNblur', propName, value)` call on blur
35
- 4. Handle `displayMode === 'DISPLAY_ONLY'` and `'STACKED_LARGE_VAL'` using `getComponentFromRegistry('FieldValueList')`
36
- 5. Show `validatemessage` when `status === 'error'`
37
- 6. Pass `data-test-id={testId}` to the interactive element
38
- 7. Support `readOnly`, `disabled`, `required`, `placeholder`, `hideLabel`
39
- 8. Use local state for the input value, sync from `value` prop via `useEffect`
40
-
41
- Do NOT modify `component-map.ts` unless the file path changes.
@@ -1,49 +0,0 @@
1
- ---
2
- agent: agent
3
- description: Remove MUI and replace all components with a new design system
4
- ---
5
-
6
- Replace the entire UI layer of this application from MUI (@mui/material) to **{{designSystem}}**.
7
-
8
- ## Steps:
9
-
10
- ### 1. Install the new design system
11
-
12
- Install {{designSystem}} and remove @mui/material, @mui/icons-material, @mui/styles, @mui/x-date-pickers (keep @mui/x-date-pickers if {{designSystem}} doesn't have a date picker).
13
-
14
- ### 2. Replace field components (`src/components/field/`)
15
-
16
- Replace all MUI TextField, Select, Checkbox, Radio, etc. with {{designSystem}} equivalents. Keep the PConnect wiring (handleEvent, displayMode, validation).
17
-
18
- ### 3. Replace template components (`src/components/template/`)
19
-
20
- Replace MUI Grid, Box, Tabs, Paper with {{designSystem}} layout primitives. Keep children rendering logic.
21
-
22
- ### 4. Replace widget components (`src/components/widget/`)
23
-
24
- Replace MUI Card, List, Table, Button with {{designSystem}} equivalents. Keep data fetching and PCore API calls.
25
-
26
- ### 5. Replace DSE components (`src/components/designSystemExtension/`)
27
-
28
- Replace MUI Alert, Typography, Chip with {{designSystem}} equivalents. FieldValueList is critical — every field uses it.
29
-
30
- ### 6. Update MashupApp.tsx
31
-
32
- Replace MUI's ThemeProvider with {{designSystem}}'s provider (if any). Remove @mui/styles LegacyThemeProvider.
33
-
34
- ### 7. Update infra components (`src/components/infra/`)
35
-
36
- Replace MUI usage in ActionButtons, NavBar, Stages, DeferLoad, DashboardFilter, VerticalTabs.
37
-
38
- ### 8. Clean up
39
-
40
- - Remove all @mui/\* imports
41
- - Run `npm run build` to verify
42
- - Fix any TypeScript errors
43
-
44
- ## Critical Rules
45
-
46
- - NEVER modify `@pega/sdk-react` imports or the component registry structure
47
- - NEVER remove `handleEvent` calls or `getPConnect` wiring
48
- - ALWAYS handle `displayMode` in field components
49
- - ALWAYS preserve `data-test-id` attributes