@salesforce/ui-bundle-template-feature-vue-authentication 0.0.0-stage → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +106 -2
  3. package/dist/.forceignore +15 -0
  4. package/dist/.husky/pre-commit +4 -0
  5. package/dist/.prettierignore +11 -0
  6. package/dist/.prettierrc +17 -0
  7. package/dist/CHANGELOG.md +5431 -0
  8. package/dist/README.md +83 -0
  9. package/dist/config/project-scratch-def.json +13 -0
  10. package/dist/eslint.config.js +7 -0
  11. package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls +68 -0
  12. package/dist/force-app/main/default/classes/UIBundleAuthUtils.cls-meta.xml +5 -0
  13. package/dist/force-app/main/default/classes/UIBundleAuthUtils_Test.cls +141 -0
  14. package/dist/force-app/main/default/classes/UIBundleAuthUtils_Test.cls-meta.xml +5 -0
  15. package/dist/force-app/main/default/classes/UIBundleChangePassword.cls +77 -0
  16. package/dist/force-app/main/default/classes/UIBundleChangePassword.cls-meta.xml +5 -0
  17. package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls +71 -0
  18. package/dist/force-app/main/default/classes/UIBundleForgotPassword.cls-meta.xml +5 -0
  19. package/dist/force-app/main/default/classes/UIBundleLogin.cls +105 -0
  20. package/dist/force-app/main/default/classes/UIBundleLogin.cls-meta.xml +5 -0
  21. package/dist/force-app/main/default/classes/UIBundleRegistration.cls +162 -0
  22. package/dist/force-app/main/default/classes/UIBundleRegistration.cls-meta.xml +5 -0
  23. package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig.cls +145 -0
  24. package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig.cls-meta.xml +5 -0
  25. package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig_Test.cls +181 -0
  26. package/dist/force-app/main/default/classes/UIBundleSocialLoginConfig_Test.cls-meta.xml +5 -0
  27. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.forceignore +15 -0
  28. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.graphqlrc.yml +2 -0
  29. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.prettierignore +9 -0
  30. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/.prettierrc +11 -0
  31. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/README.md +43 -0
  32. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/codegen.yml +95 -0
  33. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/components.json +19 -0
  34. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/e2e/app.spec.ts +17 -0
  35. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/eslint.config.js +124 -0
  36. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/feature-vue-authentication.uibundle-meta.xml +7 -0
  37. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/index.html +12 -0
  38. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/package.json +74 -0
  39. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/playwright.config.ts +24 -0
  40. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/scripts/get-graphql-schema.mjs +71 -0
  41. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/scripts/rewrite-e2e-assets.mjs +23 -0
  42. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/App.vue +5 -0
  43. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/api/graphqlClient.ts +44 -0
  44. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/appLayout.vue +80 -0
  45. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/alerts/status-alert.vue +59 -0
  46. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/layouts/card-layout.vue +30 -0
  47. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/Alert.vue +21 -0
  48. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/AlertAction.vue +17 -0
  49. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/AlertDescription.vue +22 -0
  50. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/AlertTitle.vue +22 -0
  51. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/alert/index.ts +25 -0
  52. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/Avatar.vue +23 -0
  53. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/AvatarFallback.vue +31 -0
  54. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/AvatarImage.vue +16 -0
  55. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/avatar/index.ts +3 -0
  56. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/button/Button.vue +33 -0
  57. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/button/index.ts +43 -0
  58. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/Card.vue +29 -0
  59. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardAction.vue +22 -0
  60. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardContent.vue +17 -0
  61. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardDescription.vue +17 -0
  62. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardFooter.vue +22 -0
  63. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardHeader.vue +22 -0
  64. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/CardTitle.vue +22 -0
  65. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/card/index.ts +7 -0
  66. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/checkbox/Checkbox.vue +43 -0
  67. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/checkbox/index.ts +1 -0
  68. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/Collapsible.vue +19 -0
  69. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/CollapsibleContent.vue +12 -0
  70. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/CollapsibleTrigger.vue +12 -0
  71. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/collapsible/index.ts +3 -0
  72. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/Dialog.vue +15 -0
  73. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogClose.vue +12 -0
  74. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogContent.vue +59 -0
  75. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogDescription.vue +31 -0
  76. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogFooter.vue +33 -0
  77. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogHeader.vue +17 -0
  78. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogOverlay.vue +31 -0
  79. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogPortal.vue +12 -0
  80. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogTitle.vue +26 -0
  81. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/DialogTrigger.vue +12 -0
  82. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dialog/index.ts +10 -0
  83. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
  84. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +51 -0
  85. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuContent.vue +47 -0
  86. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +12 -0
  87. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuItem.vue +44 -0
  88. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +30 -0
  89. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuPortal.vue +12 -0
  90. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
  91. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +52 -0
  92. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +26 -0
  93. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +19 -0
  94. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
  95. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +37 -0
  96. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +38 -0
  97. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
  98. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/dropdown-menu/index.ts +15 -0
  99. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/Field.vue +27 -0
  100. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldContent.vue +22 -0
  101. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldDescription.vue +24 -0
  102. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldError.vue +48 -0
  103. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldGroup.vue +22 -0
  104. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldLabel.vue +24 -0
  105. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldLegend.vue +29 -0
  106. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldSeparator.vue +31 -0
  107. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldSet.vue +22 -0
  108. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/FieldTitle.vue +22 -0
  109. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/field/index.ts +33 -0
  110. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/index.ts +115 -0
  111. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/input/Input.vue +30 -0
  112. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/input/index.ts +1 -0
  113. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/label/Label.vue +29 -0
  114. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/label/index.ts +1 -0
  115. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/Pagination.vue +17 -0
  116. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationContent.vue +15 -0
  117. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationEllipsis.vue +23 -0
  118. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationItem.vue +7 -0
  119. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationLink.vue +31 -0
  120. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationNext.vue +29 -0
  121. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/PaginationPrevious.vue +29 -0
  122. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/pagination/index.ts +7 -0
  123. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/Popover.vue +15 -0
  124. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverAnchor.vue +12 -0
  125. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverContent.vue +44 -0
  126. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverDescription.vue +17 -0
  127. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverHeader.vue +17 -0
  128. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverTitle.vue +14 -0
  129. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/PopoverTrigger.vue +12 -0
  130. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/popover/index.ts +7 -0
  131. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/Select.vue +15 -0
  132. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectContent.vue +65 -0
  133. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectGroup.vue +26 -0
  134. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectItem.vue +41 -0
  135. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectLabel.vue +26 -0
  136. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectScrollDownButton.vue +32 -0
  137. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectScrollUpButton.vue +32 -0
  138. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectSeparator.vue +24 -0
  139. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectTrigger.vue +45 -0
  140. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/SelectValue.vue +12 -0
  141. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/select/index.ts +10 -0
  142. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/separator/Separator.vue +33 -0
  143. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/separator/index.ts +1 -0
  144. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/skeleton/Skeleton.vue +15 -0
  145. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/skeleton/index.ts +1 -0
  146. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/sonner/Sonner.vue +29 -0
  147. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/sonner/index.ts +3 -0
  148. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/spinner/Spinner.vue +17 -0
  149. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/components/ui/spinner/index.ts +1 -0
  150. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/composables/useAsyncData.ts +69 -0
  151. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/api/userProfileApi.ts +107 -0
  152. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/authHelpers.ts +78 -0
  153. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/authenticationConfig.ts +66 -0
  154. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/components/SocialLogin.vue +150 -0
  155. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/composables/useCountdownTimer.ts +246 -0
  156. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/composables/useRetryWithBackoff.ts +112 -0
  157. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/composables/useSessionTimeout.ts +244 -0
  158. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/context/authContext.ts +115 -0
  159. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/footers/FooterLink.vue +47 -0
  160. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/forms/AuthForm.vue +141 -0
  161. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/forms/SubmitButton.vue +57 -0
  162. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/EmailField.vue +46 -0
  163. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/PasswordField.vue +48 -0
  164. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/TextField.vue +106 -0
  165. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/form.ts +90 -0
  166. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/hooks/formContexts.ts +61 -0
  167. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/layout/CenteredPageLayout.vue +76 -0
  168. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/layouts/AuthAppLayout.vue +24 -0
  169. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/layouts/PrivateRouteLayout.vue +50 -0
  170. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/menu/AuthMenu.vue +143 -0
  171. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/ChangePassword.vue +122 -0
  172. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/ForgotPassword.vue +90 -0
  173. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/Login.vue +106 -0
  174. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/Profile.vue +180 -0
  175. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/Register.vue +135 -0
  176. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/pages/ResetPassword.vue +114 -0
  177. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/SessionExpiredAlert.vue +50 -0
  178. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/SessionTimeoutValidator.vue +136 -0
  179. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/SessionWarningModal.vue +151 -0
  180. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/sessionTimeService.ts +142 -0
  181. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/sessionTimeout/sessionTimeoutConfig.ts +82 -0
  182. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/utils/helpers.ts +90 -0
  183. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/features/authentication/utils/queryToSearchParams.ts +33 -0
  184. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/lib/utils.ts +6 -0
  185. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/main.ts +6 -0
  186. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/pages/Home.vue +10 -0
  187. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/pages/NotFound.vue +18 -0
  188. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/router-utils.ts +32 -0
  189. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/router.ts +90 -0
  190. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/styles/global.css +134 -0
  191. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/src/test/setup.ts +1 -0
  192. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/tsconfig.json +45 -0
  193. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/tsconfig.node.json +13 -0
  194. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/tsconfig.tsbuildinfo +1 -0
  195. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/ui-bundle.json +7 -0
  196. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/vite-env.d.ts +14 -0
  197. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/vite.config.ts +106 -0
  198. package/dist/force-app/main/default/uiBundles/feature-vue-authentication/vitest-env.d.ts +2 -0
  199. package/dist/jest.config.js +6 -0
  200. package/dist/package-lock.json +12554 -0
  201. package/dist/package.json +46 -0
  202. package/dist/scripts/apex/hello.apex +10 -0
  203. package/dist/scripts/gitignore-templates.json +4 -0
  204. package/dist/scripts/graphql-search.sh +191 -0
  205. package/dist/scripts/network-senders.mjs +84 -0
  206. package/dist/scripts/org-setup-config-schema.mjs +132 -0
  207. package/dist/scripts/org-setup-dev.mjs +114 -0
  208. package/dist/scripts/org-setup-url.mjs +108 -0
  209. package/dist/scripts/org-setup-utils.mjs +569 -0
  210. package/dist/scripts/org-setup-xml.mjs +283 -0
  211. package/dist/scripts/org-setup.config.json +5 -0
  212. package/dist/scripts/org-setup.mjs +2545 -0
  213. package/dist/scripts/sf-project-setup.mjs +103 -0
  214. package/dist/scripts/soql/account.soql +6 -0
  215. package/dist/scripts/validate-org-setup-config.mjs +38 -0
  216. package/dist/sfdx-project.json +12 -0
  217. package/package.json +44 -4
