@pega/sdk 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/index.js +764 -165
- package/package.json +1 -1
- package/templates/react-native-sdk-reference/.claude/settings.json +5 -0
- package/templates/react-native-sdk-reference/.prettierignore +17 -0
- package/templates/react-native-sdk-reference/.vscode/extensions.json +1 -0
- package/templates/react-native-sdk-reference/.vscode/settings.json +7 -0
- package/templates/react-native-sdk-reference/AGENTS.md +3 -0
- package/templates/react-native-sdk-reference/CLAUDE.md +1 -0
- package/templates/react-native-sdk-reference/README.md +56 -0
- package/templates/react-native-sdk-reference/app.json +40 -5
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/react-native-sdk-reference/assets/expo.icon/icon.json +35 -0
- package/templates/react-native-sdk-reference/assets/icons/bell.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/clock.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/cross.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/donut.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/gear.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/globe.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/internet.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/music.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/right-arrow.png +0 -0
- package/templates/react-native-sdk-reference/assets/icons/speed.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/MediaCo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/adaptive-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-background.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-foreground.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/android-icon-monochrome.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge-white.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-badge.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/expo-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/favicon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/logo-glow.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/partial-react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@2x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/react-logo@3x.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/splash-icon.png +0 -0
- package/templates/react-native-sdk-reference/assets/images/tutorial-web.png +0 -0
- package/templates/react-native-sdk-reference/eslint.config.mjs +68 -0
- package/templates/react-native-sdk-reference/package.json +59 -14
- package/templates/react-native-sdk-reference/pega-constellationjs-0.26.3.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/pega-sdk-types-0.1.0.tgz +0 -0
- package/templates/react-native-sdk-reference/sdk-config.json +31 -9
- package/templates/react-native-sdk-reference/src/app/_layout.tsx +38 -0
- package/templates/react-native-sdk-reference/src/app/home/_layout.tsx +39 -0
- package/templates/react-native-sdk-reference/src/app/home/contact.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/index.tsx +36 -0
- package/templates/react-native-sdk-reference/src/app/home/shop.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/home/your-services.tsx +11 -0
- package/templates/react-native-sdk-reference/src/app/index.tsx +72 -0
- package/templates/react-native-sdk-reference/src/app/workarea.tsx +135 -0
- package/templates/react-native-sdk-reference/src/bridge/Context/StoreContext.ts +4 -0
- package/templates/react-native-sdk-reference/src/bridge/RootComponent.tsx +12 -0
- package/templates/react-native-sdk-reference/src/bridge/react_pconnect.jsx +334 -0
- package/templates/react-native-sdk-reference/src/components/common/DisplayField.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/common/FormFieldWrapper.tsx +5 -0
- package/templates/react-native-sdk-reference/src/components/common/HelperText.tsx +11 -0
- package/templates/react-native-sdk-reference/src/components/common/LabelText.tsx +22 -0
- package/templates/react-native-sdk-reference/src/components/common/inputTheme.ts +17 -0
- package/templates/react-native-sdk-reference/src/components/design-system/AutoComplete.tsx +126 -0
- package/templates/react-native-sdk-reference/src/components/design-system/FieldGroup.tsx +72 -0
- package/templates/react-native-sdk-reference/src/components/design-system/Radio.tsx +61 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +196 -0
- package/templates/react-native-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +89 -0
- package/templates/react-native-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/Currency.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-native-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +211 -0
- package/templates/react-native-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/Email.tsx +81 -0
- package/templates/react-native-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/Group.tsx +47 -0
- package/templates/react-native-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/Integer.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/Phone.tsx +85 -0
- package/templates/react-native-sdk-reference/src/components/field/Phone/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +118 -0
- package/templates/react-native-sdk-reference/src/components/field/RadioButtons/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/TextArea.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/TextInput.tsx +84 -0
- package/templates/react-native-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/URL.tsx +86 -0
- package/templates/react-native-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-native-sdk-reference/src/components/helpers/instructions-utils.ts +57 -0
- package/templates/react-native-sdk-reference/src/components/helpers/state-utils.tsx +46 -0
- package/templates/react-native-sdk-reference/src/components/helpers/template-utils.ts +75 -0
- package/templates/react-native-sdk-reference/src/components/helpers/utils.ts +339 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/ActionButtons.tsx +63 -0
- package/templates/react-native-sdk-reference/src/components/infra/ActionButtons/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/Assignment.tsx +348 -0
- package/templates/react-native-sdk-reference/src/components/infra/Assignment/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/AssignmentCard.tsx +56 -0
- package/templates/react-native-sdk-reference/src/components/infra/AssignmentCard/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/FlowContainer.tsx +57 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/helpers.ts +137 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/FlowContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/RootContainer.tsx +52 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/RootContainer/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/helper.ts +128 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/SimpleView/index.tsx +59 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/ViewContainer.tsx +31 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/helper.ts +39 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/ViewContainer/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Containers/helper.ts +9 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/ErrorBoundary.tsx +53 -0
- package/templates/react-native-sdk-reference/src/components/infra/ErrorBoundary/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/MultiStep.tsx +24 -0
- package/templates/react-native-sdk-reference/src/components/infra/MultiStep/index.ts +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/Reference.tsx +68 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/Reference/utils.ts +16 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/Region.tsx +10 -0
- package/templates/react-native-sdk-reference/src/components/infra/Region/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/infra/View/View.tsx +49 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +38 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/DefaultForm/utils/index.ts +28 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/Details.tsx +82 -0
- package/templates/react-native-sdk-reference/src/components/template/Details/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/OneColumn.tsx +29 -0
- package/templates/react-native-sdk-reference/src/components/template/OneColumn/index.tsx +1 -0
- package/templates/react-native-sdk-reference/src/context/LoaderContext.tsx +42 -0
- package/templates/react-native-sdk-reference/src/mediaco/AdvBanner.tsx +62 -0
- package/templates/react-native-sdk-reference/src/mediaco/Header.tsx +60 -0
- package/templates/react-native-sdk-reference/src/mediaco/HomeScreen.tsx +78 -0
- package/templates/react-native-sdk-reference/src/mediaco/QuickActions.tsx +68 -0
- package/templates/react-native-sdk-reference/src/mediaco/ResolutionScreen.tsx +48 -0
- package/templates/react-native-sdk-reference/src/mediaco/SafeArea.tsx +11 -0
- package/templates/react-native-sdk-reference/src/mediaco/TabBar.tsx +102 -0
- package/templates/react-native-sdk-reference/src/mediaco/YourServices.tsx +90 -0
- package/templates/react-native-sdk-reference/src/sdk-pega-component-map.ts +64 -0
- package/templates/react-native-sdk-reference/src/types/PConnProps.d.ts +41 -0
- package/templates/react-native-sdk-reference/src/utils/auth.ts +62 -0
- package/templates/react-native-sdk-reference/src/utils/init-pcore.ts +37 -0
- package/templates/react-native-sdk-reference/src/utils/pcore-polyfills.ts +66 -0
- package/templates/react-native-sdk-reference/tsconfig.json +9 -8
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +171 -0
- package/templates/react-sdk-reference/.ai-common/agents/implementation-expert.md +25 -26
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions-embedded.md +119 -0
- package/templates/react-sdk-reference/.ai-common/global/ai-agent-instructions.md +70 -121
- package/templates/react-sdk-reference/.ai-common/instructions/component-map.md +7 -19
- package/templates/react-sdk-reference/.ai-common/instructions/dse-component.md +10 -40
- package/templates/react-sdk-reference/.ai-common/instructions/embedded-component.md +134 -0
- package/templates/react-sdk-reference/.ai-common/instructions/field-component.md +15 -43
- package/templates/react-sdk-reference/.ai-common/instructions/template-component.md +11 -63
- package/templates/react-sdk-reference/.ai-common/instructions/widget-component.md +12 -57
- package/templates/react-sdk-reference/.ai-common/prompts/add-component.md +45 -71
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +98 -0
- package/templates/react-sdk-reference/.ai-common/prompts/embedded-component-manifest.md +155 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +67 -237
- package/templates/react-sdk-reference/.ai-common/prompts/generate-dse-components.md +26 -77
- package/templates/react-sdk-reference/.ai-common/prompts/generate-embedded-components.md +315 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-field-components.md +31 -80
- package/templates/react-sdk-reference/.ai-common/prompts/generate-template-components.md +43 -99
- package/templates/react-sdk-reference/.ai-common/prompts/generate-widget-components.md +33 -83
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/AlertBanner.md +60 -74
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Banner.md +64 -84
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/CaseSummaryFields.md +76 -109
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/DetailsFields.md +84 -101
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroup.md +62 -87
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldGroupList.md +56 -76
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/FieldValueList.md +61 -85
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Operator.md +84 -107
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/Pulse.md +36 -44
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/RichTextEditor.md +125 -189
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension-skills/WssQuickCreate.md +34 -50
- package/templates/react-sdk-reference/.ai-common/skills/design-system-extension.md +57 -179
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/analyze-customer-repo.md +130 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/authenticate.md +311 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/run-and-verify-integration.md +156 -0
- package/templates/react-sdk-reference/.ai-common/skills/embedded-flow/wire-integration.md +476 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +120 -242
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +71 -212
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/CancelAlert.md +47 -209
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Checkbox.md +90 -259
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Currency.md +75 -169
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Date.md +65 -160
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/DateTime.md +59 -157
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Decimal.md +55 -134
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Dropdown.md +61 -185
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Email.md +60 -138
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Group.md +40 -99
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Integer.md +44 -111
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Location.md +57 -165
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Multiselect.md +41 -122
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +32 -130
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Percentage.md +48 -112
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Phone.md +43 -153
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RadioButtons.md +76 -183
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/RichText.md +59 -176
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ScalarList.md +30 -123
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SelectableCard.md +47 -178
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/SemanticLink.md +31 -117
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextArea.md +51 -106
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextContent.md +22 -75
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/TextInput.md +54 -116
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/Time.md +46 -100
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/URL.md +44 -93
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +40 -167
- package/templates/react-sdk-reference/.ai-common/skills/infra-components.md +165 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/ActionButtons.md +122 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/MultiStep.md +178 -0
- package/templates/react-sdk-reference/.ai-common/skills/infra-skills/Stages.md +140 -0
- package/templates/react-sdk-reference/.ai-common/skills/template-components.md +74 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AdvancedSearch.md +66 -167
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/AppShell.md +57 -170
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/BannerPage.md +41 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseSummary.md +53 -109
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseView.md +86 -289
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/CaseViewActionsMenu.md +60 -185
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Confirmation.md +66 -115
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DataReference.md +33 -68
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultForm.md +53 -133
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DefaultPage.md +39 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/Details.md +38 -91
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsSubTabs.md +47 -101
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsThreeColumn.md +27 -34
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DetailsTwoColumn.md +25 -40
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/DynamicTabs.md +34 -104
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/FieldGroupTemplate.md +46 -147
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/HierarchicalForm.md +139 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboard.md +43 -82
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/InlineDashboardPage.md +47 -80
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListPage.md +16 -29
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +43 -228
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/MultiReferenceReadOnly.md +20 -65
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/NarrowWide.md +49 -97
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/OneColumn.md +37 -71
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/PromotedFilters.md +58 -148
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SelfServiceCaseView.md +82 -107
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +21 -60
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SingleReferenceReadOnly.md +43 -100
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/SubTabs.md +36 -76
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/TwoColumn.md +41 -90
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WideNarrow.md +36 -43
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/WssNavBar.md +25 -115
- package/templates/react-sdk-reference/.ai-common/skills/widget-components.md +38 -174
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/AppAnnouncement.md +30 -57
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Attachment.md +55 -101
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/CaseHistory.md +38 -121
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/FileUtility.md +37 -98
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/Followers.md +18 -33
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/QuickCreate.md +26 -91
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/SummaryItem.md +28 -120
- package/templates/react-sdk-reference/.ai-common/skills/widget-skills/ToDo.md +41 -272
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-auth-0.2.44.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +13 -3
- package/templates/react-native-sdk-reference/.github/AGENTS.md +0 -23
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +0 -40
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +0 -48
- package/templates/react-native-sdk-reference/App.tsx +0 -49
- package/templates/react-native-sdk-reference/expo-env.d.ts +0 -3
- package/templates/react-sdk-reference/pega-auth-0.2.42.tgz +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Checkbox field supporting single boolean toggle, multi-selection mode, and optional card-style variant.
|
|
4
4
|
|
|
5
|
-
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture,
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, input contract, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -14,17 +14,15 @@ Renders one or more checkboxes. Supports three usage modes: (1) a single boolean
|
|
|
14
14
|
|
|
15
15
|
- **Pega Name:** `Checkbox`
|
|
16
16
|
- **Type / Subtype:** `Field` / `Boolean`
|
|
17
|
-
- **Registration key:** `Checkbox` (
|
|
17
|
+
- **Registration key:** `Checkbox` (in the project's component map)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
> **Important naming note:** The component's export name should avoid conflicts with the design system's checkbox widget (e.g., use `CheckboxComponent` as the export name). Register it under the key `Checkbox` in the project's component map.
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
>
|
|
23
|
-
> ```typescript
|
|
24
|
-
> import type { PConnFieldProps } from '@pega/sdk-react';
|
|
25
|
-
> ```
|
|
21
|
+
## Inputs (component-specific)
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
> Note: The Checkbox input contract overrides `value` to be a boolean (not a string), while inheriting all other fields from the project's field input contract.
|
|
24
|
+
|
|
25
|
+
| Name | Type | Description |
|
|
28
26
|
| ---------------------- | -------------------- | -------------------------------------------------------------------- |
|
|
29
27
|
| `value` | `boolean` (optional) | Checked state for single-mode checkbox |
|
|
30
28
|
| `caption` | `string` (optional) | Label shown next to the single checkbox (not the group label) |
|
|
@@ -39,130 +37,36 @@ Renders one or more checkboxes. Supports three usage modes: (1) a single boolean
|
|
|
39
37
|
| `referenceList` | `string` | Reference list property path |
|
|
40
38
|
| `variant` | `string` (optional) | `'card'` — renders options as selectable card grid |
|
|
41
39
|
| `hideFieldLabels` | `boolean` | Hide field labels inside card variant |
|
|
42
|
-
| `additionalProps` | `any` | Extra
|
|
40
|
+
| `additionalProps` | `any` | Extra inputs passed to card or checkbox |
|
|
43
41
|
| `imagePosition` | `string` | Card image position |
|
|
44
42
|
| `imageSize` | `string` | Card image size |
|
|
45
43
|
| `showImageDescription` | `string` | Whether to show image description |
|
|
46
|
-
| `renderMode` | `string` | `'ReadOnly'` — sets read-only mode alongside `readOnly`
|
|
44
|
+
| `renderMode` | `string` | `'ReadOnly'` — sets read-only mode alongside `readOnly` input |
|
|
47
45
|
| `image` | `string` | Image field path for card variant |
|
|
48
46
|
|
|
49
|
-
##
|
|
50
|
-
|
|
51
|
-
Follow this exact structure. The export name
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
datasource?: any;
|
|
73
|
-
selectionKey?: string;
|
|
74
|
-
selectionList?: any;
|
|
75
|
-
primaryField: string;
|
|
76
|
-
readonlyContextList: any;
|
|
77
|
-
referenceList: string;
|
|
78
|
-
variant?: string;
|
|
79
|
-
hideFieldLabels: boolean;
|
|
80
|
-
additionalProps: any;
|
|
81
|
-
imagePosition: string;
|
|
82
|
-
imageSize: string;
|
|
83
|
-
showImageDescription: string;
|
|
84
|
-
renderMode: string;
|
|
85
|
-
image: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// ── Styles (design-system agnostic) ──────────────────────────
|
|
89
|
-
// .checkbox-column → display: flex, flexDirection: column
|
|
90
|
-
// .selectable-card-grid → display: grid, gridTemplateColumns: repeat(auto-fit, minmax(min(100%, 40ch), 1fr)),
|
|
91
|
-
// gridAutoRows: 1fr, gap: 0.5rem
|
|
92
|
-
|
|
93
|
-
// ── Component ────────────────────────────────────────────────
|
|
94
|
-
export default function CheckboxComponent(props: CheckboxProps) {
|
|
95
|
-
// 1. Registry lookups
|
|
96
|
-
const FieldValueList = getComponentFromRegistry('FieldValueList');
|
|
97
|
-
const SelectableCard = getComponentFromRegistry('SelectableCard');
|
|
98
|
-
|
|
99
|
-
// 2. Destructure props — note alias: readonlyContextList → selectedvalues
|
|
100
|
-
const {
|
|
101
|
-
getPConnect, label, caption, value, readOnly, testId,
|
|
102
|
-
required, disabled, status, helperText, validatemessage,
|
|
103
|
-
displayMode, hideLabel, trueLabel, falseLabel,
|
|
104
|
-
selectionMode, datasource, selectionKey, selectionList,
|
|
105
|
-
primaryField, referenceList,
|
|
106
|
-
readonlyContextList: selectedvalues,
|
|
107
|
-
variant, hideFieldLabels, additionalProps,
|
|
108
|
-
imagePosition, imageSize, showImageDescription, renderMode, image,
|
|
109
|
-
} = props;
|
|
110
|
-
|
|
111
|
-
// 3. Derived flags
|
|
112
|
-
const readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly;
|
|
113
|
-
const helperTextToDisplay = validatemessage || helperText;
|
|
114
|
-
|
|
115
|
-
// 4. PConnect setup
|
|
116
|
-
const thePConn = getPConnect();
|
|
117
|
-
const actionsApi = thePConn.getActionsApi();
|
|
118
|
-
const propName = (thePConn.getStateProps() as any).value;
|
|
119
|
-
|
|
120
|
-
// 5. State
|
|
121
|
-
const [checked, setChecked] = useState<any>(false);
|
|
122
|
-
|
|
123
|
-
// 6. useEffect: sync checked state from value prop — deps: [value]
|
|
124
|
-
useEffect(() => { setChecked(value); }, [value]);
|
|
125
|
-
|
|
126
|
-
// 7. useEffect: init reference list on mount — deps: [thePConn]
|
|
127
|
-
// Guard: referenceList?.length > 0 && !readOnlyMode
|
|
128
|
-
// Calls: thePConn.setReferenceList(selectionList)
|
|
129
|
-
// updateNewInstuctions(thePConn, selectionList)
|
|
130
|
-
|
|
131
|
-
// 8. Display mode returns (uses caption, not label!)
|
|
132
|
-
if (displayMode === 'DISPLAY_ONLY') {
|
|
133
|
-
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />;
|
|
134
|
-
}
|
|
135
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
136
|
-
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} variant="stacked" />;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// 9. Event handlers — see Behavioral Contract for each variant
|
|
140
|
-
|
|
141
|
-
// 10. Branch: card variant (variant === 'card')
|
|
142
|
-
// → see Behavioral Contract "Card" section
|
|
143
|
-
// Return early with heading + grid + SelectableCard
|
|
144
|
-
|
|
145
|
-
// 11. Branch: multi-select (selectionMode === 'multi')
|
|
146
|
-
// → see Behavioral Contract "Multi-select" section
|
|
147
|
-
// Build list of checkbox controls from datasource.source
|
|
148
|
-
|
|
149
|
-
// 12. Branch: single checkbox (default)
|
|
150
|
-
// → see Behavioral Contract "Single checkbox" section
|
|
151
|
-
// Single FormControlLabel with checked={checked}
|
|
152
|
-
|
|
153
|
-
// 13. Main return: wrapper with group label + checkbox(es) + helper text
|
|
154
|
-
// Error state: status === 'error'
|
|
155
|
-
// Group label: {label}, hidden if hideLabel
|
|
156
|
-
// Helper text: helperTextToDisplay
|
|
157
|
-
return (
|
|
158
|
-
<FormWrapper required={required} error={status === 'error'}>
|
|
159
|
-
{!hideLabel && <GroupLabel>{label}</GroupLabel>}
|
|
160
|
-
<CheckboxGroup>{/* theCheckbox from step 11 or 12 */}</CheckboxGroup>
|
|
161
|
-
<HelperText>{helperTextToDisplay}</HelperText>
|
|
162
|
-
</FormWrapper>
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
```
|
|
47
|
+
## Implementation Structure
|
|
48
|
+
|
|
49
|
+
Follow this exact structure. The export name should avoid collision with the design system's checkbox widget.
|
|
50
|
+
|
|
51
|
+
**Module Setup:** The component depends on the project's component registry (to resolve `FieldValueList` and `SelectableCard`), the project's event-commit utility, and the project's instruction helpers (`insertInstruction`, `deleteInstruction`, `updateNewInstuctions`) for multi-selection reference list management. Define the input contract by overriding `value` to be an optional boolean (rather than the string from the base field input contract) and adding all the component-specific fields listed in the inputs table above.
|
|
52
|
+
|
|
53
|
+
**Styling notes (design-system agnostic):** a vertical checkbox column layout (flex, column direction), and for the card variant a CSS grid layout (`repeat(auto-fit, minmax(min(100%, 40ch), 1fr))`, equal row heights, small gap).
|
|
54
|
+
|
|
55
|
+
**Main Component Logic** — steps in order:
|
|
56
|
+
|
|
57
|
+
1. **Registry lookups** — resolve `FieldValueList` and `SelectableCard` via the project's component registry.
|
|
58
|
+
2. **Receive inputs** — all the standard field inputs plus the component-specific ones; notably alias `readonlyContextList` to `selectedvalues` for readability.
|
|
59
|
+
3. **Derived flags** — `readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly` and `helperTextToDisplay = validatemessage || helperText`.
|
|
60
|
+
4. **PConnect setup** — obtain the PConnect instance, its actions API, and the bound property name.
|
|
61
|
+
5. **Local state** — `checked` initialized to `false`.
|
|
62
|
+
6. **Sync from store** — a lifecycle effect watching `value` updates `checked` whenever it changes.
|
|
63
|
+
7. **Reference list init** — a lifecycle effect watching the PConnect instance: when `referenceList?.length > 0 && !readOnlyMode`, call `thePConn.setReferenceList(selectionList)` followed by `updateNewInstuctions(thePConn, selectionList)`.
|
|
64
|
+
8. **Display mode returns** — note these use `caption` (not `label`) as the display name: `DISPLAY_ONLY` and `STACKED_LARGE_VAL` both return `FieldValueList` with value set to `trueLabel` when `value` is true, `falseLabel` otherwise, the latter with a stacked variant.
|
|
65
|
+
9. **Event handlers** — see the Behavioral Contract below for the exact logic of each variant's change/blur handlers.
|
|
66
|
+
10. **Branch: card variant** (`variant === 'card'`) — return early with a heading, a CSS grid wrapper, and a `SelectableCard`; see the Behavioral Contract "Card" section for full input wiring.
|
|
67
|
+
11. **Branch: multi-select** (`selectionMode === 'multi'`) — build a list of checkbox controls from `datasource.source`; see the Behavioral Contract "Multi-select" section.
|
|
68
|
+
12. **Branch: single checkbox** (default) — a single checkbox control with `checked` state; see the Behavioral Contract "Single checkbox" section.
|
|
69
|
+
13. **Main return** — a wrapper containing (in order): the group label (`label`, hidden when `hideLabel`), the checkbox group content built in step 11 or 12, and the helper text (`helperTextToDisplay`); the wrapper carries `required` and an error state driven by `status === 'error'`.
|
|
166
70
|
|
|
167
71
|
## Behavioral Contract
|
|
168
72
|
|
|
@@ -170,189 +74,116 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
170
74
|
|
|
171
75
|
1. **Read-only determination:** `readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly`.
|
|
172
76
|
2. **Helper text:** `helperTextToDisplay = validatemessage || helperText`.
|
|
173
|
-
3. **Local state:** Maintain `checked` (boolean) initialized to `false`.
|
|
174
|
-
4. **Reference list init:**
|
|
175
|
-
5. **`handleCheckboxChange(event, item)`** — shared by card and
|
|
176
|
-
```
|
|
177
|
-
if (event.target.checked) {
|
|
178
|
-
insertInstruction(thePConn, selectionList, selectionKey, primaryField, item);
|
|
179
|
-
} else {
|
|
180
|
-
deleteInstruction(thePConn, selectionList, selectionKey, item);
|
|
181
|
-
}
|
|
182
|
-
thePConn.clearErrorMessages({ property: selectionList });
|
|
183
|
-
```
|
|
77
|
+
3. **Local state:** Maintain `checked` (boolean) initialized to `false`. A lifecycle effect watching `value` updates `checked`.
|
|
78
|
+
4. **Reference list init:** A lifecycle effect watching the PConnect instance — if `referenceList?.length > 0 && !readOnlyMode`, call `thePConn.setReferenceList(selectionList)` and `updateNewInstuctions(thePConn, selectionList)`.
|
|
79
|
+
5. **`handleCheckboxChange(event, item)`** — shared by card and internal usage: when the checkbox is checked, call `insertInstruction(thePConn, selectionList, selectionKey, primaryField, item)`; otherwise call `deleteInstruction(thePConn, selectionList, selectionKey, item)`. Either way, finish by calling `thePConn.clearErrorMessages({ property: selectionList })`.
|
|
184
80
|
|
|
185
81
|
### Variant: Single checkbox (default)
|
|
186
82
|
|
|
187
83
|
Render a single checkbox with:
|
|
188
84
|
|
|
189
|
-
- `checked
|
|
190
|
-
-
|
|
191
|
-
-
|
|
85
|
+
- Checked state bound to `checked`
|
|
86
|
+
- Change handler wired only when not read-only
|
|
87
|
+
- Blur handler wired only when not read-only
|
|
192
88
|
- Label = `caption` (next to checkbox)
|
|
193
89
|
- Group label = `label` (above, hidden if `hideLabel`)
|
|
194
|
-
- **On change:**
|
|
195
|
-
- **On blur:** `pConn.getValidationApi().validate(event.target.checked)`.
|
|
90
|
+
- **On change:** Commit via the project's event-commit utility with event type `'changeNblur'`, the property name, and the checked boolean.
|
|
91
|
+
- **On blur:** Validate via `pConn.getValidationApi().validate(event.target.checked)`.
|
|
196
92
|
|
|
197
93
|
### Variant: Multi-select (`selectionMode === 'multi'`)
|
|
198
94
|
|
|
199
95
|
Render a list of checkboxes from `datasource.source`:
|
|
200
96
|
|
|
201
|
-
- Extract
|
|
202
|
-
- For each
|
|
203
|
-
-
|
|
97
|
+
- Extract the data field key: the second segment of `selectionKey` split by `.`.
|
|
98
|
+
- For each element in `datasource.source`:
|
|
99
|
+
- Checked: `selectedvalues?.some?.(data => data[dataField] === element.key)`
|
|
204
100
|
- Label: `element.text ?? element.value`
|
|
205
|
-
- **On change:** `
|
|
206
|
-
```
|
|
207
|
-
if (event.target.checked) {
|
|
208
|
-
insertInstruction(thePConn, selectionList, selectionKey, primaryField, {
|
|
209
|
-
id: element.key,
|
|
210
|
-
primary: element.text ?? element.value,
|
|
211
|
-
});
|
|
212
|
-
} else {
|
|
213
|
-
deleteInstruction(thePConn, selectionList, selectionKey, {
|
|
214
|
-
id: element.key,
|
|
215
|
-
primary: element.text ?? element.value,
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
thePConn.clearErrorMessages({ property: selectionList, category: '', context: '' });
|
|
219
|
-
```
|
|
101
|
+
- **On change:** When the checkbox is checked, call `insertInstruction(thePConn, selectionList, selectionKey, primaryField, { id: element.key, primary: element.text ?? element.value })`; otherwise call `deleteInstruction(thePConn, selectionList, selectionKey, { id: element.key, primary: element.text ?? element.value })`. Either way, finish by calling `thePConn.clearErrorMessages({ property: selectionList, category: '', context: '' })`.
|
|
220
102
|
- **On blur:** `thePConn.getValidationApi().validate(selectedvalues, selectionList)`
|
|
221
|
-
-
|
|
222
|
-
- Layout: vertical column (
|
|
103
|
+
- Test id: `${testId}:${element.value}`
|
|
104
|
+
- Layout: vertical column (flex, column direction).
|
|
223
105
|
|
|
224
106
|
### Variant: Card (`variant === 'card'`)
|
|
225
107
|
|
|
226
108
|
Return early (before multi/single logic) with heading + CSS Grid + `SelectableCard`:
|
|
227
109
|
|
|
228
|
-
- Build `
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
...additionalProps,
|
|
233
|
-
className: 'standard',
|
|
234
|
-
disabled,
|
|
235
|
-
readOnly,
|
|
236
|
-
onClick: (actions as any).onClick,
|
|
237
|
-
};
|
|
238
|
-
```
|
|
239
|
-
- Grid: `repeat(auto-fit, minmax(min(100%, 40ch), 1fr))`, `gridAutoRows: '1fr'`, `gap: '0.5rem'`.
|
|
240
|
-
- `SelectableCard` props:
|
|
241
|
-
- `{...commonProps}`, `testId`, `displayMode`, `getPConnect`
|
|
110
|
+
- Build common configuration by spreading `additionalProps` and adding `className: 'standard'`, `disabled`, `readOnly`, and `onClick` taken from the PConnect actions API.
|
|
111
|
+
- Grid: `repeat(auto-fit, minmax(min(100%, 40ch), 1fr))`, equal row heights, gap `0.5rem`.
|
|
112
|
+
- `SelectableCard` inputs:
|
|
113
|
+
- Common configuration spread, `testId`, `displayMode`, `getPConnect`
|
|
242
114
|
- `type='checkbox'`
|
|
243
|
-
- `dataSource
|
|
244
|
-
- `readOnly
|
|
245
|
-
- `recordKey
|
|
246
|
-
- `cardLabel
|
|
247
|
-
- `readOnlyList
|
|
248
|
-
- `hideFieldLabels
|
|
249
|
-
- `showNoValue
|
|
250
|
-
- `image` config object
|
|
251
|
-
|
|
252
|
-
image={{
|
|
253
|
-
imagePosition,
|
|
254
|
-
imageSize,
|
|
255
|
-
showImageDescription,
|
|
256
|
-
imageField: image?.split('.').pop(),
|
|
257
|
-
imageDescription: (thePConn?.getRawMetadata()?.config as any)
|
|
258
|
-
.imageDescription?.split('.').pop(),
|
|
259
|
-
}}
|
|
260
|
-
```
|
|
261
|
-
- `onChange`: stop propagation, find item from `datasource.source` by matching `item[recordKey] === e.target.id`, call `handleCheckboxChange`:
|
|
262
|
-
```
|
|
263
|
-
onChange={(e) => {
|
|
264
|
-
e.stopPropagation();
|
|
265
|
-
const recordKey = selectionKey?.split('.').pop();
|
|
266
|
-
const selectedItem = datasource?.source?.find(
|
|
267
|
-
item => item[recordKey] === e.target.id
|
|
268
|
-
) ?? {};
|
|
269
|
-
handleCheckboxChange(e, {
|
|
270
|
-
id: selectedItem[recordKey],
|
|
271
|
-
primary: selectedItem[recordKey],
|
|
272
|
-
});
|
|
273
|
-
}}
|
|
274
|
-
```
|
|
115
|
+
- `dataSource` set to `datasource`
|
|
116
|
+
- `readOnly` set to `renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly`
|
|
117
|
+
- `recordKey` set to the last segment of `selectionKey`
|
|
118
|
+
- `cardLabel` set to the last segment of `primaryField`
|
|
119
|
+
- `readOnlyList` set to `selectedvalues`
|
|
120
|
+
- `hideFieldLabels`
|
|
121
|
+
- `showNoValue` set to true when read-only mode is active and `selectedvalues.length === 0`
|
|
122
|
+
- `image` config object bundling `imagePosition`, `imageSize`, `showImageDescription`, an `imageField` derived by taking the last segment of the `image` input path, and an `imageDescription` derived by taking the last segment of the `imageDescription` path found on `thePConn.getRawMetadata().config`.
|
|
123
|
+
- `onChange`: stop event propagation, resolve the record key by taking the last segment of `selectionKey`, find the matching item in `datasource.source` whose field at that key equals the event target's `id` (defaulting to an empty object if not found), then call `handleCheckboxChange` with an item shaped as `{ id: selectedItem[recordKey], primary: selectedItem[recordKey] }`.
|
|
275
124
|
- `onBlur`: `() => thePConn.getValidationApi().validate(selectedvalues, selectionList)`
|
|
276
125
|
|
|
277
126
|
## Display Mode Rendering
|
|
278
127
|
|
|
279
|
-
Display mode uses `caption` (not `label`) and shows true/false label:
|
|
128
|
+
Display mode uses `caption` (not `label`) and shows the true/false label:
|
|
280
129
|
|
|
281
|
-
- **`DISPLAY_ONLY`:**
|
|
282
|
-
- **`STACKED_LARGE_VAL`:**
|
|
130
|
+
- **`DISPLAY_ONLY`:** Render `FieldValueList` with `name` set to `caption` (or empty when `hideLabel` is true) and `value` set to `trueLabel` when `value` is true, `falseLabel` otherwise.
|
|
131
|
+
- **`STACKED_LARGE_VAL`:** Render `FieldValueList` the same way, with a stacked variant.
|
|
283
132
|
|
|
284
133
|
## Read-Only Rendering
|
|
285
134
|
|
|
286
|
-
Single mode: Set
|
|
287
|
-
Multi/Card mode: `readOnlyMode` flag prevents `insertInstruction`/`deleteInstruction`; cards show `readOnlyList`.
|
|
135
|
+
Single mode: Set the read-only attribute on the checkbox element; disable the change/blur handlers.
|
|
136
|
+
Multi/Card mode: The `readOnlyMode` flag prevents `insertInstruction`/`deleteInstruction`; cards show `readOnlyList`.
|
|
288
137
|
|
|
289
138
|
## Visual Specifications
|
|
290
139
|
|
|
291
140
|
### Standard / Multi-select
|
|
292
141
|
|
|
293
|
-
| Property | Value
|
|
294
|
-
| ----------------- |
|
|
295
|
-
| Checkbox size | Default (24px)
|
|
296
|
-
| Label placement | End (right of checkbox)
|
|
297
|
-
| Group label |
|
|
298
|
-
| Layout | Single: single row. Multi: vertical column
|
|
299
|
-
| Helper text | Below group
|
|
300
|
-
| Error state | Red text/border on helper
|
|
301
|
-
| Disabled/readOnly | Greyed out, pointer-events none
|
|
302
|
-
|
|
303
|
-
**
|
|
304
|
-
|
|
305
|
-
```css
|
|
306
|
-
.checkbox-group {
|
|
307
|
-
display: flex;
|
|
308
|
-
flex-direction: column;
|
|
309
|
-
gap: 4px;
|
|
310
|
-
}
|
|
311
|
-
.checkbox-label {
|
|
312
|
-
display: flex;
|
|
313
|
-
align-items: center;
|
|
314
|
-
gap: 8px;
|
|
315
|
-
cursor: pointer;
|
|
316
|
-
}
|
|
317
|
-
input[type='checkbox']:disabled {
|
|
318
|
-
opacity: 0.38;
|
|
319
|
-
}
|
|
320
|
-
```
|
|
142
|
+
| Property | Value |
|
|
143
|
+
| ----------------- | ----------------------------------------------- |
|
|
144
|
+
| Checkbox size | Default (24px) |
|
|
145
|
+
| Label placement | End (right of checkbox) |
|
|
146
|
+
| Group label | Legend/label above group, hidden if `hideLabel` |
|
|
147
|
+
| Layout | Single: single row. Multi: vertical column |
|
|
148
|
+
| Helper text | Below group |
|
|
149
|
+
| Error state | Red text/border on helper |
|
|
150
|
+
| Disabled/readOnly | Greyed out, pointer-events none |
|
|
151
|
+
|
|
152
|
+
**Visual-only styling notes:** The checkbox group uses a vertical flex column with a small gap between items; each checkbox label row is a flex container with center-aligned items, a small gap between the input and text, and a pointer cursor. Disabled checkbox inputs are shown at reduced opacity.
|
|
321
153
|
|
|
322
154
|
### Card Variant
|
|
323
155
|
|
|
324
156
|
| Property | Value |
|
|
325
157
|
| -------- | ------------------------------------------------------------------------------------------------- |
|
|
326
158
|
| Layout | CSS Grid `repeat(auto-fit, minmax(min(100%, 40ch), 1fr))`, row height equal (`1fr`), gap `0.5rem` |
|
|
327
|
-
| Heading |
|
|
159
|
+
| Heading | Heading element with no top/bottom margin |
|
|
328
160
|
|
|
329
161
|
## Edge Cases & Special Logic
|
|
330
162
|
|
|
331
|
-
- **Export name
|
|
163
|
+
- **Export name should avoid collision** with the design system's checkbox widget.
|
|
332
164
|
- **Display mode uses `caption`** (not `label`) for the field name. This is unique to Checkbox.
|
|
333
|
-
- **`readonlyContextList`** is
|
|
334
|
-
- **`handleCheckboxChange`** (card mode):
|
|
165
|
+
- **`readonlyContextList`** is aliased to `selectedvalues` — use `selectedvalues` everywhere in the component body.
|
|
166
|
+
- **`handleCheckboxChange`** (card mode): Stops event propagation before processing. Finds the selected item from `datasource.source` by matching `item[recordKey] === e.target.id`.
|
|
335
167
|
- `updateNewInstuctions` is called on mount to sync reference list state.
|
|
336
168
|
- `clearErrorMessages` is called after every multi-select change.
|
|
337
169
|
- Card variant returns early (before multi/single branch logic).
|
|
338
|
-
- Multi-select
|
|
170
|
+
- Multi-select blur handler validates with both `selectedvalues` and `selectionList` as arguments.
|
|
339
171
|
|
|
340
172
|
## Dependencies
|
|
341
173
|
|
|
342
|
-
- `insertInstruction`, `deleteInstruction`, `updateNewInstuctions`
|
|
343
|
-
-
|
|
344
|
-
- `
|
|
345
|
-
- `
|
|
174
|
+
- The project's instruction helpers (`insertInstruction`, `deleteInstruction`, `updateNewInstuctions`) — for multi-selection reference list management.
|
|
175
|
+
- The project's event-commit utility.
|
|
176
|
+
- The project's component registry, resolving `FieldValueList` — for display modes.
|
|
177
|
+
- The project's component registry, resolving `SelectableCard` — for card variant.
|
|
346
178
|
|
|
347
179
|
## Design System Mapping
|
|
348
180
|
|
|
349
181
|
**UI control type:** Single or multi-select checkbox (boolean or list).
|
|
350
182
|
|
|
351
|
-
|
|
183
|
+
When implementing in a specific design system, map the following:
|
|
352
184
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
| Chakra UI | `<Checkbox>` / `<CheckboxGroup>` |
|
|
185
|
+
- **Single checkbox** → use the DS's checkbox component with a label to the right
|
|
186
|
+
- **Multi-select** → render a list of checkboxes in a vertical flex column
|
|
187
|
+
- **Card variant** → delegate to the `SelectableCard` component in a CSS grid
|
|
188
|
+
- **Group wrapper** → use the DS's form control/form group with legend/label, error state, and helper text
|
|
189
|
+
- **Read-only** → disable the checkbox inputs; for cards, show the read-only list
|