@molecule/app-ui-angular 1.1.2 → 1.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 (55) hide show
  1. package/README.md +272 -169
  2. package/dist/components/card.component.d.ts +10 -0
  3. package/dist/components/card.component.d.ts.map +1 -1
  4. package/dist/components/card.component.js +27 -7
  5. package/dist/components/card.component.js.map +1 -1
  6. package/dist/components/confirm-dialog.component.d.ts +33 -2
  7. package/dist/components/confirm-dialog.component.d.ts.map +1 -1
  8. package/dist/components/confirm-dialog.component.js +81 -24
  9. package/dist/components/confirm-dialog.component.js.map +1 -1
  10. package/dist/components/dropdown.component.d.ts.map +1 -1
  11. package/dist/components/dropdown.component.js +5 -4
  12. package/dist/components/dropdown.component.js.map +1 -1
  13. package/dist/components/input.component.d.ts.map +1 -1
  14. package/dist/components/input.component.js +11 -2
  15. package/dist/components/input.component.js.map +1 -1
  16. package/dist/components/modal.component.d.ts +16 -9
  17. package/dist/components/modal.component.d.ts.map +1 -1
  18. package/dist/components/modal.component.js +27 -15
  19. package/dist/components/modal.component.js.map +1 -1
  20. package/dist/components/page-header.component.d.ts +11 -0
  21. package/dist/components/page-header.component.d.ts.map +1 -1
  22. package/dist/components/page-header.component.js +25 -10
  23. package/dist/components/page-header.component.js.map +1 -1
  24. package/dist/components/prompt-dialog.component.d.ts +35 -4
  25. package/dist/components/prompt-dialog.component.d.ts.map +1 -1
  26. package/dist/components/prompt-dialog.component.js +63 -9
  27. package/dist/components/prompt-dialog.component.js.map +1 -1
  28. package/dist/components/responsive-app-shell.component.d.ts +3 -7
  29. package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
  30. package/dist/components/responsive-app-shell.component.js +12 -17
  31. package/dist/components/responsive-app-shell.component.js.map +1 -1
  32. package/dist/components/select.component.d.ts +3 -1
  33. package/dist/components/select.component.d.ts.map +1 -1
  34. package/dist/components/select.component.js +11 -2
  35. package/dist/components/select.component.js.map +1 -1
  36. package/dist/components/sidebar-user-card.component.d.ts +10 -0
  37. package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
  38. package/dist/components/sidebar-user-card.component.js +20 -3
  39. package/dist/components/sidebar-user-card.component.js.map +1 -1
  40. package/dist/components/tabs.component.d.ts +10 -0
  41. package/dist/components/tabs.component.d.ts.map +1 -1
  42. package/dist/components/tabs.component.js +19 -7
  43. package/dist/components/tabs.component.js.map +1 -1
  44. package/dist/components/textarea.component.d.ts +8 -1
  45. package/dist/components/textarea.component.d.ts.map +1 -1
  46. package/dist/components/textarea.component.js +18 -3
  47. package/dist/components/textarea.component.js.map +1 -1
  48. package/dist/components/tooltip.component.d.ts.map +1 -1
  49. package/dist/components/tooltip.component.js +3 -2
  50. package/dist/components/tooltip.component.js.map +1 -1
  51. package/dist/utilities/rest-attrs.d.ts +35 -2
  52. package/dist/utilities/rest-attrs.d.ts.map +1 -1
  53. package/dist/utilities/rest-attrs.js +38 -2
  54. package/dist/utilities/rest-attrs.js.map +1 -1
  55. package/package.json +5 -4
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-11-14T14:59:19.917Z
6
+ Generated: 2026-11-16T10:36:46.823Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-ui-angular
@@ -1696,6 +1696,24 @@ interface ResolvedIcon {
1696
1696
  }
1697
1697
  ```
1698
1698
 
1699
+ #### `ReapplyRestAttributesOptions`
1700
+
1701
+ Options for {@link reapplyRestAttributes}.
1702
+
1703
+ ```typescript
1704
+ interface ReapplyRestAttributesOptions {
1705
+ /**
1706
+ * Move `aria-describedby` too. The default keeps it on the host: a
1707
+ * component that MERGES the host's `aria-describedby` with its own target
1708
+ * (the input/select/textarea family, see below) has already applied it on
1709
+ * an inner binding, and re-moving the re-bound value would erase that
1710
+ * merge. A component that spreads `aria-describedby` straight onto its
1711
+ * `...rest` target (Modal) has no merge to protect, so it opts in.
1712
+ */
1713
+ includeDescribedBy?: boolean
1714
+ }
1715
+ ```
1716
+
1699
1717
  ### Types
1700
1718
 
1701
1719
  #### `Children`
@@ -2862,6 +2880,7 @@ order; rest props (`aria-*`, `data-*`, `id`) land on the host.
2862
2880
  '[attr.data-testid]': 'testId',
2863
2881
  '[attr.role]': 'interactive ? "button" : null',
2864
2882
  '[attr.tabindex]': 'interactive ? 0 : null',
2883
+ '(keydown)': 'handleKeyDown($event)',
2865
2884
  },
2866
2885
  template: `<ng-content></ng-content>`,
2867
2886
  })
@@ -2908,6 +2927,22 @@ export class Card {
2908
2927
  hostStyle(): string | null {
2909
2928
  return styleText(this.style)
2910
2929
  }
2930
+
2931
+ /**
2932
+ * An interactive card is announced as a button and sits in the tab order, so
2933
+ * Enter and Space activate it the way they activate a native button: by
2934
+ * clicking it, which runs the consumer's click handler with a real click
2935
+ * event. Keys pressed in a control inside the card belong to that control,
2936
+ * and a card that is not interactive ignores keys.
2937
+ *
2938
+ * @param event - The key event.
2939
+ */
2940
+ handleKeyDown(event: KeyboardEvent): void {
2941
+ if (!this.interactive || event.target !== event.currentTarget) return
2942
+ if (event.key !== 'Enter' && event.key !== ' ') return
2943
+ event.preventDefault()
2944
+ ;(event.currentTarget as HTMLElement).click()
2945
+ }
2911
2946
  }
2912
2947
  ```