@@ -0,0 +1,47 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import type { HTMLAttributes } from "vue";
8
+ import type { RouteLocationRaw } from "vue-router";
9
+ import { RouterLink } from "vue-router";
10
+ import { cn } from "@/lib/utils";
11
+
12
+ /**
13
+ * Footer link component. The Vue analogue of the React `FooterLink`, using
14
+ * `RouterLink` in place of react-router's `Link`.
15
+ */
16
+ const props = defineProps<{
17
+ /** Link text prefix (e.g., "Don't have an account?"). */
18
+ text?: string;
19
+ /** Destination route. */
20
+ to: RouteLocationRaw;
21
+ /** Link label (e.g., "Sign up"). */
22
+ linkText: string;
23
+ /** Extra classes for the wrapping paragraph. */
24
+ class?: HTMLAttributes["class"];
25
+ }>();
26
+ </script>
27
+
28
+ <template>
29
+ <p :class="cn('w-full text-center text-sm text-muted-foreground', props.class)">
30
+ <template v-if="text">
31
+ {{ text }}<!-- Robustness: explicit non-breaking space so formatters don't strip it -->{{
32
+ "\u00a0"
33
+ }}
34
+ </template>
35
+ <RouterLink
36
+ :to="to"
37
+ :class="
38
+ cn(
39
+ 'font-medium underline hover:text-primary transition-colors',
40
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
41
+ )
42
+ "
43
+ >
44
+ {{ linkText }}
45
+ </RouterLink>
46
+ </p>
47
+ </template>
@@ -0,0 +1,141 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import { computed, useId } from "vue";
8
+ import type { RouteLocationRaw } from "vue-router";
9
+ import { FieldGroup } from "@/components/ui/field";
10
+ import StatusAlert from "@/components/alerts/status-alert.vue";
11
+ import CardLayout from "@/components/layouts/card-layout.vue";
12
+ import { useAuth } from "../context/authContext";
13
+ import { useFormContext } from "../hooks/form";
14
+ import FooterLink from "../footers/FooterLink.vue";
15
+ import SubmitButton from "./SubmitButton.vue";
16
+
17
+ /**
18
+ * Wrapper that enforces a consistent layout (Card) and error/success alert
19
+ * positioning for all authentication forms. The Vue analogue of the React
20
+ * `AuthForm`.
21
+ *
22
+ * Auth-aware behavior:
23
+ * - While auth state is loading, the submit button is disabled.
24
+ * - If the user is already authenticated, an info alert is shown and submit is
25
+ * disabled (unless `showAlreadyLoggedIn` is false).
26
+ *
27
+ * Submission goes through the enclosing `<form.AppForm>` context, as in the
28
+ * React version; the owning page passes `isSubmitting` from its form store.
29
+ * After an invalid submit, focus moves to the first invalid field unless the
30
+ * user has already moved focus elsewhere.
31
+ */
32
+ const props = withDefaults(
33
+ defineProps<{
34
+ /** Card title. */
35
+ title: string;
36
+ /** Card description. */
37
+ description: string;
38
+ /** Optional error message(s) shown in an error alert. */
39
+ error?: string | string[] | null;
40
+ /** Optional success message(s) shown in a success alert. */
41
+ success?: string | string[] | null;
42
+ /** Show the "already logged in" alert and disable submit when authenticated. @default true */
43
+ showAlreadyLoggedIn?: boolean;
44
+ /** Submit button text. */
45
+ submitText: string;
46
+ /** Submit button loading text. */
47
+ submitLoadingText?: string;
48
+ /** Externally-driven submit disabled state. */
49
+ submitDisabled?: boolean;
50
+ /** Whether the form is currently submitting. */
51
+ isSubmitting?: boolean;
52
+ /** Optional footer navigation link. */
53
+ footerText?: string;
54
+ footerLink?: RouteLocationRaw;
55
+ footerLinkText?: string;
56
+ }>(),
57
+ {
58
+ showAlreadyLoggedIn: true,
59
+ submitDisabled: false,
60
+ isSubmitting: false,
61
+ },
62
+ );
63
+
64
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
+ const form = useFormContext<any>();
66
+ const { isAuthenticated, loading } = useAuth();
67
+
68
+ const id = useId();
69
+
70
+ const showAuthAlert = computed(() => props.showAlreadyLoggedIn && isAuthenticated.value);
71
+ const isSubmitDisabled = computed(
72
+ () => props.submitDisabled || showAuthAlert.value || loading.value,
73
+ );
74
+
75
+ const hasError = computed(() =>
76
+ Array.isArray(props.error) ? props.error.length > 0 : !!props.error,
77
+ );
78
+ const hasSuccess = computed(() =>
79
+ Array.isArray(props.success) ? props.success.length > 0 : !!props.success,
80
+ );
81
+
82
+ async function onSubmit(event: Event): Promise<void> {
83
+ const formElement = event.currentTarget as HTMLFormElement;
84
+ const previousFocus = document.activeElement;
85
+ await form.handleSubmit();
86
+ if (!form.state.isValid) {
87
+ requestAnimationFrame(() => {
88
+ if (formElement.isConnected && document.activeElement === previousFocus) {
89
+ formElement.querySelector<HTMLElement>('[aria-invalid="true"]:not(:disabled)')?.focus();
90
+ }
91
+ });
92
+ }
93
+ }
94
+ </script>
95
+
96
+ <template>
97
+ <CardLayout :title="title" :description="description">
98
+ <h1 class="sr-only">{{ title }}</h1>
99
+ <div class="space-y-6">
100
+ <!-- Auth status alert for authenticated users on public pages -->
101
+ <StatusAlert v-if="showAuthAlert" variant="info">You are already logged in.</StatusAlert>
102
+ <!-- Global form error alert (e.g. "Invalid Credentials"). Slot wins over the prop. -->
103
+ <StatusAlert v-if="$slots.error || hasError" variant="error">
104
+ <slot v-if="$slots.error" name="error" />
105
+ <ul v-else-if="Array.isArray(error)">
106
+ <li v-for="(msg, i) in error" :key="i">{{ msg }}</li>
107
+ </ul>
108
+ <template v-else>{{ error }}</template>
109
+ </StatusAlert>
110
+ <!-- Global success alert. Slot wins over the prop. -->
111
+ <StatusAlert v-if="$slots.success || hasSuccess" variant="success">
112
+ <slot v-if="$slots.success" name="success" />
113
+ <ul v-else-if="Array.isArray(success)">
114
+ <li v-for="(msg, i) in success" :key="i">{{ msg }}</li>
115
+ </ul>
116
+ <template v-else>{{ success }}</template>
117
+ </StatusAlert>
118
+
119
+ <form :id="id" @submit.prevent.stop="onSubmit">
120
+ <FieldGroup>
121
+ <slot />
122
+ </FieldGroup>
123
+ <SubmitButton
124
+ :form="id"
125
+ :label="submitText"
126
+ :loading-label="submitLoadingText"
127
+ :is-submitting="isSubmitting"
128
+ :disabled="isSubmitDisabled"
129
+ class="mt-6"
130
+ />
131
+ </form>
132
+ <!-- Navigation links (e.g. "Forgot Password?") -->
133
+ <FooterLink
134
+ v-if="footerLink"
135
+ :text="footerText"
136
+ :to="footerLink"
137
+ :link-text="footerLinkText ?? ''"
138
+ />
139
+ </div>
140
+ </CardLayout>
141
+ </template>
@@ -0,0 +1,57 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import type { HTMLAttributes } from "vue";
8
+ import { Button } from "@/components/ui/button";
9
+ import { Spinner } from "@/components/ui/spinner";
10
+ import { cn } from "@/lib/utils";
11
+
12
+ /**
13
+ * Submit button that reflects the form's submission state.
14
+ *
15
+ * The Vue analogue of the React `SubmitButton`. Because TanStack Form's
16
+ * submission state is exposed reactively via the form store, the owning page
17
+ * passes `isSubmitting` in rather than the button subscribing itself — this
18
+ * keeps the component free of a hard dependency on a specific form instance.
19
+ *
20
+ * UX best practice:
21
+ * 1. Disables interaction while submitting to prevent double-submission.
22
+ * 2. Provides immediate visual feedback (Spinner).
23
+ */
24
+ const props = withDefaults(
25
+ defineProps<{
26
+ /** Button text when not submitting. */
27
+ label: string;
28
+ /** Button text while submitting. @default "Submitting…" */
29
+ loadingLabel?: string;
30
+ /** Form id to associate with (for buttons outside the form element). */
31
+ form?: string;
32
+ /** Whether the form is currently submitting. */
33
+ isSubmitting?: boolean;
34
+ /** Externally-driven disabled state (combined with isSubmitting). */
35
+ disabled?: boolean;
36
+ /** Extra classes. */
37
+ class?: HTMLAttributes["class"];
38
+ }>(),
39
+ {
40
+ loadingLabel: "Submitting…",
41
+ isSubmitting: false,
42
+ disabled: false,
43
+ },
44
+ );
45
+ </script>
46
+
47
+ <template>
48
+ <Button
49
+ type="submit"
50
+ :form="form"
51
+ :class="cn('w-full', props.class)"
52
+ :disabled="isSubmitting || disabled"
53
+ >
54
+ <Spinner v-if="isSubmitting" class="mr-2" aria-hidden="true" />
55
+ {{ isSubmitting ? loadingLabel : label }}
56
+ </Button>
57
+ </template>
@@ -0,0 +1,46 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import type { HTMLAttributes } from "vue";
8
+ import { AUTH_PLACEHOLDERS } from "../authenticationConfig";
9
+ import TextField from "./TextField.vue";
10
+
11
+ /**
12
+ * Email field with a preset type and autocomplete.
13
+ * The Vue analogue of the React `EmailField` field component.
14
+ */
15
+ withDefaults(
16
+ defineProps<{
17
+ label: string;
18
+ id?: string;
19
+ description?: string;
20
+ placeholder?: string;
21
+ disabled?: boolean;
22
+ class?: HTMLAttributes["class"];
23
+ }>(),
24
+ {
25
+ placeholder: AUTH_PLACEHOLDERS.EMAIL,
26
+ disabled: false,
27
+ },
28
+ );
29
+ </script>
30
+
31
+ <template>
32
+ <TextField
33
+ :label="label"
34
+ :id="id"
35
+ :description="description"
36
+ type="email"
37
+ autocomplete="username"
38
+ :placeholder="placeholder"
39
+ :disabled="disabled"
40
+ :class="$props.class"
41
+ >
42
+ <template v-if="$slots.labelAction" #labelAction>
43
+ <slot name="labelAction" />
44
+ </template>
45
+ </TextField>
46
+ </template>
@@ -0,0 +1,48 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import type { HTMLAttributes } from "vue";
8
+ import { AUTH_PLACEHOLDERS } from "../authenticationConfig";
9
+ import TextField from "./TextField.vue";
10
+
11
+ /**
12
+ * Password field with a preset type and autocomplete.
13
+ * The Vue analogue of the React `PasswordField` field component.
14
+ */
15
+ withDefaults(
16
+ defineProps<{
17
+ label: string;
18
+ id?: string;
19
+ description?: string;
20
+ autocomplete?: string;
21
+ placeholder?: string;
22
+ disabled?: boolean;
23
+ class?: HTMLAttributes["class"];
24
+ }>(),
25
+ {
26
+ autocomplete: "current-password",
27
+ placeholder: AUTH_PLACEHOLDERS.PASSWORD,
28
+ disabled: false,
29
+ },
30
+ );
31
+ </script>
32
+
33
+ <template>
34
+ <TextField
35
+ :label="label"
36
+ :id="id"
37
+ :description="description"
38
+ type="password"
39
+ :autocomplete="autocomplete"
40
+ :placeholder="placeholder"
41
+ :disabled="disabled"
42
+ :class="$props.class"
43
+ >
44
+ <template v-if="$slots.labelAction" #labelAction>
45
+ <slot name="labelAction" />
46
+ </template>
47
+ </TextField>
48
+ </template>
@@ -0,0 +1,106 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import { computed, useId, type HTMLAttributes } from "vue";
8
+ import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/ui/field";
9
+ import { Input } from "@/components/ui/input";
10
+ import { cn } from "@/lib/utils";
11
+ import { useFieldContext } from "./formContexts";
12
+
13
+ /**
14
+ * Reusable text field bound to the current TanStack Form field context.
15
+ * The Vue analogue of the React `TextField` field component: renders a label,
16
+ * optional description, an input wired to the field, and deduplicated errors
17
+ * once the field has been blurred or the form submitted.
18
+ */
19
+ const props = withDefaults(
20
+ defineProps<{
21
+ /** Field label text. */
22
+ label: string;
23
+ /** Optional explicit id; falls back to a generated id. */
24
+ id?: string;
25
+ /** Optional description text rendered under the label. */
26
+ description?: string;
27
+ /** Input type. @default "text" */
28
+ type?: string;
29
+ /** Placeholder text. */
30
+ placeholder?: string;
31
+ /** Autocomplete hint. */
32
+ autocomplete?: string;
33
+ /** Whether the input is disabled. */
34
+ disabled?: boolean;
35
+ /** Extra classes for the input. */
36
+ class?: HTMLAttributes["class"];
37
+ }>(),
38
+ {
39
+ type: "text",
40
+ disabled: false,
41
+ },
42
+ );
43
+
44
+ const field = useFieldContext<string>();
45
+
46
+ const generatedId = useId();
47
+ const id = computed(() => props.id ?? generatedId);
48
+ const descriptionId = computed(() => `${id.value}-description`);
49
+ const errorId = computed(() => `${id.value}-error`);
50
+
51
+ // Submitted fields can be invalid before their first blur.
52
+ const isInvalid = computed(
53
+ () =>
54
+ (field.state.value.meta.isBlurred || field.submissionAttempts.value > 0) &&
55
+ field.state.value.meta.errors.length > 0,
56
+ );
57
+
58
+ // Deduplicate errors by message.
59
+ const uniqueErrors = computed(() => {
60
+ const errors = field.state.value.meta.errors as Array<{ message?: string } | undefined>;
61
+ return [...new Map(errors.map((error) => [error?.message, error])).values()];
62
+ });
63
+
64
+ const describedBy = computed(
65
+ () => cn(props.description && descriptionId.value, isInvalid.value && errorId.value) || undefined,
66
+ );
67
+
68
+ function onInput(event: Event): void {
69
+ field.handleChange((event.target as HTMLInputElement).value);
70
+ }
71
+ </script>
72
+
73
+ <template>
74
+ <Field :data-invalid="isInvalid">
75
+ <div class="flex items-center">
76
+ <FieldLabel :for="id">{{ label }}</FieldLabel>
77
+ <div v-if="$slots.labelAction" class="ml-auto">
78
+ <slot name="labelAction" />
79
+ </div>
80
+ </div>
81
+ <FieldDescription v-if="description" :id="descriptionId">
82
+ {{ description }}
83
+ </FieldDescription>
84
+ <Input
85
+ :id="id"
86
+ :name="field.name"
87
+ :type="type"
88
+ :model-value="field.state.value.value ?? ''"
89
+ :placeholder="placeholder"
90
+ :autocomplete="autocomplete"
91
+ :disabled="disabled"
92
+ :aria-invalid="isInvalid"
93
+ :aria-describedby="describedBy"
94
+ :class="props.class"
95
+ @blur="field.handleBlur"
96
+ @input="onInput"
97
+ />
98
+ <!-- After a submit, focus moves to the field, so the error is read as its description rather than announced. -->
99
+ <FieldError
100
+ v-if="isInvalid && uniqueErrors.length > 0"
101
+ :id="errorId"
102
+ :errors="uniqueErrors"
103
+ :role="field.submissionAttempts.value > 0 ? undefined : 'alert'"
104
+ />
105
+ </Field>
106
+ </template>
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { computed, defineComponent, provide, type Component } from "vue";
7
+ import { useField, useForm } from "@tanstack/vue-form";
8
+ import { fieldContext, formContext, type FieldContext } from "./formContexts";
9
+ import EmailField from "./EmailField.vue";
10
+ import PasswordField from "./PasswordField.vue";
11
+ import TextField from "./TextField.vue";
12
+
13
+ /**
14
+ * App form hook wiring the shared field components into TanStack Form.
15
+ *
16
+ * `@tanstack/vue-form` does not ship `createFormHook` (that composition helper
17
+ * lives only in `@tanstack/react-form`). This is the Vue-native equivalent: it
18
+ * wraps the real `useForm`/`useField` composables and augments the returned
19
+ * form with `AppForm`/`AppField` render components that `provide` the shared
20
+ * contexts consumed by the field SFCs.
21
+ *
22
+ * Usage in a page's `<script setup>`:
23
+ * const form = useAppForm({ defaultValues: { email: "" }, onSubmit: ... });
24
+ * // In template: <form.AppField name="email">...</form.AppField>
25
+ */
26
+ function createFormHook(config: {
27
+ fieldComponents: Record<string, Component>;
28
+ formComponents?: Record<string, Component>;
29
+ }) {
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ function useAppForm(opts: any): any {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ const form: any = useForm(opts);
34
+
35
+ form.AppForm = defineComponent({
36
+ name: "AppForm",
37
+ inheritAttrs: false,
38
+ setup(_props, { slots }) {
39
+ provide(formContext, form);
40
+ return () => slots.default?.();
41
+ },
42
+ });
43
+
44
+ form.AppField = defineComponent({
45
+ name: "AppField",
46
+ inheritAttrs: false,
47
+ props: { name: { type: String, required: true } },
48
+ setup(props, { slots }) {
49
+ const field = useField({ form, name: props.name });
50
+ const submissionAttempts = form.useStore(
51
+ (state: { submissionAttempts: number }) => state.submissionAttempts,
52
+ );
53
+ const context: FieldContext = {
54
+ name: props.name,
55
+ handleChange: (value: unknown) => field.api.handleChange(value),
56
+ handleBlur: () => field.api.handleBlur(),
57
+ state: computed(() => field.state),
58
+ submissionAttempts,
59
+ };
60
+ provide(fieldContext, context);
61
+ return () => slots.default?.(config.fieldComponents);
62
+ },
63
+ });
64
+
65
+ return form;
66
+ }
67
+
68
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
+ function withForm(options: any): any {
70
+ return options?.render ?? options;
71
+ }
72
+
73
+ return { useAppForm, withForm };
74
+ }
75
+
76
+ /**
77
+ * Field components, for use as a namespace in page templates:
78
+ * <form.AppField name="email"><fields.EmailField label="Email" /></form.AppField>
79
+ * Vue only resolves dotted tags (`<fields.EmailField>`) against `<script setup>`
80
+ * bindings, not slot-scope variables, so pages import this rather than reading
81
+ * the components off the `AppField` slot props as the React version does.
82
+ */
83
+ export const fields = { TextField, PasswordField, EmailField };
84
+
85
+ export const { useAppForm, withForm } = createFormHook({
86
+ fieldComponents: fields,
87
+ formComponents: {},
88
+ });
89
+
90
+ export { useFormContext, useFieldContext } from "./formContexts";
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { inject, type ComputedRef, type InjectionKey, type Ref } from "vue";
7
+
8
+ /**
9
+ * Shared form/field contexts for the auth form components.
10
+ *
11
+ * Split into its own module so the reusable field SFCs (TextField, etc.) can
12
+ * import `useFieldContext` without creating an import cycle with `form.ts`,
13
+ * which wires those same components into `createFormHook`.
14
+ *
15
+ * `@tanstack/vue-form` does not ship the `createFormHookContexts` composition
16
+ * helper (that lives only in `@tanstack/react-form`). This is the Vue-native
17
+ * equivalent built on `provide`/`inject`: `form.ts` provides these contexts and
18
+ * the field SFCs inject them.
19
+ */
20
+ export interface FieldMeta {
21
+ isBlurred: boolean;
22
+ isTouched: boolean;
23
+ isDirty: boolean;
24
+ errors: Array<{ message?: string } | undefined>;
25
+ [key: string]: unknown;
26
+ }
27
+
28
+ export interface FieldContext<TData = unknown> {
29
+ name: string;
30
+ handleChange: (updater: TData) => void;
31
+ handleBlur: () => void;
32
+ state: ComputedRef<{ value: TData; meta: FieldMeta }>;
33
+ /** Number of times the owning form has been submitted. */
34
+ submissionAttempts: Readonly<Ref<number>>;
35
+ }
36
+
37
+ export function createFormHookContexts() {
38
+ const fieldContext: InjectionKey<FieldContext> = Symbol("auth.fieldContext");
39
+ const formContext: InjectionKey<unknown> = Symbol("auth.formContext");
40
+
41
+ function useFieldContext<TData = unknown>(): FieldContext<TData> {
42
+ const context = inject(fieldContext);
43
+ if (!context) {
44
+ throw new Error("useFieldContext must be called within a <form.AppField> slot");
45
+ }
46
+ return context as FieldContext<TData>;
47
+ }
48
+
49
+ function useFormContext<TForm = unknown>(): TForm {
50
+ const context = inject(formContext);
51
+ if (!context) {
52
+ throw new Error("useFormContext must be called within a <form.AppForm> slot");
53
+ }
54
+ return context as TForm;
55
+ }
56
+
57
+ return { fieldContext, formContext, useFieldContext, useFormContext };
58
+ }
59
+
60
+ export const { fieldContext, formContext, useFieldContext, useFormContext } =
61
+ createFormHookContexts();
@@ -0,0 +1,76 @@
1
+ <!--
2
+ Copyright (c) 2026, Salesforce, Inc.,
3
+ All rights reserved.
4
+ For full license text, see the LICENSE.txt file
5
+ -->
6
+ <script setup lang="ts">
7
+ import { cva, type VariantProps } from "class-variance-authority";
8
+ import type { HTMLAttributes } from "vue";
9
+ import { computed, watchEffect } from "vue";
10
+ import { cn } from "@/lib/utils";
11
+
12
+ /**
13
+ * Variant styles for the content container's maximum width.
14
+ */
15
+ const contentContainerVariants = cva("w-full", {
16
+ variants: {
17
+ contentMaxWidth: {
18
+ sm: "max-w-sm",
19
+ md: "max-w-md",
20
+ lg: "max-w-lg",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ contentMaxWidth: "sm",
25
+ },
26
+ });
27
+
28
+ type ContentMaxWidth = VariantProps<typeof contentContainerVariants>["contentMaxWidth"];
29
+
30
+ /**
31
+ * Full-viewport-height container that centers its content horizontally.
32
+ *
33
+ * The Vue analogue of the React `CenteredPageLayout`. By default content is
34
+ * top-aligned; set `topAligned={false}` to vertically center instead. When a
35
+ * `title` is provided it is applied to `document.title` (React renders a
36
+ * `<title>` element that it hoists to the head — Vue sets it imperatively).
37
+ */
38
+ const props = withDefaults(
39
+ defineProps<{
40
+ /** Maximum width of the content container. @default "sm" */
41
+ contentMaxWidth?: ContentMaxWidth;
42
+ /** Optional page title applied to document.title. */
43
+ title?: string;
44
+ /** When true, content is aligned to the top instead of vertically centered. @default true */
45
+ topAligned?: boolean;
46
+ /** Extra classes for the <main> element. */
47
+ class?: HTMLAttributes["class"];
48
+ }>(),
49
+ {
50
+ contentMaxWidth: "sm",
51
+ topAligned: true,
52
+ },
53
+ );
54
+
55
+ watchEffect(() => {
56
+ if (props.title) {
57
+ document.title = props.title;
58
+ }
59
+ });
60
+
61
+ const mainClass = computed(() =>
62
+ cn(
63
+ "flex min-h-svh w-full justify-center p-6 md:p-10",
64
+ props.topAligned ? "items-start" : "items-center",
65
+ props.class,
66
+ ),
67
+ );
68
+ </script>
69
+
70
+ <template>
71
+ <main :class="mainClass" data-slot="page-layout">
72
+ <div :class="contentContainerVariants({ contentMaxWidth })">
73
+ <slot />
74
+ </div>
75
+ </main>
76
+ </template>