@salesforce/ui-bundle-template-app-angular-template-b2e 11.30.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 (161) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/.forceignore +15 -0
  3. package/dist/.husky/pre-commit +4 -0
  4. package/dist/.prettierignore +11 -0
  5. package/dist/.prettierrc +17 -0
  6. package/dist/CHANGELOG.md +3966 -0
  7. package/dist/README.md +77 -0
  8. package/dist/config/project-scratch-def.json +13 -0
  9. package/dist/eslint.config.js +7 -0
  10. package/dist/force-app/main/default/applications/angularinternalapp.app-meta.xml +17 -0
  11. package/dist/force-app/main/default/permissionsets/angularinternalapp_Access.permissionset-meta.xml +13 -0
  12. package/dist/force-app/main/default/uiBundles/angularinternalapp/.forceignore +15 -0
  13. package/dist/force-app/main/default/uiBundles/angularinternalapp/.postcssrc.json +5 -0
  14. package/dist/force-app/main/default/uiBundles/angularinternalapp/.prettierignore +8 -0
  15. package/dist/force-app/main/default/uiBundles/angularinternalapp/.prettierrc +12 -0
  16. package/dist/force-app/main/default/uiBundles/angularinternalapp/CHANGELOG.md +4 -0
  17. package/dist/force-app/main/default/uiBundles/angularinternalapp/README.md +85 -0
  18. package/dist/force-app/main/default/uiBundles/angularinternalapp/angular.json +98 -0
  19. package/dist/force-app/main/default/uiBundles/angularinternalapp/angularinternalapp.uibundle-meta.xml +8 -0
  20. package/dist/force-app/main/default/uiBundles/angularinternalapp/e2e/app.spec.ts +15 -0
  21. package/dist/force-app/main/default/uiBundles/angularinternalapp/esbuild/api-version.mjs +17 -0
  22. package/dist/force-app/main/default/uiBundles/angularinternalapp/eslint.config.js +60 -0
  23. package/dist/force-app/main/default/uiBundles/angularinternalapp/middleware/html.mjs +3 -0
  24. package/dist/force-app/main/default/uiBundles/angularinternalapp/middleware/proxy.mjs +12 -0
  25. package/dist/force-app/main/default/uiBundles/angularinternalapp/package.json +57 -0
  26. package/dist/force-app/main/default/uiBundles/angularinternalapp/playwright.config.ts +25 -0
  27. package/dist/force-app/main/default/uiBundles/angularinternalapp/public/favicon.ico +0 -0
  28. package/dist/force-app/main/default/uiBundles/angularinternalapp/scripts/rewrite-e2e-assets.mjs +30 -0
  29. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/account/account-search.service.ts +196 -0
  30. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/account/distinctAccountIndustries.ts +26 -0
  31. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/account/distinctAccountTypes.ts +26 -0
  32. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/account/getAccountDetail.ts +128 -0
  33. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/account/searchAccounts.ts +58 -0
  34. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/data-client.service.spec.ts +184 -0
  35. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/api/data-client.service.ts +74 -0
  36. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/app.config.ts +22 -0
  37. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/app.html +1 -0
  38. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/app.routes.ts +31 -0
  39. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/app.spec.ts +18 -0
  40. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/app.ts +15 -0
  41. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/layout/app-layout/app-layout.component.html +52 -0
  42. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/layout/app-layout/app-layout.component.spec.ts +90 -0
  43. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/layout/app-layout/app-layout.component.ts +67 -0
  44. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/_field-size.scss +42 -0
  45. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/alert/alert.component.html +31 -0
  46. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/alert/alert.component.ts +53 -0
  47. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/button/button.component.html +18 -0
  48. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/button/button.component.scss +112 -0
  49. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/button/button.component.ts +57 -0
  50. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/card/card.component.scss +34 -0
  51. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/card/card.component.ts +110 -0
  52. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/collapsible/collapsible.component.html +10 -0
  53. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/collapsible/collapsible.component.ts +26 -0
  54. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/date-picker/date-picker.component.html +25 -0
  55. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/date-picker/date-picker.component.scss +36 -0
  56. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/date-picker/date-picker.component.ts +41 -0
  57. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/date-range-picker/date-range-picker.component.html +34 -0
  58. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/date-range-picker/date-range-picker.component.scss +33 -0
  59. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/date-range-picker/date-range-picker.component.ts +66 -0
  60. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/dialog/dialog.component.html +37 -0
  61. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/dialog/dialog.component.ts +55 -0
  62. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/field/field.component.html +21 -0
  63. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/field/field.component.ts +36 -0
  64. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/field-size.ts +8 -0
  65. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/input/input.component.html +19 -0
  66. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/input/input.component.scss +35 -0
  67. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/input/input.component.ts +36 -0
  68. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/label/label.component.html +3 -0
  69. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/label/label.component.ts +17 -0
  70. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/paginator/paginator.component.html +10 -0
  71. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/paginator/paginator.component.ts +37 -0
  72. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/popover/popover.component.html +41 -0
  73. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/popover/popover.component.ts +40 -0
  74. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/select/select.component.html +24 -0
  75. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/select/select.component.scss +35 -0
  76. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/select/select.component.ts +72 -0
  77. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/separator/separator.component.html +1 -0
  78. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/separator/separator.component.scss +23 -0
  79. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/separator/separator.component.ts +56 -0
  80. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/skeleton/skeleton.component.html +1 -0
  81. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/skeleton/skeleton.component.scss +28 -0
  82. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/skeleton/skeleton.component.ts +24 -0
  83. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/components/ui/spinner/spinner.component.ts +35 -0
  84. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/agentforce/agentforce-conversation-client/agentforce-conversation-client.component.html +3 -0
  85. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/agentforce/agentforce-conversation-client/agentforce-conversation-client.component.ts +119 -0
  86. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/agentforce/agentforce-embed.service.ts +177 -0
  87. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/active-filters/active-filters.component.html +23 -0
  88. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/active-filters/active-filters.component.ts +78 -0
  89. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/date-filter/date-filter.component.html +18 -0
  90. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/date-filter/date-filter.component.ts +137 -0
  91. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/date-range-filter/date-range-filter.component.html +11 -0
  92. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/date-range-filter/date-range-filter.component.ts +69 -0
  93. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/filter-field-wrapper/filter-field-wrapper.component.html +11 -0
  94. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/filter-field-wrapper/filter-field-wrapper.component.ts +36 -0
  95. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/multi-select-filter/multi-select-filter.component.html +10 -0
  96. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/multi-select-filter/multi-select-filter.component.ts +58 -0
  97. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/numeric-range-filter/numeric-range-filter.component.html +22 -0
  98. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/numeric-range-filter/numeric-range-filter.component.ts +146 -0
  99. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/search-filter/search-filter.component.html +8 -0
  100. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/search-filter/search-filter.component.ts +82 -0
  101. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/select-filter/select-filter.component.html +12 -0
  102. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/select-filter/select-filter.component.ts +65 -0
  103. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/text-filter/text-filter.component.html +12 -0
  104. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/filters/text-filter/text-filter.component.ts +90 -0
  105. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/object-breadcrumb/object-breadcrumb.component.html +55 -0
  106. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/object-breadcrumb/object-breadcrumb.component.ts +40 -0
  107. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/pagination-controls/pagination-controls.component.html +8 -0
  108. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/pagination-controls/pagination-controls.component.ts +61 -0
  109. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/search-bar/search-bar.component.html +59 -0
  110. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/search-bar/search-bar.component.ts +108 -0
  111. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/sort-control/sort-control.component.html +50 -0
  112. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/components/sort-control/sort-control.component.ts +72 -0
  113. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/object-search-state.service.ts +232 -0
  114. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/utils/debounce.ts +31 -0
  115. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/utils/field-utils.ts +54 -0
  116. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/utils/filter-utils.ts +354 -0
  117. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/utils/index.ts +12 -0
  118. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/features/object-search/utils/sort-utils.ts +46 -0
  119. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/account-detail/account-detail-page.component.html +174 -0
  120. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/account-detail/account-detail-page.component.scss +7 -0
  121. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/account-detail/account-detail-page.component.ts +199 -0
  122. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/account-search/account-search-page.component.html +111 -0
  123. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/account-search/account-search-page.component.ts +217 -0
  124. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/home/home-page.component.html +18 -0
  125. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/home/home-page.component.ts +47 -0
  126. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/home/home.component.html +6 -0
  127. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/home/home.component.spec.ts +23 -0
  128. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/home/home.component.ts +13 -0
  129. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/not-found/not-found.component.html +12 -0
  130. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/not-found/not-found.component.spec.ts +33 -0
  131. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/pages/not-found/not-found.component.ts +15 -0
  132. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/types/conversation.ts +55 -0
  133. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/types/globals.d.ts +13 -0
  134. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/app/utils/async-data.ts +99 -0
  135. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/index.html +14 -0
  136. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/index.ts +15 -0
  137. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/main.ts +5 -0
  138. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/styles.scss +170 -0
  139. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/theme.scss +39 -0
  140. package/dist/force-app/main/default/uiBundles/angularinternalapp/src/types/sf-globals.d.ts +9 -0
  141. package/dist/force-app/main/default/uiBundles/angularinternalapp/tsconfig.app.json +11 -0
  142. package/dist/force-app/main/default/uiBundles/angularinternalapp/tsconfig.json +33 -0
  143. package/dist/force-app/main/default/uiBundles/angularinternalapp/tsconfig.spec.json +10 -0
  144. package/dist/force-app/main/default/uiBundles/angularinternalapp/ui-bundle.json +7 -0
  145. package/dist/jest.config.js +6 -0
  146. package/dist/package-lock.json +10066 -0
  147. package/dist/package.json +46 -0
  148. package/dist/scripts/apex/hello.apex +10 -0
  149. package/dist/scripts/gitignore-templates.json +4 -0
  150. package/dist/scripts/graphql-search.sh +191 -0
  151. package/dist/scripts/org-setup-config-schema.mjs +103 -0
  152. package/dist/scripts/org-setup-dev.mjs +87 -0
  153. package/dist/scripts/org-setup-utils.mjs +369 -0
  154. package/dist/scripts/org-setup-xml.mjs +182 -0
  155. package/dist/scripts/org-setup.config.json +9 -0
  156. package/dist/scripts/org-setup.mjs +1702 -0
  157. package/dist/scripts/sf-project-setup.mjs +103 -0
  158. package/dist/scripts/soql/account.soql +6 -0
  159. package/dist/scripts/validate-org-setup-config.mjs +38 -0
  160. package/dist/sfdx-project.json +12 -0
  161. package/package.json +40 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
