@salesforce/templates 66.11.0 → 66.11.1

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 (65) hide show
  1. package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package-lock.json +361 -332
  2. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package-lock.json +354 -325
  3. package/lib/templates/uiBundles/angularbasic/angular.json +11 -7
  4. package/lib/templates/uiBundles/angularbasic/eslint.config.js +4 -0
  5. package/lib/templates/uiBundles/angularbasic/package-lock.json +292 -239
  6. package/lib/templates/uiBundles/angularbasic/package.json +4 -0
  7. package/lib/templates/uiBundles/angularbasic/src/app/api/{graphql-client.service.spec.ts → data-client.service.spec.ts} +36 -6
  8. package/lib/templates/uiBundles/angularbasic/src/app/api/data-client.service.ts +74 -0
  9. package/lib/templates/uiBundles/angularbasic/src/app/app.config.ts +15 -1
  10. package/lib/templates/uiBundles/angularbasic/src/app/app.routes.ts +6 -1
  11. package/lib/templates/uiBundles/angularbasic/src/app/app.ts +7 -2
  12. package/lib/templates/uiBundles/angularbasic/src/app/{layout → components/layout/app-layout}/app-layout.component.html +2 -1
  13. package/lib/templates/uiBundles/angularbasic/src/app/{layout → components/layout/app-layout}/app-layout.component.ts +9 -3
  14. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/_field-size.scss +42 -0
  15. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/alert/alert.component.html +31 -0
  16. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/alert/alert.component.ts +53 -0
  17. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/button/button.component.html +18 -0
  18. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/button/button.component.scss +112 -0
  19. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/button/button.component.ts +57 -0
  20. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/card/card.component.scss +34 -0
  21. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/card/card.component.ts +110 -0
  22. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/collapsible/collapsible.component.html +10 -0
  23. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/collapsible/collapsible.component.ts +26 -0
  24. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/date-picker/date-picker.component.html +25 -0
  25. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/date-picker/date-picker.component.scss +36 -0
  26. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/date-picker/date-picker.component.ts +41 -0
  27. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/date-range-picker/date-range-picker.component.html +34 -0
  28. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/date-range-picker/date-range-picker.component.scss +33 -0
  29. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/date-range-picker/date-range-picker.component.ts +66 -0
  30. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/dialog/dialog.component.html +37 -0
  31. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/dialog/dialog.component.ts +55 -0
  32. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/field/field.component.html +21 -0
  33. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/field/field.component.ts +36 -0
  34. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/field-size.ts +8 -0
  35. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/input/input.component.html +19 -0
  36. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/input/input.component.scss +35 -0
  37. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/input/input.component.ts +36 -0
  38. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/label/label.component.html +3 -0
  39. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/label/label.component.ts +17 -0
  40. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/paginator/paginator.component.html +10 -0
  41. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/paginator/paginator.component.ts +37 -0
  42. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/popover/popover.component.html +41 -0
  43. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/popover/popover.component.ts +40 -0
  44. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/select/select.component.html +24 -0
  45. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/select/select.component.scss +35 -0
  46. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/select/select.component.ts +72 -0
  47. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/separator/separator.component.html +1 -0
  48. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/separator/separator.component.scss +23 -0
  49. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/separator/separator.component.ts +56 -0
  50. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/skeleton/skeleton.component.html +1 -0
  51. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/skeleton/skeleton.component.scss +28 -0
  52. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/skeleton/skeleton.component.ts +24 -0
  53. package/lib/templates/uiBundles/angularbasic/src/app/components/ui/spinner/spinner.component.ts +35 -0
  54. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.ts +7 -1
  55. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.ts +7 -1
  56. package/lib/templates/uiBundles/angularbasic/src/app/utils/async-data.ts +99 -0
  57. package/lib/templates/uiBundles/angularbasic/src/index.html +1 -0
  58. package/lib/templates/uiBundles/angularbasic/src/styles.scss +170 -0
  59. package/lib/templates/uiBundles/angularbasic/src/theme.scss +39 -0
  60. package/lib/templates/uiBundles/reactbasic/package-lock.json +354 -325
  61. package/package.json +3 -3
  62. package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.ts +0 -48
  63. package/lib/templates/uiBundles/angularbasic/src/app/app.css +0 -0
  64. package/lib/templates/uiBundles/angularbasic/src/styles.css +0 -12
  65. /package/lib/templates/uiBundles/angularbasic/src/app/{layout → components/layout/app-layout}/app-layout.component.spec.ts +0 -0