2913
2948
 
@@ -3599,12 +3634,18 @@ React's `Modal` root is a fragment/portal).
3599
3634
  'data-parity-unwrap': '',
3600
3635
  style: 'display: contents',
3601
3636
  },
3602
- template: `<mol-modal [open]="open" (close)="close.emit($event)"
3637
+ template: `<mol-modal
3638
+ [open]="open"
3639
+ (close)="close.emit($event)"
3640
+ [attr.aria-labelledby]="titleId"
3641
+ [attr.aria-describedby]="ariaDescribedBy"
3603
3642
  ><div [class]="cm().stack(3)">
3604
- <h2 [class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))">
3643
+ <h2 [attr.id]="titleId" [class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))">
3605
3644
  <ng-content select="[slot=title]"></ng-content>
3606
3645
  </h2>
3607
- <p [class]="cm().textSize('sm')"><ng-content select="[slot=description]"></ng-content></p>
3646
+ <p #descriptionSlot [attr.id]="descriptionId" [class]="cm().textSize('sm')">
3647
+ <ng-content select="[slot=description]"></ng-content>
3648
+ </p>
3608
3649
  <ng-content></ng-content>
3609
3650
  <div [class]="cm().flex({ justify: 'end', gap: 'sm' })">
3610
3651
  <button mol-button [variant]="'ghost'" [disabled]="!!loading" (click)="close.emit($event)">
@@ -3622,7 +3663,32 @@ React's `Modal` root is a fragment/portal).
3622
3663
  </div></mol-modal
3623
3664
  >`,
3624
3665
  })
3625
- export class ConfirmDialog {
3666
+ export class ConfirmDialog implements DoCheck {
3667
+ /**
3668
+ * Per-instance id of the rendered title heading, wired as the dialog's
3669
+ * accessible name: the binding on `<mol-modal>` lands on its host element,
3670
+ * which Modal's rest-attribute move copies onto the dialog `<div>` —
3671
+ * `aria-labelledby` pointing at the visible `<h2>` (WAI-ARIA dialog
3672
+ * pattern; axe `aria-dialog-name`).
3673
+ */
3674
+ readonly titleId = `mol-confirm-dialog-title-${++confirmDialogInstances}`
3675
+
3676
+ /**
3677
+ * Per-instance id of the rendered description paragraph, wired as the
3678
+ * dialog's accessible description through the same rest-attribute move as
3679
+ * the title (only bound when projected description content renders — a
3680
+ * reference to an empty paragraph describes nothing, axe
3681
+ * `aria-dialog-name`/`aria-valid-attr-value`).
3682
+ */
3683
+ readonly descriptionId = nextInstanceId()
3684
+
3685
+ /** The rendered description paragraph (its projected nodes decide the wiring). */
3686
+ // `static: true` resolves the query during creation, so the projected nodes
3687
+ // are readable on the FIRST change-detection pass — a non-static query
3688
+ // resolves after view init, one pass too late for the description wiring.
3689
+ @ViewChild('descriptionSlot', { static: true })
3690
+ descriptionSlot?: ElementRef<HTMLParagraphElement>
3691
+
3626
3692
  /** Whether the dialog is open. */
3627
3693
  open = false
3628
3694
  /** Title (node-valued prop). */
@@ -3658,6 +3724,23 @@ export class ConfirmDialog {
3658
3724
  return getClassMap()
3659
3725
  }
3660
3726
 
3727
+ /**
3728
+ * The dialog's accessible description id, or null when no description
3729
+ * content renders. A FIELD, not a template method call: Angular memoizes a
3730
+ * no-argument method binding, so it would keep the first (pre-view-init)
3731
+ * value forever. Re-read each pass from the projected description nodes.
3732
+ */
3733
+ ariaDescribedBy: string | null = null
3734
+
3735
+ /**
3736
+ * Recomputes {@link ariaDescribedBy} before each view check. The query is
3737
+ * static, so the projected nodes are readable on the first pass already; a
3738
+ * later change to what renders is picked up on the next pass.
3739
+ */
3740
+ ngDoCheck(): void {
3741
+ this.ariaDescribedBy = hasNodes(this.descriptionSlot?.nativeElement) ? this.descriptionId : null
3742
+ }
3743
+
3661
3744
  /**
3662
3745
  * The cancel button's label.
3663
3746
  * @returns The label text.
@@ -3721,6 +3804,7 @@ fragment-like.
3721
3804
  ><div
3722
3805
  [attr.id]="menuId"
3723
3806
  role="menu"
3807
+ tabindex="-1"
3724
3808
  data-state="open"
3725
3809
  [class]="menuClasses()"
3726
3810
  [style]="menuStyleText()"
@@ -5048,6 +5132,7 @@ export class Input implements DoCheck {
5048
5132
  }
5049
5133
 
5050
5134
  ngDoCheck(): void {
5135
+ void this.i18n.locale()
5051
5136
  const host = this.host.nativeElement as HTMLElement
5052
5137
  const input = this.inputEl?.nativeElement ?? host.querySelector('input')
5053
5138
  const left =
@@ -5070,9 +5155,10 @@ export class Input implements DoCheck {
5070
5155
  this.sync.sync(right, this.hasRight || clear, this.parentOf(right))
5071
5156
  if (!this.movedRest && input) {
5072
5157
  this.restDescribedBy = host.getAttribute('aria-describedby')
5073
- moveRestAttributes(host, input)
5074
5158
  this.movedRest = true
5159
+ moveRestAttributes(host, input)
5075
5160
  }
5161
+ reapplyRestAttributes(host, input)
5076
5162
  if (this.value !== undefined && input && input.value !== String(this.value))
5077
5163
  input.value = String(this.value)
5078
5164
  }
@@ -5965,6 +6051,7 @@ the topmost dialog only, reference-counted body scroll lock).
5965
6051
  #wrapper
5966
6052
  [class]="cm().dialogWrapper"
5967
6053
  [style]="wrapperStyle()"
6054
+ role="presentation"
5968
6055
  (click)="handleOverlayClick($event)"
5969
6056
  >
5970
6057
  <div
@@ -5976,7 +6063,6 @@ the topmost dialog only, reference-counted body scroll lock).
5976
6063
  [class]="dialogClasses()"
5977
6064
  [style]="dialogStyle()"
5978
6065
  [attr.data-testid]="testId"
5979
- (click)="stopPropagation($event)"
5980
6066
  >
5981
6067
  @if (title) {
5982
6068
  <div [class]="cm().dialogHeader">
@@ -6013,7 +6099,7 @@ the topmost dialog only, reference-counted body scroll lock).
6013
6099
  </div>
6014
6100
  </div>`,
