@pega/custom-dx-components 26.1.11 → 26.1.12-alpha.0.2
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 +6 -2
- package/package.json +48 -64
- package/src/ai/README.md +44 -0
- package/src/ai/catalog/README.md +133 -0
- package/src/ai/catalog/best-practices/README.md +24 -0
- package/src/ai/catalog/best-practices/accessibility-for-async-components.md +53 -0
- package/src/ai/catalog/best-practices/error-handling-and-resiliency.md +116 -0
- package/src/ai/catalog/best-practices/genai-assistant-integration-patterns.md +49 -0
- package/src/ai/catalog/best-practices/performance-and-efficiency.md +109 -0
- package/src/ai/catalog/best-practices/security-considerations.md +93 -0
- package/src/ai/catalog/best-practices/testing-pconnect-components.md +245 -0
- package/src/ai/catalog/best-practices/troubleshooting-common-pitfalls.md +132 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/README.md +39 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/approval-workflow-decision.md +47 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/attachment-upload.md +45 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/bulk-action-submit.md +50 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/confirm-before-destructive-action.md +43 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/create-and-stage-new-case.md +45 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/graceful-submit-failure.md +39 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/modal-assignment-submit.md +58 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/multi-step-wizard.md +44 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/resolve-or-ignore-duplicate.md +47 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/safe-case-deletion.md +36 -0
- package/src/ai/catalog/pconnect-case-collaboration/SKILL.md +42 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/README.md +36 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/look-up-user-details.md +43 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-attachments.md +51 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-participants.md +52 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/participant-and-follower.md +40 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/post-and-manage-feed.md +50 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/relate-cases.md +35 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/tag-case-and-find-related.md +44 -0
- package/src/ai/catalog/pconnect-data-subscriptions/SKILL.md +42 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/data-page-subscription-cleanup.md +41 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/publish-and-subscribe-events.md +40 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/pubsub-cleanup.md +38 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/query-paginated-list-data.md +44 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/realtime-case-subscription.md +46 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/refresh-and-update-data.md +41 -0
- package/src/ai/catalog/pconnect-forms-and-fields/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/README.md +36 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/autosave-tracking.md +45 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/cascading-dependent-fields.md +51 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/collect-form-changes-for-manual-save.md +45 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/custom-field-validators.md +44 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/discard-changes-and-reset-form.md +41 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/full-form-validation.md +38 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/persist-widget-ui-state.md +41 -0
- package/src/ai/catalog/pconnect-lists-and-views/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/activate-and-switch-container-items.md +52 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/container-item-lifecycle.md +61 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/insert-delete-list-rows.md +40 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/reorder-list-rows.md +39 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/repeating-row-edit.md +39 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/view-personalization.md +60 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/SKILL.md +45 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/agent-conversation-for-tasks.md +54 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/bookmarkable-filter-state.md +40 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/deep-link-semantic-url.md +39 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/genai-assistant-conversation.md +43 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/locale-switch-and-relocalize.md +38 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/persist-operator-preferences.md +40 -0
- package/src/ai/catalog/references/architecture-overview.md +52 -0
- package/src/ai/catalog/references/pconnect-actions-api.md +948 -0
- package/src/ai/catalog/references/pconnect-case-info-data-info-localization.md +618 -0
- package/src/ai/catalog/references/pconnect-case-validation-utilities.md +238 -0
- package/src/ai/catalog/references/pconnect-container-manager.md +215 -0
- package/src/ai/catalog/references/pconnect-list-actions.md +250 -0
- package/src/ai/catalog/references/pconnect-misc-suggestions-creation.md +231 -0
- package/src/ai/catalog/references/pconnect-reference-context-component.md +471 -0
- package/src/ai/catalog/references/pconnect-state-config.md +316 -0
- package/src/ai/catalog/references/pconnect-validation-api.md +45 -0
- package/src/ai/catalog/references/pcore-analytics-genai-details.md +50 -0
- package/src/ai/catalog/references/pcore-bootstrap-init-details.md +121 -0
- package/src/ai/catalog/references/pcore-bootstrap-registry-routing.md +253 -0
- package/src/ai/catalog/references/pcore-case-collaboration-details.md +191 -0
- package/src/ai/catalog/references/pcore-case-collaboration-genai.md +264 -0
- package/src/ai/catalog/references/pcore-environment-info-details.md +96 -0
- package/src/ai/catalog/references/pcore-environment-locale-namespace.md +175 -0
- package/src/ai/catalog/references/pcore-messaging-details.md +99 -0
- package/src/ai/catalog/references/pcore-misc-details.md +207 -0
- package/src/ai/catalog/references/pcore-misc-utilities.md +325 -0
- package/src/ai/catalog/references/pcore-rest-data-details.md +164 -0
- package/src/ai/catalog/references/pcore-rest-data-messaging.md +308 -0
- package/src/ai/catalog/references/pcore-store-context-details.md +40 -0
- package/src/ai/catalog/references/pcore-store-context-state.md +130 -0
- package/src/ai/index.js +154 -0
- package/src/ai/project/.claude/skills/boolean/SKILL.md +43 -0
- package/src/ai/project/.claude/skills/case/SKILL.md +58 -0
- package/src/ai/project/.claude/skills/create-dx-component/SKILL.md +98 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/PConnProps.d.ts +24 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/create-nonce.ts +5 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/event-utils.ts +18 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/styles.ts +7 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/README.md +28 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/build-a-data-widget.md +281 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/field-with-limits-and-validation.md +156 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/status-badge-field.md +97 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/accessibility.md +71 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/choosing-type-and-subtype.md +79 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/cli-workflow.md +125 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/component-patterns.md +241 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/config-schema.md +296 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/cosmos-components.md +137 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-behavior.md +155 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-essentials.md +90 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-subtypes-extra.md +68 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/localization.md +30 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/pcore-pconnect-apis.md +77 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/presentation-essentials.md +57 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/props-contract.md +182 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/state-matrix.md +102 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/storybook-pattern.md +262 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/styles-pattern.md +54 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/template-essentials.md +87 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/template-patterns.md +131 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/test-pattern.md +215 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/ui-gallery-reuse.md +93 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/widget-essentials.md +84 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/widget-patterns.md +164 -0
- package/src/ai/project/.claude/skills/currency/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/date/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/decimal/SKILL.md +49 -0
- package/src/ai/project/.claude/skills/details/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/email/SKILL.md +42 -0
- package/src/ai/project/.claude/skills/field/SKILL.md +68 -0
- package/src/ai/project/.claude/skills/form/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/generate-component-set/SKILL.md +80 -0
- package/src/ai/project/.claude/skills/generate-component-set/component-manifest.json +161 -0
- package/src/ai/project/.claude/skills/identify-components/SKILL.md +76 -0
- package/src/ai/project/.claude/skills/integer/SKILL.md +45 -0
- package/src/ai/project/.claude/skills/page/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/page-widget/SKILL.md +55 -0
- package/src/ai/project/.claude/skills/percentage/SKILL.md +52 -0
- package/src/ai/project/.claude/skills/phone/SKILL.md +44 -0
- package/src/ai/project/.claude/skills/picklist/SKILL.md +50 -0
- package/src/ai/project/.claude/skills/plan-dx-component/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/design-system-mapping.md +108 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/intake.md +146 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/plan-template.md +76 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/requirements-template.md +88 -0
- package/src/ai/project/.claude/skills/presentation/SKILL.md +61 -0
- package/src/ai/project/.claude/skills/publish-library/SKILL.md +106 -0
- package/src/ai/project/.claude/skills/radiobuttons/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/review-component/SKILL.md +49 -0
- package/src/ai/project/.claude/skills/review-component/references/checklist.md +77 -0
- package/src/ai/project/.claude/skills/template/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/text/SKILL.md +45 -0
- package/src/ai/project/.claude/skills/update-dx-component/SKILL.md +56 -0
- package/src/ai/project/.claude/skills/update-dx-component/references/maintenance.md +43 -0
- package/src/ai/project/.claude/skills/url/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/validate-component/SKILL.md +78 -0
- package/src/ai/project/.claude/skills/validate-component/references/runtime-troubleshooting.md +56 -0
- package/src/ai/project/.claude/skills/validate-component/scripts/check-component.mjs +327 -0
- package/src/ai/project/.claude/skills/widget/SKILL.md +59 -0
- package/src/ai/project/.gemini/settings.json +5 -0
- package/src/ai/project/AGENTS.md +74 -0
- package/src/ai/readme-section.md +91 -0
- package/src/cli.js +48 -7
- package/src/constants.js +54 -53
- package/src/internal-tests.js +27 -0
- package/src/tasks/ai-toggle/index.js +46 -0
- package/src/tasks/authenticate/helper.js +38 -38
- package/src/tasks/authenticate/index.js +17 -15
- package/src/tasks/build-all/helper.js +4 -4
- package/src/tasks/build-all/index.js +7 -7
- package/src/tasks/build-comp/helper.js +17 -17
- package/src/tasks/build-comp/index.js +10 -10
- package/src/tasks/build-jest-assets/index.js +7 -9
- package/src/tasks/build-lib/helper.js +8 -8
- package/src/tasks/build-lib/index.js +8 -8
- package/src/tasks/bundle/builder/index.js +9 -12
- package/src/tasks/bundle/builder/modules.js +8 -9
- package/src/tasks/bundle/builder/paths.js +2 -19
- package/src/tasks/bundle/builder/webpack.config.js +60 -77
- package/src/tasks/bundle/index.js +8 -8
- package/src/tasks/create/index.js +35 -35
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -36
- package/src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +2 -27
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +2 -35
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +3 -36
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +4 -39
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +4 -53
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +3 -36
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -42
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/component-constants.ts +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -11
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +3 -13
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +28 -28
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/textformat-utils.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -33
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +3 -33
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +3 -31
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +3 -31
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +3 -35
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +3 -33
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +2 -35
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +19 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +9 -9
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +19 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +9 -9
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +4 -9
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.test.tsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +19 -14
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +3 -35
- package/src/tasks/create/templates/Launchpad/Field/__components.md +1 -1
- package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.test.tsx.mustache +3 -3
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +1 -1
- package/src/tasks/create-all/index.js +42 -41
- package/src/tasks/create-lib/helper.js +13 -13
- package/src/tasks/create-lib/index.js +5 -5
- package/src/tasks/create-version/helper.js +10 -10
- package/src/tasks/create-version/index.js +3 -4
- package/src/tasks/delete/helper.js +20 -19
- package/src/tasks/delete/index.js +2 -2
- package/src/tasks/delete-all/helper.js +26 -25
- package/src/tasks/delete-all/index.js +2 -2
- package/src/tasks/delete-lib/helper.js +6 -6
- package/src/tasks/delete-lib/index.js +6 -6
- package/src/tasks/delete-pub/helper.js +18 -18
- package/src/tasks/delete-pub/index.js +8 -8
- package/src/tasks/delete-version/index.js +2 -2
- package/src/tasks/dev-server/index.js +1 -1
- package/src/tasks/export-archive/helper.js +21 -21
- package/src/tasks/export-archive/index.js +27 -40
- package/src/tasks/export-rc/helper.js +34 -34
- package/src/tasks/export-rc/index.js +21 -31
- package/src/tasks/import-archive/helper.js +39 -39
- package/src/tasks/import-archive/index.js +69 -89
- package/src/tasks/import-comp/helper.js +8 -8
- package/src/tasks/import-comp/index.js +30 -42
- package/src/tasks/index.js +5 -0
- package/src/tasks/init/Node.gitignore +149 -0
- package/src/tasks/init/helper.js +15 -8
- package/src/tasks/init/index.js +115 -35
- package/src/tasks/init/template/.prettierrc.json +4 -1
- package/src/tasks/init/template/.storybook/main.ts +1 -4
- package/src/tasks/init/template/.storybook/manager.ts +1 -1
- package/src/tasks/init/template/.storybook/preview.tsx +2 -2
- package/src/tasks/init/template/.storybook/theme.js +1 -1
- package/src/tasks/init/template/.vscode/extensions.json +0 -1
- package/src/tasks/init/template/README.md +2 -2
- package/src/tasks/init/template/eslint.config.mjs +13 -155
- package/src/tasks/init/template/jest.config.cjs +2 -0
- package/src/tasks/init/template/package-lock.json +26864 -0
- package/src/tasks/init/template/package.json.mustache +19 -74
- package/src/tasks/init/template/setupTests.ts +10 -4
- package/src/tasks/init/template/tsconfig.json +14 -6
- package/src/tasks/internal-test/index.js +21 -0
- package/src/tasks/internal-test-full/index.js +15 -0
- package/src/tasks/internal-test-functional/index.js +15 -0
- package/src/tasks/internal-test-unit/index.js +13 -0
- package/src/tasks/linter/index.js +2 -2
- package/src/tasks/list/helper.js +41 -40
- package/src/tasks/list/index.js +3 -3
- package/src/tasks/list-lib/helper.js +5 -5
- package/src/tasks/list-lib/index.js +8 -8
- package/src/tasks/list-pub/helper.js +23 -16
- package/src/tasks/list-pub/index.js +24 -21
- package/src/tasks/move/helper.js +8 -8
- package/src/tasks/move/index.js +19 -23
- package/src/tasks/promote-webpack/index.js +4 -4
- package/src/tasks/promote-webpack/webpack.config.js +62 -93
- package/src/tasks/publish/helper.js +21 -21
- package/src/tasks/publish/index.js +16 -16
- package/src/tasks/publish-all/helper.js +20 -20
- package/src/tasks/publish-all/index.js +11 -12
- package/src/tasks/publish-archive/helper.js +9 -9
- package/src/tasks/publish-archive/index.js +12 -14
- package/src/tasks/publish-lib/helper.js +3 -3
- package/src/tasks/publish-lib/index.js +28 -34
- package/src/tasks/quarantine/index.js +8 -8
- package/src/tasks/rename/index.js +26 -30
- package/src/tasks/rename-lib/index.js +21 -25
- package/src/tasks/restore/index.js +8 -8
- package/src/tasks/restore-config/index.js +3 -5
- package/src/tasks/set-perm/index.js +8 -8
- package/src/tasks/show-help/index.js +17 -9
- package/src/tasks/show-status/index.js +2 -2
- package/src/tasks/store/index.js +8 -8
- package/src/tasks/switch-lib/helper.js +7 -7
- package/src/tasks/switch-lib/index.js +7 -7
- package/src/tasks/switch-version/helper.js +6 -6
- package/src/tasks/switch-version/index.js +7 -7
- package/src/tasks/update/index.js +1 -1
- package/src/tasks/upgrade/index.js +7 -7
- package/src/tasks/validator/index.js +49 -203
- package/src/util.js +169 -186
- package/src/rules/no-pcore-pconnect-in-presentation.js +0 -103
- package/src/tasks/init/template/.stylelintrc.json +0 -4
- package/src/tasks/init/template/babel.config.cjs +0 -22
- package/src/tasks/init/template/cspell.json +0 -14
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Component Plan Template
|
|
2
|
+
|
|
3
|
+
Fill in every section that applies. Write "not applicable" with a reason instead of leaving a section out. Keep it short enough to read in one sitting; the point is a decision, not a document.
|
|
4
|
+
|
|
5
|
+
## 1. Summary
|
|
6
|
+
|
|
7
|
+
One paragraph: what the component does and for whom. Whether it is a plan from requirements or a port, and from what source.
|
|
8
|
+
|
|
9
|
+
## 2. Fit and type
|
|
10
|
+
|
|
11
|
+
- Buildable as a custom DX component: yes, partly, or no, and why.
|
|
12
|
+
- Type and subtype, and the reason (for a Field, the type of the stored value).
|
|
13
|
+
- Anything that does not fit, and the closest alternative.
|
|
14
|
+
|
|
15
|
+
## 3. Contract
|
|
16
|
+
|
|
17
|
+
| Item | Decision |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| Name and label | `<Org>_<Library>_<Name>`, and the label shown in App Studio |
|
|
20
|
+
| Where it appears | The view, page or placement |
|
|
21
|
+
| Data in | The bound property, the data page, or the props |
|
|
22
|
+
| Data out | What it writes back, and when it commits |
|
|
23
|
+
| Read-only and display-only behavior | |
|
|
24
|
+
| Edge values | Empty, `null`, zero, very long, malformed |
|
|
25
|
+
|
|
26
|
+
## 4. Authoring properties
|
|
27
|
+
|
|
28
|
+
| Property | Label | Format | Default | Why the designer needs it |
|
|
29
|
+
| --- | --- | --- | --- | --- |
|
|
30
|
+
|
|
31
|
+
Start with the smallest set that makes the component usable.
|
|
32
|
+
|
|
33
|
+
## 5. States
|
|
34
|
+
|
|
35
|
+
Choose the applicable rows from [state-matrix.md](../../create-dx-component/references/state-matrix.md). For each: what is shown, what can be done, what is announced.
|
|
36
|
+
|
|
37
|
+
## 6. Building blocks
|
|
38
|
+
|
|
39
|
+
- Cosmos components and what each is for (see [design-system-mapping.md](./design-system-mapping.md)).
|
|
40
|
+
- PCore and PConnect methods needed, each found in the API catalog.
|
|
41
|
+
- Anything custom, and why Cosmos does not cover it.
|
|
42
|
+
|
|
43
|
+
## 7. Quality and compliance
|
|
44
|
+
|
|
45
|
+
- The accessibility target and any regional rules, as stated by the user or marked as a proposed default.
|
|
46
|
+
- Languages (including right-to-left), supported browsers and devices, performance and data-size expectations, privacy and audit needs.
|
|
47
|
+
|
|
48
|
+
- Accessibility: names, keyboard path, focus, announcements ([accessibility.md](../../create-dx-component/references/accessibility.md)).
|
|
49
|
+
- Localization: the visible strings ([localization.md](../../create-dx-component/references/localization.md)).
|
|
50
|
+
- Tests and stories: one per state, plus the edge values.
|
|
51
|
+
|
|
52
|
+
### AI-assisted content (only if the component uses AI)
|
|
53
|
+
|
|
54
|
+
Source of the content and what is sent to it; how it is labeled as machine-generated; whether a person must approve it; stop, retry and feedback; the states from [state-matrix.md](../../create-dx-component/references/state-matrix.md); how model output is sanitized before rendering.
|
|
55
|
+
|
|
56
|
+
## 8. Dependencies and risks
|
|
57
|
+
|
|
58
|
+
| Item | Needed for | In Cosmos or the browser? | Consent |
|
|
59
|
+
| --- | --- | --- | --- |
|
|
60
|
+
|
|
61
|
+
Plus any platform behavior that could not be verified.
|
|
62
|
+
|
|
63
|
+
## 9. Open questions
|
|
64
|
+
|
|
65
|
+
Numbered, each with who can answer it.
|
|
66
|
+
|
|
67
|
+
## 10. Acceptance criteria and trace
|
|
68
|
+
|
|
69
|
+
A short list the user can check: observable behavior, not implementation. Keep the user's own wording where they gave criteria, and map each criterion to the test that will prove it.
|
|
70
|
+
|
|
71
|
+
| Requirement or criterion | Source (file, link, image, or the message) | Decision | Test |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
|
|
74
|
+
## 11. Size
|
|
75
|
+
|
|
76
|
+
Small, medium or large, and the biggest uncertainty behind that estimate.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Requirements Template
|
|
2
|
+
|
|
3
|
+
Copy this into a file (for example `requirements/QuantityField.md`) and fill in what you know. **Leave anything you do not know blank**: the assistant will ask about it, or propose a default for you to approve. You can also ask the assistant to interview you and write the file for you.
|
|
4
|
+
|
|
5
|
+
You can attach images, paste links, or name a design system anywhere below.
|
|
6
|
+
|
|
7
|
+
## 1. What is it for?
|
|
8
|
+
|
|
9
|
+
- What problem does it solve, and for whom?
|
|
10
|
+
- In one or two sentences, what should the user be able to do?
|
|
11
|
+
|
|
12
|
+
## 2. Where will it appear?
|
|
13
|
+
|
|
14
|
+
- In which case type, step, page or dashboard?
|
|
15
|
+
- Is it one input for one value, a block that shows its own data, a layout that arranges other fields, or a replacement for the whole case view?
|
|
16
|
+
- Does it appear in more than one place?
|
|
17
|
+
|
|
18
|
+
## 3. Data
|
|
19
|
+
|
|
20
|
+
- What value or data does it show or change? Give the property name if you know it.
|
|
21
|
+
- Where does the data come from (a case property, a data page, something else)?
|
|
22
|
+
- Give two or three **example values**, including an empty one and an unusual one.
|
|
23
|
+
- If it changes data, when should the change be saved (as the user types, when they leave the field, on a button)?
|
|
24
|
+
|
|
25
|
+
## 4. Behavior
|
|
26
|
+
|
|
27
|
+
- What should happen when the user interacts with it? List the actions in order.
|
|
28
|
+
- What is allowed, and what must be refused (for example, only whole numbers from 1 to 999)?
|
|
29
|
+
- What error message should the user see, in your own words?
|
|
30
|
+
|
|
31
|
+
## 5. States
|
|
32
|
+
|
|
33
|
+
Say what should be shown in each state you care about. Skip the ones that do not apply.
|
|
34
|
+
|
|
35
|
+
| State | What the user sees and can do |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| Normal | |
|
|
38
|
+
| Empty | |
|
|
39
|
+
| Loading | |
|
|
40
|
+
| Error | |
|
|
41
|
+
| Read-only or display-only | |
|
|
42
|
+
| Disabled | |
|
|
43
|
+
| Success | |
|
|
44
|
+
| Very long or unusual content | |
|
|
45
|
+
|
|
46
|
+
## 6. Look and feel
|
|
47
|
+
|
|
48
|
+
- Screenshots, mockups or a sketch: attach them or give the file names, and say what each one shows.
|
|
49
|
+
- Public links to something similar (documentation, a demo, an example): paste them. Only public pages can be read. For a private ticket, wiki page or document, paste the relevant text or save an export into the project.
|
|
50
|
+
- Code or a prototype from a design tool, or a design file export: attach it and say what it should and should not decide.
|
|
51
|
+
- A design system or library you want it to resemble (name, version, component): the assistant will map it onto the Pega design system and tell you what will look different.
|
|
52
|
+
- Anything about the look that is a hard requirement.
|
|
53
|
+
|
|
54
|
+
## 7. What should the app designer be able to configure in App Studio?
|
|
55
|
+
|
|
56
|
+
List the settings you would like (for example a minimum, a label, a color map), and a default for each.
|
|
57
|
+
|
|
58
|
+
## 8. Quality and compliance
|
|
59
|
+
|
|
60
|
+
- Accessibility target (for example WCAG 2.2 level AA) and any regional rules that apply to you. Leave blank if you do not know; the assistant will propose a default and say so.
|
|
61
|
+
- Languages, including any right-to-left language.
|
|
62
|
+
- Browsers and devices it must work on.
|
|
63
|
+
- Performance expectations, and the largest amount of data it must handle.
|
|
64
|
+
- Privacy and data-handling rules, and whether it must leave an audit trail.
|
|
65
|
+
|
|
66
|
+
## 8a. Does it use AI?
|
|
67
|
+
|
|
68
|
+
Skip this if it does not generate or act on generated content.
|
|
69
|
+
|
|
70
|
+
- What does the AI produce or decide (suggestions, a summary, an answer, an action)?
|
|
71
|
+
- Where does it come from, and what data is sent to it?
|
|
72
|
+
- How should the user know it is machine-generated, and must a person approve it before it has an effect?
|
|
73
|
+
- Can the user stop it, retry it and give feedback?
|
|
74
|
+
- What should happen when it is slow, wrong, refused or unavailable?
|
|
75
|
+
|
|
76
|
+
## 9. Limits
|
|
77
|
+
|
|
78
|
+
- What must it **not** do?
|
|
79
|
+
- Which libraries are you willing, or not willing, to use?
|
|
80
|
+
- Deadline or size expectations, if any.
|
|
81
|
+
|
|
82
|
+
## 10. How will you know it works?
|
|
83
|
+
|
|
84
|
+
A short list of things you will check. Given/when/then sentences are ideal because each one becomes a test. For example "typing 0 shows an error", "clearing the field leaves it empty", "it looks right in a details view".
|
|
85
|
+
|
|
86
|
+
## 11. Anything else
|
|
87
|
+
|
|
88
|
+
Context, history, related components, links to tickets.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: presentation
|
|
3
|
+
description: 'Scaffold and implement a Pega DX **Presentation** component. In this tooling a Presentation component replaces how a whole case view is rendered (subtypes CASEVIEW and WSSCASEVIEW): it receives everything as props and has no access to PCore or PConnect. Use when: the user wants to restyle or restructure the case view page. NOT for badges, status pills, formatters or other read-only displays — use a Field (bound to a property) or a Widget (standalone block) for those.'
|
|
4
|
+
argument-hint: 'Describe the case view change (e.g., "a case view with a compact header and the tabs on the left")'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create Presentation Component Skill
|
|
8
|
+
|
|
9
|
+
## When to Use
|
|
10
|
+
|
|
11
|
+
- The user wants to **replace how a case view is rendered**: header, summary fields, tabs, stages, tasks, banners, utilities.
|
|
12
|
+
- The two supported subtypes are `CASEVIEW` (props type `CaseViewProps` from `@pega/cosmos-react-work`) and `WSSCASEVIEW` (props type `CaseViewProps` from `@pega/cosmos-react-wss`).
|
|
13
|
+
|
|
14
|
+
Do NOT use this skill for:
|
|
15
|
+
|
|
16
|
+
- an input or a read-only value bound to a case property, such as a badge, status pill, formatted number or icon (use `field` and handle `DISPLAY_ONLY`),
|
|
17
|
+
- a standalone block that shows its own data (use `widget`),
|
|
18
|
+
- a layout container (use `template`).
|
|
19
|
+
|
|
20
|
+
`config.json` `type: "Presentation"` accepts only the subtypes `CASEVIEW` and `WSSCASEVIEW`; any other subtype fails `validate-schema`.
|
|
21
|
+
|
|
22
|
+
## What a Presentation component is
|
|
23
|
+
|
|
24
|
+
A Presentation component is a **pure render of props**. The platform passes every piece of the case view (heading, summary fields, tabs, stages, tasks, banners, utilities, expand/collapse state and callbacks) as props whose type comes from the design system. There is no `getPConnect`, and the project's lint rule `no-pcore-pconnect-in-presentation` rejects any use of `PCore` or `getPConnect` in a component whose `config.json` has `type: "Presentation"`.
|
|
25
|
+
|
|
26
|
+
Consequently:
|
|
27
|
+
|
|
28
|
+
- Do not call `getPConnect`, `PCore`, `getActionsApi`, `getValidationApi` or any PCore/PConnect API. If the requirement needs data the props do not carry, the right component type is a Widget.
|
|
29
|
+
- Do not fetch data or run side-effecting effects. Local UI state (open/closed, hover) is fine.
|
|
30
|
+
- Render from the props the type defines. Read the type before using a prop: `node_modules/@pega/cosmos-react-work/lib/components/CaseView/CaseView.types.d.ts` (or the `@pega/cosmos-react-wss` equivalent for `WSSCASEVIEW`).
|
|
31
|
+
|
|
32
|
+
## Procedure
|
|
33
|
+
|
|
34
|
+
The repo-wide rules (gallery reuse, contract approval and its layout, authoring properties, consent, Cosmos first, no dead code) are in `AGENTS.md` and are not repeated here.
|
|
35
|
+
|
|
36
|
+
### Step 0: Check the UI Gallery
|
|
37
|
+
|
|
38
|
+
Follow [ui-gallery-reuse.md](../create-dx-component/references/ui-gallery-reuse.md).
|
|
39
|
+
|
|
40
|
+
### Step 1: Agree the contract
|
|
41
|
+
|
|
42
|
+
Use the approval layout from `AGENTS.md`. The draft states:
|
|
43
|
+
|
|
44
|
+
- **Subtype**: `CASEVIEW` or `WSSCASEVIEW`
|
|
45
|
+
- **Name**: PascalCase; the component key is `<Org>_<Library>_<Name>`
|
|
46
|
+
- **What changes**: which parts of the case view are rearranged or restyled, and what keeps the default behavior
|
|
47
|
+
- **Properties**: none by default (`"properties": []`); add one only if the user wants a designer-configurable setting
|
|
48
|
+
|
|
49
|
+
### Step 2: Scaffold
|
|
50
|
+
|
|
51
|
+
`npm run create -- Presentation CASEVIEW <Name> "<Label>" 1.0.0 <Library> "<description>" <Organization>`
|
|
52
|
+
|
|
53
|
+
Use `WSSCASEVIEW` instead of `CASEVIEW` for the Web Self Service variant. See [cli-workflow.md](../create-dx-component/references/cli-workflow.md) for the full command forms.
|
|
54
|
+
|
|
55
|
+
### Step 3: Implement
|
|
56
|
+
|
|
57
|
+
Implement every scaffolded file from [presentation-essentials.md](../create-dx-component/references/presentation-essentials.md): pure render from the props, no PCore or `getPConnect`, Cosmos instead of the scaffold's plain-HTML placeholder, the `create-nonce` import if you keep `styled-components`, and a test with the optional props absent.
|
|
58
|
+
|
|
59
|
+
### Step 4: Validate
|
|
60
|
+
|
|
61
|
+
Run `node .claude/skills/validate-component/scripts/check-component.mjs <Org>_<Library>_<Name>` (`--no-build` while fixing), fix every failure, and paste the final table into your report.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: publish-library
|
|
3
|
+
description: 'Connect to a Pega Infinity server and publish a DX component library — authentication, `tasks.config.json` server settings, SSL keys, library versions, and the store/export lifecycle. Use when: the user wants to authenticate, publish, version, store, restore, export, or import a component library, or is debugging a failed `npm run publish` or `npm run authenticate`.'
|
|
4
|
+
argument-hint: 'Describe the goal (e.g. "publish the current library version" or "authenticate against a new Infinity server")'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Publish DX Component Library Skill
|
|
8
|
+
|
|
9
|
+
Building and testing a component is covered by [validate-component](../validate-component/SKILL.md). This skill starts once the component builds clean and needs to reach a Pega server.
|
|
10
|
+
|
|
11
|
+
## This repo is in Library mode
|
|
12
|
+
|
|
13
|
+
[tasks.config.json](../../../tasks.config.json) sets `"libraryModeCL": true`. That determines which npm scripts are legal:
|
|
14
|
+
|
|
15
|
+
| Available in Library mode | **Not** available (Component mode only) |
|
|
16
|
+
| ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
|
|
17
|
+
| `createLib`, `switchLib`, `listLib`, `deleteLib` | `publishAll` |
|
|
18
|
+
| `createLibVersion`, `switchLibVersion`, `deleteLibVersion` | `promoteWebPack`, `revertWebPack` |
|
|
19
|
+
| `publishLibVersion`, `restoreLibVersion`, `storeLibVersion` | `exportRC` |
|
|
20
|
+
| `listPublishedLib`, `deletePublishedLib`, `showStatus`, `setPermanent` | |
|
|
21
|
+
| `importLibVersion`, `exportLibVersion`, `move`, `startDevServer` | |
|
|
22
|
+
|
|
23
|
+
`npm run publish` and `npm run publishLibVersion` both resolve to `custom-dx-components publish`. Never suggest a Component-mode command while `libraryModeCL` is `true` — it will fail.
|
|
24
|
+
|
|
25
|
+
## Server configuration
|
|
26
|
+
|
|
27
|
+
All connection settings live under `server-config` in [tasks.config.json](../../../tasks.config.json). Read it before advising anything — do not assume defaults.
|
|
28
|
+
|
|
29
|
+
| Key | Meaning |
|
|
30
|
+
| -------------------------------- | ----------------------------------------------------------------------------- |
|
|
31
|
+
| `server` | Infinity base URL, e.g. `https://localhost:1080/prweb` |
|
|
32
|
+
| `serverType` | `infinity` |
|
|
33
|
+
| `authService` | Infinity authentication service alias — used when `grantType` is `authCode` |
|
|
34
|
+
| `grantType` | `authCode`, `passwordCreds`, or `clientCreds` |
|
|
35
|
+
| `clientId` | OAuth client registration ID |
|
|
36
|
+
| `clientSecret` | Required **only** for `passwordCreds` and `clientCreds` |
|
|
37
|
+
| `redirectUri` | OAuth redirect, e.g. `https://localhost:4010/` |
|
|
38
|
+
| `cert` / `key` | SSL cert and key, needed when `grantType` is `authCode` and `redirectUri` is `https://localhost` |
|
|
39
|
+
| `rulesetName` / `rulesetVersion` | Target ruleset for published components |
|
|
40
|
+
| `archiveRulesetName` / `archiveRulesetVersion` | Ruleset used by `exportLibVersion` / `importLibVersion` |
|
|
41
|
+
| `devBuild`, `devServerPort` | Local dev server settings for `startDevServer` |
|
|
42
|
+
| `questions_ask*` | Controls which settings `npm run authenticate` re-prompts for |
|
|
43
|
+
|
|
44
|
+
### Secrets
|
|
45
|
+
|
|
46
|
+
`clientSecret`, `user`, and `password` sit in a tracked file. **Never** write a real secret into [tasks.config.json](../../../tasks.config.json) on the user's behalf, never echo one into the terminal, and never paste one into a chat response. If a credential is needed, tell the user to enter it themselves at the `npm run authenticate` prompt.
|
|
47
|
+
|
|
48
|
+
The [keys/](../../../keys) folder holds `dxcb.crt` and `dxcb.key` for the local HTTPS redirect listener. These are local development certificates — they are not deployment credentials and must not be reused as such.
|
|
49
|
+
|
|
50
|
+
## Procedure
|
|
51
|
+
|
|
52
|
+
### Authenticate
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run authenticate
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Run this first whenever the token may be stale, the server has changed, or a publish returns 401/403. It prompts only for the settings listed in `questions_askOnce` / `questions_askAlways` — currently `server,authService` are asked once.
|
|
59
|
+
|
|
60
|
+
### Publish
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm run validate -- <Org>_<Library>_<Name> N N # the component must build clean first
|
|
64
|
+
npm run test
|
|
65
|
+
npm run publish
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Publish only when the user explicitly asks. Publishing writes to a shared Pega server and is not a local, reversible action.
|
|
69
|
+
|
|
70
|
+
### Version lifecycle
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm run listLib # what libraries exist locally
|
|
74
|
+
npm run listPublishedLib # what is already on the server
|
|
75
|
+
npm run showStatus # local vs published drift
|
|
76
|
+
npm run createLibVersion # start a new version
|
|
77
|
+
npm run switchLibVersion # move between versions
|
|
78
|
+
npm run storeLibVersion # snapshot the current version into store/
|
|
79
|
+
npm run restoreLibVersion # bring a stored version back
|
|
80
|
+
npm run setPermanent # lock a published version
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`store/` and `<Org>_<Library>/` are **generated** folders — they do not exist until `storeLibVersion` and a build have run. Do not reference them as if they were checked in.
|
|
84
|
+
|
|
85
|
+
### Versioning rules
|
|
86
|
+
|
|
87
|
+
- `component.version` in [tasks.config.json](../../../tasks.config.json) seeds the `version` written into each new component's `config.json`.
|
|
88
|
+
- `component.library` must equal the `library` value in every `config.json` and the `Pega_<library>_` name prefix. A mismatch fails the build.
|
|
89
|
+
- Bump the version before publishing a change to an already-published library version, or use `createLibVersion` for a breaking change.
|
|
90
|
+
- `setPermanent` makes a published version immutable — confirm with the user before running it.
|
|
91
|
+
|
|
92
|
+
## Common Failures
|
|
93
|
+
|
|
94
|
+
- **401 / 403 on publish** — token expired. Run `npm run authenticate`.
|
|
95
|
+
- **Redirect never completes on `authCode`** — `cert` and `key` are missing or untrusted. Both are required when `redirectUri` starts with `https://localhost`.
|
|
96
|
+
- **`clientSecret` empty with `passwordCreds` or `clientCreds`** — that grant type requires it; `authCode` does not.
|
|
97
|
+
- **Command "not found" or silently wrong** — a Component-mode script was used while `libraryModeCL` is `true`. Check the table above.
|
|
98
|
+
- **Library name mismatch** — `component.library`, the `library` key in `config.json`, and the `<Org>_<Library>_` folder prefix must all agree.
|
|
99
|
+
|
|
100
|
+
## Before Publishing
|
|
101
|
+
|
|
102
|
+
1. `npm run validate -- <Org>_<Library>_<Name> N N` (or `validateAll`) passes
|
|
103
|
+
2. `npm run test` passes, coverage thresholds met
|
|
104
|
+
3. `npm run lint` and `npm run _lint:spelling` pass
|
|
105
|
+
4. Version bumped if the target version is already published
|
|
106
|
+
5. The user has explicitly asked to publish
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: radiobuttons
|
|
3
|
+
description: 'Scaffold a Pega DX Field component with subtype **Radiobuttons** — single-select radio group bound to a case property. Use when: user asks for radio buttons, a mutually exclusive option group, a rating scale, a segmented choice, or an inline yes/no/maybe selector.'
|
|
4
|
+
argument-hint: 'Describe the radio group (e.g., "a three-option priority selector shown inline")'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create Radiobuttons Field
|
|
8
|
+
|
|
9
|
+
Field subtype `Radiobuttons`. Binds to a case property whose value is one key from a small option set.
|
|
10
|
+
|
|
11
|
+
Read [../field/SKILL.md](../field/SKILL.md) for the shared Field rules first. This skill adds only what is specific to `Radiobuttons`.
|
|
12
|
+
|
|
13
|
+
## Cosmos Mapping
|
|
14
|
+
|
|
15
|
+
| Mode | Component |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Edit | `RadioButtonGroup` from `@pega/cosmos-react-core` |
|
|
18
|
+
| `DISPLAY_ONLY` | The **display label** for the stored key |
|
|
19
|
+
|
|
20
|
+
## Picklist or Radiobuttons
|
|
21
|
+
|
|
22
|
+
| Use radio buttons when | Use a picklist when |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Two to roughly five options | More than five options |
|
|
25
|
+
| All options should be visible at once | The list is long or data-page driven |
|
|
26
|
+
| The choice is central to the form | The choice is secondary |
|
|
27
|
+
|
|
28
|
+
## Value Handling
|
|
29
|
+
|
|
30
|
+
- Store the **key**, render the **label**, exactly as with a picklist.
|
|
31
|
+
- Dispatch with `changeNblur`.
|
|
32
|
+
- Every option needs a stable `key`. Do not use the array index — reordering the options would silently remap stored data. Compare keys as strings (`` `${value}` === `${item.key}` ``) and give the group a `name` of `pageReference.propName` so two groups on different pages never share a name.
|
|
33
|
+
- On blur call `validate(value)` only when there is no value, so a required group reports its error.
|
|
34
|
+
|
|
35
|
+
## config.json Additions
|
|
36
|
+
|
|
37
|
+
| Property | Label | Format | Default | Notes |
|
|
38
|
+
| --- | --- | --- | --- | --- |
|
|
39
|
+
| `orientation` | Orientation | `SELECT` | `"vertical"` | options: `vertical`, `horizontal` |
|
|
40
|
+
| `options` | Options (comma separated) | `TEXT` | | |
|
|
41
|
+
|
|
42
|
+
## Gotchas
|
|
43
|
+
|
|
44
|
+
- `RadioButtonGroup` owns the group label and the accessible grouping. Do not wrap it in a separate `FieldGroup` label as well, or screen readers announce the name twice.
|
|
45
|
+
- A radio group cannot be deselected by default. The platform's own group offers an opt-in clear (`allowClear` with `onClear` committing `''`) and an environment flag for click-to-deselect; if you need it, add it deliberately as an authoring option, or add an explicit "None" option. Do not assume an empty click clears the value.
|
|
46
|
+
- Keep every option label short enough to read inline when `orientation` is `horizontal`.
|
|
47
|
+
- Do not use radio buttons for a true boolean — use `boolean`.
|
|
48
|
+
|
|
49
|
+
## Validate
|
|
50
|
+
|
|
51
|
+
Run `node .claude/skills/validate-component/scripts/check-component.mjs <Org>_<Library>_<Name>` and paste its table into your final report.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-component
|
|
3
|
+
description: 'Independent, read-only audit of a finished Pega DX component (Field, Widget, Template or Presentation) against the project checklist. Use when: the user asks to review, audit, check or sign off a component; or before reporting a new component as done. Reports findings by severity with file and line evidence; it does not edit files.'
|
|
4
|
+
argument-hint: 'The component key to review (for example Acme_Lib_Quantity), plus the brief if you have it'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review a DX Component
|
|
8
|
+
|
|
9
|
+
A second pair of eyes for a component that is already built. The author checked their own work; this review exists to catch what they missed and what they claimed without proof. It is **read-only**: report findings, do not fix them. The author (or a separate step) fixes, then the check script is rerun.
|
|
10
|
+
|
|
11
|
+
## When to run it
|
|
12
|
+
|
|
13
|
+
- A new Field, Widget or Template is built and about to be reported done. Skip it for a one-line fix.
|
|
14
|
+
- The user asks for a review, audit or quality check of an existing component.
|
|
15
|
+
|
|
16
|
+
## Stay independent
|
|
17
|
+
|
|
18
|
+
A reviewer that reads the author's conclusions tends to agree with them.
|
|
19
|
+
|
|
20
|
+
- If your tool can start a sub-agent or a fresh session, delegate the review and give it only: the component key, the original brief (or the user's request), and this skill. **Do not pass the author's summary, test results or opinion of the code.**
|
|
21
|
+
- If you must review in the same session, re-read every file from disk instead of relying on memory, and treat every claim in your own earlier report as unproven until you find the code or test that shows it.
|
|
22
|
+
|
|
23
|
+
## Procedure
|
|
24
|
+
|
|
25
|
+
1. **Locate the component** at `src/components/<Org>_<Library>_<Name>/` and note its type and subtype from `config.json`. If you were not given a brief, reconstruct the intended behavior from the user's request and `config.json`, and say that you did.
|
|
26
|
+
2. **Get the mechanical facts first.** Run `node .claude/skills/validate-component/scripts/check-component.mjs <key> --no-build` and take its table as given. Do not repeat what it checks (schema, `tsc`, ESLint, Jest, properties read, scans). Spend your effort on what a script cannot judge. Note any `FAIL` row as a finding.
|
|
27
|
+
3. **Read the files in this order:** `config.json`, `index.tsx` and any helper files, `styles.ts`, `mock.ts`, `demo.stories.tsx`, `demo.test.tsx`.
|
|
28
|
+
4. **Walk the checklist** in [references/checklist.md](./references/checklist.md): the common section, the section for the component type, accessibility, and tests and stories. For every item decide pass, fail or not applicable. A fail needs evidence.
|
|
29
|
+
5. **Use a saved plan if there is one** (for example `requirements/<Name>.plan.md`): its acceptance criteria and trace are the brief. Then **trace each requirement in the brief** to the code that implements it and the test that proves it. A requirement with no test is a finding. A test that does not assert the behavior it is named after is a finding.
|
|
30
|
+
6. **Check the author's report, if there is one,** against the check table and the code. A claim with no support is a Blocker (checklist item R1).
|
|
31
|
+
7. **Write the report** in the format below.
|
|
32
|
+
|
|
33
|
+
## Rules for the reviewer
|
|
34
|
+
|
|
35
|
+
- Every finding cites `file:line` and the checklist id. No evidence, no finding.
|
|
36
|
+
- Say "cannot determine" instead of guessing, and list it under Not verified.
|
|
37
|
+
- Do not invent platform behavior. Use the references this project ships; for a PCore or PConnect method, check the API catalog under `.claude/skills/references/`.
|
|
38
|
+
- Report the real problems. Do not pad the report with style opinions the checklist does not mention, and do not repeat one root cause as several findings.
|
|
39
|
+
- Do not edit, create or delete files. Do not run publish, authenticate or delete commands.
|
|
40
|
+
|
|
41
|
+
## Report format
|
|
42
|
+
|
|
43
|
+
1. **Verdict:** `Ready`, `Ready after minor fixes`, or `Not ready`, with one sentence of reasoning. `Not ready` if there is any Blocker or two or more Majors.
|
|
44
|
+
2. **Findings**, most severe first. Each one: severity, checklist id, `file:line`, what is wrong, why it matters to a user or to saved data, and the smallest fix.
|
|
45
|
+
- **Blocker:** corrupts or loses data, a security problem, an accessibility barrier, a requirement not met, or a false claim in the report.
|
|
46
|
+
- **Major:** breaks a platform contract, a missing state, a missing guard, or a missing test for a stated requirement.
|
|
47
|
+
- **Minor:** convention or polish that does not change behavior.
|
|
48
|
+
3. **Requirements trace:** each requirement, the code that implements it, the test that proves it, or `no test`.
|
|
49
|
+
4. **Not verified:** what you could not check (for example the build, a real Pega server, a screen reader) and why.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Review Checklist
|
|
2
|
+
|
|
3
|
+
Each item has an id, the check, and the severity if it fails. The right-hand column names the reference that explains the rule. Mark an item not applicable only when it truly does not apply, and say so.
|
|
4
|
+
|
|
5
|
+
## Common (every component)
|
|
6
|
+
|
|
7
|
+
| Id | Check | If it fails | Reference |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| C1 | Every requirement in the brief is implemented. | Blocker | the brief |
|
|
10
|
+
| C2 | Every `config.json` property changes behavior. Its default in `config.json` matches the fallback in code, and numbers and booleans that arrive as strings are normalized. | Major | [config-schema.md](../../create-dx-component/references/config-schema.md) |
|
|
11
|
+
| C3 | The UI is built from Cosmos components. Styled-components appear only for what Cosmos cannot express, and there are no inline styles. | Minor, Major if layout or text is hand-built | [AGENTS.md](../../../../AGENTS.md) |
|
|
12
|
+
| C4 | No `dangerouslySetInnerHTML`. Any URL from data is checked against an allow-list of protocols before it is rendered as a link. No secrets or environment URLs. | Blocker | [field-behavior.md](../../create-dx-component/references/field-behavior.md) |
|
|
13
|
+
| C5 | Imports are only React, Cosmos packages, styled-components and local files, unless the user approved a library. | Major | [AGENTS.md](../../../../AGENTS.md) |
|
|
14
|
+
| C6 | The component is exported with `withConfiguration()` and imports `create-nonce`. | Major | [create-dx-component](../../create-dx-component/SKILL.md) |
|
|
15
|
+
| C7 | Visible text goes through the localization service, not hard-coded literals, apart from scaffold placeholders. | Minor | [widget-patterns.md](../../create-dx-component/references/widget-patterns.md) |
|
|
16
|
+
| C8 | Every PCore and PConnect method called appears in the API catalog. An undocumented one is justified to the user. | Major | [pcore-pconnect-apis.md](../../create-dx-component/references/pcore-pconnect-apis.md) |
|
|
17
|
+
|
|
18
|
+
## Field
|
|
19
|
+
|
|
20
|
+
| Id | Check | If it fails | Reference |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| F1 | Typing updates a local draft. The store is written on blur (or on change only for stepper and slider variants), not on every keystroke. | Major | [field-behavior.md](../../create-dx-component/references/field-behavior.md) |
|
|
23
|
+
| F2 | A blur with an unchanged value does not commit but still validates. An unchanged empty value validates `''`. | Major | field-behavior.md |
|
|
24
|
+
| F3 | Clearing sends `''`. Zero is a value: there is no `if (!value)` on a number. A `null` stored value is read as empty (`?? ''`). | Blocker if a clear or zero corrupts data | field-behavior.md |
|
|
25
|
+
| F4 | Invalid input is never silently turned into another value (`''`, `0`) and committed. An out-of-range or malformed draft is not committed, and the user sees an error. | Blocker | field-behavior.md |
|
|
26
|
+
| F5 | `DISPLAY_ONLY`, `readOnly`, `disabled` and `required` are handled, including string booleans. A read-only control cannot commit. | Major | [props-contract.md](../../create-dx-component/references/props-contract.md) |
|
|
27
|
+
| F6 | `validatemessage` becomes an error status and replaces the helper text. `clearErrorMessages` runs on edit. Hiding the label keeps the helper text. | Minor | field-behavior.md |
|
|
28
|
+
| F7 | The subtype traps in field-behavior.md are respected: date-only values are not time-zone shifted, a URL is checked against `http` and `https`, a phone number that is only a country code is empty, a picklist stores the key and shows the label. | Blocker or Major | field-behavior.md |
|
|
29
|
+
|
|
30
|
+
## Widget
|
|
31
|
+
|
|
32
|
+
| Id | Check | If it fails | Reference |
|
|
33
|
+
| --- | --- | --- | --- |
|
|
34
|
+
| W1 | The fetch effect resets loading and error at the start, ignores a response that arrives after unmount or a dependency change, and returns a cleanup. | Major | [widget-patterns.md](../../create-dx-component/references/widget-patterns.md) |
|
|
35
|
+
| W2 | A failed load is an error state, never an empty list. "Nothing to show" and "could not load" are different messages. | Major | widget-patterns.md |
|
|
36
|
+
| W3 | Object props are dependencies by a stable key, not by identity, and a change in any input refetches. | Major | widget-patterns.md |
|
|
37
|
+
| W4 | Loading, empty, error, retry and refresh exist and use Cosmos state components. Refresh keeps the current rows visible. | Major | [state-matrix.md](../../create-dx-component/references/state-matrix.md) |
|
|
38
|
+
| W5 | An async action cannot be activated twice, and its pending flag is reset when it fails. | Major | widget-patterns.md |
|
|
39
|
+
| W6 | Every subscription uses a unique name, unsubscribes with the same name and context, and is not recreated on every render. | Major | widget-patterns.md |
|
|
40
|
+
| W7 | A failed mutation shows a message. A destructive action asks for confirmation and does not run if confirmation is unavailable. Focus is restored after a delete. | Major | widget-patterns.md |
|
|
41
|
+
| W8 | List keys are stable ids, not the array index. | Minor | widget-patterns.md |
|
|
42
|
+
|
|
43
|
+
## Template
|
|
44
|
+
|
|
45
|
+
| Id | Check | If it fails | Reference |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| T1 | `children` are treated as regions. Fields come from `getChildren()`, regions are found by name, and the element from `getComponent()` is memoized. | Major | [template-patterns.md](../../create-dx-component/references/template-patterns.md) |
|
|
48
|
+
| T2 | A DETAILS template forces `readOnly` and `displayMode: 'DISPLAY_ONLY'` on its children. | Blocker for DETAILS | template-patterns.md |
|
|
49
|
+
| T3 | `NumCols` and other numeric settings are parsed from strings with a fallback. | Major | template-patterns.md |
|
|
50
|
+
| T4 | Hidden children leave no gap, and a region whose children are all hidden also drops its heading. | Minor | template-patterns.md |
|
|
51
|
+
| T5 | Columns use `minmax(0, 1fr)` tracks. There is no fixed pixel width for text, no `100vh`, no landmark such as `main`, and no `document.title` change. | Minor | template-patterns.md |
|
|
52
|
+
| T6 | Heading levels are sequential, and instructions appear only when a heading is shown. | Minor | template-patterns.md |
|
|
53
|
+
|
|
54
|
+
## Accessibility
|
|
55
|
+
|
|
56
|
+
| Id | Check | If it fails | Reference |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| A1 | Every control has an accessible name. Hiding the label keeps a name. Repeated controls have distinct names. | Major | [accessibility.md](../../create-dx-component/references/accessibility.md) |
|
|
59
|
+
| A2 | An error is tied to its control and is not shown by color alone. | Major | accessibility.md |
|
|
60
|
+
| A3 | Everything a pointer can do works from the keyboard, focus stays visible, and focus moves deliberately after an action, never on load. | Major | accessibility.md |
|
|
61
|
+
| A4 | Loading finished, saved and failed are announced without taking focus. | Major | accessibility.md |
|
|
62
|
+
| A5 | Text wraps, nothing needs a fixed width, and the layout works at narrow widths. | Minor | accessibility.md |
|
|
63
|
+
|
|
64
|
+
## Tests and stories
|
|
65
|
+
|
|
66
|
+
| Id | Check | If it fails | Reference |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| S1 | Each applicable state in the state matrix has a story and an assertion. | Major | [state-matrix.md](../../create-dx-component/references/state-matrix.md) |
|
|
69
|
+
| S2 | Tests assert what a user sees and the arguments of commits. No `.skip` or `.only`, no deleted assertions, and no test that only checks the mock. | Major | [test-pattern.md](../../create-dx-component/references/test-pattern.md) |
|
|
70
|
+
| S3 | Tests cover the edge cases: empty, `null`, zero, long values, and for widgets a late response and a failed request. | Major | test-pattern.md |
|
|
71
|
+
| S4 | Mock data is deterministic and contains no production data or secrets. | Minor | test-pattern.md |
|
|
72
|
+
|
|
73
|
+
## Report honesty
|
|
74
|
+
|
|
75
|
+
| Id | Check | If it fails |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| R1 | Every claim in the author's report (built, tested, verified, accessible) is supported by the check table or by code you read. A step shown as `NOT RUN` or `FAIL` is not reported as passing. | Blocker |
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: template
|
|
3
|
+
description: 'Scaffold and implement a Pega DX **Template** component — a layout container that arranges child views/fields (FORM, DETAILS, PAGE subtypes). Use when: user wants a layout wrapper, a custom column/section arrangement, a container for child fields, or asks for a Template subtype.'
|
|
4
|
+
argument-hint: 'Describe the layout (e.g., "a two-column form with a sidebar" or "a tabbed details template")'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create Template Component Skill
|
|
8
|
+
|
|
9
|
+
## Prefer a Subtype Skill
|
|
10
|
+
|
|
11
|
+
If the subtype is clear, use the narrower skill instead — it carries the layout rules this skill does not repeat.
|
|
12
|
+
|
|
13
|
+
| Subtype | Skill |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| FORM | `form` |
|
|
16
|
+
| DETAILS | `details` |
|
|
17
|
+
| PAGE | `page` |
|
|
18
|
+
|
|
19
|
+
Use this skill when the subtype is unclear, or the layout is unusual (tabs, steps, a sidebar): see [choosing-type-and-subtype.md](../create-dx-component/references/choosing-type-and-subtype.md).
|
|
20
|
+
|
|
21
|
+
## When to Use
|
|
22
|
+
|
|
23
|
+
- User wants a **layout container** that receives and arranges child components
|
|
24
|
+
- User mentions a Template subtype: **FORM**, **DETAILS**, **PAGE**
|
|
25
|
+
- User needs `CONTENTPICKER` in App Studio so authors can add child fields/views
|
|
26
|
+
- Component takes a `children` array as its primary content
|
|
27
|
+
|
|
28
|
+
Do NOT use this skill for components that own their own data (see `widget`), single-property bindings (see `field`), or read-only formatters (see `field`, which handles `DISPLAY_ONLY`).
|
|
29
|
+
|
|
30
|
+
## Procedure
|
|
31
|
+
|
|
32
|
+
The repo-wide rules (gallery reuse, contract approval and its layout, authoring properties, consent, Cosmos first, no dead code) are in `AGENTS.md` and are not repeated here.
|
|
33
|
+
|
|
34
|
+
### Step 0: Check the UI Gallery
|
|
35
|
+
|
|
36
|
+
Follow [ui-gallery-reuse.md](../create-dx-component/references/ui-gallery-reuse.md).
|
|
37
|
+
|
|
38
|
+
### Step 1: Agree the contract
|
|
39
|
+
|
|
40
|
+
Besides the name, label, description, library and version, the draft states:
|
|
41
|
+
|
|
42
|
+
- **Subtype**: FORM, DETAILS or PAGE
|
|
43
|
+
- **Layout primitive**: Cosmos `Grid`, `Flex`, `FieldGroup` or `Card` composition
|
|
44
|
+
- **Regions**: the region names (`A`, `B`, `C`, or `Fields`), which are required, and how they stack when narrow
|
|
45
|
+
- **Configurable knobs**: column count, gap, section headings, `showLabel`, orientation
|
|
46
|
+
- **States to cover**: the applicable rows from [state-matrix.md](../create-dx-component/references/state-matrix.md)
|
|
47
|
+
|
|
48
|
+
### Step 2: Scaffold
|
|
49
|
+
|
|
50
|
+
`npm run create -- Template <FORM|DETAILS|PAGE> <Name> "<Label>" <version> <Library> "<description>" <Organization>`
|
|
51
|
+
|
|
52
|
+
Pass every argument: a bare `npm run create` prompts interactively and hangs an agent. The CLI also accepts `FORM-region` and `DETAILS-region`. If no library exists yet, run `npm run createLib -- <Library> 1.0.0 Y Current` first. See [cli-workflow.md](../create-dx-component/references/cli-workflow.md).
|
|
53
|
+
|
|
54
|
+
### Step 3: Implement
|
|
55
|
+
|
|
56
|
+
Implement every scaffolded file from [template-essentials.md](../create-dx-component/references/template-essentials.md); open a deeper reference only when its closing table says so. Layout is where Cosmos coverage is best: never create styled-components for grids, flex rows, cards or gaps. Templates do not need `event-utils.ts`.
|
|
57
|
+
|
|
58
|
+
### Step 4: Validate
|
|
59
|
+
|
|
60
|
+
Run `node .claude/skills/validate-component/scripts/check-component.mjs <Org>_<Library>_<Name>` (`--no-build` while fixing), and paste the final table into your report. For a new component, run the `review-component` skill as described in [create-dx-component](../create-dx-component/SKILL.md). `npm run startStorybook` is long-running, so leave it to the user.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: text
|
|
3
|
+
description: 'Scaffold a Pega DX Field component with subtype **Text** — free-text single-line or multi-line input bound to a string case property. Use when: user asks for a text field, string input, notes/comment box, masked text, textarea, or a custom-formatted text display.'
|
|
4
|
+
argument-hint: 'Describe the text field (e.g., "a single-line SSN input with a mask")'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create Text Field
|
|
8
|
+
|
|
9
|
+
Field subtype `Text`. Binds to a string case property.
|
|
10
|
+
|
|
11
|
+
Read [../field/SKILL.md](../field/SKILL.md) for the shared Field rules first. This skill adds only what is specific to `Text`.
|
|
12
|
+
|
|
13
|
+
## Cosmos Mapping
|
|
14
|
+
|
|
15
|
+
| Mode | Component |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| Edit, single line | `Input` from `@pega/cosmos-react-core` |
|
|
18
|
+
| Edit, multi line | `TextArea` |
|
|
19
|
+
| `DISPLAY_ONLY` | Raw `{value}` inside the styled wrapper |
|
|
20
|
+
|
|
21
|
+
## Value Handling
|
|
22
|
+
|
|
23
|
+
- `value` arrives as `string`. Default it to `''`, never `undefined`, or the input flips to uncontrolled.
|
|
24
|
+
- `onChange` sends `event.target.value` straight through — no coercion.
|
|
25
|
+
- Trim only on blur if the requirement calls for it, and send the trimmed value through `handleEvent(actions, 'blur', propName, trimmed)`.
|
|
26
|
+
|
|
27
|
+
## config.json Additions
|
|
28
|
+
|
|
29
|
+
| Property | Label | Format | Default | Notes |
|
|
30
|
+
| --- | --- | --- | --- | --- |
|
|
31
|
+
| `placeholder` | Placeholder | `TEXT` | | |
|
|
32
|
+
| `maxLength` | Maximum length | `NUMBER` | | |
|
|
33
|
+
| `multiLine` | Multi-line | `BOOLEAN` | `false` | |
|
|
34
|
+
|
|
35
|
+
## Gotchas
|
|
36
|
+
|
|
37
|
+
- **`Input` does not render a character counter.** Passing `maxLength` only sets the native attribute. Only `TextArea` has `maxLength` + `displayCharCount`. For a counter on a single-line field, wrap a bare `Input` in your own `FormField` and set `charLimitDisplay`.
|
|
38
|
+
- **`Input` renders its own `FormField` when `label` is passed.** If you compose it inside your own `FormField`, pass `label` to the outer one only, or you nest two. Give both the **same explicit `id`** so the label's `htmlFor` resolves.
|
|
39
|
+
- **`FormField.onClear` only renders for radio/checkbox groups** (it is gated behind `isRadioCheck`). For a text input clear button, pass an `actions` array instead.
|
|
40
|
+
- For masked input, mask on change and store the unmasked value in the case property unless the business rule says otherwise.
|
|
41
|
+
- `TextArea` needs an explicit `rows` or it collapses to one line in some Constellation containers.
|
|
42
|
+
|
|
43
|
+
## Validate
|
|
44
|
+
|
|
45
|
+
Run `node .claude/skills/validate-component/scripts/check-component.mjs <Org>_<Library>_<Name>` and paste its table into your final report.
|