@pega/sdk 0.0.3 → 0.0.4
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.
- package/LICENSE +183 -183
- package/README.md +6 -6
- package/SECURITY.md +2 -1
- package/dist/index.js +12 -55
- package/package.json +7 -6
- package/templates/angular-sdk-reference/package.json +15 -15
- package/templates/angular-sdk-reference/tsconfig.json +2 -2
- package/templates/react-native-sdk-reference/App.tsx +2 -4
- package/templates/react-native-sdk-reference/package.json +6 -6
- package/templates/react-native-sdk-reference/tsconfig.json +2 -1
- package/templates/react-sdk-reference/.claude/instructions/component-map.md +1 -1
- package/templates/react-sdk-reference/.claude/instructions/field-component.md +4 -0
- package/templates/react-sdk-reference/.claude/instructions/template-component.md +2 -1
- package/templates/react-sdk-reference/.claude/instructions/widget-component.md +1 -0
- package/templates/react-sdk-reference/.claude/prompts/add-component.md +18 -10
- package/templates/react-sdk-reference/.claude/prompts/component-manifest.json +165 -83
- package/templates/react-sdk-reference/.claude/prompts/generate-all-components.md +26 -17
- package/templates/react-sdk-reference/.claude/prompts/generate-dse-components.md +27 -13
- package/templates/react-sdk-reference/.claude/prompts/generate-field-components.md +42 -28
- package/templates/react-sdk-reference/.claude/prompts/generate-template-components.md +48 -34
- package/templates/react-sdk-reference/.claude/prompts/generate-widget-components.md +25 -11
- package/templates/react-sdk-reference/.claude/prompts/identify-components.md +65 -65
- package/templates/react-sdk-reference/.claude/skills/component-contracts.md +99 -99
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/AlertBanner.md +40 -38
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Banner.md +54 -51
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/CaseSummaryFields.md +51 -46
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/DetailsFields.md +32 -28
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroup.md +38 -35
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroupList.md +25 -23
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldValueList.md +29 -26
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Operator.md +32 -26
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Pulse.md +17 -15
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/RichTextEditor.md +85 -59
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/WssQuickCreate.md +49 -47
- package/templates/react-sdk-reference/.claude/skills/design-system-extension.md +13 -11
- package/templates/react-sdk-reference/.claude/skills/field-components.md +9 -8
- package/templates/react-sdk-reference/.claude/skills/field-skills/AutoComplete.md +27 -26
- package/templates/react-sdk-reference/.claude/skills/field-skills/CancelAlert.md +30 -22
- package/templates/react-sdk-reference/.claude/skills/field-skills/Checkbox.md +60 -43
- package/templates/react-sdk-reference/.claude/skills/field-skills/Currency.md +23 -20
- package/templates/react-sdk-reference/.claude/skills/field-skills/Date.md +19 -17
- package/templates/react-sdk-reference/.claude/skills/field-skills/DateTime.md +18 -15
- package/templates/react-sdk-reference/.claude/skills/field-skills/Decimal.md +22 -21
- package/templates/react-sdk-reference/.claude/skills/field-skills/Dropdown.md +50 -30
- package/templates/react-sdk-reference/.claude/skills/field-skills/Email.md +20 -18
- package/templates/react-sdk-reference/.claude/skills/field-skills/Group.md +21 -15
- package/templates/react-sdk-reference/.claude/skills/field-skills/Integer.md +17 -16
- package/templates/react-sdk-reference/.claude/skills/field-skills/Location.md +30 -21
- package/templates/react-sdk-reference/.claude/skills/field-skills/Multiselect.md +66 -42
- package/templates/react-sdk-reference/.claude/skills/field-skills/ObjectReference.md +27 -18
- package/templates/react-sdk-reference/.claude/skills/field-skills/Percentage.md +22 -21
- package/templates/react-sdk-reference/.claude/skills/field-skills/Phone.md +36 -17
- package/templates/react-sdk-reference/.claude/skills/field-skills/RadioButtons.md +56 -35
- package/templates/react-sdk-reference/.claude/skills/field-skills/RichText.md +23 -12
- package/templates/react-sdk-reference/.claude/skills/field-skills/ScalarList.md +41 -31
- package/templates/react-sdk-reference/.claude/skills/field-skills/SelectableCard.md +70 -55
- package/templates/react-sdk-reference/.claude/skills/field-skills/SemanticLink.md +34 -27
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextArea.md +24 -22
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextContent.md +38 -22
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextInput.md +24 -21
- package/templates/react-sdk-reference/.claude/skills/field-skills/Time.md +16 -15
- package/templates/react-sdk-reference/.claude/skills/field-skills/URL.md +16 -15
- package/templates/react-sdk-reference/.claude/skills/field-skills/UserReference.md +57 -34
- package/templates/react-sdk-reference/.claude/skills/run-and-verify.md +10 -8
- package/templates/react-sdk-reference/.claude/skills/template-components.md +7 -8
- package/templates/react-sdk-reference/.claude/skills/template-skills/AdvancedSearch.md +27 -21
- package/templates/react-sdk-reference/.claude/skills/template-skills/AppShell.md +17 -15
- package/templates/react-sdk-reference/.claude/skills/template-skills/BannerPage.md +19 -16
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseSummary.md +19 -13
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseView.md +23 -17
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseViewActionsMenu.md +34 -29
- package/templates/react-sdk-reference/.claude/skills/template-skills/Confirmation.md +18 -16
- package/templates/react-sdk-reference/.claude/skills/template-skills/DataReference.md +36 -32
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultForm.md +23 -21
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultPage.md +31 -29
- package/templates/react-sdk-reference/.claude/skills/template-skills/Details.md +19 -17
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsSubTabs.md +22 -20
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsThreeColumn.md +19 -17
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsTwoColumn.md +19 -17
- package/templates/react-sdk-reference/.claude/skills/template-skills/DynamicTabs.md +15 -10
- package/templates/react-sdk-reference/.claude/skills/template-skills/FieldGroupTemplate.md +19 -16
- package/templates/react-sdk-reference/.claude/skills/template-skills/HierarchicalForm.md +18 -15
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboard.md +17 -13
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboardPage.md +10 -13
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListPage.md +9 -7
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListView.md +33 -30
- package/templates/react-sdk-reference/.claude/skills/template-skills/MultiReferenceReadOnly.md +13 -11
- package/templates/react-sdk-reference/.claude/skills/template-skills/NarrowWide.md +42 -40
- package/templates/react-sdk-reference/.claude/skills/template-skills/OneColumn.md +25 -20
- package/templates/react-sdk-reference/.claude/skills/template-skills/PromotedFilters.md +25 -19
- package/templates/react-sdk-reference/.claude/skills/template-skills/SelfServiceCaseView.md +36 -29
- package/templates/react-sdk-reference/.claude/skills/template-skills/SimpleTable.md +31 -27
- package/templates/react-sdk-reference/.claude/skills/template-skills/SingleReferenceReadOnly.md +29 -24
- package/templates/react-sdk-reference/.claude/skills/template-skills/SubTabs.md +14 -11
- package/templates/react-sdk-reference/.claude/skills/template-skills/TwoColumn.md +34 -32
- package/templates/react-sdk-reference/.claude/skills/template-skills/WideNarrow.md +48 -46
- package/templates/react-sdk-reference/.claude/skills/template-skills/WssNavBar.md +23 -19
- package/templates/react-sdk-reference/.claude/skills/widget-components.md +11 -22
- package/templates/react-sdk-reference/.claude/skills/widget-skills/AppAnnouncement.md +22 -20
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Attachment.md +33 -28
- package/templates/react-sdk-reference/.claude/skills/widget-skills/CaseHistory.md +18 -15
- package/templates/react-sdk-reference/.claude/skills/widget-skills/FileUtility.md +43 -37
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Followers.md +23 -19
- package/templates/react-sdk-reference/.claude/skills/widget-skills/QuickCreate.md +20 -16
- package/templates/react-sdk-reference/.claude/skills/widget-skills/SummaryItem.md +26 -24
- package/templates/react-sdk-reference/.claude/skills/widget-skills/ToDo.md +43 -35
- package/templates/react-sdk-reference/.cursor/rules/prompts/component-manifest.json +165 -83
- package/templates/react-sdk-reference/.github/agents/implementation-expert.agent.md +135 -0
- package/templates/react-sdk-reference/.github/instructions/component-map.instructions.md +2 -2
- package/templates/react-sdk-reference/.github/instructions/dse-component.instructions.md +1 -1
- package/templates/react-sdk-reference/.github/instructions/field-component.instructions.md +5 -1
- package/templates/react-sdk-reference/.github/instructions/template-component.instructions.md +3 -2
- package/templates/react-sdk-reference/.github/instructions/widget-component.instructions.md +2 -1
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +58 -15
- package/templates/react-sdk-reference/.github/prompts/component-manifest.json +165 -83
- package/templates/react-sdk-reference/.github/prompts/generate-all-components.prompt.md +322 -65
- package/templates/react-sdk-reference/.github/prompts/generate-dse-components.prompt.md +124 -50
- package/templates/react-sdk-reference/.github/prompts/generate-field-components.prompt.md +145 -66
- package/templates/react-sdk-reference/.github/prompts/generate-template-components.prompt.md +146 -73
- package/templates/react-sdk-reference/.github/prompts/generate-widget-components.prompt.md +128 -49
- package/templates/react-sdk-reference/.github/prompts/identify-components.prompt.md +65 -65
- package/templates/react-sdk-reference/.github/skills/component-contracts.md +99 -99
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/AlertBanner.md +40 -38
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Banner.md +54 -51
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/CaseSummaryFields.md +51 -46
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/DetailsFields.md +32 -28
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroup.md +38 -35
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroupList.md +25 -23
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldValueList.md +29 -26
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Operator.md +32 -26
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Pulse.md +17 -15
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/RichTextEditor.md +85 -59
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/WssQuickCreate.md +49 -47
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +13 -11
- package/templates/react-sdk-reference/.github/skills/field-components.md +9 -8
- package/templates/react-sdk-reference/.github/skills/field-skills/AutoComplete.md +27 -26
- package/templates/react-sdk-reference/.github/skills/field-skills/CancelAlert.md +30 -22
- package/templates/react-sdk-reference/.github/skills/field-skills/Checkbox.md +60 -43
- package/templates/react-sdk-reference/.github/skills/field-skills/Currency.md +23 -20
- package/templates/react-sdk-reference/.github/skills/field-skills/Date.md +19 -17
- package/templates/react-sdk-reference/.github/skills/field-skills/DateTime.md +18 -15
- package/templates/react-sdk-reference/.github/skills/field-skills/Decimal.md +22 -21
- package/templates/react-sdk-reference/.github/skills/field-skills/Dropdown.md +50 -30
- package/templates/react-sdk-reference/.github/skills/field-skills/Email.md +20 -18
- package/templates/react-sdk-reference/.github/skills/field-skills/Group.md +21 -15
- package/templates/react-sdk-reference/.github/skills/field-skills/Integer.md +17 -16
- package/templates/react-sdk-reference/.github/skills/field-skills/Location.md +30 -21
- package/templates/react-sdk-reference/.github/skills/field-skills/Multiselect.md +66 -42
- package/templates/react-sdk-reference/.github/skills/field-skills/ObjectReference.md +27 -18
- package/templates/react-sdk-reference/.github/skills/field-skills/Percentage.md +22 -21
- package/templates/react-sdk-reference/.github/skills/field-skills/Phone.md +36 -17
- package/templates/react-sdk-reference/.github/skills/field-skills/RadioButtons.md +56 -35
- package/templates/react-sdk-reference/.github/skills/field-skills/RichText.md +23 -12
- package/templates/react-sdk-reference/.github/skills/field-skills/ScalarList.md +41 -31
- package/templates/react-sdk-reference/.github/skills/field-skills/SelectableCard.md +70 -55
- package/templates/react-sdk-reference/.github/skills/field-skills/SemanticLink.md +34 -27
- package/templates/react-sdk-reference/.github/skills/field-skills/TextArea.md +24 -22
- package/templates/react-sdk-reference/.github/skills/field-skills/TextContent.md +38 -22
- package/templates/react-sdk-reference/.github/skills/field-skills/TextInput.md +24 -21
- package/templates/react-sdk-reference/.github/skills/field-skills/Time.md +16 -15
- package/templates/react-sdk-reference/.github/skills/field-skills/URL.md +16 -15
- package/templates/react-sdk-reference/.github/skills/field-skills/UserReference.md +57 -34
- package/templates/react-sdk-reference/.github/skills/run-and-verify.md +10 -8
- package/templates/react-sdk-reference/.github/skills/template-components.md +7 -8
- package/templates/react-sdk-reference/.github/skills/template-skills/AdvancedSearch.md +27 -21
- package/templates/react-sdk-reference/.github/skills/template-skills/AppShell.md +17 -15
- package/templates/react-sdk-reference/.github/skills/template-skills/BannerPage.md +19 -16
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseSummary.md +19 -13
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseView.md +23 -17
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseViewActionsMenu.md +34 -29
- package/templates/react-sdk-reference/.github/skills/template-skills/Confirmation.md +18 -16
- package/templates/react-sdk-reference/.github/skills/template-skills/DataReference.md +36 -32
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultForm.md +23 -21
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultPage.md +31 -29
- package/templates/react-sdk-reference/.github/skills/template-skills/Details.md +19 -17
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsSubTabs.md +22 -20
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsThreeColumn.md +19 -17
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsTwoColumn.md +19 -17
- package/templates/react-sdk-reference/.github/skills/template-skills/DynamicTabs.md +15 -10
- package/templates/react-sdk-reference/.github/skills/template-skills/FieldGroupTemplate.md +19 -16
- package/templates/react-sdk-reference/.github/skills/template-skills/HierarchicalForm.md +18 -15
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboard.md +17 -13
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboardPage.md +10 -13
- package/templates/react-sdk-reference/.github/skills/template-skills/ListPage.md +9 -7
- package/templates/react-sdk-reference/.github/skills/template-skills/ListView.md +33 -30
- package/templates/react-sdk-reference/.github/skills/template-skills/MultiReferenceReadOnly.md +13 -11
- package/templates/react-sdk-reference/.github/skills/template-skills/NarrowWide.md +42 -40
- package/templates/react-sdk-reference/.github/skills/template-skills/OneColumn.md +25 -20
- package/templates/react-sdk-reference/.github/skills/template-skills/PromotedFilters.md +25 -19
- package/templates/react-sdk-reference/.github/skills/template-skills/SelfServiceCaseView.md +36 -29
- package/templates/react-sdk-reference/.github/skills/template-skills/SimpleTable.md +31 -27
- package/templates/react-sdk-reference/.github/skills/template-skills/SingleReferenceReadOnly.md +29 -24
- package/templates/react-sdk-reference/.github/skills/template-skills/SubTabs.md +14 -11
- package/templates/react-sdk-reference/.github/skills/template-skills/TwoColumn.md +34 -32
- package/templates/react-sdk-reference/.github/skills/template-skills/WideNarrow.md +48 -46
- package/templates/react-sdk-reference/.github/skills/template-skills/WssNavBar.md +23 -19
- package/templates/react-sdk-reference/.github/skills/widget-components.md +11 -22
- package/templates/react-sdk-reference/.github/skills/widget-skills/AppAnnouncement.md +22 -20
- package/templates/react-sdk-reference/.github/skills/widget-skills/Attachment.md +33 -28
- package/templates/react-sdk-reference/.github/skills/widget-skills/CaseHistory.md +18 -15
- package/templates/react-sdk-reference/.github/skills/widget-skills/FileUtility.md +43 -37
- package/templates/react-sdk-reference/.github/skills/widget-skills/Followers.md +23 -19
- package/templates/react-sdk-reference/.github/skills/widget-skills/QuickCreate.md +20 -16
- package/templates/react-sdk-reference/.github/skills/widget-skills/SummaryItem.md +26 -24
- package/templates/react-sdk-reference/.github/skills/widget-skills/ToDo.md +43 -35
- package/templates/react-sdk-reference/AGENTS.md +0 -1
- package/templates/react-sdk-reference/index.html +1 -4
- package/templates/react-sdk-reference/package.json +15 -15
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/AppSelector.tsx +6 -6
- package/templates/react-sdk-reference/src/FallbackComponent.tsx +2 -6
- package/templates/react-sdk-reference/src/MashupApp.styles.ts +269 -41
- package/templates/react-sdk-reference/src/MashupApp.tsx +186 -85
- package/templates/react-sdk-reference/src/PortalApp.tsx +10 -34
- package/templates/react-sdk-reference/src/components/component-map.ts +2 -7
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.tsx +7 -28
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.tsx +12 -7
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +35 -33
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/DetailsFields.tsx +6 -27
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +15 -11
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -7
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -12
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/Operator.tsx +27 -25
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/Pulse.tsx +4 -4
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/RichTextEditor.tsx +8 -40
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +9 -9
- package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +26 -20
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +35 -17
- package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +27 -25
- package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +10 -6
- package/templates/react-sdk-reference/src/components/field/Currency/currency-utils.ts +1 -1
- package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +20 -7
- package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +23 -8
- package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +5 -5
- package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +45 -25
- package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +8 -8
- package/templates/react-sdk-reference/src/components/field/Group/Group.tsx +1 -1
- package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +5 -5
- package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +21 -16
- package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +42 -27
- package/templates/react-sdk-reference/src/components/field/Multiselect/utils.ts +43 -29
- package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +53 -30
- package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +12 -11
- package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +6 -6
- package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +12 -12
- package/templates/react-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +38 -16
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.tsx +17 -4
- package/templates/react-sdk-reference/src/components/field/ScalarList/ScalarList.tsx +5 -5
- package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +31 -18
- package/templates/react-sdk-reference/src/components/field/SelectableCard/utils.tsx +28 -20
- package/templates/react-sdk-reference/src/components/field/SemanticLink/SemanticLink.tsx +28 -19
- package/templates/react-sdk-reference/src/components/field/SemanticLink/utils.ts +3 -1
- package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +4 -4
- package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +4 -4
- package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +20 -7
- package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +7 -7
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +14 -14
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReferenceUtils.ts +2 -2
- package/templates/react-sdk-reference/src/components/helpers/case-utils.tsx +5 -5
- package/templates/react-sdk-reference/src/components/helpers/data_page.ts +3 -3
- package/templates/react-sdk-reference/src/components/helpers/date-format-utils.ts +5 -5
- package/templates/react-sdk-reference/src/components/helpers/field-group-utils.ts +2 -7
- package/templates/react-sdk-reference/src/components/helpers/formatters/Boolean.ts +9 -3
- package/templates/react-sdk-reference/src/components/helpers/formatters/Currency.ts +18 -6
- package/templates/react-sdk-reference/src/components/helpers/formatters/CurrencyMap.ts +168 -168
- package/templates/react-sdk-reference/src/components/helpers/formatters/Date.ts +5 -5
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +8 -5
- package/templates/react-sdk-reference/src/components/helpers/instructions-utils.ts +2 -2
- package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +54 -30
- package/templates/react-sdk-reference/src/components/helpers/state-utils.tsx +5 -2
- package/templates/react-sdk-reference/src/components/helpers/template-utils.ts +5 -4
- package/templates/react-sdk-reference/src/components/helpers/utils.ts +3 -3
- package/templates/react-sdk-reference/src/components/helpers/versionHelpers.ts +3 -1
- package/templates/react-sdk-reference/src/components/index.ts +1 -4
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/AdvancedSearch.tsx +18 -10
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroup/persistUtils.ts +3 -3
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +26 -90
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/hooks.ts +8 -5
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/utils.ts +8 -4
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/TemplateContext.ts +1 -1
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.tsx +28 -19
- package/templates/react-sdk-reference/src/components/template/BannerPage/BannerPage.tsx +2 -2
- package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +5 -5
- package/templates/react-sdk-reference/src/components/template/CaseView/CaseView.tsx +35 -16
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +10 -10
- package/templates/react-sdk-reference/src/components/template/Confirmation/Confirmation.tsx +12 -26
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReference.tsx +41 -124
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReferenceAdvancedSearchContext.ts +2 -2
- package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +18 -78
- package/templates/react-sdk-reference/src/components/template/DataReference/utils.ts +18 -12
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +4 -12
- package/templates/react-sdk-reference/src/components/template/DefaultForm/utils/index.ts +3 -3
- package/templates/react-sdk-reference/src/components/template/DefaultPage/DefaultPage.tsx +3 -3
- package/templates/react-sdk-reference/src/components/template/Details/Details/Details.tsx +6 -8
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +7 -14
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +7 -14
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/DynamicTabs.tsx +16 -8
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx +7 -4
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +20 -5
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/hooks.ts +35 -77
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +10 -10
- package/templates/react-sdk-reference/src/components/template/ListView/DefaultViewMeta.ts +31 -31
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +173 -133
- package/templates/react-sdk-reference/src/components/template/ListView/hooks.ts +17 -10
- package/templates/react-sdk-reference/src/components/template/ListView/utils.ts +64 -51
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +6 -6
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.tsx +6 -6
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +8 -18
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +3 -3
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +7 -1
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/OneColumn.tsx +3 -3
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/OneColumnTab.tsx +1 -1
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.tsx +13 -40
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/SelfServiceCaseView.tsx +19 -16
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -7
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +84 -203
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +15 -5
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +15 -29
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +7 -7
- package/templates/react-sdk-reference/src/components/template/SubTabs/SubTabs.tsx +1 -1
- package/templates/react-sdk-reference/src/components/template/SubTabs/tabUtils.ts +13 -11
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.tsx +3 -3
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +3 -3
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx +6 -6
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +13 -24
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +3 -3
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +7 -1
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.tsx +25 -25
- package/templates/react-sdk-reference/src/components/template/utils.tsx +6 -6
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/AppAnnouncement.tsx +9 -9
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.tsx +125 -79
- package/templates/react-sdk-reference/src/components/widget/Attachment/AttachmentUtils.ts +58 -33
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/CaseHistory.tsx +14 -12
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -7
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.tsx +137 -107
- package/templates/react-sdk-reference/src/components/widget/Followers/Followers.tsx +4 -4
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/QuickCreate.tsx +15 -11
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.tsx +25 -18
- package/templates/react-sdk-reference/src/components/widget/SummaryList/SummaryList.tsx +7 -2
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +30 -116
- package/templates/react-sdk-reference/src/main.tsx +1 -1
- package/templates/react-sdk-reference/tsconfig.json +2 -1
- package/templates/react-sdk-reference/vite.config.ts +51 -26
- package/templates/wc-sdk-reference/package.json +3 -3
- package/templates/wc-sdk-reference/src/index.ts +10 -10
- package/templates/wc-sdk-reference/tsconfig.json +1 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Use when the user wants to generate, create, add, replace, migrate, or identify UI components (field, template, widget, design system extension, or infra) in this Pega SDK reference app — a single component, a batch, or the entire app — with any design system (Ant Design, Chakra UI, Radix, Shadcn, Carbon, MUI, etc.). Handles trigger phrases like 'generate a component', 'add a component', 'replace all field components with...', 'migrate the design system to...', 'replace everything with...', 'what components are in this screenshot'. Executes the repo's existing .github/prompts workflows end-to-end — generation, batch generation, full-app generation, screenshot-based identification, and full/targeted design-system migration — including component-map.ts registration, provider setup, and build verification."
|
|
3
|
+
name: 'Implementation Expert'
|
|
4
|
+
tools: [read, edit, search, execute, agent, vscode_askQuestions]
|
|
5
|
+
user-invocable: true
|
|
6
|
+
disable-model-invocation: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are the **Implementation Expert** for this Pega Infinity SDK React reference application. You are not limited
|
|
10
|
+
to generating new components — you implement the **entire component lifecycle flow** defined in `.github/prompts/`:
|
|
11
|
+
creating components, batch-generating them, generating the whole app, identifying components from screenshots, and
|
|
12
|
+
migrating the design system of components that already exist. You execute these workflows end-to-end exactly as
|
|
13
|
+
written, rather than improvising your own approach.
|
|
14
|
+
|
|
15
|
+
This repo is a reference implementation customers clone and re-skin: the UI components under
|
|
16
|
+
`src/components/{field,template,widget,designSystemExtension}/` are meant to be replaced with any design system,
|
|
17
|
+
while the SDK wiring (`src/components/component-map.ts` registry mechanics, `src/components/infra/`,
|
|
18
|
+
`src/components/helpers/event-utils.ts`, `@pega/sdk-react`, and `MashupApp.tsx`/`PortalApp.tsx`'s auth/bootstrap
|
|
19
|
+
logic) is reusable infrastructure you must never break.
|
|
20
|
+
|
|
21
|
+
## Startup behavior
|
|
22
|
+
|
|
23
|
+
The **first time you respond in a conversation**, before doing any routing or file work:
|
|
24
|
+
|
|
25
|
+
- **If the user's message already states a clear, actionable task** (e.g. "generate a TextInput field with Chakra
|
|
26
|
+
UI", "replace all widgets with Ant Design"), skip the menu below and go straight to Step 0 / Routing logic.
|
|
27
|
+
- **If the user's message is vague, empty, a greeting, or just says something like "help" / "what can you do"**,
|
|
28
|
+
respond with:
|
|
29
|
+
1. A one-paragraph summary of what you do (implement the full component lifecycle: generate, batch-generate,
|
|
30
|
+
generate everything, identify components from a screenshot, migrate design systems).
|
|
31
|
+
2. A short bulleted menu of the flows you support, each with a one-line example trigger phrase, e.g.:
|
|
32
|
+
- **Add/replace a single component** — "add a Dropdown field using Chakra UI"
|
|
33
|
+
- **Batch-generate one type** — "generate all widget components with Ant Design"
|
|
34
|
+
- **Generate everything** — "generate all components using Radix"
|
|
35
|
+
- **Identify components from a screenshot** — attach an image and ask "what components are in this screenshot"
|
|
36
|
+
- **Migrate the design system** — "replace all field components with Carbon" or "migrate the whole app to Chakra UI"
|
|
37
|
+
3. Then immediately call the `vscode_askQuestions` tool (not inline text questions) to let the user pick from
|
|
38
|
+
concrete options rather than typing free text. At minimum ask:
|
|
39
|
+
- **Flow**: options = Add/replace a single component | Batch-generate one type | Generate everything |
|
|
40
|
+
Identify components from a screenshot | Migrate the design system.
|
|
41
|
+
- **Component type** (skip only if "Identify from screenshot" chosen): options = Field | Template | Widget |
|
|
42
|
+
Design System Extension | **All** (`All` = Field + Template + Widget + Design System Extension together).
|
|
43
|
+
Enable multi-select so the user can combine individual types into a custom subset (e.g. Field + Widget),
|
|
44
|
+
but treat **All** as its own exclusive/standalone choice — if the flow is "Generate everything", default
|
|
45
|
+
the selection to **All** and don't present it as something to combine with the individual type options.
|
|
46
|
+
- **Design system**: options = Ant Design | Chakra UI | Radix | Shadcn | Carbon | MUI | Other (freeform allowed).
|
|
47
|
+
Every question should list selectable options (`allowFreeformInput: true` so the user can still type something
|
|
48
|
+
not listed) instead of asking open-ended questions in plain chat text.
|
|
49
|
+
|
|
50
|
+
Do not start reading prompt files or editing anything until the user's intent and the required inputs (from
|
|
51
|
+
Step 0 below) are confirmed.
|
|
52
|
+
|
|
53
|
+
## Routing logic
|
|
54
|
+
|
|
55
|
+
Determine which prompt file governs the request, then **read that prompt file's full contents with the read tool
|
|
56
|
+
before writing any code**. Never paraphrase or execute steps from memory — always re-read the prompt (and every
|
|
57
|
+
skill file it tells you to read) at the start of the task, and follow every numbered step in order without
|
|
58
|
+
skipping or shortcutting any of them.
|
|
59
|
+
|
|
60
|
+
| Request shape | Prompt file to read and follow |
|
|
61
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| One new/replacement component, one type (e.g. "add an AutoComplete field with Chakra UI") | `.github/prompts/add-component.prompt.md` |
|
|
63
|
+
| Multiple/all field components, one design system | `.github/prompts/generate-field-components.prompt.md` |
|
|
64
|
+
| Multiple/all template components, one design system | `.github/prompts/generate-template-components.prompt.md` |
|
|
65
|
+
| Multiple/all widget components, one design system | `.github/prompts/generate-widget-components.prompt.md` |
|
|
66
|
+
| Multiple/all design system extension components, one design system | `.github/prompts/generate-dse-components.prompt.md` |
|
|
67
|
+
| Multiple component types at once, or "generate all components" | `.github/prompts/generate-all-components.prompt.md` (wave-based orchestration — launch subagents via `runSubagent`, respecting the ≤10-subagents-per-wave limit defined in that prompt) |
|
|
68
|
+
| A screenshot/image is attached and the user wants to know what components are in it (no migration requested) | `.github/prompts/identify-components.prompt.md` — output only the single `components="..."` line it specifies |
|
|
69
|
+
| Migrating/replacing the design system of components that **already exist** — full app, or scoped by folder/named-shorthand/explicit list/screenshot | `.github/prompts/replace-design-system.prompt.md` (reads `.github/prompts/component-manifest.json` for scope resolution; targeted migration for ≤10 resolved components, full 9-wave migration otherwise) |
|
|
70
|
+
|
|
71
|
+
If a request mixes generation and migration ambiguously, use `vscode_askQuestions` to ask which they mean (options:
|
|
72
|
+
"Generate/replace" vs "Migrate existing") before picking a prompt — generation prompts assume the component
|
|
73
|
+
doesn't exist yet (or is being fully rewritten), migration assumes it exists and only its design-system primitives
|
|
74
|
+
change.
|
|
75
|
+
|
|
76
|
+
### Migration-specific notes (`replace-design-system.prompt.md`)
|
|
77
|
+
|
|
78
|
+
- That prompt tells you to launch per-component subagents using prompts named `replace-field` (fields) and
|
|
79
|
+
`replace-component` (everything else). **These files do not exist in `.github/prompts/`.** When launching those
|
|
80
|
+
subagents yourself via `runSubagent`, give each one the equivalent instructions inline instead: the relevant
|
|
81
|
+
general skill (`.github/skills/field-components.md`, `template-components.md`, `widget-components.md`, or
|
|
82
|
+
`design-system-extension.md`), the component-specific skill file
|
|
83
|
+
(`.github/skills/{type}-skills/<Name>.md`), the target design system, and the same "preserve visual intent /
|
|
84
|
+
keep default export name / update in place" constraints that `add-component.prompt.md` uses for a single
|
|
85
|
+
component.
|
|
86
|
+
- Root provider setup (Step T1.3 / 1.3) and `FieldValueList` replacement (Step T1.4 / 1.4) are blocking
|
|
87
|
+
prerequisites — complete them before launching any migration subagent wave.
|
|
88
|
+
|
|
89
|
+
## Step 0 — resolve missing inputs
|
|
90
|
+
|
|
91
|
+
Every generation prompt requires: component name(s), component type, target design system, and output path.
|
|
92
|
+
`replace-design-system.prompt.md` requires a target design system plus at least one way to resolve scope
|
|
93
|
+
(screenshot, `components=` list, or `scope=` folder/shorthand) — if none are given, it defaults to a full 9-wave
|
|
94
|
+
migration, so confirm that's really what the user wants before proceeding. If any required input is missing or
|
|
95
|
+
ambiguous, use the `vscode_askQuestions` tool to ask — present concrete, selectable options (e.g. the known
|
|
96
|
+
design systems, the four component types, folder/named-shorthand scopes from `component-manifest.json`) rather
|
|
97
|
+
than a plain open-ended question, while still allowing freeform input for anything not listed. Do not guess a
|
|
98
|
+
design system or silently default to MUI.
|
|
99
|
+
|
|
100
|
+
## Guardrails
|
|
101
|
+
|
|
102
|
+
- **One folder per component — never a shared/monolithic file.** Every component (field, template, widget, or
|
|
103
|
+
designSystemExtension) must be created at `<outputPath>/<ComponentName>/<ComponentName>.tsx` plus a sibling
|
|
104
|
+
`<outputPath>/<ComponentName>/index.tsx` that does `export { default } from './<ComponentName>';` — exactly as
|
|
105
|
+
Step 5/6 of `add-component.prompt.md` specifies. Never write multiple components into one `.tsx` file, never
|
|
106
|
+
create a catch-all file like `generated/<designSystem>Components.tsx`, and never export a single bundled object
|
|
107
|
+
(e.g. `generatedComponents`) that `component-map.ts` spreads in one line. This applies identically whether you
|
|
108
|
+
generate one component, a batch of one type, or "all components" via `generate-all-components.prompt.md` — the
|
|
109
|
+
wave/subagent orchestration in that flow does not change the per-component file-and-folder contract.
|
|
110
|
+
- `component-map.ts` must get one **named import + one map entry per component**, added under the matching
|
|
111
|
+
category comment (Fields / Templates / Widgets / Design System Extension), never a single spread of a bundled
|
|
112
|
+
object.
|
|
113
|
+
- Never modify the auth/bootstrap logic in `src/MashupApp.tsx`/`src/PortalApp.tsx`, `src/components/infra/`
|
|
114
|
+
(beyond what a migration prompt explicitly directs), `src/components/helpers/event-utils.ts`, or anything under
|
|
115
|
+
`@pega/sdk-react`. The one exception: `replace-design-system.prompt.md` explicitly requires wrapping the
|
|
116
|
+
existing provider tree in `MashupApp.tsx`/`PortalApp.tsx` with a new design-system provider — that specific,
|
|
117
|
+
additive change is allowed only during a migration flow.
|
|
118
|
+
- Never remove the `...sdkComponents` spread in `src/components/component-map.ts` — only add or replace entries.
|
|
119
|
+
- Field components must handle `displayMode` (`DISPLAY_ONLY` / `STACKED_LARGE_VAL`) via `FieldValueList`, obtained
|
|
120
|
+
through `getComponentFromRegistry`, never a hardcoded import.
|
|
121
|
+
- `FieldValueList`'s prop interface (`name`, `value`, `variant: 'stacked' | 'inline'`) must never change — every
|
|
122
|
+
field component depends on it.
|
|
123
|
+
- Preserve the original visual intent (spacing, padding, sizing) when mapping old styles to the new design
|
|
124
|
+
system's primitives — don't silently drop them.
|
|
125
|
+
- Keep the same default export name for every generated/replaced component so `component-map.ts` references and
|
|
126
|
+
imports stay valid.
|
|
127
|
+
|
|
128
|
+
## Verification
|
|
129
|
+
|
|
130
|
+
After generation or migration, run the build (`npm run build`, or the steps in `.github/skills/run-and-verify.md`
|
|
131
|
+
if the prompt references it) and report the result. Before declaring success, confirm the folder-per-component
|
|
132
|
+
contract held: every generated/replaced component has its own `<ComponentName>/<ComponentName>.tsx` +
|
|
133
|
+
`<ComponentName>/index.tsx`, and no monolithic/shared/"generated" bundle file was created. Summarize: which
|
|
134
|
+
components were generated/replaced/migrated, which files were touched, the `component-map.ts` diff, provider
|
|
135
|
+
changes (if any), and the build outcome (pass/fail, with errors if any).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo:
|
|
2
|
+
applyTo: '**/component-map.ts'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Component Map Rules
|
|
@@ -13,7 +13,7 @@ import { sdkComponents } from '@pega/sdk-react';
|
|
|
13
13
|
|
|
14
14
|
function getSampleComponentMap() {
|
|
15
15
|
return {
|
|
16
|
-
...sdkComponents,
|
|
16
|
+
...sdkComponents, // NEVER remove this — provides infrastructure
|
|
17
17
|
// Your components below:
|
|
18
18
|
TextInput,
|
|
19
19
|
Dropdown,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo:
|
|
2
|
+
applyTo: 'src/components/field/**/*.tsx'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Field Component Rules
|
|
@@ -9,11 +9,13 @@ When creating or modifying field components, follow these rules:
|
|
|
9
9
|
## Required Structure
|
|
10
10
|
|
|
11
11
|
1. **Import types from `@pega/sdk-react`**:
|
|
12
|
+
|
|
12
13
|
```typescript
|
|
13
14
|
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
14
15
|
```
|
|
15
16
|
|
|
16
17
|
2. **Define a props interface extending `PConnFieldProps`**:
|
|
18
|
+
|
|
17
19
|
```typescript
|
|
18
20
|
interface MyFieldProps extends PConnFieldProps {
|
|
19
21
|
// additional props specific to this field
|
|
@@ -30,6 +32,7 @@ When creating or modifying field components, follow these rules:
|
|
|
30
32
|
1. **Extract standard props**: `getPConnect`, `label`, `required`, `disabled`, `value`, `validatemessage`, `status`, `readOnly`, `testId`, `helperText`, `displayMode`, `hideLabel`, `placeholder`
|
|
31
33
|
|
|
32
34
|
2. **Get PConnect APIs**:
|
|
35
|
+
|
|
33
36
|
```typescript
|
|
34
37
|
const pConn = getPConnect();
|
|
35
38
|
const actions = pConn.getActionsApi();
|
|
@@ -37,6 +40,7 @@ When creating or modifying field components, follow these rules:
|
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
3. **Handle displayMode** (MUST be before the main return):
|
|
43
|
+
|
|
40
44
|
```typescript
|
|
41
45
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
42
46
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
package/templates/react-sdk-reference/.github/instructions/template-component.instructions.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo:
|
|
2
|
+
applyTo: 'src/components/template/**/*.tsx'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Template Component Rules
|
|
@@ -9,6 +9,7 @@ When creating or modifying template/layout components, follow these rules:
|
|
|
9
9
|
## Required Structure
|
|
10
10
|
|
|
11
11
|
1. **Import types from `@pega/sdk-react`**:
|
|
12
|
+
|
|
12
13
|
```typescript
|
|
13
14
|
import type { PConnProps } from '@pega/sdk-react';
|
|
14
15
|
```
|
|
@@ -28,7 +29,7 @@ Receive React `children` directly:
|
|
|
28
29
|
import type { PropsWithChildren, ReactElement } from 'react';
|
|
29
30
|
|
|
30
31
|
interface TwoColumnProps extends PConnProps {
|
|
31
|
-
templateCol?: string;
|
|
32
|
+
templateCol?: string; // e.g. "1fr 1fr", "2fr 1fr"
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
applyTo:
|
|
2
|
+
applyTo: 'src/components/widget/**/*.tsx'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Widget Component Rules
|
|
@@ -9,6 +9,7 @@ When creating or modifying widget components, follow these rules:
|
|
|
9
9
|
## Required Structure
|
|
10
10
|
|
|
11
11
|
1. **Import types from `@pega/sdk-react`**:
|
|
12
|
+
|
|
12
13
|
```typescript
|
|
13
14
|
import type { PConnProps } from '@pega/sdk-react';
|
|
14
15
|
// or PConnFieldProps if the widget behaves like a field (e.g., Attachment)
|
|
@@ -12,9 +12,12 @@ Read the user's message carefully. Extract:
|
|
|
12
12
|
- **Design system** — the UI library to use (e.g. `Ant Design`, `Chakra UI`, `Carbon`, `Radix UI`)
|
|
13
13
|
- **Output path** — the exact or relative path where the component should be generated (e.g. `src/components/field/AutoComplete`)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
All four values above are required. If any are missing or ambiguous, you MUST stop and ask the user before proceeding. Do not infer any value from the project structure, `.instructions.md` files, existing folders, or any other source.
|
|
16
|
+
|
|
17
|
+
⛔ **STOP** — If the user's message does not explicitly provide ALL of: component name, component type, design system, and output path — ask for the missing items now. Do not proceed to Step 1 until you have explicit answers from the user for all required inputs.
|
|
16
18
|
|
|
17
19
|
Example questions to ask (only ask the ones that are actually missing):
|
|
20
|
+
|
|
18
21
|
1. Which design system should I use? (e.g. Ant Design, Chakra UI, Carbon, Radix UI)
|
|
19
22
|
2. What is the exact component name?
|
|
20
23
|
3. What type of component is this? (field / template / widget / designSystemExtension)
|
|
@@ -44,29 +47,31 @@ Before generating, check if a component already exists at the resolved output pa
|
|
|
44
47
|
|
|
45
48
|
Always read the **general type skill** for the component type:
|
|
46
49
|
|
|
47
|
-
| Component Type
|
|
48
|
-
|
|
49
|
-
| `field`
|
|
50
|
-
| `template`
|
|
51
|
-
| `widget`
|
|
50
|
+
| Component Type | General Skill File |
|
|
51
|
+
| ----------------------- | ------------------------------------------- |
|
|
52
|
+
| `field` | `.github/skills/field-components.md` |
|
|
53
|
+
| `template` | `.github/skills/template-components.md` |
|
|
54
|
+
| `widget` | `.github/skills/widget-components.md` |
|
|
52
55
|
| `designSystemExtension` | `.github/skills/design-system-extension.md` |
|
|
53
56
|
|
|
54
57
|
Then look for a **component-specific skill** based on the component type:
|
|
55
58
|
|
|
56
|
-
| Component Type
|
|
57
|
-
|
|
58
|
-
| `field`
|
|
59
|
-
| `template`
|
|
60
|
-
| `widget`
|
|
59
|
+
| Component Type | Specific Skill Location |
|
|
60
|
+
| ----------------------- | ------------------------------------------------------------------ |
|
|
61
|
+
| `field` | `.github/skills/field-skills/<ComponentName>.md` |
|
|
62
|
+
| `template` | `.github/skills/template-skills/<ComponentName>.md` |
|
|
63
|
+
| `widget` | `.github/skills/widget-skills/<ComponentName>.md` |
|
|
61
64
|
| `designSystemExtension` | `.github/skills/design-system-extension-skills/<ComponentName>.md` |
|
|
62
65
|
|
|
63
66
|
If the component-specific skill file exists, read it fully. Pay special attention to:
|
|
67
|
+
|
|
64
68
|
- **Behavioral Contract** — state management, event handling, option loading, edge cases
|
|
65
69
|
- **Design System Mapping** table — the recommended component for the chosen design system
|
|
66
70
|
|
|
67
71
|
You must read **both** the general type skill and the component-specific skill (if it exists) before proceeding.
|
|
68
72
|
|
|
69
73
|
Examples:
|
|
74
|
+
|
|
70
75
|
- `AutoComplete` (field) → read `field-components.md` + `field-skills/AutoComplete.md`
|
|
71
76
|
- `AdvancedSearch` (template) → read `template-components.md` + `template-skills/AdvancedSearch.md`
|
|
72
77
|
- `AppAnnouncement` (widget) → read `widget-components.md` + `widget-skills/AppAnnouncement.md`
|
|
@@ -79,11 +84,13 @@ If no component-specific skill file exists, continue using the general pattern f
|
|
|
79
84
|
## Step 3 — Check and install dependencies
|
|
80
85
|
|
|
81
86
|
Run:
|
|
87
|
+
|
|
82
88
|
```
|
|
83
89
|
cat package.json | grep "<design-system-package>"
|
|
84
90
|
```
|
|
85
91
|
|
|
86
92
|
If the design system package is **not** listed in `dependencies` or `devDependencies`, install it:
|
|
93
|
+
|
|
87
94
|
```
|
|
88
95
|
npm install <design-system-package>
|
|
89
96
|
```
|
|
@@ -103,6 +110,7 @@ Before writing any code, inspect the installed package:
|
|
|
103
110
|
4. Only use component names and prop names confirmed in those files. Do not rely on training knowledge of the API.
|
|
104
111
|
|
|
105
112
|
Also check:
|
|
113
|
+
|
|
106
114
|
- Whether the design system has a **form layout wrapper** (label + input + helper text) — use it instead of manual margins
|
|
107
115
|
- Whether it has **size/density/variant conventions** — use built-in props rather than custom padding
|
|
108
116
|
- Whether it has a **companion icons package** — read its exports before using any icon name; never guess icon names
|
|
@@ -116,12 +124,46 @@ Create the component directory at the resolved output path (from Step 0).
|
|
|
116
124
|
|
|
117
125
|
Create `<ComponentName>.tsx` using the pattern for the component type:
|
|
118
126
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
### field
|
|
128
|
+
|
|
129
|
+
Use this structure from `field-components.md` (read in Step 2):
|
|
130
|
+
|
|
131
|
+
1. Imports: React hooks + `handleEvent` from `../../helpers/event-utils` + `getComponentFromRegistry` from `@pega/sdk-react` + `PConnFieldProps` + DS input from Step 4
|
|
132
|
+
2. Interface extending `PConnFieldProps` with any extra props from the component skill file
|
|
133
|
+
3. Destructure: `getPConnect`, `label`, `required`, `disabled`, `value`, `validatemessage`, `status`, `readOnly`, `testId`, `helperText`, `displayMode`, `hideLabel`, `placeholder`
|
|
134
|
+
4. Display mode guards: if `DISPLAY_ONLY` or `STACKED_LARGE_VAL` → return `FieldValueList` (via `getComponentFromRegistry('FieldValueList')`)
|
|
135
|
+
5. Return → DS form input from Step 4, with `onBlur` calling `handleEvent(actions, 'changeNblur', propName, inputValue)`. Show `validatemessage` when `status === 'error'`. Pass `data-test-id={testId}` on the interactive element.
|
|
136
|
+
|
|
137
|
+
### template
|
|
138
|
+
|
|
139
|
+
Use this structure from `template-components.md` (read in Step 2):
|
|
140
|
+
|
|
141
|
+
- **Layout**: `PropsWithChildren` + `templateCol` parsing + DS grid from Step 4 rendering children in column ratios. Mobile: stack to full width.
|
|
142
|
+
- **Form**: `createElement(createPConnectComponent(), ...)` for each child from `getPConnect().getChildren()[0].getPConnect().getChildren()`. No DS primitives.
|
|
143
|
+
- **Page**: `createElement(createPConnectComponent(), ...)` for each region from `getPConnect().getChildren()`. No DS primitives.
|
|
144
|
+
|
|
145
|
+
### widget
|
|
146
|
+
|
|
147
|
+
Use this structure from `widget-components.md` (read in Step 2):
|
|
148
|
+
|
|
149
|
+
1. Imports: React hooks + DS components from Step 4 + `PConnProps` from `@pega/sdk-react`
|
|
150
|
+
2. Interface extending `PConnProps` with props from the component skill file
|
|
151
|
+
3. Component function: destructure `getPConnect`, call `getPConnect()` to get `pConn`
|
|
152
|
+
4. `useEffect` → data fetch using exact PCore API from skill file's Behavioral Contract
|
|
153
|
+
5. Return → DS Card/List/Table from Step 4, rendering fetched data
|
|
154
|
+
|
|
155
|
+
### designSystemExtension
|
|
156
|
+
|
|
157
|
+
Use this structure from `design-system-extension.md` (read in Step 2):
|
|
158
|
+
|
|
159
|
+
- **Pattern B** (Pure display): variant mapping (urgent→error, etc.) + DS Alert/Card/Avatar from Step 4. No `getPConnect`.
|
|
160
|
+
- **Pattern A** (PConnect display): CSS classes + optional DS typography. No DS primitives.
|
|
161
|
+
- **Pattern C** (Complex display): `createElement(createPConnectComponent(), ...)` for PConnect children. No DS primitives.
|
|
162
|
+
|
|
163
|
+
---
|
|
123
164
|
|
|
124
165
|
Create `index.tsx`:
|
|
166
|
+
|
|
125
167
|
```typescript
|
|
126
168
|
export { default } from './<ComponentName>';
|
|
127
169
|
```
|
|
@@ -142,6 +184,7 @@ Do not restructure or reorder any existing entries.
|
|
|
142
184
|
## Step 7 — Verify the build
|
|
143
185
|
|
|
144
186
|
Run:
|
|
187
|
+
|
|
145
188
|
```
|
|
146
189
|
npm run build
|
|
147
190
|
```
|