@lifecorner/angular-ui-kit 3.33.0 → 3.34.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.
@@ -1 +1 @@
1
- {"version":3,"file":"lifecorner-angular-ui-kit-modal.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/modal/modal.component.ts","../../../../libs/angular-ui-kit/src/lib/modal/modal.component.html"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n input,\n output,\n computed,\n effect,\n linkedSignal,\n HostListener,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { IconComponent, ɵprovideKitIcons } from '@lifecorner/angular-ui-kit/icon';\nimport { ICON_X_MARK } from '@lifecorner/angular-ui-kit/icons';\nimport { OverlayStackService } from '@lifecorner/angular-ui-kit/internal/overlay';\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\n/**\n * Where the dialog sits.\n * - `center`: centred on every screen (3.2)\n * - `auto`: a bottom sheet below 640 px viewport width (full width, top\n * corners rounded, above the safe-area inset, in thumb reach), centred above\n * - `sheet`: a bottom sheet on every screen\n */\nexport type ModalPlacement = 'center' | 'auto' | 'sheet';\n\n/**\n * Modal dialog component for focused user interactions.\n *\n * Features:\n * - Size presets (sm, md, lg, xl, full)\n * - Placement: centred, or a bottom sheet on phones (`placement=\"auto\"`)\n * - Header and footer stay visible while the body scrolls; the close button\n * is a 44 px target\n * - Focus trap for keyboard accessibility\n * - Backdrop click and Escape key to close\n * - Two-way open binding\n * - Header, body, and footer content slots\n * - Optional close button\n * - Accessible with ARIA dialog role\n *\n * @example\n * ```html\n * <lc-modal [(open)]=\"isOpen\" size=\"md\" [closeOnBackdropClick]=\"true\">\n * <div slot=\"header\"><h2>Title</h2></div>\n * <div slot=\"body\">Content</div>\n * <div slot=\"footer\"><lc-button (click)=\"close()\">Close</lc-button></div>\n * </lc-modal>\n * ```\n */\n@Component({\n selector: 'lc-modal',\n standalone: true,\n imports: [A11yModule, IconComponent],\n viewProviders: [ɵprovideKitIcons([ICON_X_MARK])],\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None, // Required for dynamic size class styling\n})\nexport class ModalComponent implements OnDestroy {\n private static nextId = 0;\n\n /**\n * Whether the modal is open (input from parent)\n * @default false\n */\n open = input<boolean>(false);\n\n /**\n * Modal size\n * @default 'md'\n */\n size = input<ModalSize>('md');\n\n /**\n * Where the dialog sits: `center` (3.2), `auto` — a bottom sheet below\n * 640 px viewport width and centred above — or `sheet` (always a bottom\n * sheet). The sheet spans the width, rounds its top corners, keeps clear of\n * `env(safe-area-inset-bottom)` and is at most 90 % of the dynamic viewport\n * high; header and footer stay visible while the body scrolls. `full`\n * size ignores it.\n * @default 'center'\n */\n placement = input<ModalPlacement>('center');\n\n /**\n * Whether clicking backdrop closes modal\n * @default true\n */\n closeOnBackdropClick = input<boolean>(true);\n\n /**\n * Whether pressing Escape closes modal\n * @default true\n */\n closeOnEscape = input<boolean>(true);\n\n /**\n * Whether to show close button in header\n * @default true\n */\n showCloseButton = input<boolean>(true);\n\n /**\n * ARIA label for accessibility\n */\n ariaLabel = input<string>();\n\n /**\n * ARIA labelledby ID\n */\n ariaLabelledBy = input<string>();\n\n /**\n * ARIA describedby ID\n */\n ariaDescribedBy = input<string>();\n\n /** Accessible name of the close button (`showCloseButton`). */\n closeAriaLabel = input('Close modal');\n\n /**\n * Emitted when modal opens\n */\n readonly modalOpened = output<void>();\n\n /**\n * Emitted when modal closes\n */\n readonly modalClosed = output<void>();\n\n /**\n * Two-way binding for open state\n */\n readonly openChange = output<boolean>();\n\n /**\n * Emitted when backdrop is clicked\n */\n readonly backdropClicked = output<MouseEvent>();\n\n /**\n * Internal open state (protected for AOT); follows the `open` input and is\n * also set by the programmatic open/close methods.\n */\n protected _open = linkedSignal(() => this.open());\n\n /**\n * Computed modal classes\n */\n protected modalClasses = computed(() => {\n return `lc-modal lc-modal--${this.size()} lc-modal--placement-${this.placement()}`;\n });\n\n private readonly overlayStack = inject(OverlayStackService);\n /** Identifies this instance in the overlay stack. */\n private readonly modalId = `lc-modal-${++ModalComponent.nextId}`;\n private originalOverflow?: string;\n\n constructor() {\n // Watch for open state changes\n effect(() => {\n if (this._open()) {\n this.showModal();\n } else {\n this.hideModal();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.hideModal();\n }\n\n /**\n * Open the modal programmatically\n */\n openModal(): void {\n this._open.set(true);\n this.openChange.emit(true);\n this.modalOpened.emit();\n }\n\n /**\n * Close the modal programmatically\n */\n closeModal(): void {\n this._open.set(false);\n this.openChange.emit(false);\n this.modalClosed.emit();\n }\n\n /**\n * Handle backdrop click. Ignored while another overlay (popover, menu,\n * confirm dialog, …) sits above this modal — the click belongs to that layer.\n */\n protected onBackdropClick(event: MouseEvent): void {\n if (!this.overlayStack.claim(this.modalId, event)) return;\n this.backdropClicked.emit(event);\n if (this.closeOnBackdropClick()) {\n this.closeModal();\n }\n }\n\n /**\n * Handle close button click\n */\n protected onCloseClick(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.closeModal();\n }\n\n /**\n * Escape closes the modal only while it is the top-most overlay; the event\n * is consumed either way so overlays underneath stay open.\n */\n @HostListener('document:keydown', ['$event'])\n protected onDocumentKeydown(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !this._open()) return;\n if (!this.overlayStack.claim(this.modalId, event)) return;\n event.stopPropagation();\n if (this.closeOnEscape()) {\n this.closeModal();\n }\n }\n\n /**\n * Show the modal. Focus is moved inside and restored on close by the\n * template's `cdkTrapFocus` / `cdkTrapFocusAutoCapture`.\n */\n private showModal(): void {\n this.overlayStack.push(this.modalId);\n\n // Lock body scroll\n if (typeof document !== 'undefined' && this.originalOverflow === undefined) {\n this.originalOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n }\n\n /**\n * Hide the modal\n */\n private hideModal(): void {\n this.overlayStack.remove(this.modalId);\n\n // Restore body scroll\n if (typeof document !== 'undefined' && this.originalOverflow !== undefined) {\n document.body.style.overflow = this.originalOverflow;\n this.originalOverflow = undefined;\n }\n }\n}\n","@if (_open()) {\n <!-- Backdrop (the lc-modal does NOT use CDK Overlay; do not add the\n `cdk-overlay-backdrop` class here — it would be styled by global CDK\n rules and, vice versa, leak modal styling onto other overlays.) -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- backdrop click is a mouse shortcut; Escape and the close button close the modal -->\n <div\n class=\"lc-modal-backdrop\"\n (click)=\"onBackdropClick($event)\"\n ></div>\n\n <!-- Modal Content -->\n <div\n [class]=\"modalClasses()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n >\n <div class=\"lc-modal__header\">\n <ng-content select=\"[slot='header']\" />\n \n @if (showCloseButton()) {\n <button\n type=\"button\"\n class=\"lc-modal__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onCloseClick($event)\"\n >\n <lc-icon name=\"x-mark\" size=\"md\" [decorative]=\"true\" />\n </button>\n }\n </div>\n \n <div class=\"lc-modal__body\">\n <ng-content select=\"[slot='body']\" />\n <ng-content />\n </div>\n \n <div class=\"lc-modal__footer\">\n <ng-content select=\"[slot='footer']\" />\n </div>\n </div>\n}\n"],"mappings":";;;;;;;AA+DA,IAAa,iBAAb,MAAa,eAAc;CACjB,OAAO,SAAS;CAMxB,OAAO,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAM5B,OAAO,MAAiB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,C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A,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;EAAA,eACpB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;EAAC,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAMrC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAV1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAU,YACR;GAAI,SACP,CAAC,YAAY,aAAa;GAAC,eACrB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;GAAC,iBAG/B,wBAAwB;GAAM,eAChC,kBAAkB;GAAI,UAAA;GAAA,QAAA,CAAA,wxHAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgKpC,MAAA;GAAa,MAAA,CAAA,oBAAoB,CAAC,QAAQ,CAAC"}
1
+ {"version":3,"file":"lifecorner-angular-ui-kit-modal.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/modal/modal.component.ts","../../../../libs/angular-ui-kit/src/lib/modal/modal.component.html"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n input,\n output,\n computed,\n effect,\n linkedSignal,\n HostListener,\n OnDestroy,\n inject,\n afterNextRender,\n untracked,\n EnvironmentInjector,\n} from '@angular/core';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { IconComponent, ɵprovideKitIcons } from '@lifecorner/angular-ui-kit/icon';\nimport { ICON_X_MARK } from '@lifecorner/angular-ui-kit/icons';\nimport { OverlayStackService } from '@lifecorner/angular-ui-kit/internal/overlay';\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\n/**\n * Where the dialog sits.\n * - `center`: centred on every screen (3.2)\n * - `auto`: a bottom sheet below 640 px viewport width (full width, top\n * corners rounded, above the safe-area inset, in thumb reach), centred above\n * - `sheet`: a bottom sheet on every screen\n */\nexport type ModalPlacement = 'center' | 'auto' | 'sheet';\n\n/**\n * What a custom-element `returnFocusTo` host (`<lc-button>`) hands the focus\n * to when it can't take it itself.\n */\nconst FOCUSABLE =\n 'button:not([disabled]), [href], input:not([disabled]):not([type=hidden]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Modal dialog component for focused user interactions.\n *\n * Features:\n * - Size presets (sm, md, lg, xl, full)\n * - Placement: centred, or a bottom sheet on phones (`placement=\"auto\"`)\n * - Header and footer stay visible while the body scrolls; the close button\n * is a 44 px target\n * - Focus trap for keyboard accessibility; `returnFocusTo` (3.34) names the\n * element that gets the focus back after the dialog closed (WebKit doesn't\n * focus a tapped button, so the one captured at open is `body`)\n * - Backdrop click and Escape key to close\n * - Two-way open binding\n * - Header, body, and footer content slots\n * - Optional close button\n * - Accessible with ARIA dialog role\n *\n * @example\n * ```html\n * <lc-modal [(open)]=\"isOpen\" size=\"md\" [closeOnBackdropClick]=\"true\">\n * <div slot=\"header\"><h2>Title</h2></div>\n * <div slot=\"body\">Content</div>\n * <div slot=\"footer\"><lc-button (click)=\"close()\">Close</lc-button></div>\n * </lc-modal>\n * ```\n */\n@Component({\n selector: 'lc-modal',\n standalone: true,\n imports: [A11yModule, IconComponent],\n viewProviders: [ɵprovideKitIcons([ICON_X_MARK])],\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None, // Required for dynamic size class styling\n})\nexport class ModalComponent implements OnDestroy {\n private static nextId = 0;\n\n /**\n * Whether the modal is open (input from parent)\n * @default false\n */\n open = input<boolean>(false);\n\n /**\n * Modal size\n * @default 'md'\n */\n size = input<ModalSize>('md');\n\n /**\n * Where the dialog sits: `center` (3.2), `auto` — a bottom sheet below\n * 640 px viewport width and centred above — or `sheet` (always a bottom\n * sheet). The sheet spans the width, rounds its top corners, keeps clear of\n * `env(safe-area-inset-bottom)` and is at most 90 % of the dynamic viewport\n * high; header and footer stay visible while the body scrolls. `full`\n * size ignores it.\n * @default 'center'\n */\n placement = input<ModalPlacement>('center');\n\n /**\n * Whether clicking backdrop closes modal\n * @default true\n */\n closeOnBackdropClick = input<boolean>(true);\n\n /**\n * Whether pressing Escape closes modal\n * @default true\n */\n closeOnEscape = input<boolean>(true);\n\n /**\n * Whether to show close button in header\n * @default true\n */\n showCloseButton = input<boolean>(true);\n\n /**\n * ARIA label for accessibility\n */\n ariaLabel = input<string>();\n\n /**\n * ARIA labelledby ID\n */\n ariaLabelledBy = input<string>();\n\n /**\n * ARIA describedby ID\n */\n ariaDescribedBy = input<string>();\n\n /** Accessible name of the close button (`showCloseButton`). */\n closeAriaLabel = input('Close modal');\n\n /**\n * Element that gets the focus back after the dialog closed (3.34), instead\n * of the one that had it at open. Set it to the trigger: WebKit (Safari,\n * every iOS browser) doesn't focus a tapped button, so the captured element\n * is `body`. Applied after the next render, once the dialog has left the DOM\n * and the focus trap has restored its captured element. This holds on every\n * close: ×, Escape, backdrop, `open` false, `closeModal()`, and destroying an\n * open modal. A custom-element host that can't take focus (`<lc-button>`)\n * hands it to its first focusable descendant. Ignored when the element is no\n * longer in the document or can't take focus; the captured element then\n * keeps it. `null`: as before.\n * @default null\n */\n returnFocusTo = input<HTMLElement | null>(null);\n\n /**\n * Emitted when modal opens\n */\n readonly modalOpened = output<void>();\n\n /**\n * Emitted when modal closes\n */\n readonly modalClosed = output<void>();\n\n /**\n * Two-way binding for open state\n */\n readonly openChange = output<boolean>();\n\n /**\n * Emitted when backdrop is clicked\n */\n readonly backdropClicked = output<MouseEvent>();\n\n /**\n * Internal open state (protected for AOT); follows the `open` input and is\n * also set by the programmatic open/close methods.\n */\n protected _open = linkedSignal(() => this.open());\n\n /**\n * Computed modal classes\n */\n protected modalClasses = computed(() => {\n return `lc-modal lc-modal--${this.size()} lc-modal--placement-${this.placement()}`;\n });\n\n private readonly overlayStack = inject(OverlayStackService);\n /** Identifies this instance in the overlay stack. */\n private readonly modalId = `lc-modal-${++ModalComponent.nextId}`;\n private originalOverflow?: string;\n /**\n * The environment injector: a node injector would cancel the focus-return\n * hook when the modal is destroyed while open (`ConfirmService`).\n */\n private readonly environmentInjector = inject(EnvironmentInjector);\n /** Whether `showModal()` ran without a `hideModal()` after it. */\n private shown = false;\n\n constructor() {\n // Watch for open state changes\n effect(() => {\n if (this._open()) {\n this.showModal();\n } else {\n this.hideModal();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.hideModal();\n }\n\n /**\n * Open the modal programmatically\n */\n openModal(): void {\n this._open.set(true);\n this.openChange.emit(true);\n this.modalOpened.emit();\n }\n\n /**\n * Close the modal programmatically\n */\n closeModal(): void {\n this._open.set(false);\n this.openChange.emit(false);\n this.modalClosed.emit();\n }\n\n /**\n * Handle backdrop click. Ignored while another overlay (popover, menu,\n * confirm dialog, …) sits above this modal — the click belongs to that layer.\n */\n protected onBackdropClick(event: MouseEvent): void {\n if (!this.overlayStack.claim(this.modalId, event)) return;\n this.backdropClicked.emit(event);\n if (this.closeOnBackdropClick()) {\n this.closeModal();\n }\n }\n\n /**\n * Handle close button click\n */\n protected onCloseClick(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.closeModal();\n }\n\n /**\n * Escape closes the modal only while it is the top-most overlay; the event\n * is consumed either way so overlays underneath stay open.\n */\n @HostListener('document:keydown', ['$event'])\n protected onDocumentKeydown(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !this._open()) return;\n if (!this.overlayStack.claim(this.modalId, event)) return;\n event.stopPropagation();\n if (this.closeOnEscape()) {\n this.closeModal();\n }\n }\n\n /**\n * Show the modal. Focus is moved inside and restored on close by the\n * template's `cdkTrapFocus` / `cdkTrapFocusAutoCapture`, then given to\n * `returnFocusTo` when set (3.34).\n */\n private showModal(): void {\n this.shown = true;\n this.overlayStack.push(this.modalId);\n\n // Lock body scroll\n if (typeof document !== 'undefined' && this.originalOverflow === undefined) {\n this.originalOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n }\n\n /**\n * Hide the modal\n */\n private hideModal(): void {\n this.overlayStack.remove(this.modalId);\n\n // Restore body scroll\n if (typeof document !== 'undefined' && this.originalOverflow !== undefined) {\n document.body.style.overflow = this.originalOverflow;\n this.originalOverflow = undefined;\n }\n\n if (!this.shown) return;\n this.shown = false;\n // Untracked: this runs inside the open effect, and a tracked read would\n // re-run it (and re-push the modal above a nested overlay) when the input\n // changes.\n if (untracked(this.returnFocusTo)) this.scheduleFocusReturn();\n }\n\n /**\n * Focuses `returnFocusTo` after the next render: the template refresh has\n * removed the dialog, and `cdkTrapFocus` has restored its captured element\n * on destroy, so this is the last focus write. Reads the input again then,\n * so a trigger re-rendered meanwhile is taken from a fresh query.\n */\n private scheduleFocusReturn(): void {\n afterNextRender(\n () => {\n const target = this.returnFocusTo();\n if (this.shown || !target?.isConnected) return;\n target.focus();\n if (target.ownerDocument.activeElement !== target && target.localName.includes('-')) {\n target.querySelector<HTMLElement>(FOCUSABLE)?.focus();\n }\n },\n { injector: this.environmentInjector },\n );\n }\n}\n","@if (_open()) {\n <!-- Backdrop (the lc-modal does NOT use CDK Overlay; do not add the\n `cdk-overlay-backdrop` class here — it would be styled by global CDK\n rules and, vice versa, leak modal styling onto other overlays.) -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- backdrop click is a mouse shortcut; Escape and the close button close the modal -->\n <div\n class=\"lc-modal-backdrop\"\n (click)=\"onBackdropClick($event)\"\n ></div>\n\n <!-- Modal Content -->\n <div\n [class]=\"modalClasses()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n >\n <div class=\"lc-modal__header\">\n <ng-content select=\"[slot='header']\" />\n \n @if (showCloseButton()) {\n <button\n type=\"button\"\n class=\"lc-modal__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onCloseClick($event)\"\n >\n <lc-icon name=\"x-mark\" size=\"md\" [decorative]=\"true\" />\n </button>\n }\n </div>\n \n <div class=\"lc-modal__body\">\n <ng-content select=\"[slot='body']\" />\n <ng-content />\n </div>\n \n <div class=\"lc-modal__footer\">\n <ng-content select=\"[slot='footer']\" />\n </div>\n </div>\n}\n"],"mappings":";;;;;;;AAoCA,MAAM,YACJ;AAsCF,IAAa,iBAAb,MAAa,eAAc;CACjB,OAAO,SAAS;CAMxB,OAAO,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAM5B,OAAO,MAAiB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAW7B,YAAY,MAAsB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAM3C,uBAAuB,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,uBAAA,CAAA,+BAAA,CAAA,CAAA;CAM3C,gBAAgB,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAMpC,kBAAkB,MAAe,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;CAKtC,YAAY,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAK3B,iBAAiB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;CAKhC,kBAAkB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,kBAA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UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;GAAA;EAAA;EAAA,eACpB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;EAAC,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAMrC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAc,YAAA,CAAA;EAV1B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAU,YACR;GAAI,SACP,CAAC,YAAY,aAAa;GAAC,eACrB,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;GAAC,iBAG/B,wBAAwB;GAAM,eAChC,kBAAkB;GAAI,UAAA;GAAA,QAAA,CAAA,wxHAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsLpC,MAAA;GAAa,MAAA,CAAA,oBAAoB,CAAC,QAAQ,CAAC"}
@@ -333,7 +333,7 @@ var ToastOutletComponent = class ToastOutletComponent {
333
333
  } },
334
334
  ngImport: i0,
335
335
  template: "@for (position of positions; track position) {\n <div class=\"lc-toast-outlet__stack\" [class]=\"'lc-toast-outlet__stack lc-toast-outlet__stack--' + position\">\n <!-- Both regions are always present (even empty) so that toasts inserted\n later are announced; the toasts themselves do not announce again. -->\n @for (live of liveLevels; track live) {\n <div\n class=\"lc-toast-outlet__region\"\n [class.lc-toast-outlet__region--latest]=\"latestLive().get(position) === live\"\n [attr.aria-live]=\"live\"\n aria-atomic=\"false\"\n >\n @for (toast of toastsFor(position, live); track toast.id) {\n <lc-toast [toast]=\"toast\" [announce]=\"false\" [closeAriaLabel]=\"closeAriaLabel()\" (closed)=\"onClosed($event)\" />\n }\n </div>\n }\n </div>\n}\n",
336
- styles: [":host{display:contents}@property --_lc-toast-outlet-top{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}@property --_lc-toast-outlet-bottom{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}.lc-toast-outlet__stack{--_lc-toast-outlet-top: var(--lc-toast-outlet-offset-top, var(--_lc-toast-outlet-frame-top, 0px));--_lc-toast-outlet-bottom: var(--lc-toast-outlet-offset-bottom, var(--_lc-toast-outlet-frame-bottom, 0px));position:fixed;z-index:1200;display:flex;flex-direction:column;width:100%;max-width:calc(400px + 2 * var(--spacing-4));padding:var(--spacing-4);box-sizing:border-box;pointer-events:none;max-height:calc(100vh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));max-height:calc(100dvh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));overflow-y:auto;overscroll-behavior:contain}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--top-right{top:var(--_lc-toast-outlet-top)}.lc-toast-outlet__stack--bottom-left,.lc-toast-outlet__stack--bottom-center,.lc-toast-outlet__stack--bottom-right{bottom:var(--_lc-toast-outlet-bottom);flex-direction:column-reverse}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--bottom-left{left:0;align-items:flex-start}.lc-toast-outlet__stack--top-right,.lc-toast-outlet__stack--bottom-right{right:0;align-items:flex-end}.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--bottom-center{left:50%;transform:translate(-50%);align-items:center}.lc-toast-outlet__region{display:flex;flex-direction:inherit;align-items:inherit;width:100%}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region{flex-direction:column}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region--latest{order:-1}\n"],
336
+ styles: [":host{display:contents}@property --_lc-toast-outlet-top{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}@property --_lc-toast-outlet-bottom{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}.lc-toast-outlet__stack{--_lc-toast-outlet-top: var(--lc-toast-outlet-offset-top, var(--_lc-toast-outlet-frame-top, 0px));--_lc-toast-outlet-bottom: var(--lc-toast-outlet-offset-bottom, var(--_lc-toast-outlet-frame-bottom, 0px));position:fixed;z-index:1200;display:flex;flex-direction:column;width:100%;max-width:calc(400px + 2 * var(--spacing-4));padding:var(--spacing-4);padding-top:calc(var(--spacing-4) - var(--spacing-2));box-sizing:border-box;pointer-events:none;max-height:calc(100vh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));max-height:calc(100dvh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));overflow-y:auto;overscroll-behavior:contain}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--top-right{top:var(--_lc-toast-outlet-top)}.lc-toast-outlet__stack--bottom-left,.lc-toast-outlet__stack--bottom-center,.lc-toast-outlet__stack--bottom-right{bottom:var(--_lc-toast-outlet-bottom);flex-direction:column-reverse}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--bottom-left{left:0;align-items:flex-start}.lc-toast-outlet__stack--top-right,.lc-toast-outlet__stack--bottom-right{right:0;align-items:flex-end}.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--bottom-center{left:50%;transform:translate(-50%);align-items:center}.lc-toast-outlet__region{display:flex;flex-direction:inherit;align-items:inherit;width:100%}.lc-toast-outlet__region>lc-toast{margin-top:var(--spacing-2)}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region{flex-direction:column}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region--latest{order:-1}\n"],
337
337
  dependencies: [{
338
338
  kind: "component",
339
339
  type: ToastComponent,
@@ -365,7 +365,7 @@ i0.ɵɵngDeclareClassMetadata({
365
365
  "[style.--_lc-toast-outlet-frame-bottom]": "insets.bottom()"
366
366
  },
367
367
  template: "@for (position of positions; track position) {\n <div class=\"lc-toast-outlet__stack\" [class]=\"'lc-toast-outlet__stack lc-toast-outlet__stack--' + position\">\n <!-- Both regions are always present (even empty) so that toasts inserted\n later are announced; the toasts themselves do not announce again. -->\n @for (live of liveLevels; track live) {\n <div\n class=\"lc-toast-outlet__region\"\n [class.lc-toast-outlet__region--latest]=\"latestLive().get(position) === live\"\n [attr.aria-live]=\"live\"\n aria-atomic=\"false\"\n >\n @for (toast of toastsFor(position, live); track toast.id) {\n <lc-toast [toast]=\"toast\" [announce]=\"false\" [closeAriaLabel]=\"closeAriaLabel()\" (closed)=\"onClosed($event)\" />\n }\n </div>\n }\n </div>\n}\n",
368
- styles: [":host{display:contents}@property --_lc-toast-outlet-top{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}@property --_lc-toast-outlet-bottom{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}.lc-toast-outlet__stack{--_lc-toast-outlet-top: var(--lc-toast-outlet-offset-top, var(--_lc-toast-outlet-frame-top, 0px));--_lc-toast-outlet-bottom: var(--lc-toast-outlet-offset-bottom, var(--_lc-toast-outlet-frame-bottom, 0px));position:fixed;z-index:1200;display:flex;flex-direction:column;width:100%;max-width:calc(400px + 2 * var(--spacing-4));padding:var(--spacing-4);box-sizing:border-box;pointer-events:none;max-height:calc(100vh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));max-height:calc(100dvh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));overflow-y:auto;overscroll-behavior:contain}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--top-right{top:var(--_lc-toast-outlet-top)}.lc-toast-outlet__stack--bottom-left,.lc-toast-outlet__stack--bottom-center,.lc-toast-outlet__stack--bottom-right{bottom:var(--_lc-toast-outlet-bottom);flex-direction:column-reverse}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--bottom-left{left:0;align-items:flex-start}.lc-toast-outlet__stack--top-right,.lc-toast-outlet__stack--bottom-right{right:0;align-items:flex-end}.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--bottom-center{left:50%;transform:translate(-50%);align-items:center}.lc-toast-outlet__region{display:flex;flex-direction:inherit;align-items:inherit;width:100%}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region{flex-direction:column}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region--latest{order:-1}\n"]
368
+ styles: [":host{display:contents}@property --_lc-toast-outlet-top{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}@property --_lc-toast-outlet-bottom{syntax: \"<length-percentage>\"; inherits: false; initial-value: 0px;}.lc-toast-outlet__stack{--_lc-toast-outlet-top: var(--lc-toast-outlet-offset-top, var(--_lc-toast-outlet-frame-top, 0px));--_lc-toast-outlet-bottom: var(--lc-toast-outlet-offset-bottom, var(--_lc-toast-outlet-frame-bottom, 0px));position:fixed;z-index:1200;display:flex;flex-direction:column;width:100%;max-width:calc(400px + 2 * var(--spacing-4));padding:var(--spacing-4);padding-top:calc(var(--spacing-4) - var(--spacing-2));box-sizing:border-box;pointer-events:none;max-height:calc(100vh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));max-height:calc(100dvh - var(--_lc-toast-outlet-top) - var(--_lc-toast-outlet-bottom));overflow-y:auto;overscroll-behavior:contain}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--top-right{top:var(--_lc-toast-outlet-top)}.lc-toast-outlet__stack--bottom-left,.lc-toast-outlet__stack--bottom-center,.lc-toast-outlet__stack--bottom-right{bottom:var(--_lc-toast-outlet-bottom);flex-direction:column-reverse}.lc-toast-outlet__stack--top-left,.lc-toast-outlet__stack--bottom-left{left:0;align-items:flex-start}.lc-toast-outlet__stack--top-right,.lc-toast-outlet__stack--bottom-right{right:0;align-items:flex-end}.lc-toast-outlet__stack--top-center,.lc-toast-outlet__stack--bottom-center{left:50%;transform:translate(-50%);align-items:center}.lc-toast-outlet__region{display:flex;flex-direction:inherit;align-items:inherit;width:100%}.lc-toast-outlet__region>lc-toast{margin-top:var(--spacing-2)}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region{flex-direction:column}.lc-toast-outlet__stack--bottom-left>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-center>.lc-toast-outlet__region--latest,.lc-toast-outlet__stack--bottom-right>.lc-toast-outlet__region--latest{order:-1}\n"]
369
369
  }]
370
370
  }],
371
371
  propDecorators: { closeAriaLabel: [{
@@ -1 +1 @@
1
- {"version":3,"file":"lifecorner-angular-ui-kit-toast.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/toast/toast.service.ts","../../../../libs/angular-ui-kit/src/lib/toast/toast.component.ts","../../../../libs/angular-ui-kit/src/lib/toast/toast.component.html","../../../../libs/angular-ui-kit/src/lib/toast/toast-outlet.component.ts","../../../../libs/angular-ui-kit/src/lib/toast/toast-outlet.component.html"],"sourcesContent":["import { Injectable, PLATFORM_ID, inject, signal, Signal } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nexport type ToastVariant = 'success' | 'error' | 'warning' | 'info';\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface ToastConfig {\n message: string;\n variant?: ToastVariant;\n position?: ToastPosition;\n duration?: number;\n showCloseButton?: boolean;\n action?: ToastAction;\n}\n\nexport interface Toast extends Required<Omit<ToastConfig, 'action'>> {\n id: string;\n action?: ToastAction;\n}\n\n/**\n * Toast service for showing ephemeral notifications.\n *\n * The toasts are rendered by `<lc-toast-outlet />`, which the application\n * places once (e.g. in its shell); without it nothing is shown. The options,\n * their defaults, the timing and how a toast is announced to screen readers\n * are documented under *Feedback/Toast Outlet* (3.17).\n *\n * @example\n * ```typescript\n * private readonly toastService = inject(ToastService);\n *\n * showSuccess() {\n * this.toastService.show({\n * message: 'Changes saved successfully!',\n * variant: 'success',\n * duration: 3000\n * });\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n /**\n * Public readonly signal for toasts\n */\n public readonly toasts: Signal<readonly Toast[]>;\n\n /**\n * Internal signal for toast list\n */\n private readonly toastList = signal<Toast[]>([]);\n\n private readonly MAX_TOASTS = 5;\n private toastIdCounter = 0;\n private activeTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n /** Auto-dismiss timers only make sense in the browser (and `window` does not exist on the server). */\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n constructor() {\n this.toasts = this.toastList.asReadonly();\n }\n\n /**\n * Show a toast notification\n */\n show(config: ToastConfig): string {\n const toast: Toast = {\n id: this.generateId(),\n message: config.message,\n variant: config.variant || 'info',\n position: config.position || 'top-right',\n duration: config.duration !== undefined ? config.duration : 3000,\n showCloseButton: config.showCloseButton !== undefined ? config.showCloseButton : true,\n action: config.action,\n };\n\n // Add toast to list\n let currentToasts = this.toastList();\n\n // Remove oldest toast if at max capacity\n if (currentToasts.length >= this.MAX_TOASTS) {\n const oldestToast = currentToasts[0];\n if (oldestToast) {\n this.clearTimeout(oldestToast.id);\n currentToasts = currentToasts.slice(1);\n }\n }\n\n this.toastList.set([...currentToasts, toast]);\n\n // Auto-dismiss if duration > 0\n if (toast.duration > 0 && this.isBrowser) {\n const timeoutId = setTimeout(() => {\n this.close(toast.id);\n }, toast.duration);\n\n this.activeTimeouts.set(toast.id, timeoutId);\n }\n\n return toast.id;\n }\n\n /**\n * Close a specific toast\n */\n close(id: string): void {\n this.removeToast(id);\n }\n\n /**\n * Close all toasts\n */\n closeAll(): void {\n const currentToasts = this.toastList();\n currentToasts.forEach((toast) => {\n this.clearTimeout(toast.id);\n });\n this.toastList.set([]);\n }\n\n /**\n * Generate unique toast ID\n */\n private generateId(): string {\n return `toast-${++this.toastIdCounter}-${Date.now()}`;\n }\n\n /**\n * Remove a toast from the list\n */\n private removeToast(id: string): void {\n this.clearTimeout(id);\n const currentToasts = this.toastList();\n this.toastList.set(currentToasts.filter((t) => t.id !== id));\n }\n\n /**\n * Clear timeout for a toast\n */\n private clearTimeout(id: string): void {\n const timeoutId = this.activeTimeouts.get(id);\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n this.activeTimeouts.delete(id);\n }\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n computed,\n ViewEncapsulation,\n} from '@angular/core';\nimport { IconComponent, ɵprovideKitIcons } from '@lifecorner/angular-ui-kit/icon';\nimport {\n ICON_CHECK_CIRCLE,\n ICON_CIRCLE_X,\n ICON_EXCLAMATION_TRIANGLE,\n ICON_INFORMATION_CIRCLE,\n ICON_X_MARK,\n} from '@lifecorner/angular-ui-kit/icons';\nimport type { Toast, ToastVariant } from './toast.service';\n\n/**\n * Toast component for displaying ephemeral notification messages.\n *\n * Features:\n * - Semantic variants (success, warning, error, info)\n * - Auto-dismiss with configurable duration\n * - Manual dismiss with close button\n * - Icon display per variant\n * - Stacked toast positioning via ToastService + `<lc-toast-outlet />`\n * - Animated enter/exit transitions\n *\n * Usually rendered by `<lc-toast-outlet />`; can also be placed directly:\n *\n * @example\n * ```html\n * <lc-toast [toast]=\"toast\" (closed)=\"dismiss($event)\" />\n * ```\n */\n@Component({\n selector: 'lc-toast',\n standalone: true,\n imports: [IconComponent],\n viewProviders: [\n ɵprovideKitIcons([ICON_X_MARK, ICON_CHECK_CIRCLE, ICON_CIRCLE_X, ICON_EXCLAMATION_TRIANGLE, ICON_INFORMATION_CIRCLE]),\n ],\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n encapsulation: ViewEncapsulation.None, // Required for dynamic variant class styling\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'hostClasses()',\n '[attr.role]': 'ariaRole()',\n '[attr.aria-live]': 'ariaLive()',\n '[attr.aria-atomic]': 'announce() ? \"true\" : null',\n },\n})\nexport class ToastComponent {\n /**\n * Toast data\n */\n toast = input.required<Toast>();\n\n /**\n * Whether the toast is its own live region (`role=\"status\"`/`\"alert\"` on the\n * host). `lc-toast-outlet` sets this to false because its persistent live\n * regions already announce the toast — announcing twice would be noise.\n * @default true\n */\n announce = input<boolean>(true);\n\n /** Accessible name of the close button (`toast.showCloseButton`). */\n closeAriaLabel = input('Close notification');\n\n /**\n * Emitted when toast is closed\n */\n readonly closed = output<string>();\n\n /**\n * Computed host classes\n */\n protected hostClasses = computed(() => {\n const toast = this.toast();\n return `lc-toast lc-toast--${toast.variant}`;\n });\n\n /**\n * Computed container classes\n */\n protected containerClasses = computed(() => {\n return 'lc-toast__container';\n });\n\n /**\n * Computed ARIA role\n */\n protected ariaRole = computed(() => {\n if (!this.announce()) return null;\n const variant = this.toast().variant;\n return variant === 'error' || variant === 'warning' ? 'alert' : 'status';\n });\n\n /**\n * Computed ARIA live region priority\n */\n protected ariaLive = computed(() => {\n if (!this.announce()) return null;\n const variant = this.toast().variant;\n return variant === 'error' || variant === 'warning' ? 'assertive' : 'polite';\n });\n\n /**\n * Computed default icon based on variant\n */\n protected defaultIcon = computed(() => {\n const icons: Record<ToastVariant, string> = {\n success: 'check-circle',\n error: 'x-circle',\n warning: 'exclamation-triangle',\n info: 'information-circle',\n };\n return icons[this.toast().variant];\n });\n\n /**\n * Handle close button click\n */\n protected onCloseClick(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.closed.emit(this.toast().id);\n }\n\n /**\n * Handle action button click\n */\n protected onActionClick(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n const action = this.toast().action;\n if (action) {\n action.onClick();\n this.closed.emit(this.toast().id);\n }\n }\n}\n","<div [class]=\"containerClasses()\">\n <div class=\"lc-toast__icon\">\n <lc-icon [name]=\"defaultIcon()\" size=\"md\" [decorative]=\"true\" />\n </div>\n \n <div class=\"lc-toast__message\">\n {{ toast().message }}\n </div>\n \n @if (toast().action) {\n <button\n type=\"button\"\n class=\"lc-toast__action\"\n (click)=\"onActionClick($event)\"\n >\n {{ toast().action?.label }}\n </button>\n }\n \n @if (toast().showCloseButton) {\n <button\n type=\"button\"\n class=\"lc-toast__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onCloseClick($event)\"\n >\n <lc-icon name=\"x-mark\" size=\"sm\" [decorative]=\"true\" />\n </button>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, computed, inject, input } from '@angular/core';\nimport { OverlayInsetsService } from '@lifecorner/angular-ui-kit/internal/overlay';\nimport { ToastComponent } from './toast.component';\nimport { ToastService, type Toast, type ToastPosition } from './toast.service';\n\n/** Politeness of the live region a toast is announced from. */\ntype ToastLive = 'polite' | 'assertive';\n\nconst POSITIONS: readonly ToastPosition[] = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n];\n\n/**\n * Renders the toasts of {@link ToastService}. Place it once in the application\n * shell; without it `ToastService.show()` has no visible effect.\n *\n * ```html\n * <lc-toast-outlet />\n * ```\n *\n * Toasts are stacked per `position`. Every position owns two live regions that\n * exist from the start — screen readers only announce content that is inserted\n * into an *existing* live region — one `polite` for success/info toasts and one\n * `assertive` for error/warning toasts. Dismissing a toast (close button,\n * action, auto-dismiss) removes it from the service.\n *\n * Offsets (3.28, AS-34): with `lc-app-shell` in the app (the outlet may sit\n * before or after it), the `top-*` stacks start below the shell's header and\n * the `bottom-*` stacks end above its bottom bar, each with the stack's 16 px\n * padding as the gap. The shell measures both in the browser (the header's\n * bottom edge with the top inset; the shown bar's top edge, from the\n * viewport's bottom, with the bottom inset). From 1024 px, where the bar is\n * hidden, the bottom offset is the safe-area inset. Without a shell, and in\n * prerendered HTML, both are `0px`, as before. Every stack is at most as high\n * as the space between the offsets and scrolls when its toasts need more\n * (200 % text), so each toast stays reachable.\n *\n * Bottom stacks show the newest toast nearest the edge (3.33); top stacks the\n * oldest at the top. A `top-*` stack lies over the page on purpose (a toast\n * stays visible wherever the page is scrolled), so in the shell it can cover\n * a title right under the header (at 360 px a toast at y 72 over an h1 at\n * y 80): prefer `bottom-*` there.\n *\n * CSS hooks (set them on `lc-toast-outlet` or any ancestor, e.g. `:root`;\n * each wins over the shell's value; write lengths, `0px` rather than `0`):\n * - `--lc-toast-outlet-offset-top` — the space kept free above the `top-*`\n * stacks. Default `0px`; with `lc-app-shell`: its header's bottom edge, or\n * `env(safe-area-inset-top, 0px)` without a header.\n * - `--lc-toast-outlet-offset-bottom` — the space kept free below the\n * `bottom-*` stacks. Default `0px`; with `lc-app-shell`: the shown bottom\n * bar's top edge, measured from the viewport's bottom, or\n * `env(safe-area-inset-bottom, 0px)` when no bar shows.\n */\n@Component({\n selector: 'lc-toast-outlet',\n standalone: true,\n imports: [ToastComponent],\n templateUrl: './toast-outlet.component.html',\n styleUrls: ['./toast-outlet.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // The shell's measured offsets (AS-34), private; `null` without a shell,\n // so the host gets no style attribute. The public hooks win in the CSS.\n '[style.--_lc-toast-outlet-frame-top]': 'insets.top()',\n '[style.--_lc-toast-outlet-frame-bottom]': 'insets.bottom()',\n },\n})\nexport class ToastOutletComponent {\n protected readonly positions = POSITIONS;\n protected readonly liveLevels: readonly ToastLive[] = ['assertive', 'polite'];\n\n private readonly toastService = inject(ToastService);\n protected readonly insets = inject(OverlayInsetsService);\n\n /** Accessible name of every toast's close button (forwarded to lc-toast). */\n readonly closeAriaLabel = input('Close notification');\n\n /** Toasts keyed by `${position}:${politeness}` in the order they were shown. */\n private readonly groups = computed(() => {\n const groups = new Map<string, Toast[]>();\n for (const toast of this.toastService.toasts()) {\n const key = `${toast.position}:${ToastOutletComponent.liveFor(toast)}`;\n const group = groups.get(key);\n if (group) {\n group.push(toast);\n } else {\n groups.set(key, [toast]);\n }\n }\n return groups;\n });\n\n /**\n * 3.33 (request 052, 045-n2): per `bottom-*` stack, the live level of its\n * newest toast. That region gets `lc-toast-outlet__region--latest` and is\n * laid out at the edge, so the newest toast sits nearest the edge (and, in\n * a scrolling stack, in view at rest). DOM and announcement order stay.\n */\n protected readonly latestLive = computed(() => {\n const latest = new Map<ToastPosition, ToastLive>();\n for (const toast of this.toastService.toasts()) {\n if (toast.position.startsWith('bottom-')) {\n latest.set(toast.position, ToastOutletComponent.liveFor(toast));\n }\n }\n return latest;\n });\n\n protected toastsFor(position: ToastPosition, live: ToastLive): readonly Toast[] {\n return this.groups().get(`${position}:${live}`) ?? [];\n }\n\n protected onClosed(id: string): void {\n this.toastService.close(id);\n }\n\n /** Errors and warnings interrupt (assertive), everything else waits its turn. */\n private static liveFor(toast: Toast): ToastLive {\n return toast.variant === 'error' || toast.variant === 'warning' ? 'assertive' : 'polite';\n }\n}\n","@for (position of positions; track position) {\n <div class=\"lc-toast-outlet__stack\" [class]=\"'lc-toast-outlet__stack lc-toast-outlet__stack--' + position\">\n <!-- Both regions are always present (even empty) so that toasts inserted\n later are announced; the toasts themselves do not announce again. -->\n @for (live of liveLevels; track live) {\n <div\n class=\"lc-toast-outlet__region\"\n [class.lc-toast-outlet__region--latest]=\"latestLive().get(position) === live\"\n [attr.aria-live]=\"live\"\n aria-atomic=\"false\"\n >\n @for (toast of toastsFor(position, live); track toast.id) {\n <lc-toast [toast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AAoB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAApB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAoB,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,gBAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA;GAAA,sCAAA;GAAA,yCAAA;EAAA,EAAA;EAAA,UAAA;EAAA,UCxEjC;EAkBA,QAAA,CAAA,4/DAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MD2CY;GAAc,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,QAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAWb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EAdhC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAiB,YACf;GAAI,SACP,CAAC,cAAc;GAAC,iBAGR,wBAAwB;GAAM,MACzC;IAGJ,wCAAwC;IACxC,2CAA2C;GAC5C;GAAA,UAAA;GAAA,QAAA,CAAA,4/DAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"lifecorner-angular-ui-kit-toast.mjs","names":[],"sources":["../../../../libs/angular-ui-kit/src/lib/toast/toast.service.ts","../../../../libs/angular-ui-kit/src/lib/toast/toast.component.ts","../../../../libs/angular-ui-kit/src/lib/toast/toast.component.html","../../../../libs/angular-ui-kit/src/lib/toast/toast-outlet.component.ts","../../../../libs/angular-ui-kit/src/lib/toast/toast-outlet.component.html"],"sourcesContent":["import { Injectable, PLATFORM_ID, inject, signal, Signal } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nexport type ToastVariant = 'success' | 'error' | 'warning' | 'info';\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface ToastConfig {\n message: string;\n variant?: ToastVariant;\n position?: ToastPosition;\n duration?: number;\n showCloseButton?: boolean;\n action?: ToastAction;\n}\n\nexport interface Toast extends Required<Omit<ToastConfig, 'action'>> {\n id: string;\n action?: ToastAction;\n}\n\n/**\n * Toast service for showing ephemeral notifications.\n *\n * The toasts are rendered by `<lc-toast-outlet />`, which the application\n * places once (e.g. in its shell); without it nothing is shown. The options,\n * their defaults, the timing and how a toast is announced to screen readers\n * are documented under *Feedback/Toast Outlet* (3.17).\n *\n * @example\n * ```typescript\n * private readonly toastService = inject(ToastService);\n *\n * showSuccess() {\n * this.toastService.show({\n * message: 'Changes saved successfully!',\n * variant: 'success',\n * duration: 3000\n * });\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n /**\n * Public readonly signal for toasts\n */\n public readonly toasts: Signal<readonly Toast[]>;\n\n /**\n * Internal signal for toast list\n */\n private readonly toastList = signal<Toast[]>([]);\n\n private readonly MAX_TOASTS = 5;\n private toastIdCounter = 0;\n private activeTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n /** Auto-dismiss timers only make sense in the browser (and `window` does not exist on the server). */\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n constructor() {\n this.toasts = this.toastList.asReadonly();\n }\n\n /**\n * Show a toast notification\n */\n show(config: ToastConfig): string {\n const toast: Toast = {\n id: this.generateId(),\n message: config.message,\n variant: config.variant || 'info',\n position: config.position || 'top-right',\n duration: config.duration !== undefined ? config.duration : 3000,\n showCloseButton: config.showCloseButton !== undefined ? config.showCloseButton : true,\n action: config.action,\n };\n\n // Add toast to list\n let currentToasts = this.toastList();\n\n // Remove oldest toast if at max capacity\n if (currentToasts.length >= this.MAX_TOASTS) {\n const oldestToast = currentToasts[0];\n if (oldestToast) {\n this.clearTimeout(oldestToast.id);\n currentToasts = currentToasts.slice(1);\n }\n }\n\n this.toastList.set([...currentToasts, toast]);\n\n // Auto-dismiss if duration > 0\n if (toast.duration > 0 && this.isBrowser) {\n const timeoutId = setTimeout(() => {\n this.close(toast.id);\n }, toast.duration);\n\n this.activeTimeouts.set(toast.id, timeoutId);\n }\n\n return toast.id;\n }\n\n /**\n * Close a specific toast\n */\n close(id: string): void {\n this.removeToast(id);\n }\n\n /**\n * Close all toasts\n */\n closeAll(): void {\n const currentToasts = this.toastList();\n currentToasts.forEach((toast) => {\n this.clearTimeout(toast.id);\n });\n this.toastList.set([]);\n }\n\n /**\n * Generate unique toast ID\n */\n private generateId(): string {\n return `toast-${++this.toastIdCounter}-${Date.now()}`;\n }\n\n /**\n * Remove a toast from the list\n */\n private removeToast(id: string): void {\n this.clearTimeout(id);\n const currentToasts = this.toastList();\n this.toastList.set(currentToasts.filter((t) => t.id !== id));\n }\n\n /**\n * Clear timeout for a toast\n */\n private clearTimeout(id: string): void {\n const timeoutId = this.activeTimeouts.get(id);\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n this.activeTimeouts.delete(id);\n }\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n computed,\n ViewEncapsulation,\n} from '@angular/core';\nimport { IconComponent, ɵprovideKitIcons } from '@lifecorner/angular-ui-kit/icon';\nimport {\n ICON_CHECK_CIRCLE,\n ICON_CIRCLE_X,\n ICON_EXCLAMATION_TRIANGLE,\n ICON_INFORMATION_CIRCLE,\n ICON_X_MARK,\n} from '@lifecorner/angular-ui-kit/icons';\nimport type { Toast, ToastVariant } from './toast.service';\n\n/**\n * Toast component for displaying ephemeral notification messages.\n *\n * Features:\n * - Semantic variants (success, warning, error, info)\n * - Auto-dismiss with configurable duration\n * - Manual dismiss with close button\n * - Icon display per variant\n * - Stacked toast positioning via ToastService + `<lc-toast-outlet />`\n * - Animated enter/exit transitions\n *\n * Usually rendered by `<lc-toast-outlet />`; can also be placed directly:\n *\n * @example\n * ```html\n * <lc-toast [toast]=\"toast\" (closed)=\"dismiss($event)\" />\n * ```\n */\n@Component({\n selector: 'lc-toast',\n standalone: true,\n imports: [IconComponent],\n viewProviders: [\n ɵprovideKitIcons([ICON_X_MARK, ICON_CHECK_CIRCLE, ICON_CIRCLE_X, ICON_EXCLAMATION_TRIANGLE, ICON_INFORMATION_CIRCLE]),\n ],\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n encapsulation: ViewEncapsulation.None, // Required for dynamic variant class styling\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'hostClasses()',\n '[attr.role]': 'ariaRole()',\n '[attr.aria-live]': 'ariaLive()',\n '[attr.aria-atomic]': 'announce() ? \"true\" : null',\n },\n})\nexport class ToastComponent {\n /**\n * Toast data\n */\n toast = input.required<Toast>();\n\n /**\n * Whether the toast is its own live region (`role=\"status\"`/`\"alert\"` on the\n * host). `lc-toast-outlet` sets this to false because its persistent live\n * regions already announce the toast — announcing twice would be noise.\n * @default true\n */\n announce = input<boolean>(true);\n\n /** Accessible name of the close button (`toast.showCloseButton`). */\n closeAriaLabel = input('Close notification');\n\n /**\n * Emitted when toast is closed\n */\n readonly closed = output<string>();\n\n /**\n * Computed host classes\n */\n protected hostClasses = computed(() => {\n const toast = this.toast();\n return `lc-toast lc-toast--${toast.variant}`;\n });\n\n /**\n * Computed container classes\n */\n protected containerClasses = computed(() => {\n return 'lc-toast__container';\n });\n\n /**\n * Computed ARIA role\n */\n protected ariaRole = computed(() => {\n if (!this.announce()) return null;\n const variant = this.toast().variant;\n return variant === 'error' || variant === 'warning' ? 'alert' : 'status';\n });\n\n /**\n * Computed ARIA live region priority\n */\n protected ariaLive = computed(() => {\n if (!this.announce()) return null;\n const variant = this.toast().variant;\n return variant === 'error' || variant === 'warning' ? 'assertive' : 'polite';\n });\n\n /**\n * Computed default icon based on variant\n */\n protected defaultIcon = computed(() => {\n const icons: Record<ToastVariant, string> = {\n success: 'check-circle',\n error: 'x-circle',\n warning: 'exclamation-triangle',\n info: 'information-circle',\n };\n return icons[this.toast().variant];\n });\n\n /**\n * Handle close button click\n */\n protected onCloseClick(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n this.closed.emit(this.toast().id);\n }\n\n /**\n * Handle action button click\n */\n protected onActionClick(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n const action = this.toast().action;\n if (action) {\n action.onClick();\n this.closed.emit(this.toast().id);\n }\n }\n}\n","<div [class]=\"containerClasses()\">\n <div class=\"lc-toast__icon\">\n <lc-icon [name]=\"defaultIcon()\" size=\"md\" [decorative]=\"true\" />\n </div>\n \n <div class=\"lc-toast__message\">\n {{ toast().message }}\n </div>\n \n @if (toast().action) {\n <button\n type=\"button\"\n class=\"lc-toast__action\"\n (click)=\"onActionClick($event)\"\n >\n {{ toast().action?.label }}\n </button>\n }\n \n @if (toast().showCloseButton) {\n <button\n type=\"button\"\n class=\"lc-toast__close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onCloseClick($event)\"\n >\n <lc-icon name=\"x-mark\" size=\"sm\" [decorative]=\"true\" />\n </button>\n }\n</div>\n","import { Component, ChangeDetectionStrategy, computed, inject, input } from '@angular/core';\nimport { OverlayInsetsService } from '@lifecorner/angular-ui-kit/internal/overlay';\nimport { ToastComponent } from './toast.component';\nimport { ToastService, type Toast, type ToastPosition } from './toast.service';\n\n/** Politeness of the live region a toast is announced from. */\ntype ToastLive = 'polite' | 'assertive';\n\nconst POSITIONS: readonly ToastPosition[] = [\n 'top-left',\n 'top-center',\n 'top-right',\n 'bottom-left',\n 'bottom-center',\n 'bottom-right',\n];\n\n/**\n * Renders the toasts of {@link ToastService}. Place it once in the application\n * shell; without it `ToastService.show()` has no visible effect.\n *\n * ```html\n * <lc-toast-outlet />\n * ```\n *\n * Toasts are stacked per `position`. Every position owns two live regions that\n * exist from the start — screen readers only announce content that is inserted\n * into an *existing* live region — one `polite` for success/info toasts and one\n * `assertive` for error/warning toasts. Dismissing a toast (close button,\n * action, auto-dismiss) removes it from the service.\n *\n * Offsets (3.28, AS-34): with `lc-app-shell` in the app (the outlet may sit\n * before or after it), the `top-*` stacks start below the shell's header and\n * the `bottom-*` stacks end above its bottom bar, each with the stack's 16 px\n * padding as the gap. The shell measures both in the browser (the header's\n * bottom edge with the top inset; the shown bar's top edge, from the\n * viewport's bottom, with the bottom inset). From 1024 px, where the bar is\n * hidden, the bottom offset is the safe-area inset. Without a shell, and in\n * prerendered HTML, both are `0px`, as before. Every stack is at most as high\n * as the space between the offsets and scrolls when its toasts need more\n * (200 % text), so each toast stays reachable.\n *\n * Bottom stacks show the newest toast nearest the edge (3.33); top stacks the\n * oldest at the top. The toasts of a stack are 8 px (`--spacing-2`) apart\n * (3.33.1), within a live region and across the two; an empty region and the\n * last toast add no space, and the stack keeps its 16 px padding. A `top-*`\n * stack lies over the page on purpose (a toast stays visible wherever the\n * page is scrolled), so in the shell it can cover a title right under the\n * header (at 360 px a toast at y 72 over an h1 at y 80): prefer `bottom-*`\n * there.\n *\n * CSS hooks (set them on `lc-toast-outlet` or any ancestor, e.g. `:root`;\n * each wins over the shell's value; write lengths, `0px` rather than `0`):\n * - `--lc-toast-outlet-offset-top` — the space kept free above the `top-*`\n * stacks. Default `0px`; with `lc-app-shell`: its header's bottom edge, or\n * `env(safe-area-inset-top, 0px)` without a header.\n * - `--lc-toast-outlet-offset-bottom` — the space kept free below the\n * `bottom-*` stacks. Default `0px`; with `lc-app-shell`: the shown bottom\n * bar's top edge, measured from the viewport's bottom, or\n * `env(safe-area-inset-bottom, 0px)` when no bar shows.\n */\n@Component({\n selector: 'lc-toast-outlet',\n standalone: true,\n imports: [ToastComponent],\n templateUrl: './toast-outlet.component.html',\n styleUrls: ['./toast-outlet.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n // The shell's measured offsets (AS-34), private; `null` without a shell,\n // so the host gets no style attribute. The public hooks win in the CSS.\n '[style.--_lc-toast-outlet-frame-top]': 'insets.top()',\n '[style.--_lc-toast-outlet-frame-bottom]': 'insets.bottom()',\n },\n})\nexport class ToastOutletComponent {\n protected readonly positions = POSITIONS;\n protected readonly liveLevels: readonly ToastLive[] = ['assertive', 'polite'];\n\n private readonly toastService = inject(ToastService);\n protected readonly insets = inject(OverlayInsetsService);\n\n /** Accessible name of every toast's close button (forwarded to lc-toast). */\n readonly closeAriaLabel = input('Close notification');\n\n /** Toasts keyed by `${position}:${politeness}` in the order they were shown. */\n private readonly groups = computed(() => {\n const groups = new Map<string, Toast[]>();\n for (const toast of this.toastService.toasts()) {\n const key = `${toast.position}:${ToastOutletComponent.liveFor(toast)}`;\n const group = groups.get(key);\n if (group) {\n group.push(toast);\n } else {\n groups.set(key, [toast]);\n }\n }\n return groups;\n });\n\n /**\n * 3.33 (request 052, 045-n2): per `bottom-*` stack, the live level of its\n * newest toast. That region gets `lc-toast-outlet__region--latest` and is\n * laid out at the edge, so the newest toast sits nearest the edge (and, in\n * a scrolling stack, in view at rest). DOM and announcement order stay.\n */\n protected readonly latestLive = computed(() => {\n const latest = new Map<ToastPosition, ToastLive>();\n for (const toast of this.toastService.toasts()) {\n if (toast.position.startsWith('bottom-')) {\n latest.set(toast.position, ToastOutletComponent.liveFor(toast));\n }\n }\n return latest;\n });\n\n protected toastsFor(position: ToastPosition, live: ToastLive): readonly Toast[] {\n return this.groups().get(`${position}:${live}`) ?? [];\n }\n\n protected onClosed(id: string): void {\n this.toastService.close(id);\n }\n\n /** Errors and warnings interrupt (assertive), everything else waits its turn. */\n private static liveFor(toast: Toast): ToastLive {\n return toast.variant === 'error' || toast.variant === 'warning' ? 'assertive' : 'polite';\n }\n}\n","@for (position of positions; track position) {\n <div class=\"lc-toast-outlet__stack\" [class]=\"'lc-toast-outlet__stack lc-toast-outlet__stack--' + position\">\n <!-- Both regions are always present (even empty) so that toasts inserted\n later are announced; the toasts themselves do not announce again. -->\n @for (live of liveLevels; track live) {\n <div\n class=\"lc-toast-outlet__region\"\n [class.lc-toast-outlet__region--latest]=\"latestLive().get(position) === live\"\n [attr.aria-live]=\"live\"\n aria-atomic=\"false\"\n >\n @for (toast of toastsFor(position, live); track toast.id) {\n <lc-toast [toast]=\"toast\" [announce]=\"false\" [closeAriaLabel]=\"closeAriaLabel()\" (closed)=\"onClosed($event)\" />\n }\n </div>\n }\n </div>\n}\n"],"mappings":";;;;;;AAuDA,IAAa,eAAb,MAAa,aAAY;CAIP;CAKC,YAAY,OAAgB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE/B,aAAa;CACtB,iBAAiB;CACjB,iCAAiB,IAAI,IAAG;CAEf,YAAY,kBAAkB,OAAO,WAAW,CAAC;CAElE,cAAA;EACE,KAAK,SAAS,KAAK,UAAU,WAAU;CACzC;CAKA,KAAK,QAAmB;EACtB,MAAM,QAAe;GACnB,IAAI,KAAK,WAAU;GACnB,SAAS,OAAO;GAChB,SAAS,OAAO,WAAW;GAC3B,UAAU,OAAO,YAAY;GAC7B,UAAU,OAAO,aAAa,SAAY,OAAO,WAAW;GAC5D,iBAAiB,OAAO,oBAAoB,SAAY,OAAO,kBAAkB;GACjF,QAAQ,OAAO;EAChB;EAGD,IAAI,gBAAgB,KAAK,UAAS;EAGlC,IAAI,cAAc,UAAU,KAAK,YAAY;GAC3C,MAAM,cAAc,cAAc;GAClC,IAAI,aAAa;IACf,KAAK,aAAa,YAAY,EAAE;IAChC,gBAAgB,cAAc,MAAM,CAAC;GACvC;EACF;EAEA,KAAK,UAAU,IAAI,CAAC,GAAG,eAAe,KAAK,CAAC;EAG5C,IAAI,MAAM,WAAW,KAAK,KAAK,WAAW;GACxC,MAAM,YAAY,iBAAgB;IAChC,KAAK,MAAM,MAAM,EAAE;GACrB,GAAG,MAAM,QAAQ;GAEjB,KAAK,eAAe,IAAI,MAAM,IAAI,SAAS;EAC7C;EAEA,OAAO,MAAM;CACf;CAKA,MAAM,IAAU;EACd,KAAK,YAAY,EAAE;CACrB;CAKA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M,YAAY,YAAY,cAAc;CAClF;CApDW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAoB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAApB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAoB,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,gBAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,YAAA;GAAA,sCAAA;GAAA,yCAAA;EAAA,EAAA;EAAA,UAAA;EAAA,UC3EjC;EAkBA,QAAA,CAAA,gnEAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MD8CY;GAAc,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;GAAA;GAAA,SAAA,CAAA,QAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAWb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EAdhC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAiB,YACf;GAAI,SACP,CAAC,cAAc;GAAC,iBAGR,wBAAwB;GAAM,MACzC;IAGJ,wCAAwC;IACxC,2CAA2C;GAC5C;GAAA,UAAA;GAAA,QAAA,CAAA,gnEAAA;EAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifecorner/angular-ui-kit",
3
- "version": "3.33.0",
3
+ "version": "3.34.0",
4
4
  "description": "LifeCorner Design System – Angular UI component library",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -67,6 +67,12 @@ export declare class ConfirmDialogComponent {
67
67
  * @default 'center'
68
68
  */
69
69
  readonly placement: import("@angular/core").InputSignal<ModalPlacement>;
70
+ /**
71
+ * Passed to `lc-modal` (3.34). The focus returns after confirm, cancel,
72
+ * Escape and ×. Set it to the trigger. `null`: as before.
73
+ * @default null
74
+ */
75
+ readonly returnFocusTo: import("@angular/core").InputSignal<HTMLElement | null>;
70
76
  /** Id of the title, which names the dialog. */
71
77
  protected readonly titleId: string;
72
78
  /** Emitted when user confirms */
@@ -156,6 +162,11 @@ export declare class ConfirmDialogComponent {
156
162
  "required": false;
157
163
  "isSignal": true;
158
164
  };
165
+ "returnFocusTo": {
166
+ "alias": "returnFocusTo";
167
+ "required": false;
168
+ "isSignal": true;
169
+ };
159
170
  }, {
160
171
  "confirmed": "confirmed";
161
172
  "cancelled": "cancelled";
@@ -175,6 +186,11 @@ export interface ConfirmOptions {
175
186
  buttonSize?: ConfirmDialogButtonSize;
176
187
  /** `center`, `auto` (a bottom sheet below 640 px) or `sheet` (3.3). */
177
188
  placement?: ModalPlacement;
189
+ /**
190
+ * Element that gets the focus back after the dialog closed (3.34); see
191
+ * `lc-modal` `returnFocusTo`.
192
+ */
193
+ returnFocusTo?: HTMLElement | null;
178
194
  }
179
195
  /**
180
196
  * Imperative confirm dialog service.
@@ -76,6 +76,8 @@ export type HeaderContextPlacement = 'inline' | 'below';
76
76
  * - `contextPlacement="below"` (3.33): up to 640 px the context button
77
77
  * (`contextName`) takes a full-width row of its own under the title instead
78
78
  * of being hidden; from 641 px it sits in the end group as before.
79
+ * - `focusContext()` (3.34): moves the focus to the context button after the
80
+ * next render, e.g. after a choice in the sheet it opened (WCAG 2.4.3).
79
81
  * - Every built-in label is an input (`homeAriaLabel`, `hamburgerAriaLabel`,
80
82
  * `userMenuAriaLabel`, `navAriaLabel`, `profileLabel`, `logoutLabel`,
81
83
  * `themeToDarkAriaLabel`, `themeToLightAriaLabel`, `contextAriaLabel`);
@@ -283,6 +285,10 @@ export declare class HeaderComponent {
283
285
  */
284
286
  protected get themeService(): ThemeService;
285
287
  private readonly hamburger;
288
+ /** The context button (`contextName`), while it is rendered. */
289
+ private readonly contextButton;
290
+ /** The `focusContext()` hook waiting for the next render. */
291
+ private pendingContextFocus?;
286
292
  constructor();
287
293
  /**
288
294
  * Name of the avatar trigger (AS-33, WCAG 2.5.3 Label in Name):
@@ -322,6 +328,15 @@ export declare class HeaderComponent {
322
328
  * Close profile dropdown
323
329
  */
324
330
  closeDropdown(): void;
331
+ /**
332
+ * Moves the focus to the context button after the next render (3.34), so a
333
+ * `contextName` set just before is already in its name. Call it right after
334
+ * the choice, or when the sheet that changes the context closes. Does
335
+ * nothing while the button isn't shown (no `contextName`, or up to 640 px
336
+ * with `contextPlacement="inline"`). A second call before that render
337
+ * replaces the first.
338
+ */
339
+ focusContext(): void;
325
340
  /**
326
341
  * Handle hamburger click
327
342
  */
@@ -100,6 +100,12 @@ export interface ListLinkClickEvent {
100
100
  item: ListItem;
101
101
  event: MouseEvent;
102
102
  }
103
+ /**
104
+ * The part of a row that `focusItem()` focuses (3.34): `row`, the row's
105
+ * button (`clickable`) or link (`href`), or `action`, its built-in action
106
+ * button.
107
+ */
108
+ export type ListItemPart = 'row' | 'action';
103
109
  /**
104
110
  * List component for displaying structured item collections.
105
111
  *
@@ -112,6 +118,9 @@ export interface ListLinkClickEvent {
112
118
  * - Accessible with ARIA list role; `clickable` rows are keyboard-operable
113
119
  * - `ListItem.href` rows are real links over the full row (3.16, TD-4);
114
120
  * `linkClick` hands plain clicks to your router
121
+ * - `focusItem(id, part)` (3.34): moves the focus to a row's button or link,
122
+ * or to its action, e.g. when the sheet that action opened closes
123
+ * (WCAG 2.4.3)
115
124
  *
116
125
  * @example
117
126
  * ```html
@@ -172,7 +181,24 @@ export declare class ListComponent {
172
181
  * tab" keeps working.
173
182
  */
174
183
  readonly linkClick: import("@angular/core").OutputEmitterRef<ListLinkClickEvent>;
184
+ private readonly injector;
185
+ /** The `role="list"` element; each item renders exactly one child of it. */
186
+ private readonly listEl;
187
+ /** The `focusItem()` hook waiting for the next render. */
188
+ private pendingItemFocus?;
175
189
  constructor();
190
+ /**
191
+ * Moves the focus into the row of the first item with this `id` after the
192
+ * next render (3.34). `'row'`: the row's button (`clickable`) or link
193
+ * (`href`). `'action'`: its built-in action button. Does nothing for an
194
+ * unknown `id`, for a row without that part (a plain row, a disabled row for
195
+ * `'row'`, no `action`, an `lcListItem` template's own controls), or when
196
+ * the list is destroyed first. A second call before that render replaces the
197
+ * first.
198
+ * @param id The `ListItem.id` of the row.
199
+ * @param part Which part of the row gets the focus.
200
+ */
201
+ focusItem(id: string, part?: ListItemPart): void;
176
202
  /** Whether a row renders as a link: `href` set and not disabled. */
177
203
  protected isLinkRow(item: ListItem): boolean;
178
204
  /**
@@ -17,7 +17,9 @@ export type ModalPlacement = 'center' | 'auto' | 'sheet';
17
17
  * - Placement: centred, or a bottom sheet on phones (`placement="auto"`)
18
18
  * - Header and footer stay visible while the body scrolls; the close button
19
19
  * is a 44 px target
20
- * - Focus trap for keyboard accessibility
20
+ * - Focus trap for keyboard accessibility; `returnFocusTo` (3.34) names the
21
+ * element that gets the focus back after the dialog closed (WebKit doesn't
22
+ * focus a tapped button, so the one captured at open is `body`)
21
23
  * - Backdrop click and Escape key to close
22
24
  * - Two-way open binding
23
25
  * - Header, body, and footer content slots
@@ -84,6 +86,20 @@ export declare class ModalComponent implements OnDestroy {
84
86
  ariaDescribedBy: import("@angular/core").InputSignal<string | undefined>;
85
87
  /** Accessible name of the close button (`showCloseButton`). */
86
88
  closeAriaLabel: import("@angular/core").InputSignal<string>;
89
+ /**
90
+ * Element that gets the focus back after the dialog closed (3.34), instead
91
+ * of the one that had it at open. Set it to the trigger: WebKit (Safari,
92
+ * every iOS browser) doesn't focus a tapped button, so the captured element
93
+ * is `body`. Applied after the next render, once the dialog has left the DOM
94
+ * and the focus trap has restored its captured element. This holds on every
95
+ * close: ×, Escape, backdrop, `open` false, `closeModal()`, and destroying an
96
+ * open modal. A custom-element host that can't take focus (`<lc-button>`)
97
+ * hands it to its first focusable descendant. Ignored when the element is no
98
+ * longer in the document or can't take focus; the captured element then
99
+ * keeps it. `null`: as before.
100
+ * @default null
101
+ */
102
+ returnFocusTo: import("@angular/core").InputSignal<HTMLElement | null>;
87
103
  /**
88
104
  * Emitted when modal opens
89
105
  */
@@ -113,6 +129,13 @@ export declare class ModalComponent implements OnDestroy {
113
129
  /** Identifies this instance in the overlay stack. */
114
130
  private readonly modalId;
115
131
  private originalOverflow?;
132
+ /**
133
+ * The environment injector: a node injector would cancel the focus-return
134
+ * hook when the modal is destroyed while open (`ConfirmService`).
135
+ */
136
+ private readonly environmentInjector;
137
+ /** Whether `showModal()` ran without a `hideModal()` after it. */
138
+ private shown;
116
139
  constructor();
117
140
  ngOnDestroy(): void;
118
141
  /**
@@ -139,13 +162,21 @@ export declare class ModalComponent implements OnDestroy {
139
162
  protected onDocumentKeydown(event: KeyboardEvent): void;
140
163
  /**
141
164
  * Show the modal. Focus is moved inside and restored on close by the
142
- * template's `cdkTrapFocus` / `cdkTrapFocusAutoCapture`.
165
+ * template's `cdkTrapFocus` / `cdkTrapFocusAutoCapture`, then given to
166
+ * `returnFocusTo` when set (3.34).
143
167
  */
144
168
  private showModal;
145
169
  /**
146
170
  * Hide the modal
147
171
  */
148
172
  private hideModal;
173
+ /**
174
+ * Focuses `returnFocusTo` after the next render: the template refresh has
175
+ * removed the dialog, and `cdkTrapFocus` has restored its captured element
176
+ * on destroy, so this is the last focus write. Reads the input again then,
177
+ * so a trigger re-rendered meanwhile is taken from a fresh query.
178
+ */
179
+ private scheduleFocusReturn;
149
180
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, never>;
150
181
  static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "lc-modal", never, {
151
182
  "open": {
@@ -198,6 +229,11 @@ export declare class ModalComponent implements OnDestroy {
198
229
  "required": false;
199
230
  "isSignal": true;
200
231
  };
232
+ "returnFocusTo": {
233
+ "alias": "returnFocusTo";
234
+ "required": false;
235
+ "isSignal": true;
236
+ };
201
237
  }, {
202
238
  "modalOpened": "modalOpened";
203
239
  "modalClosed": "modalClosed";
@@ -195,10 +195,13 @@ type ToastLive = 'polite' | 'assertive';
195
195
  * (200 % text), so each toast stays reachable.
196
196
  *
197
197
  * Bottom stacks show the newest toast nearest the edge (3.33); top stacks the
198
- * oldest at the top. A `top-*` stack lies over the page on purpose (a toast
199
- * stays visible wherever the page is scrolled), so in the shell it can cover
200
- * a title right under the header (at 360 px a toast at y 72 over an h1 at
201
- * y 80): prefer `bottom-*` there.
198
+ * oldest at the top. The toasts of a stack are 8 px (`--spacing-2`) apart
199
+ * (3.33.1), within a live region and across the two; an empty region and the
200
+ * last toast add no space, and the stack keeps its 16 px padding. A `top-*`
201
+ * stack lies over the page on purpose (a toast stays visible wherever the
202
+ * page is scrolled), so in the shell it can cover a title right under the
203
+ * header (at 360 px a toast at y 72 over an h1 at y 80): prefer `bottom-*`
204
+ * there.
202
205
  *
203
206
  * CSS hooks (set them on `lc-toast-outlet` or any ancestor, e.g. `:root`;
204
207
  * each wins over the shell's value; write lengths, `0px` rather than `0`):