6015
6101
  })
6016
- export class Modal implements AfterViewInit, DoCheck, OnDestroy {
6102
+ export class Modal implements AfterViewInit, AfterViewChecked, DoCheck, OnDestroy {
6017
6103
  open = false
6018
6104
  title?: string
6019
6105
  size: ModalSize = 'md'
@@ -6075,12 +6161,12 @@ export class Modal implements AfterViewInit, DoCheck, OnDestroy {
6075
6161
  return resolveIcon('x-mark', this.cm().iconMd)
6076
6162
  }
6077
6163
 
6078
- stopPropagation(event: MouseEvent): void {
6079
- event.stopPropagation()
6080
- }
6081
-
6082
6164
  handleOverlayClick(event: MouseEvent): void {
6083
- if (this.closeOnOverlayClick && event.target === event.currentTarget) this.requestClose()
6165
+ if (event.target !== event.currentTarget) {
6166
+ event.stopPropagation()
6167
+ return
6168
+ }
6169
+ if (this.closeOnOverlayClick) this.requestClose()
6084
6170
  }
6085
6171
 
6086
6172
  requestClose(): void {
@@ -6127,6 +6213,12 @@ export class Modal implements AfterViewInit, DoCheck, OnDestroy {
6127
6213
  this.syncScrollLock()
6128
6214
  }
6129
6215
 
6216
+ ngAfterViewChecked(): void {
6217
+ reapplyRestAttributes(this.host.nativeElement, this.dialog?.nativeElement, {
6218
+ includeDescribedBy: true,
6219
+ })
6220
+ }
6221
+
6130
6222
  ngOnDestroy(): void {
6131
6223
  this.removeListeners()
6132
6224
  popModalStack(this.stackId)
@@ -6200,18 +6292,7 @@ export class Modal implements AfterViewInit, DoCheck, OnDestroy {
6200
6292
  this.wrapper?.nativeElement.remove()
6201
6293
  this.moved = false
6202
6294
  }
6203
-
6204
- private syncScrollLock(): void {
6205
- const shouldLock = !!this.open && this.preventScroll
6206
- if (shouldLock && !this.locked) {
6207
- this.sync.lock()
6208
- this.locked = true
6209
- } else if (!shouldLock && this.locked) {
6210
- this.sync.unlock()
6211
- this.locked = false
6212
- }
6213
- }
6214
- // … truncated — 3 more members: addListeners, removeListeners, handleKeyDown; the full declaration is in node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts
6295
+ // … truncated — 4 more members: syncScrollLock, addListeners, removeListeners, handleKeyDown; the full declaration is in node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts
6215
6296
  ```
6216
6297
 
6217
6298
  _(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/modal.component.d.ts`.)_
@@ -8134,7 +8215,7 @@ from the DOM — the projected nodes need an always-mounted capture point.
8134
8215
  '[attr.data-mol-id]': 'automationId',
8135
8216
  },
8136
8217
  template: `@if (breadcrumbs && breadcrumbs.length > 0) {
8137
- <nav [class]="cm().pageHeaderBreadcrumbs" aria-label="Breadcrumb">
8218
+ <nav [class]="cm().pageHeaderBreadcrumbs" [attr.aria-label]="breadcrumbLabel()">
8138
8219
  @for (crumb of breadcrumbs; track $index) {
8139
8220
  @if ($index > 0) {
8140
8221
  <span [class]="cm().pageHeaderBreadcrumbSeparator" aria-hidden="true">/</span>
@@ -8178,6 +8259,13 @@ export class PageHeader implements AfterViewInit, DoCheck {
8178
8259
  /** The actions wrapper (always in the template; detached when unused). */
8179
8260
  @ViewChild('actionsSlot') actionsSlot?: ElementRef<HTMLDivElement>
8180
8261
 
8262
+ /**
8263
+ * Reactive translation, read in the injection context. Its `t` reads the
8264
+ * locale, so the view re-renders the label on a locale switch (the static `t`
8265
+ * does not).
8266
+ */
8267
+ private readonly i18n = useTranslation()
8268
+
8181
8269
  private readonly sync = new SlotWrapper(inject(ElementRef), inject(Renderer2))
8182
8270
  private hasActions = false
8183
8271
  private actionsParent: HTMLElement | null = null
@@ -8198,6 +8286,14 @@ export class PageHeader implements AfterViewInit, DoCheck {
8198
8286
  return this.cm().cn(this.cm().pageHeader, this.className)
8199
8287
  }
8200
8288
 
8289
+ /**
8290
+ * The breadcrumb nav's accessible label.
8291
+ * @returns The label text.
8292
+ */
8293
+ breadcrumbLabel(): string {
8294
+ return this.i18n.t('ui.pageHeader.breadcrumbs', undefined, { defaultValue: 'Breadcrumb' })
8295
+ }
8296
+
8201
8297
  /**
8202
8298
  * Serializes the inline style.
8203
8299
  * @returns The style attribute text.
@@ -8922,14 +9018,22 @@ keeps it open with the value intact. The host is unwrapped
8922
9018
  'data-parity-unwrap': '',
8923
9019
  style: 'display: contents',
8924
9020
  },
8925
- template: `<mol-modal [open]="open" (close)="onModalClose()"
9021
+ template: `<mol-modal
9022
+ [open]="open"
9023
+ (close)="onModalClose()"
9024
+ [attr.aria-labelledby]="titleId"
9025
+ [attr.aria-describedby]="description ? descriptionId : null"
8926
9026
  ><form (submit)="handleSubmit($event)">
8927
9027
  <div [class]="cm().stack(3)">
8928
- <h2 #titleSlot [class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))">
9028
+ <h2
9029
+ #titleSlot
9030
+ [attr.id]="titleId"
9031
+ [class]="cm().cn(cm().textSize('lg'), cm().fontWeight('bold'))"
9032
+ >
8929
9033
  <ng-content select="[slot=title]"></ng-content>
8930
9034
  </h2>
8931
9035
  @if (description) {
8932
- <p [class]="cm().textSize('sm')">{{ description }}</p>
9036
+ <p [attr.id]="descriptionId" [class]="cm().textSize('sm')">{{ description }}</p>
8933
9037
  }
8934
9038
  <div
8935
9039
  mol-input
@@ -8965,7 +9069,7 @@ keeps it open with the value intact. The host is unwrapped
8965
9069
  </form></mol-modal
8966
9070
  >`,
8967
9071
  })
