@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.
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/templates/react-sdk-reference/.claude/instructions/component-map.md +38 -0
- package/templates/react-sdk-reference/.claude/instructions/dse-component.md +75 -0
- package/templates/react-sdk-reference/.claude/instructions/field-component.md +71 -0
- package/templates/react-sdk-reference/.claude/instructions/template-component.md +92 -0
- package/templates/react-sdk-reference/.claude/instructions/widget-component.md +87 -0
- package/templates/react-sdk-reference/.claude/prompts/add-component.md +144 -0
- package/templates/react-sdk-reference/.claude/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-all-components.md +149 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-dse-components.md +126 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-field-components.md +139 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-template-components.md +151 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-widget-components.md +124 -0
- package/templates/react-sdk-reference/.claude/prompts/identify-components.md +105 -0
- package/templates/react-sdk-reference/.claude/prompts/replace-design-system.md +519 -0
- package/templates/react-sdk-reference/.claude/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension.md +289 -0
- package/templates/react-sdk-reference/.claude/skills/field-components.md +294 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.claude/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.claude/skills/template-components.md +322 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/widget-components.md +271 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/.cursor/rules/component-map.mdrules +41 -0
- package/templates/react-sdk-reference/.cursor/rules/dse-component.mdrules +78 -0
- package/templates/react-sdk-reference/.cursor/rules/field-component.mdrules +74 -0
- package/templates/react-sdk-reference/.cursor/rules/pega-sdk.mdrules +247 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/add-component.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-all-components.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-dse-components.mdrules +131 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-field-components.mdrules +144 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-template-components.mdrules +156 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-widget-components.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/identify-components.mdrules +110 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/replace-design-system.mdrules +524 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/component-contracts.mdrules +145 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/AlertBanner.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Banner.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/CaseSummaryFields.mdrules +159 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/DetailsFields.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroup.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroupList.mdrules +116 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldValueList.mdrules +120 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Operator.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Pulse.mdrules +88 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/RichTextEditor.mdrules +211 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/WssQuickCreate.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension.mdrules +294 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-components.mdrules +299 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/AutoComplete.mdrules +117 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/CancelAlert.mdrules +208 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Checkbox.mdrules +163 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Currency.mdrules +111 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Date.mdrules +104 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/DateTime.mdrules +108 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Decimal.mdrules +103 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Dropdown.mdrules +119 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Email.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Group.mdrules +95 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Integer.mdrules +92 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Location.mdrules +141 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Multiselect.mdrules +169 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ObjectReference.mdrules +169 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Percentage.mdrules +97 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Phone.mdrules +115 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RadioButtons.mdrules +151 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RichText.mdrules +143 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ScalarList.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SelectableCard.mdrules +221 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SemanticLink.mdrules +153 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextArea.mdrules +101 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextContent.mdrules +106 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextInput.mdrules +109 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Time.mdrules +93 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/URL.mdrules +90 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/UserReference.mdrules +185 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/run-and-verify.mdrules +73 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-components.mdrules +327 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AdvancedSearch.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AppShell.mdrules +127 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/BannerPage.mdrules +88 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseSummary.mdrules +105 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseView.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseViewActionsMenu.mdrules +131 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Confirmation.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DataReference.mdrules +125 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultForm.mdrules +107 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultPage.mdrules +115 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Details.mdrules +93 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsSubTabs.mdrules +100 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsThreeColumn.mdrules +83 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsTwoColumn.mdrules +83 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DynamicTabs.mdrules +106 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/FieldGroupTemplate.mdrules +114 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/HierarchicalForm.mdrules +118 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboard.mdrules +109 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboardPage.mdrules +90 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListPage.mdrules +73 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListView.mdrules +144 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/MultiReferenceReadOnly.mdrules +85 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/NarrowWide.mdrules +146 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/OneColumn.mdrules +114 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/PromotedFilters.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SelfServiceCaseView.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SimpleTable.mdrules +132 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SingleReferenceReadOnly.mdrules +108 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SubTabs.mdrules +84 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/TwoColumn.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WideNarrow.mdrules +155 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WssNavBar.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-components.mdrules +276 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/AppAnnouncement.mdrules +87 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Attachment.mdrules +151 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/CaseHistory.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/FileUtility.mdrules +205 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Followers.mdrules +104 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/QuickCreate.mdrules +119 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/SummaryItem.mdrules +172 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/ToDo.mdrules +195 -0
- package/templates/react-sdk-reference/.cursor/rules/template-component.mdrules +95 -0
- package/templates/react-sdk-reference/.cursor/rules/widget-component.mdrules +90 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +58 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +144 -16
- package/templates/react-sdk-reference/.github/prompts/generate-all-components.prompt.md +154 -0
- package/templates/react-sdk-reference/.github/prompts/generate-dse-components.prompt.md +131 -0
- package/templates/react-sdk-reference/.github/prompts/generate-field-components.prompt.md +144 -0
- package/templates/react-sdk-reference/.github/prompts/generate-template-components.prompt.md +156 -0
- package/templates/react-sdk-reference/.github/prompts/generate-widget-components.prompt.md +129 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +58 -18
- package/templates/react-sdk-reference/.github/skills/field-components.md +55 -23
- package/templates/react-sdk-reference/.github/skills/template-components.md +48 -11
- package/templates/react-sdk-reference/.github/skills/widget-components.md +49 -12
- package/templates/react-sdk-reference/AGENTS.md +217 -29
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/sdk-config.json +1 -1
- package/templates/react-sdk-reference/vite.config.ts +1 -1
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +0 -48
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +0 -81
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +0 -41
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +0 -49
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +0 -105
- package/templates/react-sdk-reference/pega-constellationjs-0.26.2.tgz +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Template component skill: WideNarrow
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: WideNarrow
|
|
7
|
+
|
|
8
|
+
Asymmetric two-column layout with a wide left column (~67%) and a narrow right column (~33%). Mirror of NarrowWide. Includes four sub-variants.
|
|
9
|
+
|
|
10
|
+
> **Prerequisite skill:** [`template-components.md`](../template-components.md) — covers architecture, child rendering patterns, and registration conventions common to ALL template components.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Component Purpose
|
|
15
|
+
|
|
16
|
+
Renders two children side by side with the left column wider than the right. Typically used when the main content occupies the left and a utility/sidebar panel sits on the right. Four sub-variants:
|
|
17
|
+
|
|
18
|
+
- **`WideNarrow`** — core CSS-based layout, accepts either `a`/`b` slot props or React `children[0]`/`children[1]`
|
|
19
|
+
- **`WideNarrowPage`** — wrapper that passes React children as `a` and `b` slot props to `WideNarrow`
|
|
20
|
+
- **`WideNarrowForm`** — simplified wrapper using only `children`
|
|
21
|
+
- **`WideNarrowDetails`** — details read-only variant; sets children to DISPLAY_ONLY mode and supports highlighted data
|
|
22
|
+
|
|
23
|
+
> This component is the mirror of `NarrowWide`. All behavioral and structural patterns are identical except column order and CSS class names. See the `NarrowWide` skill for detailed pattern descriptions.
|
|
24
|
+
|
|
25
|
+
## Pega Metadata
|
|
26
|
+
|
|
27
|
+
| Variant | Registration Key |
|
|
28
|
+
|---------|-----------------|
|
|
29
|
+
| WideNarrow | `WideNarrow` |
|
|
30
|
+
| WideNarrowPage | `WideNarrowPage` |
|
|
31
|
+
| WideNarrowForm | `WideNarrowForm` |
|
|
32
|
+
| WideNarrowDetails | `WideNarrowDetails` |
|
|
33
|
+
|
|
34
|
+
All extend `PConnProps`.
|
|
35
|
+
|
|
36
|
+
## Props
|
|
37
|
+
|
|
38
|
+
### WideNarrow
|
|
39
|
+
|
|
40
|
+
| Prop | Type | Required | Description |
|
|
41
|
+
|------|------|----------|-------------|
|
|
42
|
+
| `children` | `ReactNode[]` | No | Two children — `[0]` → wide (left), `[1]` → narrow (right) |
|
|
43
|
+
| `a` | `any` | No | Wide (left) column content |
|
|
44
|
+
| `b` | `any` | No | Narrow (right) column content |
|
|
45
|
+
| `title` | `string` | No | Optional title (not rendered) |
|
|
46
|
+
| `cols` | `string` | No | Column template (not rendered) |
|
|
47
|
+
| `icon` | `string` | No | Icon name (not rendered) |
|
|
48
|
+
|
|
49
|
+
### WideNarrowPage
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Required | Description |
|
|
52
|
+
|------|------|----------|-------------|
|
|
53
|
+
| `children` | `ReactNode[]` | Yes | Two children — `[0]` → wide slot, `[1]` → narrow slot |
|
|
54
|
+
| `title` | `string` | Yes | Page title (passed to WideNarrow) |
|
|
55
|
+
| `templateCol` | `string` | No | Column ratio (default `'1fr 1fr'`) |
|
|
56
|
+
| `icon` | `string` | No | Icon name (strips `'pi pi-'` prefix) |
|
|
57
|
+
|
|
58
|
+
### WideNarrowForm
|
|
59
|
+
|
|
60
|
+
| Prop | Type | Required | Description |
|
|
61
|
+
|------|------|----------|-------------|
|
|
62
|
+
| `children` | `ReactNode[]` | Yes | Two children rendered in wide/narrow slots |
|
|
63
|
+
|
|
64
|
+
### WideNarrowDetails
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Required | Description |
|
|
67
|
+
|------|------|----------|-------------|
|
|
68
|
+
| `label` | `string` | No | Section label for FieldGroup |
|
|
69
|
+
| `showLabel` | `boolean` | No | Whether to show the label. Default `true` |
|
|
70
|
+
| `showHighlightedData` | `boolean` | No | Whether to render highlighted data fields. Default `false` |
|
|
71
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
72
|
+
|
|
73
|
+
## Behavioral Contract
|
|
74
|
+
|
|
75
|
+
### WideNarrow
|
|
76
|
+
|
|
77
|
+
1. If `children` is provided and has exactly 2 items: render `children[0]` in `.psdk-wide-column-column` and `children[1]` in `.psdk-narrow-column-column` (both wrapped in `.psdk-wide-narrow-column`).
|
|
78
|
+
2. If `a` and `b` are provided: render `a` in the wide slot and `b` in the narrow slot.
|
|
79
|
+
3. `children` takes priority over `a`/`b` when both are present.
|
|
80
|
+
|
|
81
|
+
### WideNarrowPage
|
|
82
|
+
|
|
83
|
+
1. Extract `childArray = Children.toArray(children)`.
|
|
84
|
+
2. Retrieve `WideNarrow` from the component registry.
|
|
85
|
+
3. Render `<WideNarrow a={childArray[0]} b={childArray[1]} title={title} cols={templateCol} icon={icon?.replace('pi pi-', '')} />`.
|
|
86
|
+
|
|
87
|
+
### WideNarrowForm
|
|
88
|
+
|
|
89
|
+
1. Render using `children` path — checks `children.length === 2`, renders wide/narrow CSS divs.
|
|
90
|
+
|
|
91
|
+
### WideNarrowDetails
|
|
92
|
+
|
|
93
|
+
1. Set `getPConnect().setInheritedProp('displayMode', 'DISPLAY_ONLY')` and `setInheritedProp('readOnly', true)`.
|
|
94
|
+
2. Map `getPConnect().getChildren()` → `createElement(PConnectComponent, { ...configObject, key: index })`.
|
|
95
|
+
3. If `showHighlightedData` is true, read `getRawMetadata().config.highlightedData`, set each field's `displayMode = 'STACKED_LARGE_VAL'`, mark `pyStatusWork` as `displayAsStatus=true`, and create components via `getPConnect().createComponent(field, '', 0, {})`.
|
|
96
|
+
4. Wrap in `<FieldGroup name={theName}>` using `propsToUse.showLabel && propsToUse.label`.
|
|
97
|
+
5. Layout: highlighted data in `Grid size={{ xs: COLUMN_WIDTHS[i] }}` where **`COLUMN_WIDTHS = [8, 4]`** (wide left, narrow right — reversed vs NarrowWideDetails).
|
|
98
|
+
6. Children rendered in `Grid size={{ xs: 12 }}` rows.
|
|
99
|
+
|
|
100
|
+
## Visual Specifications
|
|
101
|
+
|
|
102
|
+
Derived from `WideNarrow.css`:
|
|
103
|
+
|
|
104
|
+
### Container
|
|
105
|
+
|
|
106
|
+
| CSS Class | Property | Value |
|
|
107
|
+
|-----------|----------|-------|
|
|
108
|
+
| `.psdk-wide-narrow-column` | Display | two-column row layout |
|
|
109
|
+
| `.psdk-wide-column-column` | Width | ~67% (2 of 3 parts) — LEFT column |
|
|
110
|
+
| `.psdk-narrow-column-column` | Width | ~33% (1 of 3 parts) — RIGHT column |
|
|
111
|
+
|
|
112
|
+
**CSS-only implementation notes:**
|
|
113
|
+
- `.psdk-wide-narrow-column`: `display: grid; grid-template-columns: 2fr 1fr; gap: 1rem`.
|
|
114
|
+
- Wide column (left): `2fr` — takes the first grid column.
|
|
115
|
+
- Narrow column (right): `1fr` — takes the second grid column.
|
|
116
|
+
- On mobile: `grid-template-columns: 1fr` (stacks vertically, wide on top).
|
|
117
|
+
|
|
118
|
+
### Key Difference from NarrowWide
|
|
119
|
+
|
|
120
|
+
| | NarrowWide | WideNarrow |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| Left column | Narrow (~33%) | Wide (~67%) |
|
|
123
|
+
| Right column | Wide (~67%) | Narrow (~33%) |
|
|
124
|
+
| CSS container class | `.psdk-narrow-wide-column` | `.psdk-wide-narrow-column` |
|
|
125
|
+
| `COLUMN_WIDTHS` (Details) | `[4, 8]` | `[8, 4]` |
|
|
126
|
+
|
|
127
|
+
## Edge Cases & Special Logic
|
|
128
|
+
|
|
129
|
+
- `WideNarrowDetails` defaults `children` to empty (`= []`) — safe even if no children are provided.
|
|
130
|
+
- Highlighted data guard: check `if (!theConfigObject) theConfigObject = {}` before creating PConnectComponent — prevents crash on null config objects.
|
|
131
|
+
- Icon cleanup in `WideNarrowPage`: strip `'pi pi-'` from icon string before passing to `WideNarrow`.
|
|
132
|
+
|
|
133
|
+
## Dependencies
|
|
134
|
+
|
|
135
|
+
- `WideNarrowPage`: `getComponentFromRegistry` from `@pega/sdk-react`
|
|
136
|
+
- `WideNarrowDetails`: `getComponentFromRegistry('FieldGroup')`, `PConnectComponent` from `@pega/sdk-react`
|
|
137
|
+
|
|
138
|
+
## Design System Mapping
|
|
139
|
+
|
|
140
|
+
**UI control type:** Asymmetric two-column layout (main content + sidebar).
|
|
141
|
+
|
|
142
|
+
Listed design systems are examples only.
|
|
143
|
+
|
|
144
|
+
| Design System | Recommended Component |
|
|
145
|
+
|---|---|
|
|
146
|
+
| Default (CSS only) | CSS Grid `grid-template-columns: 2fr 1fr; gap: 1rem` |
|
|
147
|
+
| MUI | `<Grid container><Grid size={{ xs: 12, md: 8 }}><Grid size={{ xs: 12, md: 4 }}>` |
|
|
148
|
+
| Ant Design | `<Row gutter={16}><Col xs={24} md={16}><Col xs={24} md={8}>` |
|
|
149
|
+
| Chakra UI | `<Grid templateColumns={{ base: '1fr', md: '2fr 1fr' }} gap={4}>` |
|
|
150
|
+
| Shadcn/ui | Tailwind `grid grid-cols-1 md:grid-cols-[2fr_1fr] gap-4` |
|
|
151
|
+
|
|
152
|
+
When implementing in a specific design system:
|
|
153
|
+
- Wide column ≈ 67% width (left side)
|
|
154
|
+
- Narrow column ≈ 33% width (right side)
|
|
155
|
+
- `WideNarrowDetails` forces DISPLAY_ONLY + readOnly on all children
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Template component skill: WssNavBar
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: WssNavBar
|
|
7
|
+
|
|
8
|
+
WSS (Web Self-Service) navigation bar template. Renders the app bar for WSS portal with responsive hamburger menu, navigation links, operator avatar, and logout.
|
|
9
|
+
|
|
10
|
+
> **Prerequisite skill:** [`template-components.md`](../template-components.md) — covers architecture, child rendering patterns, and registration conventions common to ALL template components.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Component Purpose
|
|
15
|
+
|
|
16
|
+
Provides the top navigation bar for WSS (Web Self-Service) portals. Responsive: shows a hamburger menu on mobile, full nav links on desktop. Navigation position and alignment are configurable. Includes operator avatar with initials and a logout action.
|
|
17
|
+
|
|
18
|
+
## Pega Metadata
|
|
19
|
+
|
|
20
|
+
- **Registration key:** `WssNavBar` (in `component-map.ts`)
|
|
21
|
+
- **Category:** Navigation template — WSS portal
|
|
22
|
+
- **Extends:** `PConnProps`
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Required | Description |
|
|
27
|
+
|------|------|----------|-------------|
|
|
28
|
+
| `links` | `array` | Yes | Array of `{ label, url, id }` navigation link objects |
|
|
29
|
+
| `navDisplayOptions` | `object` | No | `{ alignment: 'left'|'right'|'center', position: 'inline'|'below' }` |
|
|
30
|
+
| `portalLogoUrl` | `string` | No | URL for the portal logo image |
|
|
31
|
+
| `operatorInfo` | `object` | No | `{ displayName: string }` — for avatar initials |
|
|
32
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
33
|
+
|
|
34
|
+
## Behavioral Contract
|
|
35
|
+
|
|
36
|
+
### Responsive Layout
|
|
37
|
+
|
|
38
|
+
- **Mobile (xs breakpoint):** Hamburger menu button (`<MenuIcon>`) shown; nav links hidden.
|
|
39
|
+
- On click: opens a `<Drawer>` or dropdown menu with nav links.
|
|
40
|
+
- CSS: `display: { xs: 'flex', md: 'none' }` on hamburger; `display: { xs: 'none', md: 'flex' }` on nav links.
|
|
41
|
+
- **Desktop (md+ breakpoint):** Nav links shown inline; hamburger hidden.
|
|
42
|
+
|
|
43
|
+
### Navigation Position
|
|
44
|
+
|
|
45
|
+
From `navDisplayOptions.position`:
|
|
46
|
+
- `'inline'` — nav links appear in the same row as the logo.
|
|
47
|
+
- `'below'` — nav links appear in a second row below the logo/title row.
|
|
48
|
+
|
|
49
|
+
### Navigation Alignment
|
|
50
|
+
|
|
51
|
+
From `navDisplayOptions.alignment`:
|
|
52
|
+
- `'left'` — links flush left.
|
|
53
|
+
- `'right'` — links pushed to the right (flex with `ml: 'auto'`).
|
|
54
|
+
- `'center'` — links centered.
|
|
55
|
+
|
|
56
|
+
### Operator Avatar
|
|
57
|
+
|
|
58
|
+
- Extract initials from `operatorInfo.displayName`:
|
|
59
|
+
- Split by space, take first letter of first and last word.
|
|
60
|
+
- E.g. `"John Smith"` → `"JS"`.
|
|
61
|
+
- Render as `<Avatar>{initials}</Avatar>`.
|
|
62
|
+
- Clicking avatar opens a menu with a Logout option.
|
|
63
|
+
|
|
64
|
+
### Logout
|
|
65
|
+
|
|
66
|
+
- Import `logout` from `@pega/auth/lib/sdk-auth-manager`.
|
|
67
|
+
- Call `logout()` when the Logout menu item is clicked.
|
|
68
|
+
|
|
69
|
+
### Render Structure
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
<AppBar position='static'>
|
|
73
|
+
<Toolbar>
|
|
74
|
+
{/* Logo */}
|
|
75
|
+
{portalLogoUrl && <img src={portalLogoUrl} alt='logo' />}
|
|
76
|
+
|
|
77
|
+
{/* Hamburger (mobile) */}
|
|
78
|
+
<IconButton sx={{ display: { xs: 'flex', md: 'none' } }} onClick={openMobileMenu}>
|
|
79
|
+
<MenuIcon />
|
|
80
|
+
</IconButton>
|
|
81
|
+
|
|
82
|
+
{/* Nav links (desktop) */}
|
|
83
|
+
<Box sx={{ display: { xs: 'none', md: 'flex' }, ...alignmentStyles }}>
|
|
84
|
+
{links.map(link => <Button key={link.id} href={link.url}>{link.label}</Button>)}
|
|
85
|
+
</Box>
|
|
86
|
+
|
|
87
|
+
{/* Operator avatar */}
|
|
88
|
+
<Avatar onClick={openUserMenu}>{initials}</Avatar>
|
|
89
|
+
</Toolbar>
|
|
90
|
+
</AppBar>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Visual Specifications
|
|
94
|
+
|
|
95
|
+
| Element | Mobile | Desktop |
|
|
96
|
+
|---------|--------|---------|
|
|
97
|
+
| Logo | Shown | Shown |
|
|
98
|
+
| Nav links | Hidden (hamburger menu) | Shown inline or below |
|
|
99
|
+
| Avatar | Shown | Shown |
|
|
100
|
+
| Hamburger | Shown | Hidden |
|
|
101
|
+
|
|
102
|
+
**CSS-only implementation notes:**
|
|
103
|
+
- App bar: `background: var(--app-primary-color); color: white`.
|
|
104
|
+
- Toolbar: `display: flex; align-items: center; gap: 1rem; padding: 0 1rem`.
|
|
105
|
+
- Hamburger: `display: none`. At mobile breakpoint: `display: flex`.
|
|
106
|
+
- Nav links: `display: flex; gap: 0.5rem`. At mobile breakpoint: `display: none`.
|
|
107
|
+
- Avatar: `width: 36px; height: 36px; border-radius: 50%; background: var(--avatar-bg); cursor: pointer`.
|
|
108
|
+
- Logout menu: `position: absolute; top: 100%; right: 0; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.2)`.
|
|
109
|
+
|
|
110
|
+
## Edge Cases & Special Logic
|
|
111
|
+
|
|
112
|
+
- `portalLogoUrl` is async — show fallback text until resolved.
|
|
113
|
+
- `operatorInfo.displayName` may be undefined — guard and show a default avatar (single letter or icon).
|
|
114
|
+
- `navDisplayOptions` may be absent — default to `{ alignment: 'left', position: 'inline' }`.
|
|
115
|
+
- Mobile drawer state must be managed separately from the user menu state.
|
|
116
|
+
|
|
117
|
+
## Dependencies
|
|
118
|
+
|
|
119
|
+
- `logout` from `@pega/auth/lib/sdk-auth-manager` — logout handler
|
|
120
|
+
- MUI: `<AppBar>`, `<Toolbar>`, `<IconButton>`, `<Avatar>`, `<Menu>`, `<MenuItem>`, `<Button>`, `<Box>`
|
|
121
|
+
- MUI Icons: `<MenuIcon>`
|
|
122
|
+
|
|
123
|
+
## Design System Mapping
|
|
124
|
+
|
|
125
|
+
**UI control type:** Responsive application navigation bar with avatar and logout.
|
|
126
|
+
|
|
127
|
+
Listed design systems are examples only.
|
|
128
|
+
|
|
129
|
+
| Design System | App Bar | Avatar | Mobile Menu |
|
|
130
|
+
|---|---|---|---|
|
|
131
|
+
| Default (CSS only) | `<header>` + CSS | `<div class='avatar'>` | CSS hamburger + dropdown |
|
|
132
|
+
| MUI | `<AppBar>` + `<Toolbar>` | `<Avatar>` | `<Drawer>` or `<Menu>` |
|
|
133
|
+
| Ant Design | `<Layout.Header>` | `<Avatar>` | `<Drawer>` |
|
|
134
|
+
| Chakra UI | `<Box as='header'>` | `<Avatar>` | `<Drawer>` |
|
|
135
|
+
| Shadcn/ui | Custom `<header>` | Custom initials avatar | `<Sheet>` (drawer) |
|
|
136
|
+
|
|
137
|
+
When implementing in a specific design system:
|
|
138
|
+
- `logout` from `@pega/auth/lib/sdk-auth-manager` is mandatory — always call the SDK logout, not a custom one
|
|
139
|
+
- Responsive breakpoints for hamburger/nav visibility must be implemented
|
|
140
|
+
- `navDisplayOptions.alignment` and `.position` must be respected
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: widget-components
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Widget Components
|
|
7
|
+
|
|
8
|
+
Create or replace widget components in the react-sdk-reference application. Widgets are self-contained UI blocks that fetch their own data from Pega APIs (data pages, case info) and render interactive features (ToDo lists, attachments, case history, etc.).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Architecture Overview
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
src/components/widget/<ComponentName>/
|
|
16
|
+
├── <ComponentName>.tsx # Component implementation
|
|
17
|
+
├── index.tsx # Re-export (if present)
|
|
18
|
+
├── <ComponentName>.css # Styles (optional)
|
|
19
|
+
├── <ComponentName>Utils.ts # Widget-specific utilities (optional)
|
|
20
|
+
├── <ComponentName>.types.ts # Type definitions (optional)
|
|
21
|
+
└── config-ext.json # Metadata (optional)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Props Interface
|
|
27
|
+
|
|
28
|
+
Widget components extend `PConnProps`:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import type { PConnProps } from '../../../types/PConnProps';
|
|
32
|
+
|
|
33
|
+
interface MyWidgetProps extends PConnProps {
|
|
34
|
+
// Widget-specific props provided by the platform
|
|
35
|
+
datasource?: any;
|
|
36
|
+
headerText?: string;
|
|
37
|
+
context?: string;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Some widgets extend `PConnFieldProps` when they behave like form fields (e.g., Attachment):
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import type { PConnFieldProps } from '../../../types/PConnProps';
|
|
45
|
+
|
|
46
|
+
interface AttachmentProps extends Omit<PConnFieldProps, 'value'> {
|
|
47
|
+
value: any; // Attachment list (not a string)
|
|
48
|
+
allowMultiple: boolean;
|
|
49
|
+
extensions: string;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Implementation Pattern
|
|
56
|
+
|
|
57
|
+
### Data-Fetching Widget
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { useState, useEffect } from 'react';
|
|
63
|
+
// Import your design system components here:
|
|
64
|
+
// e.g. import { Card, List } from 'antd';
|
|
65
|
+
// e.g. import { Card, UnorderedList } from '@chakra-ui/react';
|
|
66
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
67
|
+
|
|
68
|
+
interface MyWidgetProps extends PConnProps {
|
|
69
|
+
datasource?: any;
|
|
70
|
+
headerText?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default function MyWidget(props: MyWidgetProps) {
|
|
74
|
+
const { getPConnect, datasource, headerText = 'My Widget' } = props;
|
|
75
|
+
const pConn = getPConnect();
|
|
76
|
+
|
|
77
|
+
const [data, setData] = useState<any[]>([]);
|
|
78
|
+
const [loading, setLoading] = useState(true);
|
|
79
|
+
|
|
80
|
+
// 1. Fetch data from a Pega data page on mount
|
|
81
|
+
// This block is always the same regardless of design system
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const context = pConn.getContextName();
|
|
84
|
+
PCore.getDataPageUtils()
|
|
85
|
+
.getDataAsync(
|
|
86
|
+
datasource?.source, // Data page name (e.g., 'D_WorkList')
|
|
87
|
+
context,
|
|
88
|
+
{}, // Parameters
|
|
89
|
+
{ pageNumber: 1, pageSize: 10 },
|
|
90
|
+
{ select: [{ field: 'pyID' }, { field: 'pyLabel' }] },
|
|
91
|
+
{ invalidateCache: true }
|
|
92
|
+
)
|
|
93
|
+
.then(response => {
|
|
94
|
+
setData(Array.isArray(response?.data) ? response.data : []);
|
|
95
|
+
setLoading(false);
|
|
96
|
+
})
|
|
97
|
+
.catch(() => setLoading(false));
|
|
98
|
+
}, []);
|
|
99
|
+
|
|
100
|
+
// 2. Loading state — replace with your DS loading indicator if available
|
|
101
|
+
if (loading) return <div>Loading...</div>;
|
|
102
|
+
|
|
103
|
+
// 3. [DS RENDER] — replace with your design system's card/list/table primitives
|
|
104
|
+
// See "Design System Adaptation" section below for guidance
|
|
105
|
+
return (
|
|
106
|
+
<YourDesignSystemCard>
|
|
107
|
+
<YourDesignSystemCardHeader title={headerText} />
|
|
108
|
+
<YourDesignSystemCardContent>
|
|
109
|
+
<YourDesignSystemList>
|
|
110
|
+
{data.map((item, i) => (
|
|
111
|
+
<YourDesignSystemListItem key={i}>{item.pyLabel}</YourDesignSystemListItem>
|
|
112
|
+
))}
|
|
113
|
+
</YourDesignSystemList>
|
|
114
|
+
</YourDesignSystemCardContent>
|
|
115
|
+
</YourDesignSystemCard>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Design System Adaptation
|
|
123
|
+
|
|
124
|
+
The PCore data-fetching logic (all `PCore.*` calls) is always identical regardless of design system. Only the `// [DS RENDER]` section changes.
|
|
125
|
+
|
|
126
|
+
**1. Check the component-specific skill file** — `.cursor/rules/skills/widget-skills/<ComponentName>.mdrules` contains a **Design System Mapping** table where available. Use it as a starting point.
|
|
127
|
+
|
|
128
|
+
**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.).
|
|
129
|
+
|
|
130
|
+
**3. Discover the API from installed packages** — confirm component names and props from `.d.ts` before writing JSX:
|
|
131
|
+
```bash
|
|
132
|
+
find node_modules/<ds-package> -name "*.d.ts" | xargs grep -l "Card\|List\|Table" | head -5
|
|
133
|
+
grep -A 30 "interface.*Props" <path-to-file>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**4. Common widget UI primitive mapping:**
|
|
137
|
+
|
|
138
|
+
| Widget pattern | Typical DS equivalent |
|
|
139
|
+
|---|---|
|
|
140
|
+
| Container with title | `Card` + header/title prop, or `Panel`, `Box` |
|
|
141
|
+
| Item list | `List`, `UnorderedList`, or `Table` rows |
|
|
142
|
+
| Loading indicator | `Spinner`, `Skeleton`, `Loading` |
|
|
143
|
+
| Action button | `Button` with `onClick` |
|
|
144
|
+
| Status badge | `Badge`, `Tag`, `Chip` |
|
|
145
|
+
| Empty state | DS empty/placeholder component or plain `<div>` |
|
|
146
|
+
|
|
147
|
+
**5. Icons** — if the DS has a companion icon package, read its exports before using any icon name. Never guess icon names.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Action Widget (opens assignments/cases)
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
function openAssignment(assignment) {
|
|
155
|
+
const { classname, ID } = assignment;
|
|
156
|
+
const context = getPConnect().getContextName();
|
|
157
|
+
const options = { containerName: 'primary', channelName: '' };
|
|
158
|
+
|
|
159
|
+
PCore.getMashupApi().openAssignment(ID, classname, options);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function createCase(caseType) {
|
|
163
|
+
PCore.getMashupApi().createCase(caseType, PCore.getConstants().APP.APP);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Common Pega APIs Used in Widgets
|
|
170
|
+
|
|
171
|
+
### Data Pages
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
// Fetch list data
|
|
175
|
+
PCore.getDataPageUtils().getDataAsync(
|
|
176
|
+
dataPageName,
|
|
177
|
+
context,
|
|
178
|
+
params,
|
|
179
|
+
paging,
|
|
180
|
+
query,
|
|
181
|
+
options,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
// Get page data (single record)
|
|
185
|
+
PCore.getDataPageUtils().getPageDataAsync(dataPageName, context, params);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Case Info
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
const pConn = getPConnect();
|
|
192
|
+
const caseKey = pConn.getCaseInfo().getKey();
|
|
193
|
+
const caseID = pConn.getCaseInfo().getID();
|
|
194
|
+
const caseName = pConn.getCaseInfo().getName();
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Attachments
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
PCore.getAttachmentUtils().prepareAttachmentData(value);
|
|
201
|
+
PCore.getAttachmentUtils().uploadAttachment(
|
|
202
|
+
file,
|
|
203
|
+
onProgress,
|
|
204
|
+
errorHandler,
|
|
205
|
+
context,
|
|
206
|
+
);
|
|
207
|
+
PCore.getAttachmentUtils().downloadAttachment(attachmentID, context);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Actions
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
const actionsApi = pConn.getActionsApi();
|
|
214
|
+
actionsApi.updateFieldValue(propName, value);
|
|
215
|
+
actionsApi.triggerFieldChange(propName, value);
|
|
216
|
+
actionsApi.openLocalAction(actionName, options);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Container Management
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
const containerManager = pConn.getContainerManager();
|
|
223
|
+
containerManager.addContainerItem({
|
|
224
|
+
semanticURL,
|
|
225
|
+
key,
|
|
226
|
+
flowName,
|
|
227
|
+
caseViewMode,
|
|
228
|
+
resourceType,
|
|
229
|
+
data,
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Registration
|
|
236
|
+
|
|
237
|
+
Register widgets in `src/components/component-map.ts`:
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
import MyWidget from './widget/MyWidget';
|
|
241
|
+
|
|
242
|
+
// In getSampleComponentMap():
|
|
243
|
+
{
|
|
244
|
+
...sdkComponents,
|
|
245
|
+
MyWidget, // Key must match the Pega component name
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Existing Widget Components
|
|
252
|
+
|
|
253
|
+
| Component | Description | Key APIs |
|
|
254
|
+
| --------------- | --------------------------- | ------------------------------------------------------------------- |
|
|
255
|
+
| AppAnnouncement | System-wide announcements | `PCore.getMessagingServiceUtils()` |
|
|
256
|
+
| Attachment | File upload/download | `PCore.getAttachmentUtils()` |
|
|
257
|
+
| CaseHistory | Case audit trail | `PCore.getDataPageUtils()` |
|
|
258
|
+
| FileUtility | File management utility | `PCore.getAttachmentUtils()` |
|
|
259
|
+
| Followers | Case followers list | `PCore.getDataPageUtils()` |
|
|
260
|
+
| QuickCreate | Quick case creation buttons | `PCore.getMashupApi().createCase()` |
|
|
261
|
+
| SummaryItem | Single summary card | Props from parent |
|
|
262
|
+
| SummaryList | List of summary cards | Props from parent |
|
|
263
|
+
| ToDo | Assignment worklist | `PCore.getDataPageUtils()`, `PCore.getMashupApi().openAssignment()` |
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Key Conventions
|
|
268
|
+
|
|
269
|
+
1. **Default export** — `export default function WidgetName`.
|
|
270
|
+
2. **Self-contained data** — Widgets fetch their own data (don't rely on parent passing data down).
|
|
271
|
+
3. **Loading states** — Always handle loading/error states when fetching data.
|
|
272
|
+
4. **PCore globals** — Access `PCore` directly (declared globally by `@pega/pcore-pconnect-typedefs`).
|
|
273
|
+
5. **Localization** — Use `pConn.getLocalizationService()` for translated strings when available.
|
|
274
|
+
6. **Context** — Use `pConn.getContextName()` as the context parameter for data page calls.
|
|
275
|
+
7. **Card layout** — Widgets typically render inside MUI `Card` with `CardHeader` and `CardContent`.
|
|
276
|
+
8. **Action handling** — Use `PCore.getMashupApi()` for case/assignment operations, `actionsApi` for field updates.
|
package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/AppAnnouncement.mdrules
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Widget component skill: AppAnnouncement
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: AppAnnouncement
|
|
7
|
+
|
|
8
|
+
Card-based announcement widget. Displays a system-wide or application announcement with an optional bullet list of items and a "See what's new" external link button.
|
|
9
|
+
|
|
10
|
+
> **Prerequisite skill:** [`widget-components.md`](../widget-components.md) — covers architecture, props interface, data-fetching patterns, and registration conventions common to ALL widget components.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Component Purpose
|
|
15
|
+
|
|
16
|
+
Renders an announcement card with a heading, description text, optional bullet list of items sourced from a `datasource` prop, and an optional external link button. Styled with a left accent border to visually distinguish it from other cards.
|
|
17
|
+
|
|
18
|
+
## Pega Metadata
|
|
19
|
+
|
|
20
|
+
- **Registration key:** `AppAnnouncement` (in `component-map.ts`)
|
|
21
|
+
- **Category:** Widget — informational display
|
|
22
|
+
- **Extends:** `PConnProps`
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Required | Description |
|
|
27
|
+
|------|------|----------|-------------|
|
|
28
|
+
| `header` | `string` | No | Announcement card title |
|
|
29
|
+
| `description` | `string` | No | Announcement body text |
|
|
30
|
+
| `datasource` | `object` | No | Data source object — `datasource.source` is an array of item objects |
|
|
31
|
+
| `whatsnewlink` | `string` | No | URL for the "See what's new" button; if absent, button is not rendered |
|
|
32
|
+
| `getPConnect` | `function` | Yes | PConnect getter |
|
|
33
|
+
|
|
34
|
+
## Behavioral Contract
|
|
35
|
+
|
|
36
|
+
1. **Item list extraction:** If `datasource` is provided and `datasource.source` is a non-empty array, extract item names and render them as a bullet list. Each array item is expected to have a `name` property.
|
|
37
|
+
2. **Button:** If `whatsnewlink` is non-empty, render a button labeled `"See what's new"` (or localized equivalent). On click, open the URL in a new browser tab (`window.open(whatsnewlink, '_blank')`).
|
|
38
|
+
3. **Description:** Render the `description` string as plain text below the header.
|
|
39
|
+
4. **No data fetching:** This widget is purely prop-driven — it does not call any PCore data APIs.
|
|
40
|
+
|
|
41
|
+
## Visual Specifications
|
|
42
|
+
|
|
43
|
+
### Card Layout
|
|
44
|
+
|
|
45
|
+
| Element | Position |
|
|
46
|
+
|---------|----------|
|
|
47
|
+
| Left accent border | 6px solid, primary light color |
|
|
48
|
+
| Card header | `header` prop as title |
|
|
49
|
+
| Card content | Description text + optional bullet list |
|
|
50
|
+
| "See what's new" button | Below description / bullet list |
|
|
51
|
+
|
|
52
|
+
**CSS-only implementation notes:**
|
|
53
|
+
- Card: `border-left: 6px solid var(--app-primary-light-color); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.12)`.
|
|
54
|
+
- Card header: `padding: 12px 16px; font-weight: 600`.
|
|
55
|
+
- Card content: `padding: 0 16px 16px`.
|
|
56
|
+
- Bullet list: `padding-left: 1.5rem; margin: 0.5rem 0`.
|
|
57
|
+
- "See what's new" button: `margin-top: 0.75rem; text-transform: none`.
|
|
58
|
+
|
|
59
|
+
## Edge Cases & Special Logic
|
|
60
|
+
|
|
61
|
+
- `datasource` may be `undefined` or `datasource.source` may be an empty array — in both cases, render no bullet list (not even an empty `<ul>`).
|
|
62
|
+
- `whatsnewlink` may be an empty string — treat the same as absent (no button rendered).
|
|
63
|
+
- `header` and `description` may both be absent — render the card with empty/placeholder content without crashing.
|
|
64
|
+
- Item objects in `datasource.source` are expected to have `name` — guard against items where `name` is `undefined`.
|
|
65
|
+
|
|
66
|
+
## Dependencies
|
|
67
|
+
|
|
68
|
+
- MUI: `<Card>`, `<CardHeader>`, `<CardContent>`, `<Typography>`, `<Button>`
|
|
69
|
+
|
|
70
|
+
## Design System Mapping
|
|
71
|
+
|
|
72
|
+
**UI control type:** Announcement / informational card with bullet list and external link.
|
|
73
|
+
|
|
74
|
+
Listed design systems are examples only.
|
|
75
|
+
|
|
76
|
+
| Design System | Card | Bullet List | Button |
|
|
77
|
+
|---|---|---|---|
|
|
78
|
+
| Default (CSS only) | `<div>` with left border + box-shadow | `<ul>/<li>` | `<button>` opening new tab |
|
|
79
|
+
| MUI | `<Card>` + `<CardHeader>` + `<CardContent>` | `<List>/<ListItem>` or `<ul>` | `<Button>` |
|
|
80
|
+
| Ant Design | `<Card>` with `title` prop | `<ul>/<li>` | `<Button>` |
|
|
81
|
+
| Chakra UI | `<Card>` + `<CardHeader>` + `<CardBody>` | `<UnorderedList>/<ListItem>` | `<Button>` |
|
|
82
|
+
| Shadcn/ui | `<Card>` + `<CardHeader>` + `<CardContent>` | `<ul>/<li>` | `<Button>` |
|
|
83
|
+
|
|
84
|
+
When implementing in a specific design system:
|
|
85
|
+
- Left accent border is a key visual identifier — implement it via CSS or the design system's border utilities
|
|
86
|
+
- "See what's new" must open in a new tab (`target='_blank'` + `rel='noopener noreferrer'`)
|
|
87
|
+
- The widget is entirely prop-driven — no data fetching needed
|