@@ -0,0 +1,110 @@
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, input } from '@angular/core';
7
+ import {
8
+ MatCard,
9
+ MatCardActions,
10
+ MatCardContent,
11
+ MatCardHeader,
12
+ MatCardSubtitle,
13
+ MatCardTitle,
14
+ } from '@angular/material/card';
15
+
16
+ /** Card container density. */
17
+ export type AppCardSize = 'default' | 'sm';
18
+
19
+ /**
20
+ * Thin wrapper over `mat-card`. Preserves the `app-card` / `app-card-*` slot API
21
+ * while Material drives the visual. `size="sm"` maps to a compact-padding class.
22
+ */
23
+ @Component({
24
+ selector: 'app-card',
25
+ changeDetection: ChangeDetectionStrategy.OnPush,
26
+ imports: [MatCard],
27
+ template:
28
+ '<mat-card appearance="outlined" [class]="classes()" [class.app-card-sm]="size() === \'sm\'"><ng-content /></mat-card>',
29
+ styleUrl: './card.component.scss',
30
+ })
31
+ export class CardComponent {
32
+ readonly size = input<AppCardSize>('default');
33
+ /** Extra classes forwarded to the inner `mat-card` (host `class` lands here). */
34
+ readonly classes = input<string>('', { alias: 'class' });
35
+ }
36
+
37
+ /**
38
+ * Header slot — wraps `mat-card-header` and recreates its title/subtitle stack
39
+ * so the slots project by element selector (Material's static
40
+ * `[mat-card-title]` projection can't see the runtime attribute across this
41
+ * boundary, and would otherwise render title + subtitle side by side).
42
+ */
43
+ @Component({
44
+ selector: 'app-card-header',
45
+ changeDetection: ChangeDetectionStrategy.OnPush,
46
+ imports: [MatCardHeader],
47
+ template: `<mat-card-header [class]="classes()">
48
+ <ng-content select="[mat-card-avatar]" />
49
+ <div class="app-card-header-text">
50
+ <ng-content select="app-card-title" />
51
+ <ng-content select="app-card-description" />
52
+ </div>
53
+ <ng-content />
54
+ </mat-card-header>`,
55
+ styles: '.app-card-header-text { display: flex; flex-direction: column; gap: 0.25rem; }',
56
+ })
57
+ export class CardHeaderComponent {
58
+ /** Extra classes forwarded to the inner `mat-card-header`. */
59
+ readonly classes = input<string>('', { alias: 'class' });
60
+ }
61
+
62
+ /** Title slot — Material's `MatCardTitle` styling. */
63
+ @Component({
64
+ selector: 'app-card-title',
65
+ changeDetection: ChangeDetectionStrategy.OnPush,
66
+ hostDirectives: [MatCardTitle],
67
+ template: '<ng-content />',
68
+ })
69
+ export class CardTitleComponent {}
70
+
71
+ /** Description slot — Material's `mat-card-subtitle` styling. */
72
+ @Component({
73
+ selector: 'app-card-description',
74
+ changeDetection: ChangeDetectionStrategy.OnPush,
75
+ hostDirectives: [MatCardSubtitle],
76
+ template: '<ng-content />',
77
+ })
78
+ export class CardDescriptionComponent {}
79
+
80
+ /** Action slot — pinned to the trailing edge of `app-card-header`. */
81
+ @Component({
82
+ selector: 'app-card-action',
83
+ changeDetection: ChangeDetectionStrategy.OnPush,
84
+ host: { style: 'margin-inline-start: auto; align-self: flex-start;' },
85
+ template: '<ng-content />',
86
+ })
87
+ export class CardActionComponent {}
88
+
89
+ /** Body slot — Material's `mat-card-content`. */
90
+ @Component({
91
+ selector: 'app-card-content',
92
+ changeDetection: ChangeDetectionStrategy.OnPush,
93
+ hostDirectives: [MatCardContent],
94
+ template: '<ng-content />',
95
+ })
96
+ export class CardContentComponent {}
97
+
98
+ /**
99
+ * Footer slot — Material's `mat-card-actions` (a flex-row action bar).
100
+ * Material ships no inter-button spacing, so `:host` (the actions element)
101
+ * sets a `gap`.
102
+ */
103
+ @Component({
104
+ selector: 'app-card-footer',
105
+ changeDetection: ChangeDetectionStrategy.OnPush,
106
+ hostDirectives: [MatCardActions],
107
+ styles: ':host { gap: 0.5rem; }',
108
+ template: '<ng-content />',
109
+ })
110
+ export class CardFooterComponent {}
@@ -0,0 +1,10 @@
1
+ <mat-expansion-panel [expanded]="open()" (expandedChange)="open.set($event)">
2
+ <mat-expansion-panel-header>
3
+ @if (title()) {
4
+ <mat-panel-title>{{ title() }}</mat-panel-title>
5
+ } @else {
6
+ <ng-content select="[collapsibleHeader]" />
7
+ }
8
+ </mat-expansion-panel-header>
9
+ <ng-content />
10
+ </mat-expansion-panel>
@@ -0,0 +1,26 @@
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, input, model } from '@angular/core';
7
+ import { MatExpansionModule } from '@angular/material/expansion';
8
+
9
+ /**
10
+ * Thin wrapper over Material's `mat-expansion-panel`. Two-way bindable `open`
11
+ * and a `title`; body via `<ng-content>`. For custom header content, omit
12
+ * `title` and project `[collapsibleHeader]`.
13
+ */
14
+ @Component({
15
+ selector: 'app-collapsible',
16
+ changeDetection: ChangeDetectionStrategy.OnPush,
17
+ imports: [MatExpansionModule],
18
+ templateUrl: './collapsible.component.html',
19
+ })
20
+ export class CollapsibleComponent {
21
+ /** Two-way bindable expanded state. Supports `[(open)]`. */
22
+ readonly open = model<boolean>(false);
23
+
24
+ /** Header title text. Omit and project `[collapsibleHeader]` for custom content. */
25
+ readonly title = input<string>('');
26
+ }
@@ -0,0 +1,25 @@
1
+ <mat-form-field
2
+ class="w-full"
3
+ [class]="'size-' + size()"
4
+ [appearance]="appearance()"
5
+ subscriptSizing="dynamic"
6
+ >
7
+ @if (label()) {
8
+ <mat-label>{{ label() }}</mat-label>
9
+ }
10
+ <input
11
+ matInput
12
+ [matDatepicker]="picker"
13
+ [min]="min()"
14
+ [max]="max()"
15
+ [placeholder]="placeholder()"
16
+ [disabled]="disabled()"
17
+ [readonly]="readonly()"
18
+ [(ngModel)]="value"
19
+ (click)="readonly() && picker.open()"
20
+ (keydown.enter)="readonly() && picker.open()"
21
+ (keydown.space)="readonly() && picker.open()"
22
+ />
23
+ <mat-datepicker-toggle matIconSuffix [for]="picker" />
24
+ <mat-datepicker #picker />
25
+ </mat-form-field>
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ @use '../field-size' as field-size;
8
+
9
+ /*
10
+ * Form-field-specific structural styling. Height comes from the `size` input
11
+ * (see field-size.scss); colour comes from the --mat-sys-* remap (styles.css).
12
+ * Here we only: give the outline our design-token radius, emit the size
13
+ * classes, and collapse the empty hint/error subscript row.
14
+ */
15
+ @include field-size.sizes;
16
+
17
+ :host {
18
+ display: block;
19
+ /*
20
+ * Allow the host to shrink below the mat-form-field's intrinsic width when
21
+ * used as a flex item (e.g. two side-by-side pickers in a date-range filter,
22
+ * or a picker beside an operator select). Without this, the default
23
+ * `min-width: auto` on a flex item keeps each field at its content width and
24
+ * the row overflows its container.
25
+ */
26
+ min-width: 0;
27
+ }
28
+
29
+ .mat-mdc-form-field {
30
+ --mdc-outlined-text-field-container-shape: var(--radius-md);
31
+ font-size: 0.875rem; /* text-sm, matches the React inputs */
32
+ }
33
+
34
+ .mat-mdc-form-field-subscript-wrapper {
35
+ display: none;
36
+ }
@@ -0,0 +1,41 @@
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, input, model } from '@angular/core';
7
+ import { FormsModule } from '@angular/forms';
8
+ import { MatDatepickerModule } from '@angular/material/datepicker';
9
+ import { MatFormFieldModule, type MatFormFieldAppearance } from '@angular/material/form-field';
10
+ import { MatInputModule } from '@angular/material/input';
11
+ import type { AppFieldSize } from '../field-size';
12
+
13
+ /**
14
+ * Thin wrapper over Material's `mat-form-field` + `matInput` + `mat-datepicker`.
15
+ * Relies on `provideNativeDateAdapter()`, so `value` is a plain `Date`.
16
+ */
17
+ @Component({
18
+ selector: 'app-date-picker',
19
+ changeDetection: ChangeDetectionStrategy.OnPush,
20
+ imports: [FormsModule, MatDatepickerModule, MatFormFieldModule, MatInputModule],
21
+ templateUrl: './date-picker.component.html',
22
+ styleUrl: './date-picker.component.scss',
23
+ })
24
+ export class DatePickerComponent {
25
+ /** Two-way bindable date value. `null` clears the field. Supports `[(value)]`. */
26
+ readonly value = model<Date | null>(null);
27
+
28
+ readonly label = input<string>('');
29
+ readonly placeholder = input<string>('');
30
+ readonly disabled = input<boolean>(false);
31
+ readonly appearance = input<MatFormFieldAppearance>('outline');
32
+ /** Field height: `sm` = 24px, `default` = 32px, `lg` = 40px. */
33
+ readonly size = input<AppFieldSize>('default');
34
+
35
+ /** Earliest / latest selectable date; `null` leaves that bound open. */
36
+ readonly min = input<Date | null>(null);
37
+ readonly max = input<Date | null>(null);
38
+
39
+ /** When `true`, calendar-only: typing is blocked, clicking opens the picker. */
40
+ readonly readonly = input<boolean>(false);
41
+ }
@@ -0,0 +1,34 @@
1
+ <mat-form-field
2
+ class="w-full"
3
+ [class]="'size-' + size()"
4
+ [appearance]="appearance()"
5
+ subscriptSizing="dynamic"
6
+ >
7
+ @if (label()) {
8
+ <mat-label>{{ label() }}</mat-label>
9
+ }
10
+ <mat-date-range-input [rangePicker]="picker" [min]="min()" [max]="max()" [disabled]="disabled()">
11
+ <input
12
+ matStartDate
13
+ [placeholder]="startPlaceholder()"
14
+ [value]="value()?.start ?? null"
15
+ [readonly]="readonly()"
16
+ (dateChange)="onStartChange($event.value)"
17
+ (click)="readonly() && picker.open()"
18
+ (keydown.enter)="readonly() && picker.open()"
19
+ (keydown.space)="readonly() && picker.open()"
20
+ />
21
+ <input
22
+ matEndDate
23
+ [placeholder]="endPlaceholder()"
24
+ [value]="value()?.end ?? null"
25
+ [readonly]="readonly()"
26
+ (dateChange)="onEndChange($event.value)"
27
+ (click)="readonly() && picker.open()"
28
+ (keydown.enter)="readonly() && picker.open()"
29
+ (keydown.space)="readonly() && picker.open()"
30
+ />
31
+ </mat-date-range-input>
32
+ <mat-datepicker-toggle matIconSuffix [for]="picker" />
33
+ <mat-date-range-picker #picker />
34
+ </mat-form-field>
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ @use '../field-size' as field-size;
8
+
9
+ /*
10
+ * Form-field-specific structural styling. Height comes from the `size` input
11
+ * (see field-size.scss); colour comes from the --mat-sys-* remap (styles.css).
12
+ * Here we only: give the outline our design-token radius, emit the size
13
+ * classes, and collapse the empty hint/error subscript row.
14
+ */
15
+ @include field-size.sizes;
16
+
17
+ :host {
18
+ display: block;
19
+ /*
20
+ * Allow the host to shrink below the mat-form-field's intrinsic width when
21
+ * used as a flex item, so the row doesn't overflow its container.
22
+ */
23
+ min-width: 0;
24
+ }
25
+
26
+ .mat-mdc-form-field {
27
+ --mdc-outlined-text-field-container-shape: var(--radius-md);
28
+ font-size: 0.875rem; /* text-sm, matches the React inputs */
29
+ }
30
+
31
+ .mat-mdc-form-field-subscript-wrapper {
32
+ display: none;
33
+ }
@@ -0,0 +1,66 @@
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, input, model } from '@angular/core';
7
+ import { FormsModule } from '@angular/forms';
8
+ import { DateRange, MatDatepickerModule } from '@angular/material/datepicker';
9
+ import { MatFormFieldModule, type MatFormFieldAppearance } from '@angular/material/form-field';
10
+ import { MatInputModule } from '@angular/material/input';
11
+ import type { AppFieldSize } from '../field-size';
12
+
13
+ export { DateRange } from '@angular/material/datepicker';
14
+
15
+ /**
16
+ * Thin wrapper over Material's `mat-form-field` + `mat-date-range-input` +
17
+ * `mat-date-range-picker`. Relies on `provideNativeDateAdapter()`, so the value
18
+ * is Material's `DateRange<Date>` (`{ start, end }`) of plain `Date`s.
19
+ */
20
+ @Component({
21
+ selector: 'app-date-range-picker',
22
+ changeDetection: ChangeDetectionStrategy.OnPush,
23
+ imports: [FormsModule, MatDatepickerModule, MatFormFieldModule, MatInputModule],
24
+ templateUrl: './date-range-picker.component.html',
25
+ styleUrl: './date-range-picker.component.scss',
26
+ })
27
+ export class DateRangePickerComponent {
28
+ /** Two-way bindable range value. `null` clears the field. Supports `[(value)]`. */
29
+ readonly value = model<DateRange<Date> | null>(null);
30
+
31
+ readonly label = input<string>('');
32
+ readonly startPlaceholder = input<string>('Start');
33
+ readonly endPlaceholder = input<string>('End');
34
+ readonly disabled = input<boolean>(false);
35
+ readonly appearance = input<MatFormFieldAppearance>('outline');
36
+ /** Field height: `sm` = 24px, `default` = 32px, `lg` = 40px. */
37
+ readonly size = input<AppFieldSize>('default');
38
+
39
+ /** Earliest / latest selectable date; `null` leaves that bound open. */
40
+ readonly min = input<Date | null>(null);
41
+ readonly max = input<Date | null>(null);
42
+
43
+ /** When `true`, calendar-only: typing is blocked, clicking opens the picker. */
44
+ readonly readonly = input<boolean>(false);
45
+
46
+ /** Start/end come off the range input's `(dateChange)` events as a pair. */
47
+ protected onStartChange(start: Date | null): void {
48
+ this.setRange(start, this.value()?.end ?? null);
49
+ }
50
+
51
+ protected onEndChange(end: Date | null): void {
52
+ this.setRange(this.value()?.start ?? null, end);
53
+ }
54
+
55
+ /**
56
+ * Commit a range, guarding against an inverted `start > end` that the two
57
+ * independent `(dateChange)` events can otherwise produce mid-selection.
58
+ */
59
+ private setRange(start: Date | null, end: Date | null): void {
60
+ if (start && end && start.getTime() > end.getTime()) {
61
+ this.value.set(new DateRange(end, start));
62
+ return;
63
+ }
64
+ this.value.set(new DateRange(start, end));
65
+ }
66
+ }
@@ -0,0 +1,37 @@
1
+ <ng-template
2
+ cdkConnectedOverlay
3
+ [cdkConnectedOverlayOpen]="open()"
4
+ [cdkConnectedOverlayHasBackdrop]="true"
5
+ cdkConnectedOverlayBackdropClass="cdk-overlay-dark-backdrop"
6
+ [cdkConnectedOverlayPositions]="[
7
+ {
8
+ originX: 'center',
9
+ originY: 'center',
10
+ overlayX: 'center',
11
+ overlayY: 'center',
12
+ },
13
+ ]"
14
+ (backdropClick)="onBackdropClick()"
15
+ (overlayKeydown)="$event.key === 'Escape' && close()"
16
+ (detach)="close()"
17
+ >
18
+ <div
19
+ role="dialog"
20
+ aria-modal="true"
21
+ [attr.aria-label]="ariaLabel()"
22
+ [attr.aria-labelledby]="ariaLabelledby()"
23
+ cdkTrapFocus
24
+ [cdkTrapFocusAutoCapture]="true"
25
+ class="bg-card text-card-foreground flex w-full max-w-md flex-col gap-4 rounded-xl p-6 shadow-lg ring-1 ring-black/10 outline-none"
26
+ >
27
+ <div data-slot="dialog-header" class="flex flex-col gap-1">
28
+ <ng-content select="[header]" />
29
+ </div>
30
+ <div data-slot="dialog-body" class="text-sm">
31
+ <ng-content />
32
+ </div>
33
+ <div data-slot="dialog-footer" class="flex items-center justify-end gap-2">
34
+ <ng-content select="[footer]" />
35
+ </div>
36
+ </div>
37
+ </ng-template>
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { CdkTrapFocus } from '@angular/cdk/a11y';
7
+ import { CdkConnectedOverlay } from '@angular/cdk/overlay';
8
+ import { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';
9
+
10
+ /**
11
+ * Modal dialog backed by CDK Overlay. Slots: `[header]`, default (body),
12
+ * `[footer]`. `open` is a two-way model; a backdrop click or Escape closes it
13
+ * and emits `(closed)`. `cdkTrapFocus` keeps focus inside the panel while open.
14
+ */
15
+ @Component({
16
+ selector: 'app-dialog',
17
+ changeDetection: ChangeDetectionStrategy.OnPush,
18
+ imports: [CdkConnectedOverlay, CdkTrapFocus],
19
+ templateUrl: './dialog.component.html',
20
+ })
21
+ export class DialogComponent {
22
+ /** Two-way bindable open state. Supports `[(open)]`. */
23
+ readonly open = model<boolean>(false);
24
+
25
+ /** When true a backdrop click closes the dialog. */
26
+ readonly closeOnBackdrop = input<boolean>(true);
27
+
28
+ /** Accessible name for the dialog (or use `ariaLabelledby`). */
29
+ readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });
30
+
31
+ /** `id` of an element (e.g. the projected header) that names the dialog. */
32
+ readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });
33
+
34
+ /** Emitted whenever the dialog transitions to closed. */
35
+ readonly closed = output<void>();
36
+
37
+ /** Imperatively open the dialog. */
38
+ show(): void {
39
+ this.open.set(true);
40
+ }
41
+
42
+ /** Imperatively close the dialog and notify listeners. */
43
+ close(): void {
44
+ if (this.open()) {
45
+ this.open.set(false);
46
+ this.closed.emit();
47
+ }
48
+ }
49
+
50
+ protected onBackdropClick(): void {
51
+ if (this.closeOnBackdrop()) {
52
+ this.close();
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,21 @@
1
+ @if (label()) {
2
+ <label [attr.for]="htmlFor()" class="text-sm leading-none font-medium select-none">
3
+ {{ label() }}
4
+ @if (required()) {
5
+ <span aria-hidden="true" class="text-destructive">*</span>
6
+ }
7
+ </label>
8
+ }
9
+
10
+ <ng-content />
11
+
12
+ @if (error()) {
13
+ <p
14
+ [id]="htmlFor() ? htmlFor() + '-error' : null"
15
+ data-slot="field-error"
16
+ role="alert"
17
+ class="text-destructive text-sm"
18
+ >
19
+ {{ error() }}
20
+ </p>
21
+ }
@@ -0,0 +1,36 @@
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, input } from '@angular/core';
7
+
8
+ /**
9
+ * Form-field wrapper: renders a `<label>`, the projected control, and an error
10
+ * message when present. Composes around `app-input` and other controls.
11
+ */
12
+ @Component({
13
+ selector: 'app-field',
14
+ changeDetection: ChangeDetectionStrategy.OnPush,
15
+ templateUrl: './field.component.html',
16
+ host: {
17
+ 'data-slot': 'field',
18
+ class: 'flex flex-col gap-1.5',
19
+ },
20
+ })
21
+ export class FieldComponent {
22
+ /** Optional label text rendered above the control. */
23
+ readonly label = input<string>('');
24
+
25
+ /**
26
+ * Error message; renders in a `role="alert"` region. When `htmlFor` is set
27
+ * the region gets id `<htmlFor>-error` for the control's `aria-describedby`.
28
+ */
29
+ readonly error = input<string | null>(null);
30
+
31
+ /** Marks the field required and renders an asterisk next to the label. */
32
+ readonly required = input<boolean>(false);
33
+
34
+ /** `id` of the projected control; forwarded to the label's `for`. */
35
+ readonly htmlFor = input<string | null>(null);
36
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /** Form-field height scale: `sm` = 24px, `default` = 32px, `lg` = 40px. */
8
+ export type AppFieldSize = 'sm' | 'default' | 'lg';
@@ -0,0 +1,19 @@
1
+ <mat-form-field
2
+ class="w-full"
3
+ [class]="'size-' + size()"
4
+ [appearance]="appearance()"
5
+ subscriptSizing="dynamic"
6
+ >
7
+ @if (label()) {
8
+ <mat-label>{{ label() }}</mat-label>
9
+ }
10
+ <input
11
+ matInput
12
+ [type]="type()"
13
+ [placeholder]="placeholder()"
14
+ [disabled]="disabled()"
15
+ [attr.id]="id() || null"
16
+ [attr.aria-describedby]="ariaDescribedby() || null"
17
+ [(ngModel)]="value"
18
+ />
19
+ </mat-form-field>
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ @use '../field-size' as field-size;
8
+
9
+ /*
10
+ * Form-field-specific structural styling. Height comes from the `size` input
11
+ * (see field-size.scss); colour comes from the --mat-sys-* remap (styles.css).
12
+ * Here we only: give the outline our design-token radius, emit the size
13
+ * classes, and collapse the empty hint/error subscript row.
14
+ */
15
+ @include field-size.sizes;
16
+
17
+ :host {
18
+ display: block;
19
+ /*
20
+ * Allow the host to shrink below the mat-form-field's intrinsic width when
21
+ * used as a flex item (e.g. two side-by-side inputs in a numeric/date
22
+ * range). Without this, the default `min-width: auto` on a flex item keeps
23
+ * each field at its content width and the row overflows its container.
24
+ */
25
+ min-width: 0;
26
+ }
27
+
28
+ .mat-mdc-form-field {
29
+ --mdc-outlined-text-field-container-shape: var(--radius-md);
30
+ font-size: 0.875rem; /* text-sm, matches the React inputs */
31
+ }
32
+
33
+ .mat-mdc-form-field-subscript-wrapper {
34
+ display: none;
35
+ }
@@ -0,0 +1,36 @@
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, input, model } from '@angular/core';
7
+ import { FormsModule } from '@angular/forms';
8
+ import { MatFormFieldModule, type MatFormFieldAppearance } from '@angular/material/form-field';
9
+ import { MatInputModule } from '@angular/material/input';
10
+ import type { AppFieldSize } from '../field-size';
11
+
12
+ /** Thin wrapper over Material's `mat-form-field` + `matInput`. */
13
+ @Component({
14
+ selector: 'app-input',
15
+ changeDetection: ChangeDetectionStrategy.OnPush,
16
+ imports: [FormsModule, MatFormFieldModule, MatInputModule],
17
+ templateUrl: './input.component.html',
18
+ styleUrl: './input.component.scss',
19
+ })
20
+ export class InputComponent {
21
+ /** Two-way bindable value. Supports `[(value)]`. */
22
+ readonly value = model<string>('');
23
+
24
+ readonly placeholder = input<string>('');
25
+ readonly label = input<string>('');
26
+ readonly type = input<string>('text');
27
+ readonly disabled = input<boolean>(false);
28
+ readonly appearance = input<MatFormFieldAppearance>('outline');
29
+ /** Field height: `sm` = 24px, `default` = 32px, `lg` = 40px. */
30
+ readonly size = input<AppFieldSize>('default');
31
+
32
+ /** `id` on the inner control, so an outer `app-field` label's `for` resolves. */
33
+ readonly id = input<string>('');
34
+
35
+ readonly ariaDescribedby = input<string>('');
36
+ }
@@ -0,0 +1,3 @@
1
+ <label [attr.for]="for()" class="text-sm leading-none font-medium select-none">
2
+ <ng-content />
3
+ </label>
@@ -0,0 +1,17 @@
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, input } from '@angular/core';
7
+
8
+ /** Thin wrapper over the native `<label>` element. */
9
+ @Component({
10
+ selector: 'app-label',
11
+ changeDetection: ChangeDetectionStrategy.OnPush,
12
+ templateUrl: './label.component.html',
13
+ })
14
+ export class LabelComponent {
15
+ /** Optional `for` attribute forwarded to the underlying `<label>`. */
16
+ readonly for = input<string | null>(null);
17
+ }