8968
- export class PromptDialog implements AfterViewInit, DoCheck {
9072
+ export class PromptDialog implements AfterViewInit, AfterViewChecked, DoCheck {
8969
9073
  /** Whether the dialog is open. */
8970
9074
  open = false
8971
9075
  /** Dialog heading (node-valued prop). */
@@ -8976,10 +9080,7 @@ export class PromptDialog implements AfterViewInit, DoCheck {
8976
9080
  placeholder?: string
8977
9081
  /** Value the input starts from every time the dialog opens. */
8978
9082
  initialValue = ''
8979
- /**
8980
- * Called with the entered value on confirm. Resolve to close the dialog;
8981
- * reject or throw to keep it open.
8982
- */
9083
+ /** Called with the entered value on confirm. */
8983
9084
  onSubmit?: (value: string) => void | Promise<void>
8984
9085
  /** Confirm-button label. */
8985
9086
  confirmLabel?: string
@@ -9002,50 +9103,41 @@ export class PromptDialog implements AfterViewInit, DoCheck {
9002
9103
  /** The composed input (its native element receives React's aria-label). */
9003
9104
  @ViewChild(Input) inputComponent?: Input
9004
9105
 
9106
+ /** Per-instance id of the rendered title heading, wired as the dialog's accessible name: the binding on `<mol-modal>` lands on its host element, which Modal's res… */
9107
+ readonly titleId = nextInstanceId()
9108
+
9109
+ /** Per-instance id of the rendered description paragraph, wired as the dialog's accessible description (only bound when a description renders — a reference to not… */
9110
+ readonly descriptionId = nextInstanceId()
9111
+
9005
9112
  /** The current input value. */
9006
9113
  readonly value = signal('')
9007
9114
  /** Whether a submit is in flight. */
9008
9115
  readonly pending = signal(false)
9009
9116
 
9010
- /**
9011
- * Reactive translation, read in the injection context. Its `t` reads the
9012
- * locale, so the view re-renders the text on a locale switch (the static `t`
9013
- * does not).
9014
- */
9117
+ /** Reactive translation, read in the injection context. */
9015
9118
  private readonly i18n = useTranslation()
9016
9119
 
9017
9120
  private lastOpen = false
9018
9121
  private lastInitial = ''
9122
+ /** Whether an open transition is waiting for the after-view input focus. */
9123
+ private pendingInputFocus = false
9019
9124
 
9020
- /**
9021
- * The current class map.
9022
- * @returns The UIClassMap.
9023
- */
9125
+ /** The current class map. */
9024
9126
  cm(): UIClassMap {
9025
9127
  return getClassMap()
9026
9128
  }
9027
9129
 
9028
- /**
9029
- * The cancel button's label.
9030
- * @returns The label text.
9031
- */
9130
+ /** The cancel button's label. */
9032
9131
  cancelText(): string {
9033
9132
  return this.cancelLabel ?? this.i18n.t('prompt.cancel', {}, { defaultValue: 'Cancel' })
9034
9133
  }
9035
9134
 
9036
- /**
9037
- * The confirm button's label.
9038
- * @returns The label text.
9039
- */
9135
+ /** The confirm button's label. */
9040
9136
  confirmText(): string {
9041
9137
  return this.confirmLabel ?? this.i18n.t('prompt.confirm', {}, { defaultValue: 'Confirm' })
9042
9138
  }
9043
9139
 
9044
- /**
9045
- * The input's accessible label: React uses the title when it is a plain
9046
- * string, otherwise the placeholder.
9047
- * @returns The label, or null when React would render none.
9048
- */
9140
+ /** The input's accessible label: React uses the title when it is a plain string, otherwise the placeholder. */
9049
9141
  inputLabel(): string | null {
9050
9142
  const title = this.titleSlot?.nativeElement
9051
9143
  if (title) {
@@ -9056,10 +9148,7 @@ export class PromptDialog implements AfterViewInit, DoCheck {
9056
9148
  return this.placeholder ?? null
9057
9149
  }
9058
9150
 
9059
- /**
9060
- * Seeds the value when the dialog opens (React's `[open, initialValue]`
9061
- * effect).
9062
- */
9151
+ /** Seeds the value when the dialog opens (React's `[open, initialValue]` effect). */
9063
9152
  ngAfterViewInit(): void {
9064
9153
  this.applyInputLabel()
9065
9154
  this.lastOpen = !!this.open
@@ -9067,12 +9156,13 @@ export class PromptDialog implements AfterViewInit, DoCheck {
9067
9156
  if (this.open) {
9068
9157
  this.value.set(this.initialValue)
9069
9158
  this.pending.set(false)
9159
+ // The dialog exists to take one string, so opening it puts focus in the
9160
+ // input — after the Modal has focused the dialog's first control.
9161
+ this.pendingInputFocus = true
9070
9162
  }
9071
9163
  }
9072
9164
 
9073
- /**
9074
- * Re-seeds the value on a later open transition (React's effect).
9075
- */
9165
+ /** Re-seeds the value on a later open transition (React's effect). */
9076
9166
  ngDoCheck(): void {
9077
9167
  const open = !!this.open
9078
9168
  this.applyInputLabel()
@@ -9082,14 +9172,24 @@ export class PromptDialog implements AfterViewInit, DoCheck {
9082
9172
  if (open) {
9083
9173
  this.value.set(this.initialValue)
9084
9174
  this.pending.set(false)
9175
+ this.pendingInputFocus = true
9085
9176
  }
9086
9177
  }
9087
9178
  }
9088
9179
 
9089
- /**
9090
- * Applies React's `aria-label` to the inner input (it is a rest prop there,
9091
- * and the view queries it needs resolve only after view init).
9092
- */
9180
+ /** Focuses the input after the view — and the composed `Modal`'s focus move — has settled (React's `[open]` effect running after the Modal's effects). */
9181
+ ngAfterViewChecked(): void {
9182
+ if (!this.pendingInputFocus) return
9183
+ this.pendingInputFocus = false
9184
+ this.focusInput()
9185
+ }
9186
+
9187
+ /** Moves focus into the dialog's input (the input ends up focused, exactly as React's post-Modal focus effect leaves it). */
9188
+ focusInput(): void {
9189
+ this.inputComponent?.inputEl?.nativeElement.focus()
9190
+ }
9191
+
9192
+ /** Applies React's `aria-label` to the inner input (it is a rest prop there, and the view queries it needs resolve only after view init). */
9093
9193
  private applyInputLabel(): void {
9094
9194
  const input = this.inputComponent?.inputEl?.nativeElement
9095
9195
  if (!input) return
@@ -9098,30 +9198,18 @@ export class PromptDialog implements AfterViewInit, DoCheck {
9098
9198
  else input.setAttribute('aria-label', label)
9099
9199
  }
9100
9200
 
9101
- /**
9102
- * Tracks the typed value (React's controlled `onChange`).
9103
- *
9104
- * @param event - The native input event.
9105
- */
9201
+ /** Tracks the typed value (React's controlled `onChange`). */
9106
9202
  onInput(event: Event): void {
9107
9203
  this.value.set((event.target as HTMLInputElement).value)
9108
9204
  }
9109
9205
 
9110
- /**
9111
- * Modal's close request: ignored while a submit is pending (React passes a
9112
- * no-op `onClose` while pending).
9113
- */
9206
+ /** Modal's close request: ignored while a submit is pending (React passes a no-op `onClose` while pending). */
9114
9207
  onModalClose(): void {
9115
9208
  if (this.pending()) return
9116
9209
  this.close.emit()
9117
9210
  }
9118
9211
 
9119
- /**
9120
- * Submits the entered value: resolve closes and resets; reject keeps the
9121
- * dialog open (React's `handleSubmit`).
9122
- *
9123
- * @param event - The form submit event.
9124
- */
9212
+ /** Submits the entered value: resolve closes and resets; reject keeps the dialog open (React's `handleSubmit`). */
9125
9213
  handleSubmit(event: Event): void {
9126
9214
  event.preventDefault()
9127
9215
  if (this.pending()) return
@@ -9140,6 +9228,8 @@ export class PromptDialog implements AfterViewInit, DoCheck {
9140
9228
  }
9141
9229
  ```
9142
9230
 
9231
+ _(Member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/prompt-dialog.component.d.ts`.)_
9232
+
9143
9233
  #### `RadioGroup`
9144
9234
 
9145
9235
  RadioGroup component.
@@ -9808,6 +9898,7 @@ backdrop, portaled into `document.body`.
9808
9898
  #wrapper
9809
9899
  [class]="cm().cn(cm().position('fixed'), cm().inset0)"
9810
9900
  [style]="wrapperStyle()"
9901
+ role="presentation"
9811
9902
  (click)="handleBackdropClick($event)"
9812
9903
  >
9813
9904
  <div
@@ -9821,7 +9912,6 @@ backdrop, portaled into `document.body`.
9821
9912
  [style]="panelStyle()"
9822
9913
  [attr.data-mol-id]="dataMolId"
9823
9914
  [attr.data-testid]="testId"
9824
- (click)="stopPropagation($event)"
9825
9915
  >
9826
9916
  <div
9827
9917
  #headerRow
@@ -9958,12 +10048,12 @@ export class ResponsiveAppShellDrawer implements AfterViewInit, DoCheck, OnDestr
9958
10048
  return resolveIcon('x-mark', this.cm().iconMd)
9959
10049
  }
9960
10050
 
9961
- stopPropagation(event: MouseEvent): void {
9962
- event.stopPropagation()
9963
- }
9964
-
9965
10051
  handleBackdropClick(event: MouseEvent): void {
9966
- if (event.target === event.currentTarget) this.shell().closeDrawer()
10052
+ if (event.target !== event.currentTarget) {
10053
+ event.stopPropagation()
10054
+ return
10055
+ }
10056
+ this.shell().closeDrawer()
9967
10057
  }
9968
10058
 
9969
10059
  ngAfterViewInit(): void {
@@ -10309,6 +10399,8 @@ export class Select implements AfterViewInit, AfterViewChecked {
10309
10399
  }
10310
10400
 
10311
10401
  ngAfterViewChecked(): void {
10402
+ void this.i18n.locale()
10403
+ reapplyRestAttributes(this.host.nativeElement, this.selectEl?.nativeElement)
10312
10404
  this.applyValue(false)
10313
10405
  }
10314
10406
 
@@ -10445,7 +10537,11 @@ matching props override it.
10445
10537
  <span [class]="secondaryClasses()">{{ secondary }}</span>
10446
10538
  }
10447
10539
  </span></button
10448
- ><mol-modal [open]="isOpen()" (close)="isOpen.set(false)" [className]="cm().drawer"
10540
+ ><mol-modal
10541
+ [open]="isOpen()"
10542
+ (close)="isOpen.set(false)"
10543
+ [className]="cm().drawer"
10544
+ [attr.aria-label]="drawerLabel()"
10449
10545
  ><mol-panel-close-provider [close]="closePanel"
10450
10546
  ><ng-content></ng-content></mol-panel-close-provider
10451
10547
  ></mol-modal>`,
@@ -10511,6 +10607,19 @@ export class SidebarUserCard implements AfterViewInit, OnDestroy {
10511
10607
  )
10512
10608
  }
10513
10609
 
10610
+ /**
10611
+ * The drawer's accessible label. The drawer is a title-less Modal (its
10612
+ * panel content carries its own headings), so it is named with the
10613
+ * localized `sidebarUserCard.drawer` label: the binding on `<mol-modal>`
10614
+ * lands on its host element, which Modal's rest-attribute move copies onto
10615
+ * the dialog `<div>` — screen readers announce "Account" instead of an
10616
+ * unnamed dialog (axe `aria-dialog-name`).
10617
+ * @returns The label text.
10618
+ */
10619
+ drawerLabel(): string {
10620
+ return this.i18n.t('sidebarUserCard.drawer', {}, { defaultValue: 'Account' })
10621
+ }
10622
+
10514
10623
  /**
10515
10624
  * The resolved display name (React's fallback chain).
10516
10625
  * @returns The name.
@@ -11368,7 +11477,7 @@ node value.
11368
11477
  '[style]': 'hostStyle()',
11369
11478
  '[attr.data-testid]': 'testId',
11370
11479
  },
11371
- template: `<div [class]="listClasses()" role="tablist" (keydown)="handleKeyDown($event)">
11480
+ template: `<div [class]="listClasses()" role="tablist">
11372
11481
  @for (item of items; track item.value) {
11373
11482
  <button
11374
11483
  #tabBtn
@@ -11376,11 +11485,12 @@ node value.
11376
11485
  type="button"
11377
11486
  role="tab"
11378
11487
  [attr.aria-selected]="item.value === activeValue() ? 'true' : 'false'"
11379
- [attr.aria-controls]="panelId(item.value)"
11488
+ [attr.aria-controls]="controlsId(item)"
11380
11489
  [attr.data-state]="item.value === activeValue() ? 'active' : 'inactive'"
11381
11490
  [attr.tabindex]="item.value === activeValue() ? 0 : -1"
11382
11491
  [disabled]="!!item.disabled"
11383
11492
  (click)="selectTab(item.value)"
11493
+ (keydown)="handleKeyDown($event)"
11384
11494
  [class]="triggerClasses()"
11385
11495
  >
11386
11496
  @if (item.icon) {
@@ -11445,54 +11555,38 @@ export class Tabs implements OnInit {
11445
11555
  /** The uncontrolled active value. */
11446
11556
  private readonly internalValue = signal<string | undefined>(undefined)
11447
11557
 
11448
- /**
11449
- * The current class map.
11450
- * @returns The UIClassMap.
11451
- */
11558
+ /** The current class map. */
11452
11559
  cm(): UIClassMap {
11453
11560
  return getClassMap()
11454
11561
  }
11455
11562
 
11456
- /**
11457
- * Seeds the uncontrolled value once, at mount, like React's
11458
- * `useState(defaultValue || items[0]?.value)`: reordering the tabs later keeps
11459
- * the active tab rather than activating whichever tab is now first.
11460
- */
11563
+ /** Seeds the uncontrolled value once, at mount, like React's `useState(defaultValue || items[0]?.value)`: reordering the tabs later keeps the active tab rather th… */
11461
11564
  ngOnInit(): void {
11462
11565
  this.internalValue.set(this.defaultValue || this.items[0]?.value)
11463
11566
  }
11464
11567
 
11465
- /**
11466
- * The active tab value: the controlled `value`, else the uncontrolled one.
11467
- * @returns The active value.
11468
- */
11568
+ /** The active tab value: the controlled `value`, else the uncontrolled one. */
11469
11569
  activeValue(): string | undefined {
11470
11570
  if (this.value !== undefined) return this.value
11471
11571
  return this.internalValue()
11472
11572
  }
11473
11573
 
11474
- /**
11475
- * The tab button id for a value.
11476
- * @param value - The tab value.
11477
- * @returns The id.
11478
- */
11574
+ /** The tab button id for a value. */
11479
11575
  tabId(value: string): string {
11480
11576
  return `${this.idBase}-tab-${value}`
11481
11577
  }
11482
11578
 
11483
- /**
11484
- * The tabpanel id for a value.
11485
- * @param value - The tab value.
11486
- * @returns The id.
11487
- */
11579
+ /** The tabpanel id for a value. */
11488
11580
  panelId(value: string): string {
11489
11581
  return `${this.idBase}-tabpanel-${value}`
11490
11582
  }
11491
11583
 
11492
- /**
11493
- * The tab-list class list.
11494
- * @returns The class string.
11495
- */
11584
+ /** The `aria-controls` value for one tab, or null: only the tab whose panel is actually rendered (the active one, when its item has content) may name it — an `ari… */
11585
+ controlsId(item: TabItem<string>): string | null {
11586
+ return item.value === this.activeValue() && !!item.content ? this.panelId(item.value) : null
11587
+ }
11588
+
11589
+ /** The tab-list class list. */
11496
11590
  listClasses(): string {
11497
11591
  return this.cm().cn(
11498
11592
  this.cm().tabsList({ variant: this.variant, size: this.size }),
@@ -11500,10 +11594,7 @@ export class Tabs implements OnInit {
11500
11594
  )
11501
11595
  }
11502
11596
 
11503
- /**
11504
- * The tab-button class list.
11505
- * @returns The class string.
11506
- */
11597
+ /** The tab-button class list. */
11507
11598
  triggerClasses(): string {
11508
11599
  return this.cm().cn(
11509
11600
  this.cm().tabsTrigger({ variant: this.variant, size: this.size }),
@@ -11511,82 +11602,51 @@ export class Tabs implements OnInit {
11511
11602
  )
11512
11603
  }
11513
11604
 
11514
- /**
11515
- * The tabpanel class list.
11516
- * @returns The class string.
11517
- */
11605
+ /** The tabpanel class list. */
11518
11606
  contentClasses(): string {
11519
11607
  return this.cm().tabsContent({ variant: this.variant, size: this.size })
11520
11608
  }
11521
11609
 
11522
- /**
11523
- * Serializes the root's inline style.
11524
- * @returns The style attribute text.
11525
- */
11610
+ /** Serializes the root's inline style. */
11526
11611
  hostStyle(): string | null {
11527
11612
  return styleText(this.style)
11528
11613
  }
11529
11614
 
11530
- /**
11531
- * Narrows a node-valued prop to a TemplateRef.
11532
- *
11533
- * @param value - The prop value.
11534
- * @returns The template, or null.
11535
- */
11615
+ /** Narrows a node-valued prop to a TemplateRef. */
11536
11616
  asTemplate(value: unknown): TemplateRef<unknown> | null {
11537
11617
  return value instanceof TemplateRef ? value : null
11538
11618
  }
11539
11619
 
11540
- /**
11541
- * A plain-string node value's text.
11542
- *
11543
- * @param value - The prop value.
11544
- * @returns The text, or empty.
11545
- */
11620
+ /** A plain-string node value's text. */
11546
11621
  nodeText(value: unknown): string {
11547
11622
  return typeof value === 'string' ? value : ''
11548
11623
  }
11549
11624
 
11550
- /**
11551
- * Whether the active tab has content (React renders no panel without it).
11552
- * @returns True when content is given.
11553
- */
11625
+ /** Whether the active tab has content (React renders no panel without it). */
11554
11626
  hasContent(): boolean {
11555
11627
  const active = this.items.find((item) => item.value === this.activeValue())
11556
11628
  return !!active?.content
11557
11629
  }
11558
11630
 
11559
- /**
11560
- * The active tab's content as a template.
11561
- * @returns The template, or null for a plain string.
11562
- */
11631
+ /** The active tab's content as a template. */
11563
11632
  activeContent(): TemplateRef<unknown> | null {
11564
11633
  const active = this.items.find((item) => item.value === this.activeValue())
11565
11634
  return active ? this.asTemplate(active.content) : null
11566
11635
  }
11567
11636
 
11568
- /**
11569
- * The active tab's plain-string content.
11570
- * @returns The text, or empty.
11571
- */
11637
+ /** The active tab's plain-string content. */
11572
11638
  contentText(): string {
11573
11639
  const active = this.items.find((item) => item.value === this.activeValue())
11574
11640
  return this.nodeText(active?.content)
11575
11641
  }
11576
11642
 
11577
- /**
11578
- * Selects a tab and notifies the caller (React's `selectTab`).
11579
- * @param tabValue - The tab value.
11580
- */
11643
+ /** Selects a tab and notifies the caller (React's `selectTab`). */
11581
11644
  selectTab(tabValue: string): void {
11582
11645
  if (this.value === undefined) this.internalValue.set(tabValue)
11583
11646
  this.change.emit(tabValue)
11584
11647
  }
11585
11648
 
11586
- /**
11587
- * The APG keyboard model: Left/Right/Home/End move focus AND selection.
11588
- * @param event - The key event.
11589
- */
11649
+ /** The APG keyboard model: Left/Right/Home/End move focus AND selection. */
11590
11650
  handleKeyDown(event: KeyboardEvent): void {
11591
11651
  const enabled = this.items.filter((item) => !item.disabled)
11592
11652
  if (enabled.length === 0) return
@@ -11615,10 +11675,7 @@ export class Tabs implements OnInit {
11615
11675
  this.focusTab(nextValue)
11616
11676
  }
11617
11677
 
11618
- /**
11619
- * Moves focus to the tab with the given value (React's `tabRefs.focus()`).
11620
- * @param value - The tab value.
11621
- */
11678
+ /** Moves focus to the tab with the given value (React's `tabRefs.focus()`). */
11622
11679
  private focusTab(value: string): void {
11623
11680
  const match = this.tabButtons?.find((ref) => ref.nativeElement.id === this.tabId(value))
11624
11681
  match?.nativeElement.focus()
@@ -11626,6 +11683,8 @@ export class Tabs implements OnInit {
11626
11683
  }
11627
11684
  ```
11628
11685
 
11686
+ _(Member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-ui-angular/dist/components/tabs.component.d.ts`.)_
11687
+
11629
11688
  #### `Textarea`
11630
11689
 
11631
11690
  Textarea component.
@@ -11738,6 +11797,10 @@ export class Textarea implements AfterViewInit, AfterViewChecked {
11738
11797
  @ViewChild('textareaEl') textareaEl?: ElementRef<HTMLTextAreaElement>
11739
11798
 
11740
11799
  private readonly host = inject(ElementRef)
11800
+
11801
+ /** Reactive translation, read in the injection context. */
11802
+ private readonly i18n = useTranslation()
11803
+
11741
11804
  /** The `aria-describedby` the caller spread onto the host (React's rest). */
11742
11805
  private restDescribedBy: string | null = null
11743
11806
  /** Whether the rest-describedby value was captured. */
@@ -11824,6 +11887,13 @@ export class Textarea implements AfterViewInit, AfterViewChecked {
11824
11887
 
11825
11888
  /** Re-applies a controlled value and recomputes the autoResize height after every check (React re-runs the value effect whenever `value` changes; running here cov… */
11826
11889
  ngAfterViewChecked(): void {
11890
+ // Registering this view against the locale: a switch marks it for check,
11891
+ // so this hook runs and the reapply below moves the caller's re-bound
11892
+ // rest attribute onto the textarea. Without the read, zoneless change
11893
+ // detection never re-checks this view — the parent's re-bound
11894
+ // `[attr.aria-label]` would land on the host and stay there.
11895
+ void this.i18n.locale()
11896
+ reapplyRestAttributes(this.host.nativeElement, this.textareaEl?.nativeElement)
11827
11897
  this.applyValue(false)
11828
11898
  this.resize()
11829
11899
  }
@@ -12400,6 +12470,7 @@ React's module-level `activeTooltips` map.
12400
12470
  template: `<div
12401
12471
  #triggerWrap
12402
12472
  [class]="cm().tooltipTrigger"
12473
+ role="presentation"
12403
12474
  (mouseover)="show()"
12404
12475
  (mouseout)="scheduleHide()"
12405
12476
  (focusin)="handleFocus($event)"
@@ -13683,6 +13754,8 @@ function formSubmitErrorMessages(error: unknown, fallback: string): string[]
13683
13754
 
13684
13755
  #### `getIconSvg(name, className)` _(deprecated)_
13685
13756
 
13757
+ > **Deprecated:** Used only by the deprecated `Molecule*` spike components.
13758
+
13686
13759
  Generates SVG markup string from an icon name.
13687
13760
 
13688
13761
  ```typescript
@@ -13801,8 +13874,9 @@ function resolveIcon(name: IconName, className?: string): ResolvedIcon
13801
13874
  Moves every rest attribute (`aria-*`, `data-*`, `id`, …) from the host
13802
13875
  element onto the element React spreads `{...rest}` onto.
13803
13876
 
13804
- Adapter bindings write each attribute once (case props are static), so a
13805
- move at first view init is stable.
13877
+ The first move happens at view init; a caller whose rest attributes follow
13878
+ state (an accessible label that switches with the locale) re-moves the
13879
+ re-bound ones with {@link reapplyRestAttributes}.
13806
13880
 
13807
13881
  ```typescript
13808
13882
  function moveRestAttributes(host: Element, target: Element | undefined | null): string[]
@@ -13813,6 +13887,35 @@ function moveRestAttributes(host: Element, target: Element | undefined | null):
13813
13887
 
13814
13888
  **Returns:** The moved attribute names.
13815
13889
 
13890
+ #### `reapplyRestAttributes(host, target, options)`
13891
+
13892
+ Moves the rest attributes a caller RE-BOUND since the last move.
13893
+
13894
+ Angular writes a changed `[attr.x]` binding back onto the host after
13895
+ {@link moveRestAttributes} took its first value off it, so without this the
13896
+ inner element keeps the first label forever while the host accumulates the
13897
+ new one. `aria-describedby` is left alone by default: the input family
13898
+ captured the host's value once and merges it with the field context's own
13899
+ target on its inner binding, so re-moving a re-bound value would erase that
13900
+ merge. A component that spreads the attribute onto `...rest` with no merge
13901
+ (Modal) passes {@link ReapplyRestAttributesOptions.includeDescribedBy}.
13902
+
13903
+ Idempotent: a host with nothing re-bound moves nothing.
13904
+
13905
+ ```typescript
13906
+ function reapplyRestAttributes(
13907
+ host: Element,
13908
+ target: Element | undefined | null,
13909
+ options?: ReapplyRestAttributesOptions,
13910
+ ): string[]
13911
+ ```
13912
+
13913
+ - `host` — The component host element.
13914
+ - `target` — The element React's `...rest` targets.
13915
+ - `options` — Whether to move `aria-describedby` too.
13916
+
13917
+ **Returns:** The moved attribute names.
13918
+
13816
13919
  #### `kebab(key)`
13817
13920
 
13818
13921
  Converts a camelCase CSS property name to kebab-case.
@@ -13874,7 +13977,7 @@ Peer dependencies:
13874
13977
  - `@molecule/app-angular` ^3.4.0
13875
13978
  - `@molecule/app-i18n` ^1.0.1
13876
13979
  - `@molecule/app-icons` ^1.0.1
13877
- - `@molecule/app-ui` ^1.0.1
13980
+ - `@molecule/app-ui` ^1.3.10
13878
13981
 
13879
13982
  ### Runtime Dependencies
13880
13983