7
+ import { provideRouter } from '@angular/router';
8
+ import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
9
+ import { provideNativeDateAdapter } from '@angular/material/core';
10
+
11
+ import { routes } from './app.routes';
12
+
13
+ export const appConfig: ApplicationConfig = {
14
+ providers: [
15
+ provideBrowserGlobalErrorListeners(),
16
+ provideRouter(routes),
17
+ provideAnimationsAsync(),
18
+ // Enables mat-datepicker (used by the object-search Date / DateRange
19
+ // filters) with the browser's native Date, avoiding a moment/luxon dep.
20
+ provideNativeDateAdapter(),
21
+ ],
22
+ };
@@ -0,0 +1,31 @@
1
+ import { Routes } from '@angular/router';
2
+ import { AppLayoutComponent } from './components/layout/app-layout/app-layout.component';
3
+ import { NotFoundComponent } from './pages/not-found/not-found.component';
4
+ import { HomePageComponent } from "./pages/home/home-page.component";
5
+ import { AccountSearchPageComponent } from "./pages/account-search/account-search-page.component";
6
+ import { AccountDetailPageComponent } from "./pages/account-detail/account-detail-page.component";
7
+ export const routes: Routes = [
8
+ {
9
+ path: "",
10
+ component: AppLayoutComponent,
11
+ children: [
12
+ {
13
+ path: "",
14
+ component: HomePageComponent,
15
+ data: { showInNavigation: true, label: "Home" }
16
+ },
17
+ {
18
+ path: "accounts/:recordId",
19
+ component: AccountDetailPageComponent
20
+ },
21
+ {
22
+ path: "accounts",
23
+ component: AccountSearchPageComponent
24
+ },
25
+ {
26
+ path: '**',
27
+ component: NotFoundComponent
28
+ }
29
+ ]
30
+ }
31
+ ];
@@ -0,0 +1,18 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { provideRouter } from '@angular/router';
3
+ import { App } from './app';
4
+
5
+ describe('App', () => {
6
+ beforeEach(async () => {
7
+ await TestBed.configureTestingModule({
8
+ imports: [App],
9
+ providers: [provideRouter([])],
10
+ }).compileComponents();
11
+ });
12
+
13
+ it('should create the app', () => {
14
+ const fixture = TestBed.createComponent(App);
15
+ const app = fixture.componentInstance;
16
+ expect(app).toBeTruthy();
17
+ });
18
+ });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
7
+ import { RouterOutlet } from '@angular/router';
8
+
9
+ @Component({
10
+ selector: 'app-root',
11
+ changeDetection: ChangeDetectionStrategy.OnPush,
12
+ imports: [RouterOutlet],
13
+ templateUrl: './app.html',
14
+ })
15
+ export class App {}
@@ -0,0 +1,52 @@
1
+ <nav class="bg-white border-b border-gray-200">
2
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
3
+ <div class="flex justify-between items-center h-16">
4
+ <a routerLink="/" class="text-xl font-semibold text-gray-900"> Angular App </a>
5
+ <button
6
+ (click)="toggleMenu()"
7
+ class="p-2 rounded-md text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"
8
+ aria-label="Toggle menu"
9
+ aria-controls="app-layout-nav-menu"
10
+ [attr.aria-expanded]="isOpen()"
11
+ >
12
+ <div class="w-6 h-6 flex flex-col justify-center space-y-1.5">
13
+ <span
14
+ class="block h-0.5 w-6 bg-current transition-all"
15
+ [class.rotate-45]="isOpen()"
16
+ [class.translate-y-2]="isOpen()"
17
+ ></span>
18
+ <span
19
+ class="block h-0.5 w-6 bg-current transition-all"
20
+ [class.opacity-0]="isOpen()"
21
+ ></span>
22
+ <span
23
+ class="block h-0.5 w-6 bg-current transition-all"
24
+ [class.-rotate-45]="isOpen()"
25
+ [class.-translate-y-2]="isOpen()"
26
+ ></span>
27
+ </div>
28
+ </button>
29
+ </div>
30
+ @if (isOpen()) {
31
+ <div id="app-layout-nav-menu" class="pb-4">
32
+ <ul class="flex flex-col space-y-2 list-none">
33
+ @for (item of navigationItems(); track item.path) {
34
+ <li>
35
+ <a
36
+ [routerLink]="item.path"
37
+ routerLinkActive="bg-blue-100 text-blue-700"
38
+ [routerLinkActiveOptions]="{ exact: true }"
39
+ (click)="closeMenu()"
40
+ class="block px-3 py-2 rounded-md text-sm font-medium transition-colors text-gray-700 hover:bg-gray-100"
41
+ >
42
+ {{ item.label }}
43
+ </a>
44
+ </li>
45
+ }
46
+ </ul>
47
+ </div>
48
+ }
49
+ </div>
50
+ </nav>
51
+ <router-outlet />
52
+ <app-agentforce-conversation-client agentId="<USER_AGENT_ID_18_CHAR_0Xx...>" />
@@ -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 { Component, input } from "@angular/core";
7
+ import { TestBed } from "@angular/core/testing";
8
+ import { provideRouter } from "@angular/router";
9
+ import { AppLayoutComponent } from "./app-layout.component";
10
+ import { AgentforceConversationClientComponent } from "../../../features/agentforce/agentforce-conversation-client/agentforce-conversation-client.component";
11
+
12
+ // Stub the Agentforce client to keep this layout test hermetic (the real one
13
+ // embeds Lightning Out on render).
14
+ @Component({ selector: "app-agentforce-conversation-client", template: "" })
15
+ class StubAgentforceConversationClientComponent {
16
+ readonly agentId = input.required<string>();
17
+ }
18
+
19
+ describe("AppLayoutComponent", () => {
20
+ beforeEach(async () => {
21
+ TestBed.configureTestingModule({
22
+ imports: [AppLayoutComponent],
23
+ providers: [
24
+ provideRouter([
25
+ {
26
+ path: "",
27
+ children: [
28
+ {
29
+ path: "accounts",
30
+ component: AppLayoutComponent,
31
+ data: { showInNavigation: true, label: "Accounts" },
32
+ },
33
+ ],
34
+ },
35
+ ]),
36
+ ],
37
+ });
38
+ TestBed.overrideComponent(AppLayoutComponent, {
39
+ remove: { imports: [AgentforceConversationClientComponent] },
40
+ add: { imports: [StubAgentforceConversationClientComponent] },
41
+ });
42
+ await TestBed.compileComponents();
43
+ });
44
+
45
+ it("should create the component", () => {
46
+ const fixture = TestBed.createComponent(AppLayoutComponent);
47
+ expect(fixture.componentInstance).toBeTruthy();
48
+ });
49
+
50
+ it("should toggle menu", () => {
51
+ const component = TestBed.createComponent(AppLayoutComponent).componentInstance;
52
+ expect(component.isOpen()).toBe(false);
53
+ component.toggleMenu();
54
+ expect(component.isOpen()).toBe(true);
55
+ component.toggleMenu();
56
+ expect(component.isOpen()).toBe(false);
57
+ });
58
+
59
+ it("should close menu", () => {
60
+ const component = TestBed.createComponent(AppLayoutComponent).componentInstance;
61
+ component.toggleMenu();
62
+ expect(component.isOpen()).toBe(true);
63
+ component.closeMenu();
64
+ expect(component.isOpen()).toBe(false);
65
+ });
66
+
67
+ it("should derive navigation items from the router config", () => {
68
+ const component = TestBed.createComponent(AppLayoutComponent).componentInstance;
69
+ const items = component.navigationItems();
70
+ expect(items.some((i) => i.path === "/accounts" && i.label === "Accounts")).toBe(true);
71
+ });
72
+
73
+ it("should render nav element", async () => {
74
+ const fixture = TestBed.createComponent(AppLayoutComponent);
75
+ await fixture.whenStable();
76
+ const compiled = fixture.nativeElement as HTMLElement;
77
+ expect(compiled.querySelector("nav")).toBeTruthy();
78
+ });
79
+
80
+ it("should set aria-expanded on toggle button", async () => {
81
+ const fixture = TestBed.createComponent(AppLayoutComponent);
82
+ await fixture.whenStable();
83
+ const button = (fixture.nativeElement as HTMLElement).querySelector("button");
84
+ expect(button?.getAttribute("aria-expanded")).toBe("false");
85
+
86
+ fixture.componentInstance.toggleMenu();
87
+ fixture.detectChanges();
88
+ expect(button?.getAttribute("aria-expanded")).toBe("true");
89
+ });
90
+ });
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { ChangeDetectionStrategy, Component, computed, inject, signal } from "@angular/core";
7
+ import { Router, RouterLink, RouterLinkActive, RouterOutlet, type Route } from "@angular/router";
8
+ import { AgentforceConversationClientComponent } from "../../../features/agentforce/agentforce-conversation-client/agentforce-conversation-client.component";
9
+
10
+ interface NavItem {
11
+ path: string;
12
+ label: string;
13
+ }
14
+
15
+ /**
16
+ * App-owned layout — overrides the base `app-layout` at compose (app copy wins).
17
+ * Angular analogue of the React internal app's `appLayout.tsx`: renders the
18
+ * floating Agentforce client after the outlet, and derives nav from the merged
19
+ * router config (routes with `data.showInNavigation`).
20
+ */
21
+ @Component({
22
+ selector: "app-layout",
23
+ changeDetection: ChangeDetectionStrategy.OnPush,
24
+ imports: [RouterOutlet, RouterLink, RouterLinkActive, AgentforceConversationClientComponent],
25
+ templateUrl: "./app-layout.component.html",
26
+ })
27
+ export class AppLayoutComponent {
28
+ private readonly router = inject(Router);
29
+
30
+ readonly isOpen = signal(false);
31
+
32
+ /** Routes flagged `data.showInNavigation` with a label, flattened. */
33
+ readonly navigationItems = computed<NavItem[]>(() =>
34
+ this.collectNavItems(this.router.config, ""),
35
+ );
36
+
37
+ private collectNavItems(routes: Route[], parentPath: string): NavItem[] {
38
+ const items: NavItem[] = [];
39
+ for (const route of routes) {
40
+ const segment = route.path ?? "";
41
+ const fullPath =
42
+ segment === ""
43
+ ? parentPath || "/"
44
+ : parentPath === "/" || parentPath === ""
45
+ ? `/${segment}`
46
+ : `${parentPath}/${segment}`;
47
+
48
+ const data = route.data as { showInNavigation?: boolean; label?: string } | undefined;
49
+ if (data?.showInNavigation === true && data.label) {
50
+ items.push({ path: fullPath, label: data.label });
51
+ }
52
+
53
+ if (route.children?.length) {
54
+ items.push(...this.collectNavItems(route.children, fullPath));
55
+ }
56
+ }
57
+ return items;
58
+ }
59
+
60
+ toggleMenu(): void {
61
+ this.isOpen.update((v) => !v);
62
+ }
63
+
64
+ closeMenu(): void {
65
+ this.isOpen.set(false);
66
+ }
67
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /*
8
+ * Shared height scale for the form-field wrappers (app-input, app-select,
9
+ * app-date-picker): sm = 24px, default = 32px, lg = 40px.
10
+ *
11
+ * Material's density scale only reaches 36px at its -5 floor, so these compact
12
+ * heights can't come from `mat.form-field-density`. Instead we set the two M3
13
+ * tokens that drive the height directly:
14
+ * --mat-form-field-container-height -> `.mat-mdc-form-field-flex` min-height
15
+ * --mat-form-field-container-vertical-padding -> infix padding-top / -bottom
16
+ *
17
+ * These are CSS custom properties, so setting them on the wrapper's own
18
+ * `mat-form-field` (an in-view element that matches under emulated
19
+ * encapsulation) is enough — they INHERIT down to Material's internal flex /
20
+ * infix elements. No `::ng-deep` and no global classes needed. This mirrors how
21
+ * `app-button` sizes work (it sets `--mat-button-*-container-height` tokens).
22
+ */
23
+ @mixin apply($height, $vertical-padding) {
24
+ --mat-form-field-container-height: #{$height};
25
+ --mat-form-field-container-vertical-padding: #{$vertical-padding};
26
+ }
27
+
28
+ /*
29
+ * Emit the three size classes. Consumers opt in via `size` on the wrapper,
30
+ * which renders `size-sm | size-default | size-lg` on the mat-form-field.
31
+ */
32
+ @mixin sizes {
33
+ .size-sm {
34
+ @include apply(1.5rem, 0.25rem); // 24px, 4px
35
+ }
36
+ .size-default {
37
+ @include apply(2rem, 0.5rem); // 32px, 8px
38
+ }
39
+ .size-lg {
40
+ @include apply(2.5rem, 0.75rem); // 40px, 12px
41
+ }
42
+ }
@@ -0,0 +1,31 @@
1
+ @if (icon()) {
2
+ <mat-icon class="row-span-2 translate-y-0.5 !size-4 !text-base leading-4" aria-hidden="true">{{
3
+ icon()
4
+ }}</mat-icon>
5
+ }
6
+
7
+ @if (title()) {
8
+ <div data-slot="alert-title" class="col-start-2 font-medium">{{ title() }}</div>
9
+ }
10
+ @if (description()) {
11
+ <div
12
+ data-slot="alert-description"
13
+ class="col-start-2 text-sm"
14
+ [class.text-muted-foreground]="variant() === 'default'"
15
+ [class.text-destructive]="variant() === 'destructive'"
16
+ >
17
+ {{ description() }}
18
+ </div>
19
+ }
20
+
21
+ <!--
22
+ Default slot for callers that project body content (e.g. app-status-alert
23
+ composing a message with a link) instead of the `description` input. Sits in
24
+ the second grid column to align with the icon. Inert when only inputs are used.
25
+ -->
26
+ <div class="col-start-2 text-sm">
27
+ <ng-content />
28
+ </div>
29
+
30
+ <!-- Optional caller-owned trailing control, pinned top-right. -->
31
+ <ng-content select="app-alert-action" />
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
7
+ import { MatIconModule } from '@angular/material/icon';
8
+
9
+ /** Visual variant. */
10
+ export type AppAlertVariant = 'default' | 'destructive';
11
+
12
+ const BASE_CLASSES =
13
+ 'relative w-full grid grid-cols-[auto_1fr] items-start gap-x-2 gap-y-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-[app-alert-action]:pr-18';
14
+ const VARIANT_CLASSES: Record<AppAlertVariant, string> = {
15
+ default: 'bg-card text-card-foreground',
16
+ destructive: 'bg-card text-destructive',
17
+ };
18
+
19
+ /** Alert banner. Optional trailing control via the `app-alert-action` slot. */
20
+ @Component({
21
+ selector: 'app-alert',
22
+ changeDetection: ChangeDetectionStrategy.OnPush,
23
+ imports: [MatIconModule],
24
+ templateUrl: './alert.component.html',
25
+ host: {
26
+ 'data-slot': 'alert',
27
+ role: 'alert',
28
+ '[class]': 'hostClass()',
29
+ },
30
+ })
31
+ export class AlertComponent {
32
+ readonly variant = input<AppAlertVariant>('default');
33
+ readonly title = input<string>('');
34
+ readonly description = input<string>('');
35
+ /** Material icon ligature name, e.g. `info`, `error`, `warning`. */
36
+ readonly icon = input<string>('');
37
+
38
+ protected readonly hostClass = computed(
39
+ () => `${BASE_CLASSES} ${VARIANT_CLASSES[this.variant()]}`,
40
+ );
41
+ }
42
+
43
+ /** Trailing action slot for `app-alert`, pinned to the top-right. */
44
+ @Component({
45
+ selector: 'app-alert-action',
46
+ changeDetection: ChangeDetectionStrategy.OnPush,
47
+ template: '<ng-content />',
48
+ host: {
49
+ 'data-slot': 'alert-action',
50
+ class: 'absolute top-2 right-2',
51
+ },
52
+ })
53
+ export class AlertActionComponent {}
@@ -0,0 +1,18 @@
1
+ <button
2
+ [matButton]="matAppearance()"
3
+ [class]="buttonClass()"
4
+ [class.destructive]="isDestructive()"
5
+ [type]="type()"
6
+ [disabled]="disabled()"
7
+ [attr.aria-label]="ariaLabel()"
8
+ [attr.aria-expanded]="ariaExpanded()"
9
+ (click)="clicked.emit($event)"
10
+ >
11
+ @if (icon()) {
12
+ <mat-icon aria-hidden="true">{{ icon() }}</mat-icon>
13
+ }
14
+ <ng-content />
15
+ @if (iconEnd()) {
16
+ <mat-icon aria-hidden="true" iconPositionEnd>{{ iconEnd() }}</mat-icon>
17
+ }
18
+ </button>
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ @use '@angular/material' as mat;
7
+
8
+ // Compact density themes — Material's canonical heights (36 / 32 / 28px).
9
+ $-lg: mat.define-theme(
10
+ (
11
+ density: (
12
+ scale: -1,
13
+ ),
14
+ )
15
+ );
16
+ $-md: mat.define-theme(
17
+ (
18
+ density: (
19
+ scale: -2,
20
+ ),
21
+ )
22
+ );
23
+ $-sm: mat.define-theme(
24
+ (
25
+ density: (
26
+ scale: -3,
27
+ ),
28
+ )
29
+ );
30
+
31
+ @mixin -height($h) {
32
+ --mat-button-filled-container-height: #{$h};
33
+ --mat-button-outlined-container-height: #{$h};
34
+ --mat-button-text-container-height: #{$h};
35
+ --mat-button-tonal-container-height: #{$h};
36
+ --mat-button-protected-container-height: #{$h};
37
+ }
38
+
39
+ @mixin -label-size($s) {
40
+ --mat-button-filled-label-text-size: #{$s};
41
+ --mat-button-outlined-label-text-size: #{$s};
42
+ --mat-button-text-label-text-size: #{$s};
43
+ --mat-button-tonal-label-text-size: #{$s};
44
+ --mat-button-protected-label-text-size: #{$s};
45
+ }
46
+
47
+ :host {
48
+ display: inline-flex;
49
+ }
50
+
51
+ .mat-mdc-button-base {
52
+ width: 100%;
53
+ font-weight: 500;
54
+ --mat-button-filled-container-shape: var(--radius-md);
55
+ --mat-button-outlined-container-shape: var(--radius-md);
56
+ --mat-button-text-container-shape: var(--radius-md);
57
+ --mat-button-tonal-container-shape: var(--radius-md);
58
+ --mat-button-protected-container-shape: var(--radius-md);
59
+ }
60
+
61
+ // Heights via Material's density scale; 24px (xs) sits below the button
62
+ // density floor (-3 = 28px), so it sets the height token directly.
63
+ .size-default,
64
+ .size-icon {
65
+ @include mat.button-density($-md);
66
+ }
67
+ .size-sm,
68
+ .size-icon-sm {
69
+ @include mat.button-density($-sm);
70
+ }
71
+ .size-lg,
72
+ .size-icon-lg {
73
+ @include mat.button-density($-lg);
74
+ }
75
+ .size-xs,
76
+ .size-icon-xs {
77
+ @include -height(1.5rem);
78
+ }
79
+
80
+ // Font-size isn't a density concern, so it stays a label token.
81
+ .size-default,
82
+ .size-lg {
83
+ @include -label-size(0.875rem);
84
+ }
85
+ .size-sm {
86
+ @include -label-size(0.8rem);
87
+ }
88
+ .size-xs {
89
+ @include -label-size(0.75rem);
90
+ }
91
+
92
+ // Icon-only: square, no min-width or horizontal padding. Material's leading-icon
93
+ // margins assume a text label, so zero them to keep the icon centred.
94
+ .size-icon,
95
+ .size-icon-xs,
96
+ .size-icon-sm,
97
+ .size-icon-lg {
98
+ width: auto;
99
+ min-width: 0;
100
+ padding: 0;
101
+ aspect-ratio: 1;
102
+
103
+ .mat-icon {
104
+ margin: 0;
105
+ }
106
+ }
107
+
108
+ // Destructive: subtle red tint + red text, matching React's bg-destructive/10.
109
+ .destructive {
110
+ --mat-button-filled-container-color: color-mix(in oklch, var(--destructive) 10%, transparent);
111
+ --mat-button-filled-label-text-color: var(--destructive);
112
+ }
@@ -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
+ import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
7
+ import { MatButtonModule, type MatButtonAppearance } from '@angular/material/button';
8
+ import { MatIconModule } from '@angular/material/icon';
9
+
10
+ /** Material's appearances plus `destructive`, which Material doesn't provide. */
11
+ export type AppButtonAppearance = MatButtonAppearance | 'destructive';
12
+
13
+ /** Button size variants. */
14
+ export type AppButtonSize =
15
+ | 'default'
16
+ | 'xs'
17
+ | 'sm'
18
+ | 'lg'
19
+ | 'icon'
20
+ | 'icon-xs'
21
+ | 'icon-sm'
22
+ | 'icon-lg';
23
+
24
+ /**
25
+ * Thin wrapper over `matButton`. Adds a `destructive` appearance and a `size`
26
+ * scale Material lacks; inputs drive the inner button (a host class/aria attr
27
+ * would land on `<app-button>`, not the real `<button>`).
28
+ */
29
+ @Component({
30
+ selector: 'app-button',
31
+ changeDetection: ChangeDetectionStrategy.OnPush,
32
+ imports: [MatButtonModule, MatIconModule],
33
+ templateUrl: './button.component.html',
34
+ styleUrl: './button.component.scss',
35
+ })
36
+ export class ButtonComponent {
37
+ readonly appearance = input<AppButtonAppearance>('filled');
38
+ readonly size = input<AppButtonSize>('default');
39
+ readonly type = input<'button' | 'submit' | 'reset'>('button');
40
+ readonly disabled = input<boolean>(false);
41
+ readonly ariaLabel = input<string>();
42
+ readonly ariaExpanded = input<boolean>();
43
+ /** Extra classes for the inner button — `class` on the host forwards here. */
44
+ readonly classes = input<string>('', { alias: 'class' });
45
+ /** Leading / trailing Material icon ligature names, e.g. `search`. */
46
+ readonly icon = input<string>('');
47
+ readonly iconEnd = input<string>('');
48
+ readonly clicked = output<MouseEvent>();
49
+
50
+ /** `destructive` renders as a filled button carrying the destructive class. */
51
+ protected readonly matAppearance = computed<MatButtonAppearance>(() =>
52
+ this.appearance() === 'destructive' ? 'filled' : (this.appearance() as MatButtonAppearance),
53
+ );
54
+ protected readonly isDestructive = computed(() => this.appearance() === 'destructive');
55
+ /** Size class merged with any caller-supplied classes, applied to the button. */
56
+ protected readonly buttonClass = computed(() => `size-${this.size()} ${this.classes()}`.trim());
57
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ // `size="sm"` — compact padding. Material hardcodes the card's 16px padding
8
+ // (there is no padding design token to override), so the compact size tightens
9
+ // the real Material padding classes. `::ng-deep` is required because the slot
10
+ // content (`mat-card-header/content/actions`) is projected — it lives in the
11
+ // consumer's view, not this wrapper's — so a plain scoped selector can't reach
12
+ // it. The rules are anchored under `.app-card-sm`, a class only this component
13
+ // applies, so the deep selector stays contained to compact cards.
14
+ .app-card-sm {
15
+ ::ng-deep .mat-mdc-card-header {
16
+ padding: 0.75rem 0.75rem 0;
17
+ }
18
+
19
+ ::ng-deep .mat-mdc-card-content {
20
+ padding: 0 0.75rem;
21
+
22
+ &:first-child {
23
+ padding-top: 0.75rem;
24
+ }
25
+
26
+ &:last-child {
27
+ padding-bottom: 0.75rem;
28
+ }
29
+ }
30
+
31
+ ::ng-deep .mat-mdc-card-actions {
32
+ padding: 0.75rem;
33
+ }
34
+ }