@cngx/common 0.1.0-rc.8 → 0.3.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 (90) hide show
  1. package/a11y/README.md +15 -2
  2. package/button/README.md +258 -0
  3. package/command/README.md +42 -2
  4. package/data/README.md +15 -12
  5. package/fesm2022/cngx-common-a11y.mjs +1076 -319
  6. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  7. package/fesm2022/cngx-common-audio.mjs +99 -77
  8. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  9. package/fesm2022/cngx-common-button.mjs +1084 -0
  10. package/fesm2022/cngx-common-button.mjs.map +1 -0
  11. package/fesm2022/cngx-common-card.mjs +138 -78
  12. package/fesm2022/cngx-common-card.mjs.map +1 -1
  13. package/fesm2022/cngx-common-chart.mjs +799 -327
  14. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  15. package/fesm2022/cngx-common-command.mjs +101 -25
  16. package/fesm2022/cngx-common-command.mjs.map +1 -1
  17. package/fesm2022/cngx-common-data.mjs +861 -423
  18. package/fesm2022/cngx-common-data.mjs.map +1 -1
  19. package/fesm2022/cngx-common-dialog.mjs +198 -160
  20. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  21. package/fesm2022/cngx-common-display.mjs +693 -329
  22. package/fesm2022/cngx-common-display.mjs.map +1 -1
  23. package/fesm2022/cngx-common-interactive.mjs +7303 -2774
  24. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  25. package/fesm2022/cngx-common-layout.mjs +2174 -442
  26. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  27. package/fesm2022/cngx-common-menu-button.mjs +557 -0
  28. package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
  29. package/fesm2022/cngx-common-popover.mjs +2109 -557
  30. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  31. package/fesm2022/cngx-common-stepper.mjs +548 -419
  32. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  33. package/fesm2022/cngx-common-tabs.mjs +442 -331
  34. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  35. package/fesm2022/cngx-common-timeline.mjs +44 -71
  36. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  37. package/fesm2022/cngx-common.mjs +10 -10
  38. package/fesm2022/cngx-common.mjs.map +1 -1
  39. package/interactive/README.md +30 -19
  40. package/layout/README.md +17 -1
  41. package/menu-button/README.md +234 -0
  42. package/package.json +31 -8
  43. package/popover/README.md +81 -4
  44. package/popover/tooltip-indicator.scss +52 -0
  45. package/schematics/collection.json +9 -0
  46. package/schematics/ng-add/index.js +9 -0
  47. package/schematics/ng-add/schema.json +96 -0
  48. package/schematics/package.json +3 -0
  49. package/stepper/README.md +5 -5
  50. package/theming/components/cngx-accordion.css +36 -7
  51. package/theming/components/cngx-async.css +185 -37
  52. package/theming/components/cngx-backdrop.css +3 -1
  53. package/theming/components/cngx-badge.css +20 -5
  54. package/theming/components/cngx-bottom-sheet.css +2 -0
  55. package/theming/components/cngx-breadcrumb.css +3 -1
  56. package/theming/components/cngx-button-group.css +325 -0
  57. package/theming/components/cngx-button-toggle.css +55 -23
  58. package/theming/components/cngx-button.css +975 -0
  59. package/theming/components/cngx-data-grid.css +2 -0
  60. package/theming/components/cngx-dialog.css +3 -1
  61. package/theming/components/cngx-divider.css +24 -9
  62. package/theming/components/cngx-drawer.css +153 -0
  63. package/theming/components/cngx-icon-glyph.css +76 -0
  64. package/theming/components/cngx-listbox.css +79 -25
  65. package/theming/components/cngx-menu.css +112 -52
  66. package/theming/components/cngx-nav.css +1220 -0
  67. package/theming/components/cngx-popover-sheet.css +434 -0
  68. package/theming/components/cngx-popover.css +37 -9
  69. package/theming/components/cngx-recycler-placeholder.css +2 -0
  70. package/theming/components/cngx-ripple.css +74 -16
  71. package/theming/components/cngx-sidebar.css +71 -0
  72. package/theming/components/cngx-slider.css +3 -1
  73. package/theming/components/cngx-tooltip.css +2 -0
  74. package/timeline/README.md +2 -2
  75. package/types/cngx-common-a11y.d.ts +488 -112
  76. package/types/cngx-common-audio.d.ts +60 -88
  77. package/types/cngx-common-button.d.ts +698 -0
  78. package/types/cngx-common-card.d.ts +104 -78
  79. package/types/cngx-common-chart.d.ts +677 -389
  80. package/types/cngx-common-command.d.ts +55 -41
  81. package/types/cngx-common-data.d.ts +506 -360
  82. package/types/cngx-common-dialog.d.ts +94 -127
  83. package/types/cngx-common-display.d.ts +475 -300
  84. package/types/cngx-common-interactive.d.ts +4383 -1721
  85. package/types/cngx-common-layout.d.ts +1399 -288
  86. package/types/cngx-common-menu-button.d.ts +382 -0
  87. package/types/cngx-common-popover.d.ts +990 -268
  88. package/types/cngx-common-stepper.d.ts +374 -465
  89. package/types/cngx-common-tabs.d.ts +309 -403
  90. package/types/cngx-common-timeline.d.ts +50 -109
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-common-layout.mjs","sources":["../../../projects/common/layout/drawer/backdrop.directive.ts","../../../projects/common/layout/drawer/drawer.directive.ts","../../../projects/common/layout/drawer/drawer-panel.directive.ts","../../../projects/common/layout/drawer/drawer-content.directive.ts","../../../projects/common/layout/observers/intersection-observer.directive.ts","../../../projects/common/layout/observers/media-query.directive.ts","../../../projects/common/layout/observers/inject-media-query.ts","../../../projects/common/layout/router/warn-router-absent.ts","../../../projects/common/layout/router/inject-query-param-sync.ts","../../../projects/common/layout/observers/resize-signal.ts","../../../projects/common/layout/observers/resize-observer.directive.ts","../../../projects/common/layout/observers/container-size.ts","../../../projects/common/layout/observers/container.directive.ts","../../../projects/common/layout/scroll/scroll-lock-core.ts","../../../projects/common/layout/scroll/scroll-lock.directive.ts","../../../projects/common/layout/scroll/scroll-edges-core.ts","../../../projects/common/layout/scroll/scroll-edges.directive.ts","../../../projects/common/layout/text/skeleton.directive.ts","../../../projects/common/layout/scroll/infinite-scroll.directive.ts","../../../projects/common/layout/scroll/sticky-header.directive.ts","../../../projects/common/layout/scroll/scroll-spy.directive.ts","../../../projects/common/layout/text/truncate.directive.ts","../../../projects/common/layout/text/highlight.directive.ts","../../../projects/common/layout/i18n/layout-language-section.ts","../../../projects/common/layout/i18n/layout-i18n.ts","../../../projects/common/layout/text/expandable-text.ts","../../../projects/common/layout/public-api.ts","../../../projects/common/layout/cngx-common-layout.ts"],"sourcesContent":["import {\n afterNextRender,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Manages backdrop overlay behavior: visibility, click-to-close, and\n * `inert` toggling on sibling elements.\n *\n * When visible, all sibling elements of the host receive the `inert`\n * attribute, preventing focus and interaction behind the backdrop.\n * This is critical for a11y in modal/drawer overlays. A sibling drawer\n * panel (`.cngx-drawer-panel`) is excluded - it is the surface the\n * backdrop guards, not content behind it. Siblings that already carry\n * `inert` are left alone, so a consumer-set `inert` survives the\n * show/hide cycle. The sibling set is re-queried on every show, so\n * siblings rendered after init are covered too.\n *\n * The directive is purely behavioral - it toggles the\n * `.cngx-backdrop--visible` class and `aria-hidden` attribute. Visual\n * styling is opt-in: either consume the shipped default stylesheet or\n * provide your own.\n *\n * ### Drawer backdrop with shipped defaults (recommended)\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <div [cngxBackdrop]=\"drawer.opened()\" (backdropClick)=\"drawer.close()\"\n * class=\"cngx-backdrop\"></div>\n * <nav [cngxDrawerPanel]=\"drawer\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n * ```css\n * @import '@cngx/common/theming/components/cngx-backdrop.css';\n * ```\n *\n * Token surface (Three-Tier-Override):\n * - `--cngx-backdrop-bg` (scrim color, default `oklch(0 0 0 / 0.5)`)\n * - `--cngx-backdrop-transition-duration` (default `200ms`)\n *\n * ### Custom styling (no opt-in class)\n * If the shipped defaults don't fit, omit the `.cngx-backdrop` class and\n * style your own host class - the directive still toggles\n * `.cngx-backdrop--visible` on the host element.\n *\n * ```html\n * <div [cngxBackdrop]=\"visible()\" class=\"my-backdrop\"></div>\n * ```\n * ```css\n * .my-backdrop {\n * position: fixed;\n * inset: 0;\n * background: rgba(0, 0, 0, 0.3);\n * opacity: 0;\n * pointer-events: none;\n * transition: opacity 0.25s ease;\n * }\n * .my-backdrop.cngx-backdrop--visible {\n * opacity: 1;\n * pointer-events: auto;\n * }\n * ```\n *\n * @category common/layout\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/backdrop.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerPanel, CngxScrollLock\n * <example-url>http://localhost:4200/#/common/layout/backdrop/overlay-with-inert</example-url>\n */\n@Directive({\n selector: '[cngxBackdrop]',\n exportAs: 'cngxBackdrop',\n standalone: true,\n host: {\n '[class.cngx-backdrop--visible]': 'visible()',\n 'aria-hidden': 'true',\n '(click)': 'handleHostClick()',\n },\n})\nexport class CngxBackdrop {\n /** Whether the backdrop is visible and siblings are inert. */\n readonly visible = input<boolean>(false, { alias: 'cngxBackdrop' });\n /** Whether clicking the backdrop emits `backdropClick`. */\n readonly closeOnClick = input<boolean>(true);\n /** Emitted when the backdrop is clicked (and `closeOnClick` is true). */\n readonly backdropClick = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly domReady = signal(false);\n\n constructor() {\n afterNextRender(() => this.domReady.set(true));\n\n effect((onCleanup) => {\n if (!this.domReady() || !this.visible()) {\n return;\n }\n // Re-queried on every show: siblings rendered after init (@if/@defer)\n // must be inerted too. The drawer panel keeps working - it is the\n // surface the backdrop guards, not content behind it.\n const el = this.el.nativeElement as HTMLElement;\n const parent = el.parentElement;\n // skip siblings that are already inert - removing it on cleanup\n // would clobber a consumer-set attribute that predated the show\n const targets = parent\n ? Array.from(parent.children).filter(\n (child): child is HTMLElement =>\n child !== el &&\n child instanceof HTMLElement &&\n !child.classList.contains('cngx-drawer-panel') &&\n !child.hasAttribute('inert'),\n )\n : [];\n targets.forEach((target) => target.setAttribute('inert', ''));\n onCleanup(() => targets.forEach((target) => target.removeAttribute('inert')));\n });\n }\n\n /** @internal */\n protected handleHostClick(): void {\n if (this.visible() && this.closeOnClick()) {\n this.backdropClick.emit();\n }\n }\n}\n","import { computed, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n/**\n * Position from which the drawer panel slides in.\n *\n * @category common/layout\n */\nexport type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * State owner for a drawer / sidebar system.\n *\n * Holds the open/close state and handles the Escape key. Supports both\n * **controlled** (`[cngxDrawerOpened]=\"signal()\"`) and **uncontrolled**\n * (internal state via `open()` / `close()` / `toggle()`) modes.\n *\n * Child directives (`CngxDrawerPanel`, `CngxDrawerContent`) receive a\n * reference to this directive via an explicit input - no ancestor injection.\n *\n * ### Uncontrolled\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <button (click)=\"drawer.toggle()\">Menu</button>\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n *\n * ### Controlled\n * ```html\n * <div cngxDrawer [cngxDrawerOpened]=\"sidebarOpen()\"\n * (openedChange)=\"sidebarOpen.set($event)\">\n * …\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawerPanel, CngxDrawerContent, CngxBackdrop, CngxScrollLock\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawer]',\n exportAs: 'cngxDrawer',\n standalone: true,\n host: {\n '[class.cngx-drawer--opened]': 'opened()',\n '(keydown.escape)': 'close()',\n },\n})\nexport class CngxDrawer {\n /** @internal Host element ref - used by `CngxDrawerPanel` for click-outside containment. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Controlled opened state. When bound, takes precedence over internal state. */\n readonly openedInput = input<boolean | undefined>(undefined, { alias: 'cngxDrawerOpened' });\n\n private readonly openedState = signal(false);\n\n /** Resolved opened state - controlled input wins over internal state. */\n readonly opened = computed(() => this.openedInput() ?? this.openedState());\n\n /** Emitted when the opened state changes. Wire to a signal for two-way binding. */\n readonly openedChange = output<boolean>();\n /** Emitted when the drawer closes. Convenience shorthand for close-only listeners. */\n readonly closed = output<void>();\n\n /** Opens the drawer. No-op when already open. */\n open(): void {\n if (this.opened()) {\n return;\n }\n this.openedState.set(true);\n this.openedChange.emit(true);\n }\n\n /** Closes the drawer. */\n close(): void {\n if (!this.opened()) {\n return;\n }\n this.openedState.set(false);\n this.openedChange.emit(false);\n this.closed.emit();\n }\n\n /** Toggles the drawer between open and closed. */\n toggle(): void {\n if (this.opened()) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { fromEvent, switchMap } from 'rxjs';\nimport { createTransitionTracker } from '@cngx/core/utils';\nimport { CngxFocusTrap } from '@cngx/common/a11y';\nimport type { CngxDrawer, DrawerPosition } from './drawer.directive';\n\n/**\n * How the drawer panel interacts with the content area.\n *\n * @category common/layout\n */\nexport type DrawerMode = 'over' | 'push' | 'side';\n\n/**\n * The sliding panel of a drawer. Reads its open state from an explicit\n * `[cngxDrawerPanel]` reference - no ancestor injection.\n *\n * Composes `CngxFocusTrap` as a `hostDirective` - the consumer controls\n * the `[enabled]` and `[autoFocus]` inputs from the template.\n *\n * Optionally closes the drawer when the user clicks outside the panel\n * (`closeOnClickOutside`, default `true`). The click that opened the\n * drawer never counts as an outside click. While closed (except in\n * `side` mode) the panel is `aria-hidden` AND `inert`, so its focusable\n * children are unreachable for keyboard and AT alike. On close, focus\n * returns to the element that was focused when the drawer opened -\n * unless the user moved focus to another focusable element themselves\n * (a click on a focusable outside target keeps its focus).\n *\n * The `role` input defaults to `complementary`. On a `<nav>` host pass\n * `[role]=\"null\"` so the implicit navigation landmark survives:\n *\n * ```html\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\" mode=\"over\" [role]=\"null\"\n * [enabled]=\"drawer.opened()\" [autoFocus]=\"true\">\n * <a href=\"/home\">Home</a>\n * </nav>\n * ```\n *\n * @category common/layout\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-panel.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerContent, CngxFocusTrap\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerPanel]',\n exportAs: 'cngxDrawerPanel',\n standalone: true,\n hostDirectives: [{ directive: CngxFocusTrap, inputs: ['enabled', 'autoFocus'] }],\n host: {\n '[class.cngx-drawer-panel]': 'true',\n '[class.cngx-drawer-panel--open]': 'isOpen()',\n '[class.cngx-drawer-panel--left]': \"position() === 'left'\",\n '[class.cngx-drawer-panel--right]': \"position() === 'right'\",\n '[class.cngx-drawer-panel--top]': \"position() === 'top'\",\n '[class.cngx-drawer-panel--bottom]': \"position() === 'bottom'\",\n '[class.cngx-drawer-panel--over]': \"mode() === 'over'\",\n '[class.cngx-drawer-panel--push]': \"mode() === 'push'\",\n '[class.cngx-drawer-panel--side]': \"mode() === 'side'\",\n '[attr.aria-hidden]': \"mode() !== 'side' && !isOpen() ? true : null\",\n '[attr.inert]': \"mode() !== 'side' && !isOpen() ? '' : null\",\n '[attr.role]': 'role()',\n },\n})\nexport class CngxDrawerPanel {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerPanel' });\n\n /** Direction the panel slides from. */\n readonly position = input<DrawerPosition>('left');\n\n /**\n * How the panel interacts with the content area:\n * - `'over'` (default) - overlays content (absolute positioned)\n * - `'push'` - pushes content aside (content gets margin)\n * - `'side'` - always visible, no toggle behavior\n */\n readonly mode = input<DrawerMode>('over');\n\n /** Whether clicking outside the panel closes the drawer. */\n readonly closeOnClickOutside = input<boolean>(true);\n\n /**\n * Landmark role rendered on the panel. Defaults to `complementary`;\n * pass `navigation` for nav drawers or `null` to keep the element's\n * implicit role (e.g. on a `<nav>` host).\n */\n readonly role = input<string | null>('complementary');\n\n /** Whether the drawer is currently open (derived from the drawer ref). In `side` mode, always `true`. */\n readonly isOpen = computed(() => this.mode() === 'side' || this.drawerRef().opened());\n\n private suppressOutsideClick = false;\n private restoreTarget: HTMLElement | null = null;\n\n constructor() {\n const doc = inject(DOCUMENT);\n const el = inject(ElementRef<HTMLElement>);\n\n // Focus restoration: closing puts `inert` on the panel, which would\n // silently drop focus to <body>. Capture the focused element at the\n // open transition and hand focus back at the close transition when\n // focus is still inside the panel (Escape) or already fell to <body>\n // (outside click on a non-focusable area). A focusable outside target\n // the user clicked keeps its focus.\n const openTransition = createTransitionTracker(() => this.isOpen());\n effect(() => {\n const open = openTransition.current();\n const wasOpen = openTransition.previous();\n if (open === wasOpen) {\n return;\n }\n untracked(() => {\n if (open) {\n const active = doc.activeElement;\n this.restoreTarget = active instanceof HTMLElement ? active : null;\n return;\n }\n const active = doc.activeElement;\n const focusLost =\n active === null ||\n active === doc.body ||\n (el.nativeElement as HTMLElement).contains(active);\n if (focusLost && this.restoreTarget?.isConnected) {\n this.restoreTarget.focus();\n }\n this.restoreTarget = null;\n });\n });\n\n // A click on a toggle OUTSIDE the container opens the drawer and then\n // bubbles on to the document listener below within the same dispatch -\n // without suppression it would close its own drawer instantly. The\n // openedChange emit is synchronous inside that dispatch; the flag is\n // lifted on the next macrotask, after the bubble phase has finished\n // (a microtask checkpoint can run between listeners of a native event).\n toObservable(this.drawerRef)\n .pipe(\n switchMap((drawer) => outputToObservable(drawer.openedChange)),\n takeUntilDestroyed(),\n )\n .subscribe((opened) => {\n if (opened) {\n this.suppressOutsideClick = true;\n setTimeout(() => (this.suppressOutsideClick = false));\n }\n });\n\n // Hit-test against the container, not the panel - toggle buttons and backdrops\n // sit inside the container and must not count as outside clicks.\n fromEvent<MouseEvent>(doc, 'click')\n .pipe(takeUntilDestroyed())\n .subscribe((e) => {\n if (\n !this.suppressOutsideClick &&\n this.mode() !== 'side' &&\n this.isOpen() &&\n this.closeOnClickOutside() &&\n !(this.drawerRef().elementRef.nativeElement as HTMLElement).contains(e.target as Node)\n ) {\n this.drawerRef().close();\n }\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport type { CngxDrawer } from './drawer.directive';\n\n/**\n * Marks the main content area adjacent to a drawer panel.\n *\n * Adds a CSS class when the drawer is open so the consumer can offset\n * the content via CSS transitions or transforms.\n *\n * ```html\n * <main [cngxDrawerContent]=\"drawer\">\n * Page content\n * </main>\n * ```\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxDrawerPanel\n * <example-url>http://localhost:4200/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/mode-over-push-side</example-url>\n * <example-url>http://localhost:4200/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerContent]',\n exportAs: 'cngxDrawerContent',\n standalone: true,\n host: {\n '[class.cngx-drawer-content]': 'true',\n '[class.cngx-drawer-content--shifted]': 'isOpen()',\n },\n})\nexport class CngxDrawerContent {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerContent' });\n\n /** Whether the drawer is currently open (derived from the drawer ref). */\n readonly isOpen = computed(() => this.drawerRef().opened());\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Observes whether the host element is visible in the viewport or a scroll container.\n *\n * Wraps the browser's `IntersectionObserver` API and exposes its state as\n * Angular signals. The observer is automatically recreated when `root`,\n * `rootMargin`, or `threshold` inputs change, and disconnected on destroy.\n *\n * Use cases: lazy loading images, infinite scroll sentinels, scroll-triggered\n * animations, \"back to top\" buttons, analytics viewport tracking.\n *\n * ### Lazy load sentinel\n * ```html\n * <div cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * (entered)=\"loadNextPage()\">\n * @if (io.isIntersecting()) { Loading... }\n * </div>\n * ```\n *\n * ### Scroll-triggered animation\n * ```html\n * <section cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * [threshold]=\"0.5\"\n * [class.visible]=\"io.isIntersecting()\">\n * Content fades in at 50% visibility\n * </section>\n * ```\n *\n * ### Custom scroll container\n * ```html\n * <div cngxIntersectionObserver [root]=\"'.scroll-container'\" [rootMargin]=\"'100px'\">\n * Observed within a scrollable parent\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/intersection-observer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxResizeObserver, CngxMediaQuery, CngxInfiniteScroll, CngxScrollSpy\n * <example-url>http://localhost:4200/#/common/layout/intersection-observer/scroll-sentinel</example-url>\n */\n@Directive({\n selector: '[cngxIntersectionObserver]',\n exportAs: 'cngxIntersectionObserver',\n standalone: true,\n})\nexport class CngxIntersectionObserver {\n /** CSS selector for the scroll container root. `null` (default) uses the viewport. */\n readonly root = input<string | null>(null);\n /** Margin around the root, using CSS margin syntax (e.g. `'100px 0px'`). */\n readonly rootMargin = input<string>('0px');\n /** Visibility ratio(s) at which the callback fires. `0` = any pixel visible, `1` = fully visible. */\n readonly threshold = input<number | number[]>(0);\n\n private readonly entryState = signal<IntersectionObserverEntry | null>(null);\n\n /** `true` when any part of the element is visible within the root. */\n readonly isIntersecting = computed(() => this.entryState()?.isIntersecting ?? false);\n /** The fraction of the element currently visible (0–1). */\n readonly intersectionRatio = computed(() => this.entryState()?.intersectionRatio ?? 0);\n\n /** Emitted on every intersection change with the raw `IntersectionObserverEntry`. */\n readonly intersectionChange = output<IntersectionObserverEntry>();\n /** Emitted once when the element enters the observed area. */\n readonly entered = output<void>();\n /** Emitted once when the element leaves the observed area. */\n readonly left = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (isDevMode() && root && !resolvedRoot) {\n console.warn(\n `[cngxIntersectionObserver] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n const wasIntersecting = this.entryState()?.isIntersecting ?? false;\n this.entryState.set(entry);\n this.intersectionChange.emit(entry);\n if (entry.isIntersecting && !wasIntersecting) {\n this.entered.emit();\n }\n if (!entry.isIntersecting && wasIntersecting) {\n this.left.emit();\n }\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, effect, inject, input, signal } from '@angular/core';\nimport { observeMediaQuery } from '@cngx/core/utils';\n\n/**\n * Reactive media query directive that exposes a `matches` signal.\n *\n * Wraps `window.matchMedia()` with automatic cleanup. Usable for\n * responsive layouts, drawer mode switching, conditional rendering,\n * or any behavior that depends on viewport/preference queries.\n *\n * ### Responsive drawer mode\n * ```html\n * <div cngxMediaQuery=\"(min-width: 1024px)\" #mq=\"cngxMediaQuery\">\n * <nav [cngxDrawerPanel]=\"drawer\"\n * [mode]=\"mq.matches() ? 'side' : 'over'\">\n * …\n * </nav>\n * </div>\n * ```\n *\n * ### Conditional content\n * ```html\n * <div cngxMediaQuery=\"(prefers-color-scheme: dark)\" #dark=\"cngxMediaQuery\">\n * @if (dark.matches()) { <span>Dark mode active</span> }\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/media-query.directive.ts\n * @since 0.1.0\n * @relatedTo CngxResizeObserver, CngxIntersectionObserver\n * <example-url>http://localhost:4200/#/common/layout/media-query/viewport-breakpoints</example-url>\n */\n@Directive({\n selector: '[cngxMediaQuery]',\n exportAs: 'cngxMediaQuery',\n standalone: true,\n})\nexport class CngxMediaQuery {\n /** The CSS media query string to evaluate. */\n readonly query = input.required<string>({ alias: 'cngxMediaQuery' });\n\n private readonly matchesState = signal(false);\n private readonly win = inject(DOCUMENT).defaultView;\n\n /** Whether the media query currently matches. */\n readonly matches = this.matchesState.asReadonly();\n\n constructor() {\n effect((onCleanup) => {\n onCleanup(\n observeMediaQuery(this.win, this.query(), (matches) => this.matchesState.set(matches)),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, inject, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Inject-form of {@link CngxMediaQuery}: returns a reactive\n * `Signal<boolean>` that reflects whether the host window currently matches\n * a CSS media query, without needing a host element.\n *\n * Use it where the directive form has nowhere to attach - inside a route\n * guard, a store, a `computed()`, or any injection context that reacts to a\n * viewport or preference query. For host-bound templates, prefer the\n * `[cngxMediaQuery]` directive; for pure styling, prefer CSS `@media` /\n * `@container`.\n *\n * Wraps `window.matchMedia()`: seeds the signal from `MediaQueryList.matches`,\n * updates on the `change` event, and removes the listener via `DestroyRef`\n * when the injection scope is destroyed. In SSR / non-DOM environments (no\n * `defaultView` or no `matchMedia`) it returns a static `false` signal and\n * wires no listener, so it never throws off the browser.\n *\n * Returns a `Signal<boolean>` - never an `Observable`; the reactive boundary\n * stays inside cngx.\n *\n * ```typescript\n * @Component({ … })\n * export class Dashboard {\n * private readonly compact = injectMediaQuery('(max-width: 640px)');\n * protected readonly layout = computed(() => (this.compact() ? 'stacked' : 'grid'));\n * }\n * ```\n *\n * @param query A CSS media query string, e.g. `(max-width: 640px)`.\n * @returns A reactive `Signal<boolean>` tracking the query's match state.\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/inject-media-query.ts\n * @since 0.1.0\n * @relatedTo CngxMediaQuery, CngxResizeObserver\n * <example-url>http://localhost:4200/#/common/layout/media-query/inject-breakpoint-signal</example-url>\n */\nexport function injectMediaQuery(query: string): Signal<boolean> {\n return createMediaQuerySignal(query, inject(DestroyRef), inject(DOCUMENT).defaultView);\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * Dev-warning the query-param sync kernel emits when `@angular/router` is\n * not provided. Mirrors {@link warnTabsRouterAbsent} in `@cngx/common/tabs`\n * so the message stays identical across the two sync surfaces; only the\n * `enables` clause differs (and this copy is dev-gated). A deliberate small\n * copy rather than a shared import - sharing would force the helper onto a\n * `public-api.ts`, and `warn*` matches no approved public-API prefix.\n *\n * @internal\n */\nexport function warnRouterAbsent(directive: string, enables: string): void {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n `${directive}: no Router available - directive is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n","import { effect, inject, untracked, type Signal, type WritableSignal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { coerceSignal } from '@cngx/core/utils';\n\nimport { warnRouterAbsent } from './warn-router-absent';\n\n/**\n * Options for {@link injectQueryParamSync}.\n *\n * `param` accepts a live `Signal<string>` so a bound `[param]` rename stays\n * reactive; a plain string is wrapped internally. `serialize`/`deserialize`\n * default to a boolean codec (`true` -> `'open'`, absence -> `false`); pass an\n * identity codec (`v => v ?? null` / `raw => raw`) to sync string ids.\n */\nexport interface QueryParamSyncOptions<T = boolean> {\n /** Query-param key. A `Signal<string>` keeps a bound rename live. */\n readonly param: string | Signal<string>;\n /** `T` -> URL string, or `null` to remove the key. Default: boolean codec. */\n readonly serialize?: (value: T) => string | null;\n /** URL string (or `null` when absent) -> `T`. Default: boolean codec. */\n readonly deserialize?: (raw: string | null) => T;\n /** Invoked with the rejection reason when `router.navigate` rejects. */\n readonly onSyncError?: (err: unknown) => void;\n}\n\n/**\n * Bidirectional sync between a caller-owned `WritableSignal<T>` and a named\n * query param. URL wins on initial load (deep-link intent); after hydrate the\n * signal is the source and reflects outward. Re-hydrates on browser\n * back/forward. Dev-warns once and no-ops when `@angular/router` is absent.\n *\n * Loop-safety (the core of this helper): the reflect effect writes the URL in\n * `untracked()` and skips `navigate` when the serialized `state()` equals the\n * last value it wrote - a local closure seeded from the initial URL read, not\n * the live URL param (the live param races the navigate-settle window). The\n * hydrate path updates that same closure whenever it accepts a URL value, so\n * back/forward re-hydration never triggers a reflex navigate. A `param` rename\n * is migrated in one navigate (`{ [old]: null, [new]: serialize(state()) }`)\n * by a dedicated effect whose only tracked source is the normalized param\n * signal; its first run seeds bookkeeping and never navigates.\n *\n * The `state.set` inside the hydrate effect is a deliberate signal-write-in-\n * effect: the URL is an external system and `state` is a caller-owned signal\n * the consumer must stay able to toggle, so hydrate cannot be a `computed`. It\n * is edge-guarded by serialized equality and wrapped in `untracked()`.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/router/inject-query-param-sync.ts\n * @since 0.1.0\n * @relatedTo CngxStepperRouterSync\n * <example-url>http://localhost:4200/#/common/layout/router/persisted-toggle</example-url>\n */\nexport function injectQueryParamSync<T = boolean>(\n state: WritableSignal<T>,\n opts: QueryParamSyncOptions<T>,\n): void {\n const router = inject(Router, { optional: true });\n\n if (!router) {\n warnRouterAbsent('injectQueryParamSync', 'query-param URL sync');\n return;\n }\n\n const route = inject(ActivatedRoute);\n\n const paramSignal: Signal<string> = coerceSignal(opts.param);\n const serialize: (value: T) => string | null =\n opts.serialize ?? ((value) => (value ? 'open' : null));\n const deserialize: (raw: string | null) => T = opts.deserialize ?? ((raw) => (raw != null) as T);\n\n // Closure bookkeeping, seeded from the initial URL read. `lastWritten` is\n // the serialized value the reflect path last pushed to the URL; the hydrate\n // path also updates it so an accepted URL value is not reflected back.\n const initialParam = paramSignal();\n let lastWritten: string | null = route.snapshot.queryParamMap.get(initialParam) ?? null;\n let previousParam = initialParam;\n\n // URL wins on initial load.\n if (lastWritten != null) {\n const hydrated = deserialize(lastWritten);\n if (!Object.is(hydrated, state())) {\n state.set(hydrated);\n }\n }\n\n // Reflect: signal change -> URL. Tracks `state()` only; param read untracked.\n effect(() => {\n const raw = serialize(state());\n untracked(() => {\n if (raw === lastWritten) {\n return;\n }\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [paramSignal()]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n\n // Re-hydrate: URL change (back/forward) -> signal. Tracks the query-param\n // emission only; param and state reads are untracked. The first run mirrors\n // the initial snapshot already handled synchronously above, so it is skipped\n // - processing it would race the reflect effect's still-pending initial\n // navigate and reset `state` to a stale value. Later runs skip our own\n // reflect echo via the `lastWritten` guard.\n const queryMap = toSignal(route.queryParamMap, {\n initialValue: route.snapshot.queryParamMap,\n });\n let hydrateInitialized = false;\n effect(() => {\n const map = queryMap();\n untracked(() => {\n if (!hydrateInitialized) {\n hydrateInitialized = true;\n return;\n }\n const raw = map.get(paramSignal()) ?? null;\n if (raw === lastWritten) {\n return;\n }\n const next = deserialize(raw);\n if (!Object.is(next, state())) {\n state.set(next);\n }\n lastWritten = raw;\n });\n });\n\n // Rename migration: param change -> one merged navigate that removes the old\n // key and writes the current value under the new one. Tracks the param\n // signal only; the first run seeds `previousParam` and never navigates.\n effect(() => {\n const param = paramSignal();\n untracked(() => {\n if (param === previousParam) {\n return;\n }\n const oldParam = previousParam;\n previousParam = param;\n const raw = serialize(state());\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [oldParam]: null, [param]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n}\n","import { type DestroyRef, signal, type Signal } from '@angular/core';\n\n/**\n * Structural window surface the resize helpers read: `window`, `globalThis`,\n * or a test double. `ResizeObserver` is optional so SSR and jsdom hosts pass\n * the type and hit the runtime guard instead.\n *\n * @category common/layout/observers\n * @since 0.3.0\n */\nexport interface ResizeObserverHost {\n ResizeObserver?: typeof ResizeObserver;\n}\n\n/**\n * Subscribes `apply` to size changes of `element` on `host`.\n *\n * Re-applies on every observation and returns the teardown that disconnects\n * the observer. On a host without `ResizeObserver` (SSR, jsdom) nothing is\n * wired, `apply` never fires, and the returned teardown is a no-op. Unlike the\n * media-query twin there is no synchronous seed: the first size is whatever the\n * observer reports after the next layout.\n *\n * Reach for this low-level form when the observed element or the box model is\n * reactive and the subscription must follow it (re-wire per `effect` run via\n * `onCleanup`); for a static target, {@link createResizeSignal} owns the\n * teardown via `DestroyRef`.\n *\n * @param host The window-like object to read `ResizeObserver` from.\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param apply Receives the first entry of every observation batch.\n * @returns Teardown that disconnects the observer.\n * @category common/layout/observers\n * @relatedTo createResizeSignal, observeMediaQuery\n * @since 0.1.0\n */\nexport function observeResize(\n host: ResizeObserverHost | null | undefined,\n element: Element,\n box: ResizeObserverBoxOptions,\n apply: (entry: ResizeObserverEntry) => void,\n): () => void {\n if (!host || typeof host.ResizeObserver !== 'function') {\n return () => undefined;\n }\n const observer = new host.ResizeObserver((entries) => apply(entries[0]));\n observer.observe(element, { box });\n return () => observer.disconnect();\n}\n\n/**\n * Creates a `Signal<ResizeObserverEntry | null>` that carries the most recent\n * observation of `element`, `null` until the first one arrives.\n *\n * Disconnects when `destroyRef` is destroyed. On a host without\n * `ResizeObserver` (SSR, jsdom) the signal stays `null` and no observer is\n * created, so it never throws off the browser.\n *\n * This is the shared kernel behind `CngxResizeObserver` and\n * `createContainerSize`; consumers that hand-roll a `ResizeObserver` should\n * route through it instead.\n *\n * ```typescript\n * const entry = createResizeSignal(\n * host,\n * 'border-box',\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const width = computed(() => entry()?.borderBoxSize[0]?.inlineSize ?? 0);\n * ```\n *\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param host The window-like object to read `ResizeObserver` from.\n * @returns A readonly signal carrying the latest entry.\n * @category common/layout/observers\n * @relatedTo observeResize, createMediaQuerySignal\n * @since 0.1.0\n */\nexport function createResizeSignal(\n element: Element,\n box: ResizeObserverBoxOptions,\n destroyRef: DestroyRef,\n host: ResizeObserverHost | null | undefined,\n): Signal<ResizeObserverEntry | null> {\n const entry = signal<ResizeObserverEntry | null>(null);\n const unsubscribe = observeResize(host, element, box, (value) => entry.set(value));\n destroyRef.onDestroy(unsubscribe);\n return entry.asReadonly();\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from './resize-signal';\n\n/**\n * Observes size changes of the host element via the `ResizeObserver` API.\n *\n * Exposes `width()`, `height()`, `contentRect()`, and `isReady()` as Angular\n * signals that update on every resize. The observer is automatically\n * disconnected on destroy and recreated when the `box` input changes.\n *\n * Use cases: responsive component logic in TypeScript (not just CSS),\n * container queries without CSS support, dynamic canvas/chart sizing,\n * resize-aware layouts.\n *\n * ### Display current size\n * ```html\n * <div cngxResizeObserver #ro=\"cngxResizeObserver\" style=\"resize: horizontal; overflow: auto;\">\n * {{ ro.width() | number:'1.0-0' }} × {{ ro.height() | number:'1.0-0' }} px\n * </div>\n * ```\n *\n * ### Responsive logic in TypeScript\n * ```typescript\n * readonly ro = viewChild(CngxResizeObserver);\n * readonly columns = computed(() => (this.ro()?.width() ?? 0) > 600 ? 3 : 1);\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/resize-observer.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxMediaQuery\n * <example-url>http://localhost:4200/#/common/layout/resize-observer/live-size</example-url>\n */\n@Directive({\n selector: '[cngxResizeObserver]',\n exportAs: 'cngxResizeObserver',\n standalone: true,\n})\nexport class CngxResizeObserver {\n /** Which box model to observe. `'content-box'` (default), `'border-box'`, or `'device-pixel-content-box'`. */\n readonly box = input<ResizeObserverBoxOptions>('content-box');\n\n private readonly entryState = signal<ResizeObserverEntry | null>(null);\n\n /** The full `DOMRectReadOnly` of the content box. `null` before first observation. */\n readonly contentRect = computed(() => this.entryState()?.contentRect ?? null);\n /** Current width in pixels. `0` before first observation. */\n readonly width = computed(() => this.entryState()?.contentRect.width ?? 0);\n /** Current height in pixels. `0` before first observation. */\n readonly height = computed(() => this.entryState()?.contentRect.height ?? 0);\n /** `true` after the first resize observation has been received. */\n readonly isReady = computed(() => this.entryState() !== null);\n\n /** Emitted on every resize with the raw `ResizeObserverEntry`. */\n readonly resize = output<ResizeObserverEntry>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n\n // One subscription per `box` value: `onCleanup` disconnects the previous\n // observer before `observeResize` wires the next, which is also the\n // teardown on destroy. The kernel no-ops when the host ships no\n // `ResizeObserver` (SSR, jsdom), so no host guard is needed here.\n effect((onCleanup) => {\n onCleanup(\n observeResize(win, this.el.nativeElement as HTMLElement, this.box(), (entry) => {\n this.entryState.set(entry);\n this.resize.emit(entry);\n }),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n type DestroyRef,\n DestroyRef as DestroyRefToken,\n ElementRef,\n inject,\n InjectionToken,\n type Signal,\n} from '@angular/core';\n\nimport { createResizeSignal, type ResizeObserverHost } from './resize-signal';\n\n/**\n * Reactive read of a query container: its size, and the custom properties its\n * `@container` rules resolved to.\n *\n * @category common/layout/observers\n * @since 0.1.0\n */\nexport interface CngxContainerSize {\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize: Signal<number>;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize: Signal<number>;\n /** `true` once the first observation has arrived. */\n readonly isReady: Signal<boolean>;\n /**\n * The resolved value of a custom property, re-read on every resize of the\n * container.\n *\n * **The `@container` rule must style a descendant, never the container\n * itself.** A container query resolves against an *ancestor* query container\n * of the element it styles, so a rule whose subject is the container element\n * matches nothing and the property never changes. Pass that descendant as\n * `on`; it defaults to the container host, which is only correct for\n * properties no container query writes.\n *\n * A component that is container and reader at once has no descendant to\n * carry the value. Pass `pseudo` instead: the query container for a\n * pseudo-element is selected from its originating element's *inclusive*\n * ancestors, so `.host::after` resolves against `.host` while a rule on\n * `.host` itself still matches nothing. No sentinel node enters the\n * template.\n *\n * ```css\n * .cngx-thing::after { --cngx-thing-narrow: 0; }\n * &#64;container cngx-thing (max-inline-size: 30rem) {\n * .cngx-thing::after { --cngx-thing-narrow: 1; }\n * }\n * ```\n *\n * Returns the empty string before the first observation and in environments\n * without layout (SSR, jsdom).\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string>;\n}\n\n/**\n * The nearest query container declared by {@link CngxContainer}.\n *\n * Deliberately has no root factory: absence is meaningful. A component that\n * needs a container and finds none must say so (a dev-mode warning), not\n * silently observe itself.\n *\n * @category common/layout/observers\n * @since 0.1.0\n */\nexport const CNGX_CONTAINER_SIZE = new InjectionToken<CngxContainerSize>('CNGX_CONTAINER_SIZE');\n\n/**\n * Creates a {@link CngxContainerSize} over `element`.\n *\n * Observes the border box, so the reported size matches what an\n * `inline-size` container query measures. The `property()` reads are plain\n * `computed()`s over the same resize signal - the browser has already\n * re-evaluated every container query by the time a `ResizeObserver` callback\n * runs, so the read returns the current value without a second scheduling hop.\n *\n * @param element The container host.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param win The window-like object providing `ResizeObserver` and `getComputedStyle`.\n * @category common/layout/observers\n * @relatedTo injectContainerSize, CngxContainer\n * @since 0.1.0\n */\nexport function createContainerSize(\n element: Element,\n destroyRef: DestroyRef,\n win: (ResizeObserverHost & Pick<Window, 'getComputedStyle'>) | null | undefined,\n): CngxContainerSize {\n const entry = createResizeSignal(element, 'border-box', destroyRef, win);\n\n const inlineSize = computed(() => entry()?.borderBoxSize?.[0]?.inlineSize ?? 0);\n const blockSize = computed(() => entry()?.borderBoxSize?.[0]?.blockSize ?? 0);\n const isReady = computed(() => entry() !== null);\n\n // Weak on the element: the container outlives descendants that get\n // destroyed, so a strong Map would pin every dead node it ever read.\n const cache = new WeakMap<Element, Map<string, Signal<string>>>();\n\n const property = (\n name: string,\n on?: Element,\n pseudo?: '::before' | '::after',\n ): Signal<string> => {\n const target = on ?? element;\n let byName = cache.get(target);\n if (!byName) {\n byName = new Map();\n cache.set(target, byName);\n }\n const key = `${pseudo ?? ''}|${name}`;\n const cached = byName.get(key);\n if (cached) {\n return cached;\n }\n // A DOM read inside a computed() is deliberate here, not an oversight: the\n // only tracked dependency is the resize entry, and a ResizeObserver\n // callback runs after layout, when every container query has already been\n // re-evaluated. The read is therefore idempotent for a given entry and\n // never forces a recalc of its own. An effect writing into a signal would\n // add a scheduling hop for nothing.\n const value = computed(() => {\n if (entry() === null || !win?.getComputedStyle) {\n return '';\n }\n return win\n .getComputedStyle(target, pseudo ?? null)\n .getPropertyValue(name)\n .trim();\n });\n byName.set(key, value);\n return value;\n };\n\n return { inlineSize, blockSize, isReady, property };\n}\n\n/**\n * Reads the nearest query container declared by a `[cngxContainer]` ancestor,\n * or observes `target` (default: the host element) when there is none.\n *\n * Use it where a component must branch structurally on the width it was given\n * - a different template, a focus move, an `aria-modal` flip. Purely visual\n * adaptation needs no TypeScript at all: write a `@container` rule.\n *\n * ```typescript\n * private readonly container = inject(CNGX_CONTAINER_SIZE, { optional: true });\n * private readonly wide = this.container?.property('--cngx-thing-wide', this.host) ?? signal('').asReadonly();\n * readonly mode = computed(() => (this.wide() === '1' ? 'side' : 'over'));\n * ```\n *\n * A component that declares the container in its own stylesheet and reads it\n * itself passes its host explicitly and reads the property off `::after` -\n * there is no descendant to carry the value:\n *\n * ```typescript\n * private readonly host = inject(ElementRef).nativeElement as Element;\n * private readonly container = injectContainerSize(this.host);\n * private readonly narrow = this.container.property('--cngx-thing-narrow', this.host, '::after');\n * ```\n *\n * @param target Element to observe when no ancestor container exists.\n * @category common/layout/observers\n * @relatedTo CngxContainer, injectMediaQuery\n * @since 0.1.0\n */\nexport function injectContainerSize(target?: ElementRef<Element> | Element): CngxContainerSize {\n const ancestor = inject(CNGX_CONTAINER_SIZE, { optional: true, skipSelf: true });\n if (ancestor && !target) {\n return ancestor;\n }\n const resolved: Element =\n target instanceof ElementRef\n ? target.nativeElement\n : (target ?? (inject(ElementRef).nativeElement as Element));\n return createContainerSize(resolved, inject(DestroyRefToken), inject(DOCUMENT).defaultView);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, type Signal } from '@angular/core';\n\nimport { CNGX_CONTAINER_SIZE, type CngxContainerSize, createContainerSize } from './container-size';\n\n/**\n * Observes a query container and publishes its size to descendants through\n * {@link CNGX_CONTAINER_SIZE}.\n *\n * The directive declares nothing visual. **Both `container-type` and\n * `container-name` belong in the stylesheet**, next to the `@container` rules\n * that use them: the name is API (an unnamed query matches the nearest\n * container of any name, so a consumer wrapping the component in their own\n * container would silently re-target it), and containment is a layout\n * decision a skin must be able to opt out of with a plain CSS rule rather\n * than `!important` against a host style.\n *\n * ```css\n * cngx-thing-layout {\n * container-type: inline-size;\n * container-name: cngx-thing-layout;\n * }\n *\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 0; }\n *\n * @container cngx-thing-layout (min-inline-size: 64rem) {\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 1; }\n * }\n * ```\n *\n * ```html\n * <div cngxContainer>\n * <app-panel />\n * </div>\n * ```\n *\n * A descendant reads the resolved value with `injectContainerSize()`, so the\n * breakpoint exists exactly once - in CSS. Note that `container-type:\n * inline-size` applies size containment: an element that must shrink-wrap its\n * content (an inline chip, a `width: max-content` bar) must not be a\n * container.\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/container.directive.ts\n * @since 0.1.0\n * @relatedTo injectContainerSize, CngxResizeObserver, CngxMediaQuery\n * <example-url>http://localhost:4200/#/common/layout/container/css-decides-js-reads</example-url>\n */\n@Directive({\n selector: '[cngxContainer]',\n exportAs: 'cngxContainer',\n standalone: true,\n providers: [{ provide: CNGX_CONTAINER_SIZE, useExisting: CngxContainer }],\n})\nexport class CngxContainer implements CngxContainerSize {\n private readonly size = createContainerSize(\n inject(ElementRef).nativeElement as Element,\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize = this.size.inlineSize;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize = this.size.blockSize;\n /** `true` once the first observation has arrived. */\n readonly isReady = this.size.isReady;\n\n /**\n * The resolved value of a custom property on `on` (default: this host),\n * re-read on every resize. The `@container` rule must style a descendant,\n * or a pseudo-element of the container itself - see\n * {@link CngxContainerSize.property}.\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string> {\n return this.size.property(name, on, pseudo);\n }\n}\n","/**\n * Ref-count per document root. Module-private on purpose: this file is the\n * single owner of the lock state. A second copy of this map (the pre-extraction\n * state: one in `CngxScrollLock`, one in `CngxDialog`) shares the dataset keys\n * below without sharing the count, so interleaved acquire/release across the\n * two owners corrupts each other's saved overflow values.\n *\n * @internal\n */\nconst lockCounts = new WeakMap<HTMLElement, number>();\n\n/**\n * Acquire a ref-counted scroll lock on a document root and get back the\n * matching release function.\n *\n * The first active lock saves the current `overflow` / `scrollbar-gutter`\n * inline styles and sets `overflow: hidden` + `scrollbar-gutter: stable`\n * (no layout shift when the scrollbar disappears). Releasing the last active\n * lock restores the saved values. The returned release function is\n * idempotent - calling it twice cannot over-decrement the count.\n *\n * Shared engine behind `CngxScrollLock` and `CngxDialog`'s modal scroll lock;\n * consumers composing their own overlay primitives can use it directly.\n *\n * ```typescript\n * const release = createScrollLock(document.documentElement);\n * // ... overlay open ...\n * release();\n * ```\n *\n * @param html - The document root (`document.documentElement`) to lock.\n * @returns Release function for this acquisition. Idempotent.\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts\n * @since 0.1.0\n * @relatedTo CngxScrollLock, CngxDialog\n */\nexport function createScrollLock(html: HTMLElement): () => void {\n const count = lockCounts.get(html) ?? 0;\n if (count === 0) {\n html.dataset['cngxPrevOverflow'] = html.style.overflow;\n html.dataset['cngxPrevScrollbarGutter'] = html.style.scrollbarGutter;\n html.style.overflow = 'hidden';\n html.style.scrollbarGutter = 'stable';\n }\n lockCounts.set(html, count + 1);\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n const current = lockCounts.get(html) ?? 0;\n if (current <= 1) {\n html.style.overflow = html.dataset['cngxPrevOverflow'] ?? '';\n html.style.scrollbarGutter = html.dataset['cngxPrevScrollbarGutter'] ?? '';\n delete html.dataset['cngxPrevOverflow'];\n delete html.dataset['cngxPrevScrollbarGutter'];\n lockCounts.set(html, 0);\n } else {\n lockCounts.set(html, current - 1);\n }\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\nimport { createScrollLock } from './scroll-lock-core';\n\n/**\n * Prevents scrolling on the document body when enabled.\n *\n * Sets `overflow: hidden` and `scrollbar-gutter: stable` on `<html>` to\n * prevent layout shift when the scrollbar disappears. Restores original\n * values when all lock instances are released.\n *\n * Multiple instances are ref-counted - the original styles are only\n * restored when the last lock is released.\n *\n * ### With a drawer\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\" [cngxScrollLock]=\"drawer.opened()\">\n * …\n * </div>\n * ```\n *\n * ### With a modal\n * ```html\n * <div [cngxScrollLock]=\"isModalOpen()\">…</div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock.directive.ts\n * @since 0.1.0\n * @relatedTo CngxDrawer, CngxBackdrop\n * <example-url>http://localhost:4200/#/common/layout/scroll-lock/toggle</example-url>\n */\n@Directive({\n selector: '[cngxScrollLock]',\n exportAs: 'cngxScrollLock',\n standalone: true,\n})\nexport class CngxScrollLock {\n /** Whether scroll lock is active. */\n readonly enabled = input<boolean>(false, { alias: 'cngxScrollLock' });\n\n constructor() {\n const html = inject(DOCUMENT).documentElement;\n let release: (() => void) | null = null;\n\n effect(() => {\n if (this.enabled() && !release) {\n release = createScrollLock(html);\n } else if (!this.enabled() && release) {\n release();\n release = null;\n }\n });\n\n inject(DestroyRef).onDestroy(() => {\n release?.();\n });\n }\n}\n","import { computed, type DestroyRef, signal, type Signal } from '@angular/core';\n\nimport { observeResize, type ResizeObserverHost } from '../observers/resize-signal';\n\n/**\n * Structural window surface `createScrollEdges` reads: `window`, `globalThis`,\n * or a test double. Every member is optional so SSR and jsdom hosts pass the\n * type and fall back at runtime: no `ResizeObserver` means no resize\n * tracking, no `MutationObserver` means the child set is captured once, no\n * `requestAnimationFrame` means every trigger reads synchronously.\n *\n * @category common/layout\n * @since 0.1.0\n */\nexport interface ScrollEdgesHost extends ResizeObserverHost {\n MutationObserver?: typeof MutationObserver;\n requestAnimationFrame?: (callback: FrameRequestCallback) => number;\n cancelAnimationFrame?: (handle: number) => void;\n}\n\n/**\n * Per-edge scroll state of one scrollport. Each signal is `true` while content\n * is hidden toward that edge, i.e. while the user can still scroll toward it.\n *\n * @category common/layout\n * @since 0.1.0\n */\nexport interface CngxScrollEdgesState {\n /** Content is hidden above (toward the block-start edge). */\n readonly canScrollBlockStart: Signal<boolean>;\n /** Content is hidden below (toward the block-end edge). */\n readonly canScrollBlockEnd: Signal<boolean>;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL). */\n readonly canScrollInlineStart: Signal<boolean>;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL). */\n readonly canScrollInlineEnd: Signal<boolean>;\n}\n\ninterface ScrollEdgesSnapshot {\n readonly blockStart: boolean;\n readonly blockEnd: boolean;\n readonly inlineStart: boolean;\n readonly inlineEnd: boolean;\n}\n\n/** Distances up to this many px count as \"at the edge\" (sub-pixel and zoom rounding). */\nconst EDGE_TOLERANCE = 1;\n\nconst NO_EDGES: ScrollEdgesSnapshot = {\n blockStart: false,\n blockEnd: false,\n inlineStart: false,\n inlineEnd: false,\n};\n\nfunction sameEdges(a: ScrollEdgesSnapshot, b: ScrollEdgesSnapshot): boolean {\n return (\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd &&\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd\n );\n}\n\n/**\n * One read of the six scroll metrics. RTL `scrollLeft` runs over `[-max, 0]`\n * in every evergreen engine and LTR over `[0, max]`, so its magnitude is the\n * distance from the inline-start edge in both directions - no direction lookup\n * and no `getComputedStyle` in the scroll path.\n */\nfunction readEdges(element: HTMLElement): ScrollEdgesSnapshot {\n const inlineOffset = Math.abs(element.scrollLeft);\n return {\n blockStart: element.scrollTop > EDGE_TOLERANCE,\n blockEnd: element.scrollHeight - element.clientHeight - element.scrollTop > EDGE_TOLERANCE,\n inlineStart: inlineOffset > EDGE_TOLERANCE,\n inlineEnd: element.scrollWidth - element.clientWidth - inlineOffset > EDGE_TOLERANCE,\n };\n}\n\n/**\n * Tracks which edges of a scrollport still hide content, as four boolean\n * signals.\n *\n * Triggers are a passive `scroll` listener, one `observeResize` per observed\n * element (the scrollport itself plus every direct element child) and a\n * `childList`-only `MutationObserver` that keeps that child set current. All\n * of them only schedule work: the metrics are read once per animation frame\n * however many triggers fired, and the result lands in one snapshot signal\n * with a structural `equal`, so the four projections only notify when an edge\n * actually flips. A distance of 1px or less counts as \"at the edge\".\n *\n * Only direct children are resize-observed. A long item list should sit inside\n * one content element rather than be N direct children (one observer each);\n * growth deep inside a fixed-size child is picked up on the next scroll.\n *\n * A `null` host (SSR) wires nothing and all four signals stay `false`.\n *\n * ```typescript\n * const edges = createScrollEdges(\n * inject(ElementRef).nativeElement,\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const showTopShadow = edges.canScrollBlockStart;\n * ```\n *\n * @param element The scrollport to read.\n * @param destroyRef Scope whose destruction removes the listener, disconnects\n * every observer and cancels a pending frame.\n * @param host The window-like object to read the observer and frame APIs from.\n * @returns The four per-edge signals.\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges-core.ts\n * @since 0.1.0\n * @relatedTo CngxScrollEdges, observeResize\n */\nexport function createScrollEdges(\n element: HTMLElement,\n destroyRef: DestroyRef,\n host: ScrollEdgesHost | null | undefined,\n): CngxScrollEdgesState {\n const edges = signal<ScrollEdgesSnapshot>(NO_EDGES, { equal: sameEdges });\n const state: CngxScrollEdgesState = {\n canScrollBlockStart: computed(() => edges().blockStart),\n canScrollBlockEnd: computed(() => edges().blockEnd),\n canScrollInlineStart: computed(() => edges().inlineStart),\n canScrollInlineEnd: computed(() => edges().inlineEnd),\n };\n\n if (!host) {\n return state;\n }\n\n let destroyed = false;\n let framePending = false;\n let frameHandle = 0;\n\n const read = (): void => {\n framePending = false;\n if (destroyed) {\n return;\n }\n edges.set(readEdges(element));\n };\n\n const schedule = (): void => {\n if (destroyed || framePending) {\n return;\n }\n if (typeof host.requestAnimationFrame !== 'function') {\n read();\n return;\n }\n framePending = true;\n frameHandle = host.requestAnimationFrame(read);\n };\n\n const resizeTeardowns = new Map<Element, () => void>();\n const observe = (target: Element): void => {\n if (resizeTeardowns.has(target)) {\n return;\n }\n resizeTeardowns.set(\n target,\n observeResize(host, target, 'border-box', () => schedule()),\n );\n };\n const syncChildren = (): void => {\n const children = new Set<Element>(Array.from(element.children));\n for (const [target, teardown] of resizeTeardowns) {\n if (target !== element && !children.has(target)) {\n teardown();\n resizeTeardowns.delete(target);\n }\n }\n children.forEach(observe);\n };\n\n element.addEventListener('scroll', schedule, { passive: true });\n observe(element);\n syncChildren();\n\n let mutationObserver: MutationObserver | null = null;\n if (typeof host.MutationObserver === 'function') {\n mutationObserver = new host.MutationObserver(() => {\n syncChildren();\n schedule();\n });\n mutationObserver.observe(element, { childList: true });\n }\n\n schedule();\n\n destroyRef.onDestroy(() => {\n destroyed = true;\n element.removeEventListener('scroll', schedule);\n mutationObserver?.disconnect();\n resizeTeardowns.forEach((teardown) => teardown());\n resizeTeardowns.clear();\n if (framePending && typeof host.cancelAnimationFrame === 'function') {\n host.cancelAnimationFrame(frameHandle);\n }\n framePending = false;\n });\n\n return state;\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, PLATFORM_ID } from '@angular/core';\n\nimport { createScrollEdges } from './scroll-edges-core';\n\n/**\n * Reports which edges of a scrollport still hide content and reflects them as\n * host attributes, so an edge shadow or fade appears only while there really\n * is something to scroll to in that direction.\n *\n * Put it on the element that scrolls (`overflow: auto` / `scroll`). The four\n * signals and the four logical host attributes are derived from one read of\n * the scroll metrics per animation frame; the attributes are present (empty\n * value) while true and absent otherwise:\n *\n * - `data-scroll-block-start` / `canScrollBlockStart()` - content hidden above\n * - `data-scroll-block-end` / `canScrollBlockEnd()` - content hidden below\n * - `data-scroll-inline-start` / `canScrollInlineStart()` - hidden toward inline start\n * - `data-scroll-inline-end` / `canScrollInlineEnd()` - hidden toward inline end\n *\n * Inline start / end follow the writing direction: in `dir=\"rtl\"` the start\n * edge is on the right. The direction is derived from the scroll offset\n * itself, so a `dir=\"rtl\"` subtree inside an LTR page reports correctly.\n *\n * The directive paints nothing. The four attributes (present only while true)\n * are its public, stable contract; every visual belongs to the consumer CSS,\n * keyed on them. Three common cues:\n *\n * Shadow (Material 2 elevate-on-scroll):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { box-shadow: 0 2px 4px -2px rgb(0 0 0 / 0.3); }\n * ```\n *\n * Hairline that appears (iOS scroll-edge appearance; transparent border at rest):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { border-block-end-color: var(--cngx-color-border); }\n * ```\n *\n * Tonal surface change (Material 3 top app bar):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { background: var(--app-bar-scrolled-surface); }\n * ```\n *\n * Forced colors strips `box-shadow`, so a shadow-only cue disappears there;\n * prefer a border or pair the shadow with one under `forced-colors: active`.\n *\n * ```html\n * <div class=\"sheet\" cngxScrollEdges #edges=\"cngxScrollEdges\">...</div>\n * ```\n *\n * The edge state is purely visual and is not announced: the hidden content\n * stays in the DOM and in the reading order, and the scrollport remains\n * reachable by keyboard scrolling. Make the scrollport focusable (and named)\n * when it holds no focusable content of its own.\n *\n * Upgrade path: the attributes map 1:1 onto CSS\n * `@container scroll-state(scrollable: block-start)` and its siblings, so the\n * CSS can swap to native scroll-state queries once they are Baseline.\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStickyHeader, CngxScrollSpy, createScrollEdges\n * <example-url>http://localhost:4200/#/common/layout/scroll-edges/edge-shadows</example-url>\n */\n@Directive({\n selector: '[cngxScrollEdges]',\n exportAs: 'cngxScrollEdges',\n standalone: true,\n host: {\n '[attr.data-scroll-block-start]': \"canScrollBlockStart() ? '' : null\",\n '[attr.data-scroll-block-end]': \"canScrollBlockEnd() ? '' : null\",\n '[attr.data-scroll-inline-start]': \"canScrollInlineStart() ? '' : null\",\n '[attr.data-scroll-inline-end]': \"canScrollInlineEnd() ? '' : null\",\n },\n})\nexport class CngxScrollEdges {\n private readonly edges = createScrollEdges(\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n inject(DestroyRef),\n isPlatformBrowser(inject(PLATFORM_ID)) ? inject(DOCUMENT).defaultView : null,\n );\n\n /** Content is hidden toward the block-start edge (above). */\n readonly canScrollBlockStart = this.edges.canScrollBlockStart;\n /** Content is hidden toward the block-end edge (below). */\n readonly canScrollBlockEnd = this.edges.canScrollBlockEnd;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL). */\n readonly canScrollInlineStart = this.edges.canScrollInlineStart;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL). */\n readonly canScrollInlineEnd = this.edges.canScrollInlineEnd;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { computed, DestroyRef, Directive, inject, input, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Headless skeleton loading placeholder.\n *\n * Toggles between loading and content states via CSS classes and ARIA attributes.\n * No template -- the consumer renders the skeleton UI.\n *\n * Exposes an `indices()` signal for `@for` rendering of repeated skeleton elements.\n * Respects `prefers-reduced-motion` (disables shimmer animation class).\n *\n * ### Basic loading placeholder\n * ```html\n * <div [cngxSkeleton]=\"isLoading()\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-line\" aria-hidden=\"true\"></div>\n * }\n * } @else {\n * <p>{{ content() }}</p>\n * }\n * </div>\n * ```\n *\n * ### Card list with repeat count\n * ```html\n * <div [cngxSkeleton]=\"loading()\" [count]=\"3\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-card\" aria-hidden=\"true\">\n * <div class=\"skeleton-avatar\"></div>\n * <div class=\"skeleton-line\"></div>\n * </div>\n * }\n * } @else {\n * @for (card of cards(); track card.id) {\n * <app-card [data]=\"card\" />\n * }\n * }\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/skeleton.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableText, CngxHighlight\n * <example-url>http://localhost:4200/#/common/layout/skeleton/basic-skeleton</example-url>\n * <example-url>http://localhost:4200/#/common/layout/skeleton/skeleton-container</example-url>\n */\n@Directive({\n selector: '[cngxSkeleton]',\n standalone: true,\n exportAs: 'cngxSkeleton',\n host: {\n class: 'cngx-skeleton',\n '[class.cngx-skeleton--loading]': 'loading()',\n '[class.cngx-skeleton--shimmer]': 'showShimmer()',\n '[attr.aria-busy]': 'loading() || null',\n },\n})\nexport class CngxSkeleton {\n /** Controls the loading state. */\n readonly skeleton = input<boolean>(false, { alias: 'cngxSkeleton' });\n\n /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */\n readonly shimmer = input<boolean>(true);\n\n /** Repeat count - exposed via the `indices()` signal for `@for` rendering. */\n readonly count = input<number>(1);\n\n private readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n this.prefersReducedMotion = createMediaQuerySignal(\n '(prefers-reduced-motion: reduce)',\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n }\n\n /** Whether the skeleton is in loading state. Mirrors the `cngxSkeleton` input. */\n readonly loading = computed(() => this.skeleton());\n\n /** Array of indices for `@for` rendering of repeated skeleton elements. */\n readonly indices = computed(() => Array.from({ length: this.count() }, (_, i) => i));\n\n /** @internal - shimmer class condition. */\n protected readonly showShimmer = computed(\n () => this.loading() && this.shimmer() && !this.prefersReducedMotion(),\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { createTransitionTracker } from '@cngx/core/utils';\n\n/**\n * Infinite scroll trigger using `IntersectionObserver`.\n *\n * Place on a sentinel element at the bottom of a list. Fires `loadMore`\n * when the sentinel enters the viewport. Includes a debounce guard and\n * a `loading` input to prevent re-triggers during fetch.\n *\n * The observer is automatically recreated when `root`, `rootMargin`, or\n * `threshold` inputs change, and disconnected on destroy or when `enabled`\n * is set to `false`. When `loading` settles back to `false` the sentinel is\n * re-observed, so a fetched page that did not push the sentinel out of view\n * still re-fires `loadMore` instead of stalling the list.\n *\n * ### Basic infinite list\n * ```html\n * <div class=\"item-list\">\n * @for (item of items(); track item.id) {\n * <app-item [data]=\"item\" />\n * }\n * <div cngxInfiniteScroll [loading]=\"isFetching()\" (loadMore)=\"fetchNext()\">\n * @if (scroll.isLoading()) { <mat-spinner diameter=\"24\" /> }\n * </div>\n * </div>\n * ```\n *\n * ### Disable when all loaded\n * ```html\n * <div cngxInfiniteScroll\n * [enabled]=\"hasNextPage()\"\n * [loading]=\"isFetching()\"\n * (loadMore)=\"fetchNext()\">\n * @if (!hasNextPage()) { <p>All items loaded</p> }\n * </div>\n * ```\n *\n * ### Custom scroll container with pre-fetch margin\n * ```html\n * <div cngxInfiniteScroll\n * [root]=\"'.scroll-container'\"\n * [rootMargin]=\"'0px 0px 400px 0px'\"\n * [loading]=\"loading()\"\n * (loadMore)=\"loadMore()\">\n * </div>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/infinite-scroll.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxScrollSpy, CngxStickyHeader\n * <example-url>http://localhost:4200/#/common/layout/infinite-scroll/scrollable-list</example-url>\n */\n@Directive({\n selector: '[cngxInfiniteScroll]',\n standalone: true,\n exportAs: 'cngxInfiniteScroll',\n host: {\n class: 'cngx-infinite-scroll',\n '[class.cngx-infinite-scroll--loading]': 'isLoading()',\n '[attr.aria-busy]': 'isLoading() || null',\n },\n})\nexport class CngxInfiniteScroll {\n /** IntersectionObserver threshold (0–1). */\n readonly threshold = input<number>(0);\n\n /** Pre-fetch margin. `'0px 0px 200px 0px'` triggers 200px before the sentinel is visible. */\n readonly rootMargin = input<string>('0px 0px 200px 0px');\n\n /** CSS selector for a custom scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n\n /** When `false`, the observer disconnects entirely. Use to stop loading when all items are fetched. */\n readonly enabled = input<boolean>(true);\n\n /** Set to `true` while fetching. Prevents re-trigger until the fetch completes. */\n readonly loading = input<boolean>(false);\n\n /** Minimum ms between consecutive `loadMore` emissions. */\n readonly debounceMs = input<number>(200);\n\n /** Emitted when the sentinel is visible, not loading, and debounce has elapsed. */\n readonly loadMore = output<void>();\n\n /** Readonly mirror of the `loading` input. */\n readonly isLoading: Signal<boolean> = computed(() => this.loading());\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n private lastEmitTime = 0;\n private observer: IntersectionObserver | null = null;\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const enabled = this.enabled();\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const debounceMs = this.debounceMs();\n\n if (!enabled) {\n return;\n }\n\n const isLoading = () => this.loading();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (isDevMode() && root && !resolvedRoot) {\n console.warn(\n `[cngxInfiniteScroll] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n if (!entry.isIntersecting) {\n return;\n }\n if (isLoading()) {\n return;\n }\n\n const now = Date.now();\n if (now - this.lastEmitTime < debounceMs) {\n return;\n }\n\n this.lastEmitTime = now;\n this.loadMore.emit();\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n this.observer = observer;\n\n onCleanup(() => {\n observer.disconnect();\n this.observer = null;\n });\n });\n\n const loadingTransition = createTransitionTracker(() => this.loading());\n effect(() => {\n const loading = loadingTransition.current();\n const wasLoading = loadingTransition.previous();\n if (!wasLoading || loading) {\n return;\n }\n // IO reports intersection CHANGES only: when a fetched page does not\n // push the sentinel out of view there is no new entry after loading\n // settles, and the list stalls. Re-observing forces a fresh entry;\n // the debounce window is reset so that entry may emit immediately.\n untracked(() => {\n const sentinel = this.el.nativeElement as HTMLElement;\n this.lastEmitTime = 0;\n this.observer?.unobserve(sentinel);\n this.observer?.observe(sentinel);\n });\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Communicates when a sticky-positioned element becomes stuck.\n *\n * Applies `position: sticky; top: 0` on the host automatically.\n * The directive adds a sentinel element before the host and uses\n * `IntersectionObserver` to detect when the sentinel scrolls out,\n * meaning the header is now stuck. Toggles a CSS class for shadow,\n * elevation, or background changes.\n *\n * The sentinel is observed against the **nearest scroll-container ancestor**\n * (the first ancestor whose computed `overflow-y` is not `visible`), not the\n * page - that is the scrollport `position: sticky` resolves against, so\n * `isSticky()` reports the state the host actually has. A scrollport whose\n * height is content-driven never scrolls in the block axis, so a header inside\n * it never pins; in dev mode the directive warns once when it resolves against\n * such a scrollport. The observer is recreated when `threshold` changes,\n * matching the sibling observer directives.\n *\n * ### Sticky header with shadow\n * ```html\n * <header cngxStickyHeader #sh=\"cngxStickyHeader\"\n * style=\"position: sticky; top: 0;\">\n * Page header\n * </header>\n * ```\n *\n * ```css\n * .cngx-sticky--active { box-shadow: 0 2px 4px rgba(0,0,0,.1); }\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/sticky-header.directive.ts\n * @since 0.1.0\n * @relatedTo CngxScrollSpy, CngxIntersectionObserver\n * <example-url>http://localhost:4200/#/common/layout/sticky-header/sticky-header-with-shadow</example-url>\n */\n@Directive({\n selector: '[cngxStickyHeader]',\n exportAs: 'cngxStickyHeader',\n standalone: true,\n host: {\n style: 'position: sticky; top: 0; z-index: var(--cngx-sticky-z-index, 1)',\n '[class.cngx-sticky--active]': 'isSticky()',\n },\n})\nexport class CngxStickyHeader {\n /** Intersection threshold - `0` triggers as soon as the sentinel leaves. */\n readonly threshold = input<number>(0);\n\n /** Emitted when the sticky state changes. */\n readonly stickyChange = output<boolean>();\n\n private readonly isStickyState = signal(false);\n /** Whether the header is currently in its stuck position. */\n readonly isSticky = this.isStickyState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /** Sentinel + scrollport resolved once after render; the observer effect keys on it. */\n private readonly observeSetup = signal<{\n sentinel: HTMLElement;\n scrollport: HTMLElement | null;\n } | null>(null);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // IntersectionObserver sentinel pattern - host is stuck once the 1px sentinel leaves\n // the scrollport the host actually sticks to.\n afterNextRender(() => {\n const host = this.el.nativeElement as HTMLElement;\n // Root the sentinel at the scrollport `position: sticky` resolves against, not the\n // viewport. Observing against the viewport reports a different thing entirely: a\n // header inside a never-scrolling scrollport would read `isSticky() === true` while\n // it visibly scrolls away with its content.\n const scrollport = this.resolveScrollParent(host);\n\n // A scrollport whose content fits never scrolls in the block axis, so a header\n // inside it can never pin - `isSticky()` stays false while the whole scrollport\n // moves. Flag the misconfiguration once, in dev only; a one-shot read here is\n // exactly what `afterNextRender` is for (no reactive-graph node, unlike a\n // dep-less effect). The 1px tolerance absorbs sub-pixel layout and browser-zoom\n // rounding: \"cannot meaningfully scroll\" instead of exact equality.\n if (\n isDevMode() &&\n scrollport &&\n scrollport.scrollHeight - scrollport.clientHeight <= 1\n ) {\n console.warn(\n '[cngxStickyHeader] resolves against a scroll container that cannot scroll ' +\n 'in the block axis (client height equals scroll height), so this header ' +\n 'will never pin. Give the scrollport a bounded block-size, or drop ' +\n 'cngxStickyHeader.',\n { host, scrollport },\n );\n }\n\n const sentinel = this.doc.createElement('div');\n sentinel.style.height = '1px';\n sentinel.style.width = '1px';\n sentinel.style.marginBottom = '-1px';\n sentinel.style.visibility = 'hidden';\n sentinel.style.pointerEvents = 'none';\n sentinel.setAttribute('aria-hidden', 'true');\n host.parentElement?.insertBefore(sentinel, host);\n\n this.observeSetup.set({ sentinel, scrollport });\n destroyRef.onDestroy(() => sentinel.remove());\n });\n\n // Observer creation lives in an effect so a later threshold change\n // recreates it - the one-shot afterNextRender above only resolves DOM.\n effect((onCleanup) => {\n const setup = this.observeSetup();\n const threshold = this.threshold();\n if (!setup) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const isSticky = !entries[entries.length - 1].isIntersecting;\n if (isSticky !== this.isStickyState()) {\n this.isStickyState.set(isSticky);\n this.stickyChange.emit(isSticky);\n }\n },\n { threshold, root: setup.scrollport },\n );\n\n observer.observe(setup.sentinel);\n\n onCleanup(() => observer.disconnect());\n });\n }\n\n /**\n * The nearest ancestor that is a scroll container in the block axis - the scrollport\n * `position: sticky` resolves against. Walks up from the host's parent to the first\n * ancestor whose computed `overflow-y` is not `visible`; `null` means no such\n * ancestor, i.e. the header sticks to the viewport. A used `overflow-x` other than\n * `visible` coerces the computed `overflow-y` to `auto`, so this also catches a\n * horizontal scroll container (e.g. a data grid that scrolls sideways).\n */\n private resolveScrollParent(host: HTMLElement): HTMLElement | null {\n const view = this.doc.defaultView;\n for (let node = host.parentElement; node; node = node.parentElement) {\n const overflowY = view?.getComputedStyle(node).overflowY;\n if (overflowY && overflowY !== 'visible') {\n return node;\n }\n }\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n Directive,\n effect,\n inject,\n input,\n isDevMode,\n output,\n signal,\n} from '@angular/core';\n\n/**\n * Tracks which section is currently most visible in the viewport.\n *\n * Observes a list of elements by their IDs using `IntersectionObserver`\n * and reports the one with the highest intersection ratio as the active section.\n * Ideal for scroll-based navigation highlighting and reading progress.\n *\n * Section IDs are resolved when the inputs change - sections rendered later\n * (`@if`/`@defer`) are not picked up automatically; re-bind `[cngxScrollSpy]`\n * once they exist. In dev mode the directive warns about IDs it cannot find.\n *\n * ### Navigation highlighting\n * ```html\n * <nav [cngxScrollSpy]=\"['intro', 'features', 'pricing']\"\n * #spy=\"cngxScrollSpy\">\n * <a [class.active]=\"spy.activeId() === 'intro'\" href=\"#intro\">Intro</a>\n * <a [class.active]=\"spy.activeId() === 'features'\" href=\"#features\">Features</a>\n * <a [class.active]=\"spy.activeId() === 'pricing'\" href=\"#pricing\">Pricing</a>\n * </nav>\n *\n * <section id=\"intro\">…</section>\n * <section id=\"features\">…</section>\n * <section id=\"pricing\">…</section>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-spy.directive.ts\n * @since 0.1.0\n * @relatedTo CngxIntersectionObserver, CngxStickyHeader, CngxInfiniteScroll\n * <example-url>http://localhost:4200/#/common/layout/scroll-spy/scroll-based-navigation</example-url>\n */\n@Directive({\n selector: '[cngxScrollSpy]',\n exportAs: 'cngxScrollSpy',\n standalone: true,\n})\nexport class CngxScrollSpy {\n /** IDs of the sections to observe. */\n readonly sections = input.required<string[]>({ alias: 'cngxScrollSpy' });\n /** Minimum visibility ratio to consider a section as a candidate. */\n readonly threshold = input<number>(0.3);\n /** CSS selector for the scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n /** Root margin for the observer. */\n readonly rootMargin = input<string>('0px');\n\n /** Emitted when the active section changes. */\n readonly activeIdChange = output<string | null>();\n\n private readonly activeIdState = signal<string | null>(null);\n /** ID of the section with the highest intersection ratio. */\n readonly activeId = this.activeIdState.asReadonly();\n\n private readonly doc = inject(DOCUMENT);\n /** Last observed intersection ratio keyed by section ID. */\n private readonly ratios = new Map<string, number>();\n private readonly initialized = signal(false);\n private activeCleanup: (() => void) | undefined;\n\n constructor() {\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // Recreate the observer whenever inputs change (deferred until DOM is ready).\n effect((onCleanup) => {\n this.sections();\n this.threshold();\n this.root();\n this.rootMargin();\n\n if (!this.initialized()) {\n return;\n }\n\n this.activeCleanup?.();\n this.activeCleanup = this.setupObserver();\n\n onCleanup(() => {\n this.activeCleanup?.();\n this.activeCleanup = undefined;\n });\n });\n }\n\n /** Builds an `IntersectionObserver` for the current section IDs. Returns a disconnect callback. */\n private setupObserver(): (() => void) | undefined {\n const ids = this.sections();\n const thresholdValue = this.threshold();\n const rootSelector = this.root();\n const rootMarginValue = this.rootMargin();\n\n this.ratios.clear();\n\n const elements = ids\n .map((id) => this.doc.getElementById(id))\n .filter((el): el is HTMLElement => el !== null);\n\n if (isDevMode() && elements.length < ids.length) {\n const missing = ids.filter((id) => !this.doc.getElementById(id));\n console.warn(\n `[cngxScrollSpy] section id(s) not found: ${missing.join(', ')}. ` +\n 'Late-rendered sections are not observed - re-bind [cngxScrollSpy] once they exist.',\n );\n }\n\n if (elements.length === 0) {\n return undefined;\n }\n\n const resolvedRoot = rootSelector ? this.doc.querySelector(rootSelector) : null;\n if (isDevMode() && rootSelector && !resolvedRoot) {\n console.warn(\n `[cngxScrollSpy] root selector \"${rootSelector}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => this.ratios.set(entry.target.id, entry.intersectionRatio));\n\n const best = Array.from(this.ratios).reduce<{ id: string | null; ratio: number }>(\n (acc, [id, ratio]) =>\n ratio >= thresholdValue && ratio > acc.ratio ? { id, ratio } : acc,\n { id: null, ratio: 0 },\n );\n\n if (best.id !== this.activeIdState()) {\n this.activeIdState.set(best.id);\n this.activeIdChange.emit(best.id);\n }\n },\n {\n root: resolvedRoot,\n rootMargin: rootMarginValue,\n threshold: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],\n },\n );\n\n elements.forEach((el) => observer.observe(el));\n\n return () => observer.disconnect();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from '../observers/resize-signal';\n\n/**\n * Manages text truncation with expand/collapse state detection.\n *\n * Applies `-webkit-line-clamp` when collapsed and detects whether the text\n * is actually clamped (content overflows). Exposes `isClamped` so the consumer\n * can conditionally show a \"Show more\" toggle only when needed.\n *\n * The `expanded` state supports two-way binding (controlled + uncontrolled).\n *\n * ### Basic truncation with toggle\n * ```html\n * <p [cngxTruncate]=\"3\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n * Long text content that may or may not overflow…\n * </p>\n * @if (trunc.isClamped() || trunc.expanded()) {\n * <button (click)=\"expanded.set(!expanded())\"\n * [attr.aria-expanded]=\"expanded()\">\n * {{ expanded() ? 'Show less' : 'Show more' }}\n * </button> * }\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/truncate.directive.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText, CngxExpandableToggle, CngxHighlight\n * <example-url>http://localhost:4200/#/common/layout/truncate/short-text-no-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/layout/truncate/truncated-text-with-toggle</example-url>\n */\n@Directive({\n selector: '[cngxTruncate]',\n exportAs: 'cngxTruncate',\n standalone: true,\n host: {\n '[style.-webkit-line-clamp]': 'clampValue()',\n '[style.display]': 'displayValue()',\n '[style.-webkit-box-orient]': 'orientValue()',\n '[style.overflow]': 'overflowValue()',\n },\n})\nexport class CngxTruncate {\n /** Maximum number of visible lines when collapsed. */\n readonly lines = input<number>(3, { alias: 'cngxTruncate' });\n /** Whether the text is expanded (full content visible). Supports two-way binding. */\n readonly expanded = model<boolean>(false);\n\n private readonly isClampedState = signal(false);\n /** Whether the text content actually exceeds the line limit and is being clamped. */\n readonly isClamped = this.isClampedState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private stopResize: (() => void) | null = null;\n private rafHandle: number | null = null;\n\n // null strips the host binding - preferred over an empty string for -webkit-line-clamp.\n /** @internal */\n protected readonly clampValue = computed(() => (this.expanded() ? null : String(this.lines())));\n /** @internal */\n protected readonly displayValue = computed(() => (this.expanded() ? null : '-webkit-box'));\n /** @internal */\n protected readonly orientValue = computed(() => (this.expanded() ? null : 'vertical'));\n /** @internal */\n protected readonly overflowValue = computed(() => (this.expanded() ? null : 'hidden'));\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // SSR guard: no window, no measuring - the style bindings above still render.\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return;\n }\n\n afterNextRender(() => {\n this.checkClamped();\n this.stopResize = observeResize(\n win,\n this.el.nativeElement as HTMLElement,\n 'content-box',\n () => this.checkClamped(),\n );\n });\n\n // Re-check after expanded/lines change; RAF ensures styles are applied first.\n effect(() => {\n this.expanded(); // track\n this.lines(); // track\n this.cancelRaf();\n this.rafHandle = requestAnimationFrame(() => this.checkClamped());\n });\n\n destroyRef.onDestroy(() => {\n this.stopResize?.();\n this.cancelRaf();\n });\n }\n\n private cancelRaf(): void {\n if (this.rafHandle !== null) {\n cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n }\n\n /**\n * Compares `scrollHeight` vs `clientHeight` to detect overflow.\n * Only meaningful when collapsed - when expanded, the last known\n * clamped state is preserved (can't measure hypothetical clamp height\n * while showing full content).\n */\n private checkClamped(): void {\n const el = this.el.nativeElement as HTMLElement;\n if (this.expanded()) {\n return;\n }\n this.isClampedState.set(el.scrollHeight > el.clientHeight);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Search-text highlighting via `<mark>` elements.\n *\n * Walks `TEXT_NODE` children of the host element, splits at match boundaries,\n * and wraps matched portions in `<mark>` elements. No `innerHTML` - safe by\n * construction. The `<mark>` element has correct native SR semantics (announced\n * as \"highlighted\" in most screen readers).\n *\n * The original text nodes are kept by reference and re-inserted when the\n * term changes or the directive is destroyed - Angular bindings targeting\n * them (interpolations, structural directives) stay live.\n *\n * ### Search result highlighting\n * ```html\n * <p [cngxHighlight]=\"searchTerm()\">\n * Angular Signals represent a fundamental shift in reactivity.\n * </p>\n * ```\n *\n * ### Case-sensitive matching\n * ```html\n * <p [cngxHighlight]=\"term()\" [highlightCaseSensitive]=\"true\">\n * CamelCase matters here.\n * </p>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/highlight.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableText\n * <example-url>http://localhost:4200/#/common/layout/highlight/live-search-highlighting</example-url>\n * <example-url>http://localhost:4200/#/common/layout/highlight/multiple-paragraphs</example-url>\n */\n@Directive({\n selector: '[cngxHighlight]',\n exportAs: 'cngxHighlight',\n standalone: true,\n})\nexport class CngxHighlight {\n /** The search term to highlight. Empty string clears all highlights. */\n readonly term = input<string>('', { alias: 'cngxHighlight' });\n /** Whether matching is case-sensitive. */\n readonly caseSensitive = input<boolean>(false, { alias: 'highlightCaseSensitive' });\n\n private readonly matchCountState = signal(0);\n /** Number of matches found in the current highlight pass. */\n readonly matchCount = this.matchCountState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /**\n * The text nodes replaced by the current highlight pass, by reference,\n * with the nodes standing in for them. Undone before every re-highlight\n * and on destroy - re-inserting the original references keeps LView\n * bindings (interpolations) attached to live DOM.\n */\n private replacements: { original: Text; inserted: Node[] }[] = [];\n private readonly initialized = signal(false);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.restoreNodes());\n\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // The highlight pass writes matchCountState - untracked, so the write\n // cannot re-trigger this effect.\n effect(() => {\n const term = this.term();\n const caseSensitive = this.caseSensitive();\n if (this.initialized()) {\n untracked(() => this.applyHighlight(term, caseSensitive));\n }\n });\n }\n\n /**\n * Performs the highlight pass: restores original DOM, then wraps matches\n * in `<mark>` elements. Updates `matchCountState` with the result count.\n */\n private applyHighlight(term: string, caseSensitive: boolean): void {\n const host = this.el.nativeElement as HTMLElement;\n\n this.restoreNodes();\n\n if (!term) {\n this.matchCountState.set(0);\n return;\n }\n\n let count = 0;\n const walker = this.doc.createTreeWalker(host, NodeFilter.SHOW_TEXT);\n const textNodes: Text[] = [];\n\n // Collect nodes before modifying the DOM during the walk.\n let node: Text | null;\n while ((node = walker.nextNode() as Text | null)) {\n textNodes.push(node);\n }\n\n for (const textNode of textNodes) {\n const text = textNode.textContent ?? '';\n const flags = caseSensitive ? 'g' : 'gi';\n const regex = new RegExp(this.escapeRegex(term), flags);\n const matches = [...text.matchAll(regex)];\n\n if (matches.length === 0) {\n continue;\n }\n\n count += matches.length;\n const fragment = this.doc.createDocumentFragment();\n let lastIndex = 0;\n\n for (const match of matches) {\n const matchStart = match.index;\n const matchEnd = matchStart + match[0].length;\n\n if (matchStart > lastIndex) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex, matchStart)));\n }\n\n const mark = this.doc.createElement('mark');\n mark.textContent = text.slice(matchStart, matchEnd);\n fragment.appendChild(mark);\n\n lastIndex = matchEnd;\n }\n\n if (lastIndex < text.length) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex)));\n }\n\n // Capture before replaceChild - inserting a fragment empties it.\n const inserted = Array.from(fragment.childNodes);\n textNode.parentNode!.replaceChild(fragment, textNode);\n this.replacements.push({ original: textNode, inserted });\n }\n\n this.matchCountState.set(count);\n }\n\n /** Puts the original text nodes back and removes the highlight nodes. */\n private restoreNodes(): void {\n for (const { original, inserted } of this.replacements) {\n const parent = inserted[0]?.parentNode;\n if (!parent) {\n continue;\n }\n parent.insertBefore(original, inserted[0]);\n for (const node of inserted) {\n if (node.parentNode === parent) {\n parent.removeChild(node);\n }\n }\n }\n this.replacements = [];\n }\n\n /** Escapes special regex characters in the search term. */\n private escapeRegex(str: string): string {\n return str.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n }\n}\n","// Pulls the augmented module into the program; ng-packagr rejects `declare module` (TS2664) otherwise.\nimport type {} from '@cngx/core/i18n';\n\n/**\n * The layout section of a {@link CngxLanguagePack}: the copy of the\n * `@cngx/common/layout` atoms. It feeds `CNGX_LAYOUT_I18N`.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport interface CngxLayoutLanguageSection {\n /** Label of the `CngxExpandableText` expand control. */\n readonly expandableTextMore: string;\n /** Label of the `CngxExpandableText` collapse control. */\n readonly expandableTextLess: string;\n}\n\n/**\n * The English layout section: the single source of the layout atoms'\n * English copy. `CNGX_LAYOUT_I18N` defaults to it.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport const CNGX_LAYOUT_LANGUAGE_EN: CngxLayoutLanguageSection = {\n expandableTextMore: 'Show more',\n expandableTextLess: 'Show less',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly layout: CngxLayoutLanguageSection;\n }\n}\n","import { inject, InjectionToken, type Provider, type Signal } from '@angular/core';\nimport { createLanguageSection } from '@cngx/core/i18n';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport { CNGX_LAYOUT_LANGUAGE_EN, type CngxLayoutLanguageSection } from './layout-language-section';\n\n/**\n * Layout i18n surface. Library defaults are English; consumers override via\n * {@link provideLayoutI18n}. Reactive from birth: the token carries a\n * `Signal`, and {@link withLayoutI18nLabels} accepts a `Signal` of a partial\n * bundle.\n *\n * Both keys are the fallback of the `CngxExpandableText` `moreLabel` /\n * `lessLabel` inputs, resolved in a `computed()`: a bound input wins, and an\n * unbound one follows a language switch. The same shape as the layout\n * section of a language pack, declared once as\n * {@link CngxLayoutLanguageSection}.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport type CngxLayoutI18n = CngxLayoutLanguageSection;\n\n/** @internal The English section with the active pack's layout section on top. */\nconst layoutBundleFromPack = createLanguageSection('layout', CNGX_LAYOUT_LANGUAGE_EN);\n\n/**\n * DI token for the layout i18n bundle. `providedIn: 'root'`: the layout\n * section of the active language pack over the English defaults; the value\n * is a `Signal`, shared by every reader under one injector.\n *\n * @category common/layout/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/i18n/layout-i18n.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText\n */\nexport const CNGX_LAYOUT_I18N = new InjectionToken<Signal<CngxLayoutI18n>>('CngxLayoutI18n', {\n providedIn: 'root',\n factory: layoutBundleFromPack,\n});\n\n/**\n * Branded feature-fn for {@link provideLayoutI18n}.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport type CngxLayoutI18nFeature = ((bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>) & {\n readonly _target: 'i18n';\n};\n\n/** @internal */\nfunction defineLayoutI18nFeature(\n fn: (bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>,\n): CngxLayoutI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override layout labels via a partial bundle - unset keys keep the\n * language pack's copy, or the English default. Pass a `Signal` of a partial\n * bundle to switch languages at runtime.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function withLayoutI18nLabels(\n overrides: Partial<CngxLayoutI18n> | Signal<Partial<CngxLayoutI18n>>,\n): CngxLayoutI18nFeature {\n return defineLayoutI18nFeature((bundle) => createOverrideMerge(bundle, overrides));\n}\n\n/**\n * Provider for the layout i18n bundle. Returns a plain `Provider`, so it\n * also scopes a subtree through `viewProviders`. The features apply on top\n * of the active language pack.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideLayoutI18n(\n * withLayoutI18nLabels({ expandableTextMore: 'Mehr anzeigen', expandableTextLess: 'Weniger anzeigen' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function provideLayoutI18n(...features: readonly CngxLayoutI18nFeature[]): Provider {\n return {\n provide: CNGX_LAYOUT_I18N,\n useFactory: () =>\n features.reduce<Signal<CngxLayoutI18n>>(\n (bundle, feat) => feat(bundle),\n layoutBundleFromPack(),\n ),\n };\n}\n\n/**\n * Inject the resolved layout i18n bundle signal. Read it inside a\n * `computed()` or template so a runtime override flip re-derives.\n *\n * @category common/layout/i18n\n * @since 0.1.0\n */\nexport function injectLayoutI18n(): Signal<CngxLayoutI18n> {\n return inject(CNGX_LAYOUT_I18N);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n inject,\n input,\n model,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport { CngxTruncate } from './truncate.directive';\n\n/**\n * Template context for the custom toggle template.\n *\n * @category common/layout\n */\nexport interface CngxExpandableToggleContext {\n /** Whether the text is currently expanded. */\n $implicit: boolean;\n /** Whether the text is currently expanded. */\n expanded: boolean;\n /** Call to toggle the expanded state. */\n toggle: () => void;\n}\n\n/**\n * Marks a custom toggle template inside `cngx-expandable-text`.\n *\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\" class=\"icon-btn\">\n * <mat-icon>{{ expanded ? 'expand_less' : 'expand_more' }}</mat-icon>\n * </button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @category common/layout\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.1.0\n * @relatedTo CngxExpandableText, CngxTruncate\n */\n@Directive({\n selector: 'ng-template[cngxExpandableToggle]',\n standalone: true,\n})\nexport class CngxExpandableToggle {\n readonly templateRef = inject<TemplateRef<CngxExpandableToggleContext>>(TemplateRef);\n}\n\n/**\n * Molecule wrapping `CngxTruncate` with a built-in expand/collapse toggle.\n *\n * Projects content into a truncated container and conditionally renders\n * a \"Show more\" / \"Show less\" button when the content is actually clamped.\n * Handles `aria-expanded` automatically.\n *\n * Supports custom toggle templates via `ng-template[cngxExpandableToggle]` -\n * use for icon buttons or any custom UI instead of plain text labels.\n *\n * ### Basic usage\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text that may or may not overflow the container…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom labels\n * ```html\n * <cngx-expandable-text [lines]=\"2\" moreLabel=\"Mehr\" lessLabel=\"Weniger\">\n * Langer Text…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom toggle template\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\">{{ expanded ? 'Collapse' : 'Expand' }}</button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @category common/layout\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.1.0\n * @relatedTo CngxTruncate, CngxExpandableToggle, CngxHighlight\n * @slot cngxExpandableToggle Replaces the show-more control; gets the current expanded state.\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/auto-toggle</example-url>\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/custom-labels</example-url>\n * <example-url>http://localhost:4200/#/common/layout/expandable-text/custom-toggle-template</example-url>\n */\n@Component({\n selector: 'cngx-expandable-text',\n exportAs: 'cngxExpandableText',\n standalone: true,\n imports: [CngxTruncate, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n style: 'display:block',\n },\n template: `\n <div [cngxTruncate]=\"lines()\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n <ng-content />\n </div>\n @if (trunc.isClamped() || expanded()) {\n @if (customToggle(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"toggleContext()\"\n />\n } @else {\n <button\n type=\"button\"\n class=\"cngx-expandable-text__toggle\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? resolvedLessLabel() : resolvedMoreLabel() }}\n </button>\n }\n }\n `,\n})\nexport class CngxExpandableText {\n private readonly i18n = injectLayoutI18n();\n\n /** Maximum visible lines when collapsed. */\n readonly lines = input<number>(3);\n /** Whether the text is expanded. Supports two-way `[(expanded)]` binding. */\n readonly expanded = model<boolean>(false);\n /**\n * Label for the \"show more\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextMore`.\n */\n readonly moreLabel = input<string | undefined>(undefined);\n /**\n * Label for the \"show less\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextLess`.\n */\n readonly lessLabel = input<string | undefined>(undefined);\n protected readonly resolvedMoreLabel = computed(\n () => this.moreLabel() ?? this.i18n().expandableTextMore,\n );\n protected readonly resolvedLessLabel = computed(\n () => this.lessLabel() ?? this.i18n().expandableTextLess,\n );\n\n /** Optional custom toggle template projected by the consumer. */\n protected readonly customToggle = contentChild(CngxExpandableToggle);\n\n /** Stable toggle closure - a fresh closure per context would defeat the equal fn below. */\n private readonly toggleFn = (): void => this.expanded.set(!this.expanded());\n\n /**\n * Template context for the custom toggle. Structural `equal` fn so\n * `ngTemplateOutletContext` does not rebind the embedded view on every\n * CD cycle (same rule as the CngxTag slot contexts).\n */\n protected readonly toggleContext = computed<CngxExpandableToggleContext>(\n () => ({\n $implicit: this.expanded(),\n expanded: this.expanded(),\n toggle: this.toggleFn,\n }),\n { equal: (a, b) => a.expanded === b.expanded },\n );\n}\n","/**\n * @module @cngx/common/layout\n */\nexport { CngxBackdrop } from './drawer/backdrop.directive';\nexport { CngxDrawer, type DrawerPosition } from './drawer/drawer.directive';\nexport { CngxDrawerPanel, type DrawerMode } from './drawer/drawer-panel.directive';\nexport { CngxDrawerContent } from './drawer/drawer-content.directive';\nexport { CngxIntersectionObserver } from './observers/intersection-observer.directive';\nexport { CngxMediaQuery } from './observers/media-query.directive';\nexport { injectMediaQuery } from './observers/inject-media-query';\nexport { injectQueryParamSync, type QueryParamSyncOptions } from './router/inject-query-param-sync';\nexport { CngxResizeObserver } from './observers/resize-observer.directive';\nexport {\n createResizeSignal,\n observeResize,\n type ResizeObserverHost,\n} from './observers/resize-signal';\nexport { CngxContainer } from './observers/container.directive';\nexport {\n CNGX_CONTAINER_SIZE,\n type CngxContainerSize,\n createContainerSize,\n injectContainerSize,\n} from './observers/container-size';\nexport { CngxScrollLock } from './scroll/scroll-lock.directive';\nexport { createScrollLock } from './scroll/scroll-lock-core';\nexport { CngxScrollEdges } from './scroll/scroll-edges.directive';\nexport {\n createScrollEdges,\n type CngxScrollEdgesState,\n type ScrollEdgesHost,\n} from './scroll/scroll-edges-core';\nexport { CngxSkeleton } from './text/skeleton.directive';\nexport { CngxInfiniteScroll } from './scroll/infinite-scroll.directive';\nexport { CngxStickyHeader } from './scroll/sticky-header.directive';\nexport { CngxScrollSpy } from './scroll/scroll-spy.directive';\nexport { CngxTruncate } from './text/truncate.directive';\nexport { CngxHighlight } from './text/highlight.directive';\nexport {\n CngxExpandableText,\n CngxExpandableToggle,\n type CngxExpandableToggleContext,\n} from './text/expandable-text';\nexport {\n CNGX_LAYOUT_I18N,\n injectLayoutI18n,\n provideLayoutI18n,\n withLayoutI18nLabels,\n type CngxLayoutI18n,\n type CngxLayoutI18nFeature,\n} from './i18n/layout-i18n';\nexport {\n CNGX_LAYOUT_LANGUAGE_EN,\n type CngxLayoutLanguageSection,\n} from './i18n/layout-language-section';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["DestroyRefToken"],"mappings":";;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEG;MAWU,YAAY,CAAA;;IAEd,OAAO,GAAG,KAAK,CAAU,KAAK,+EAAI,KAAK,EAAE,cAAc,EAAA,CAAG;;AAE1D,IAAA,YAAY,GAAG,KAAK,CAAU,IAAI,mFAAC;;IAEnC,aAAa,GAAG,MAAM,EAAQ;AAEtB,IAAA,EAAE,GAAG,MAAM,EAAC,UAAuB,EAAC;AACpC,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;AAEzC,IAAA,WAAA,GAAA;AACE,QAAA,eAAe,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAE9C,QAAA,MAAM,CAAC,CAAC,SAAS,KAAI;AACnB,YAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,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A,EAAA,CAAA;;ACjKrE;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-common-layout.mjs","sources":["../../../projects/common/layout/drawer/inert-siblings.ts","../../../projects/common/layout/drawer/backdrop.directive.ts","../../../projects/common/layout/panel-trigger/panel-target.ts","../../../projects/common/layout/drawer/drawer-host.ts","../../../projects/common/layout/drawer/escape-layer.ts","../../../projects/common/layout/drawer/drawer.directive.ts","../../../projects/common/layout/i18n/layout-language-section.ts","../../../projects/common/layout/i18n/layout-i18n.ts","../../../projects/common/layout/scroll/scroll-lock-core.ts","../../../projects/common/layout/drawer/drawer-surface.directive.ts","../../../projects/common/layout/drawer/drawer-panel.directive.ts","../../../projects/common/layout/drawer/drawer-content.directive.ts","../../../projects/common/layout/observers/intersection-observer.directive.ts","../../../projects/common/layout/observers/media-query.directive.ts","../../../projects/common/layout/observers/inject-media-query.ts","../../../projects/common/layout/router/warn-router-absent.ts","../../../projects/common/layout/router/inject-query-param-sync.ts","../../../projects/common/layout/observers/resize-signal.ts","../../../projects/common/layout/observers/resize-observer.directive.ts","../../../projects/common/layout/observers/container-size.ts","../../../projects/common/layout/observers/container.directive.ts","../../../projects/common/layout/panel-trigger/panel-trigger.directive.ts","../../../projects/common/layout/panel-toggle/panel-toggle.component.ts","../../../projects/common/layout/resizable/resizable.directive.ts","../../../projects/common/layout/scroll/scroll-lock.directive.ts","../../../projects/common/layout/scroll/scroll-edges-core.ts","../../../projects/common/layout/scroll/scroll-edges.directive.ts","../../../projects/common/layout/sidebar/sidebar.directive.ts","../../../projects/common/layout/text/skeleton.directive.ts","../../../projects/common/layout/scroll/infinite-scroll.directive.ts","../../../projects/common/layout/scroll/sticky-header.directive.ts","../../../projects/common/layout/scroll/scroll-spy.directive.ts","../../../projects/common/layout/text/truncate.directive.ts","../../../projects/common/layout/text/highlight.directive.ts","../../../projects/common/layout/text/expandable-text.ts","../../../projects/common/layout/public-api.ts","../../../projects/common/layout/cngx-common-layout.ts"],"sourcesContent":["import { CNGX_LIVE_SURFACE_SELECTOR } from '@cngx/core/utils';\n\n/**\n * @internal How far `createInertSiblings` reaches.\n *\n * - `'siblings'`: the element siblings of the host only (`CngxBackdrop`).\n * - `'outside'`: everything outside the host up to the `within` boundary\n * (default `document.body`): the siblings of the host and of every\n * ancestor below the boundary, like a modal dialog (`CngxDrawerSurface`).\n * Nothing outside the boundary is touched.\n */\nexport type CngxInertScope = 'siblings' | 'outside';\n\n/**\n * @internal Elements that stay live in every scope:\n *\n * - CDK focus-trap anchors: an inert anchor cannot take focus, so the trap\n * next to it stops wrapping and Tab leaves the modal.\n * - Live regions, announcer containers (the CDK announcer) and every\n * element marked with `CNGX_LIVE_SURFACE_ATTR` (the toast and banner\n * outlets): inert content leaves the accessibility tree, and an\n * announcement written into it is never spoken.\n * - The CDK overlay container: overlays opened from inside the modal render\n * there, outside the host.\n * - A `CngxBackdrop` (static `data-cngx-backdrop` marker): it holds no\n * focusable content, and inerting it would swallow its `backdropClick`. The\n * marker does not wait for the visible class, which can land after a modal\n * surface engaged in the same pass.\n */\nconst KEEP_LIVE_SELECTOR = [\n '.cdk-focus-trap-anchor',\n '[aria-live]',\n '[role=\"status\"]',\n '[role=\"alert\"]',\n '[role=\"log\"]',\n '.cdk-live-announcer-element',\n CNGX_LIVE_SURFACE_SELECTOR,\n '.cdk-overlay-container',\n '[data-cngx-backdrop]',\n].join(', ');\n\n/** @internal Options for {@link createInertSiblings}. */\nexport interface CngxInertSiblingsOptions {\n /** How far the inert set reaches. Defaults to `'siblings'`. */\n readonly scope?: CngxInertScope;\n /** Keeps further elements live (the backdrop keeps the drawer panel it guards). */\n readonly exclude?: (element: HTMLElement) => boolean;\n /**\n * The boundary of the `'outside'` scope: only elements inside it are\n * inerted. Defaults to `document.body`. A boundary that does not contain\n * the host inerts nothing.\n */\n readonly within?: HTMLElement;\n /**\n * A selector for further elements that stay live like the built-in ones:\n * a match is not inerted, and an element that contains a match is entered\n * instead of being inerted as a whole.\n */\n readonly keepLive?: string;\n}\n\n/**\n * @internal Top-layer surfaces that render outside the host after it engaged\n * (a dialog the service appends to `<body>`, a tooltip placed next to its\n * trigger) were opened from inside the modal and stay live. Only late\n * additions get this exemption.\n */\nconst LATE_LIVE_SELECTOR = 'dialog, [popover]';\n\n/**\n * @internal Marks the elements around `host` as `inert` and returns the\n * release function. Shared by `CngxBackdrop` (`'siblings'`) and\n * `CngxDrawerSurface` (`'outside'`).\n *\n * The set is queried at call time and then followed: an element rendered\n * later next to the host or next to one of its ancestors inside the scope\n * (`@if`, `@defer`, a routed view) is inerted as it arrives, unless it is or\n * holds a `<dialog>` or `[popover]`, which a late addition only is when the\n * modal opened it. Elements that already carry\n * `inert` are skipped and never touched on release, so a consumer-set or\n * other-owner `inert` survives. Focus-trap anchors, live regions, the CDK\n * overlay container, marked live surfaces and a backdrop\n * stay live; an element that only contains one of them is not inerted as a\n * whole, its other children are.\n * Release is idempotent and stops following the scope.\n */\nexport function createInertSiblings(\n host: HTMLElement,\n options: CngxInertSiblingsOptions = {},\n): () => void {\n const { scope = 'siblings', exclude = () => false, within, keepLive } = options;\n const root = scope === 'outside' ? (within ?? host.ownerDocument.body) : host.parentElement;\n const liveSelector = keepLive ? `${KEEP_LIVE_SELECTOR}, ${keepLive}` : KEEP_LIVE_SELECTOR;\n const lateLiveSelector = `${liveSelector}, ${LATE_LIVE_SELECTOR}`;\n const targets: HTMLElement[] = [];\n const Observer = host.ownerDocument.defaultView?.MutationObserver;\n const observer = Observer\n ? new Observer((records) => {\n for (const record of records) {\n record.addedNodes.forEach((node) => visit(node, lateLiveSelector));\n }\n })\n : null;\n\n const keepsLive = (element: HTMLElement, selector: string): boolean =>\n element.matches(selector) || exclude(element);\n\n const containsLive = (element: HTMLElement, selector: string): boolean =>\n element.contains(host) ||\n Array.from(element.querySelectorAll<HTMLElement>(selector)).some(\n (node) => !host.contains(node),\n );\n\n const visit = (child: Node, selector: string): void => {\n if (child === host || !(child instanceof HTMLElement) || child.hasAttribute('inert')) {\n return;\n }\n if (keepsLive(child, selector)) {\n return;\n }\n if (containsLive(child, selector)) {\n collect(child, selector);\n return;\n }\n child.setAttribute('inert', '');\n targets.push(child);\n };\n\n const collect = (container: Element, selector: string): void => {\n observer?.observe(container, { childList: true });\n for (const child of Array.from(container.children)) {\n visit(child, selector);\n }\n };\n\n if (root && root !== host && root.contains(host)) {\n collect(root, liveSelector);\n }\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n observer?.disconnect();\n targets.forEach((target) => target.removeAttribute('inert'));\n };\n}\n","import {\n afterNextRender,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { createInertSiblings } from './inert-siblings';\n\n/**\n * Manages backdrop overlay behavior: visibility, click-to-close, and\n * `inert` toggling on sibling elements.\n *\n * When visible, all sibling elements of the host receive the `inert`\n * attribute, preventing focus and interaction behind the backdrop.\n * This is critical for a11y in modal/drawer overlays. A sibling drawer\n * panel (`.cngx-drawer-panel`) is excluded - it is the surface the\n * backdrop guards, not content behind it. Focus-trap anchors (the\n * panel's trap would stop wrapping) and live regions (announcements would\n * go silent) stay live too; a sibling that only contains a live region has\n * its other children inerted instead. Siblings that already carry\n * `inert` are left alone, so a consumer-set `inert` survives the\n * show/hide cycle. The sibling set is re-queried on every show, so\n * siblings rendered after init are covered too.\n *\n * The directive is purely behavioral - it toggles the\n * `.cngx-backdrop--visible` class and `aria-hidden` attribute, and marks\n * its host with `data-cngx-backdrop`, which keeps it live under the inert\n * set of a page-modal drawer so its `backdropClick` still fires. Visual\n * styling is opt-in: either consume the shipped default stylesheet or\n * provide your own.\n *\n * ### Drawer backdrop with shipped defaults (recommended)\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <div [cngxBackdrop]=\"drawer.opened()\" (backdropClick)=\"drawer.close()\"\n * class=\"cngx-backdrop\"></div>\n * <nav [cngxDrawerPanel]=\"drawer\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n * ```css\n * @import '@cngx/common/theming/components/cngx-backdrop.css';\n * ```\n *\n * Token surface (Three-Tier-Override):\n * - `--cngx-backdrop-bg` (scrim color, default `oklch(0 0 0 / 0.5)`)\n * - `--cngx-backdrop-transition-duration` (default `200ms`)\n *\n * ### Custom styling (no opt-in class)\n * If the shipped defaults don't fit, omit the `.cngx-backdrop` class and\n * style your own host class - the directive still toggles\n * `.cngx-backdrop--visible` on the host element.\n *\n * ```html\n * <div [cngxBackdrop]=\"visible()\" class=\"my-backdrop\"></div>\n * ```\n * ```css\n * .my-backdrop {\n * position: fixed;\n * inset: 0;\n * background: rgba(0, 0, 0, 0.3);\n * opacity: 0;\n * pointer-events: none;\n * transition: opacity 0.25s ease;\n * }\n * .my-backdrop.cngx-backdrop--visible {\n * opacity: 1;\n * pointer-events: auto;\n * }\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/backdrop.directive.ts\n * @since 0.3.0\n * @relatedTo CngxDrawer, CngxDrawerPanel, CngxScrollLock\n * <example-url>/#/common/layout/backdrop/overlay-with-inert</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxBackdrop]',\n exportAs: 'cngxBackdrop',\n standalone: true,\n host: {\n '[class.cngx-backdrop--visible]': 'visible()',\n 'aria-hidden': 'true',\n 'data-cngx-backdrop': '',\n '(click)': 'handleHostClick()',\n },\n})\nexport class CngxBackdrop {\n /** Whether the backdrop is visible and siblings are inert. */\n readonly visible = input<boolean>(false, { alias: 'cngxBackdrop' });\n /** Whether clicking the backdrop emits `backdropClick`. */\n readonly closeOnClick = input<boolean>(true);\n /** Emitted when the backdrop is clicked (and `closeOnClick` is true). */\n readonly backdropClick = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly domReady = signal(false);\n\n constructor() {\n afterNextRender(() => this.domReady.set(true));\n\n effect((onCleanup) => {\n if (!this.domReady() || !this.visible()) {\n return;\n }\n // Re-queried on every show: siblings rendered after init (@if/@defer)\n // must be inerted too. The drawer panel keeps working - it is the\n // surface the backdrop guards, not content behind it.\n const release = createInertSiblings(this.el.nativeElement as HTMLElement, {\n scope: 'siblings',\n exclude: (sibling) => sibling.classList.contains('cngx-drawer-panel'),\n });\n onCleanup(release);\n });\n }\n\n /** @internal */\n protected handleHostClick(): void {\n if (this.visible() && this.closeOnClick()) {\n this.backdropClick.emit();\n }\n }\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * How a panel is laid out against its content: `inline` reserves space in\n * the layout (a sidebar), `push` slides in next to the content, `over`\n * slides in on top of it.\n *\n * @since 0.3.0\n */\nexport type CngxPanelMode = 'inline' | 'push' | 'over';\n\n/**\n * The edge a panel sits on. `start` / `end` follow the writing direction,\n * `left` / `right` / `top` / `bottom` are physical.\n *\n * @since 0.3.0\n */\nexport type CngxPanelSide = 'start' | 'end' | 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * The contract a disclosure panel (drawer, sidebar, sidenav) offers its\n * triggers. A trigger mirrors it and owns no state.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/panel-trigger/panel-target.ts\n * @since 0.3.0\n * @relatedTo CngxPanelTrigger, CngxPanelToggle, CNGX_PANEL_TARGET\n */\nexport interface CngxPanelTarget {\n /** The `id` of the panel element; the trigger's `aria-controls`. */\n readonly id: Signal<string>;\n /**\n * Whether the panel is shown (a peek included); the trigger's\n * `aria-expanded` unless `peeked`.\n */\n readonly expanded: Signal<boolean>;\n /**\n * Whether the panel shows only temporarily over its resting state.\n * Optional; unset reads as `false`. A trigger does not report a peek as\n * expanded.\n */\n readonly peeked?: Signal<boolean>;\n /** Opens a hidden panel, hides an open one. */\n toggle(): void;\n /** Shows the panel temporarily without changing its resting state. Optional. */\n peek?(): void;\n /** How the panel is laid out against its content. Optional; unset reads as `inline`. */\n readonly mode?: Signal<CngxPanelMode>;\n /**\n * Whether the shown panel blocks the page around it (a modal over-drawer).\n * Optional; unset reads as `false`.\n */\n readonly modal?: Signal<boolean>;\n /** The edge the panel sits on. Optional; unset reads as `start`. */\n readonly side?: Signal<CngxPanelSide>;\n /**\n * The panel's accessible name. A trigger without text content takes it\n * as its own name, so the name stays the same while the panel opens and\n * closes. Optional; unset or `undefined` falls back to\n * `CNGX_LAYOUT_I18N.panelTrigger`.\n */\n readonly label?: Signal<string | undefined>;\n}\n\n/**\n * The panel target of the surrounding drawer, sidebar or sidenav, for a\n * `CngxPanelTrigger` placed inside it (a pin or close button). A trigger\n * outside the panel takes the target as an explicit reference instead.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/panel-trigger/panel-target.ts\n * @since 0.3.0\n * @relatedTo CngxPanelTrigger, CngxDrawer\n */\nexport const CNGX_PANEL_TARGET = new InjectionToken<CngxPanelTarget>('CngxPanelTarget');\n","import { type ElementRef, InjectionToken, type Signal } from '@angular/core';\n\nimport type { DrawerMode } from './drawer-panel.directive';\nimport type { DrawerPosition } from './drawer.directive';\n\n/**\n * What a `CngxDrawerPanel` reports to its drawer host, so the host can say\n * how its panel is presented (the `CngxPanelTarget` view of `CngxDrawer`)\n * and leave Escape inside the panel to the panel's surface.\n *\n * @since 0.3.0\n */\nexport interface CngxDrawerPanelPresentation {\n /** The panel's `mode`. */\n readonly mode: Signal<DrawerMode>;\n /** Whether the panel's resolved modality blocks anything. */\n readonly modal: Signal<boolean>;\n /** The edge the panel slides in from. */\n readonly position: Signal<DrawerPosition>;\n /** The panel element. */\n readonly element: HTMLElement;\n}\n\n/**\n * The contract a `CngxDrawerPanel` reads from the drawer that owns its open\n * state. `CngxDrawer` implements it and provides `CNGX_DRAWER_HOST`; any\n * other state owner that implements it can drive a panel the same way,\n * bound explicitly (`[cngxDrawerPanel]=\"host\"`) or provided on the panel's\n * own element.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-host.ts\n * @since 0.3.0\n * @relatedTo CngxDrawer, CngxDrawerPanel, CNGX_DRAWER_HOST\n */\nexport interface CngxDrawerHost {\n /** Whether the drawer is open. */\n readonly opened: Signal<boolean>;\n /** The `id` the panel renders unless it carries a static one. */\n readonly panelId: Signal<string | undefined>;\n /** The drawer element: the boundary of a `'contained'` panel. */\n readonly elementRef: ElementRef<HTMLElement>;\n /** Closes the drawer. The panel calls it for every dismissal request. */\n close(): void;\n /**\n * Connects a panel's presentation; the latest connected panel wins.\n * Returns the disconnect, which the panel calls when it leaves or\n * switches hosts.\n */\n connectPanel(panel: CngxDrawerPanelPresentation): () => void;\n}\n\n/**\n * The drawer host of a `CngxDrawerPanel` on the same element. `CngxDrawer`\n * provides it via `useExisting`, so a bare `cngxDrawerPanel` attribute next\n * to `cngxDrawer` resolves its drawer without injecting the concrete class.\n * An explicit `[cngxDrawerPanel]` reference wins over it.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-host.ts\n * @since 0.3.0\n * @relatedTo CngxDrawer, CngxDrawerPanel\n */\nexport const CNGX_DRAWER_HOST = new InjectionToken<CngxDrawerHost>('CngxDrawerHost');\n","// Escape is dismissed one layer at a time. Host listeners bubble from the\n// innermost surface outwards and run before CngxPopover's document listener,\n// so each layer checks for a closer owner before it acts.\nconst claimed = new WeakSet<Event>();\n\n/**\n * @internal Whether a layer closer to the keypress than `host` owns this\n * Escape: an inner surface or drawer already handled it, or an open popover\n * inside `host` (a menu, a select panel) takes it through its own listener.\n */\nexport function escapeOwnedAbove(event: Event, host: HTMLElement): boolean {\n return claimed.has(event) || hasOpenPopover(host);\n}\n\n/** @internal Marks the Escape as handled for the layers around the handler. */\nexport function claimEscape(event: Event): void {\n claimed.add(event);\n}\n\nfunction hasOpenPopover(host: HTMLElement): boolean {\n return Array.from(host.querySelectorAll('[popover]')).some(isOpenPopover);\n}\n\n// Engines without the Popover API reject the pseudo-class.\nfunction isOpenPopover(element: Element): boolean {\n try {\n return element.matches(':popover-open');\n } catch {\n return false;\n }\n}\n","import { computed, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\nimport { createSlotRegistry } from '@cngx/core/utils';\n\nimport {\n CNGX_PANEL_TARGET,\n type CngxPanelMode,\n type CngxPanelSide,\n type CngxPanelTarget,\n} from '../panel-trigger/panel-target';\nimport {\n CNGX_DRAWER_HOST,\n type CngxDrawerHost,\n type CngxDrawerPanelPresentation,\n} from './drawer-host';\nimport { claimEscape, escapeOwnedAbove } from './escape-layer';\n\n/**\n * Position from which the drawer panel slides in.\n */\nexport type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';\n\n/**\n * State owner for a drawer / sidebar system.\n *\n * Holds the open/close state and handles the Escape key. Supports both\n * **controlled** (`[cngxDrawerOpened]=\"signal()\"`) and **uncontrolled**\n * (internal state via `open()` / `close()` / `toggle()`) modes.\n *\n * Child directives (`CngxDrawerPanel`, `CngxDrawerContent`) receive a\n * reference to this directive via an explicit input - no ancestor injection.\n * The panel reads it through the `CngxDrawerHost` contract, which the drawer\n * also provides as `CNGX_DRAWER_HOST` for a panel on its own element.\n *\n * The drawer is a `CngxPanelTarget`: a `[cngxPanelTrigger]=\"drawer\"` button\n * mirrors `opened` as `aria-expanded` and points `aria-controls` at\n * `panelId`, which the panel takes as its `id`. Inside the drawer it provides\n * `CNGX_PANEL_TARGET` for a bare `cngxPanelTrigger`. Its `mode`, `modal`\n * and `side` follow the panel's `mode`, resolved modality and `position`,\n * so a `CngxPanelToggle` draws the glyph of the current presentation.\n *\n * The drawer host is also the boundary of a `'contained'` panel and the\n * area its scrim covers: with the opt-in `cngx-drawer` class (stylesheet\n * `@cngx/common/theming/components/cngx-drawer.css`, part of the cngx\n * bundle) the host places the panel on its side, lets the content fill the\n * rest and paints a scrim over itself while a modal panel inside it is\n * open. Keep an app header that must stay live outside the host.\n *\n * ### With a panel trigger\n * ```html\n * <button type=\"button\" [cngxPanelTrigger]=\"drawer\">Menu</button>\n * <div cngxDrawer #drawer=\"cngxDrawer\" panelId=\"main-nav\">\n * <nav [cngxDrawerPanel]=\"drawer\">…</nav>\n * </div>\n * ```\n *\n * ### Uncontrolled\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\">\n * <button (click)=\"drawer.toggle()\">Menu</button>\n * <nav [cngxDrawerPanel]=\"drawer\" position=\"left\">…</nav>\n * <main [cngxDrawerContent]=\"drawer\">…</main>\n * </div>\n * ```\n *\n * ### Controlled\n * ```html\n * <div cngxDrawer [cngxDrawerOpened]=\"sidebarOpen()\"\n * (openedChange)=\"sidebarOpen.set($event)\">\n * …\n * </div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer.directive.ts\n * @since 0.3.0\n * @relatedTo CngxDrawerPanel, CngxDrawerContent, CngxBackdrop, CngxScrollLock\n * <example-url>/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>/#/common/layout/drawer/app-header-clipped</example-url>\n * <example-url>/#/common/layout/drawer/full-height-modal</example-url>\n * <example-url>/#/common/layout/drawer/filter-panel-push</example-url>\n * <example-url>/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n * @axis level organism\n */\n@Directive({\n selector: '[cngxDrawer]',\n exportAs: 'cngxDrawer',\n standalone: true,\n providers: [\n { provide: CNGX_PANEL_TARGET, useExisting: CngxDrawer },\n { provide: CNGX_DRAWER_HOST, useExisting: CngxDrawer },\n ],\n host: {\n '[class.cngx-drawer--opened]': 'opened()',\n '(keydown.escape)': 'handleEscape($event)',\n },\n})\nexport class CngxDrawer implements CngxPanelTarget, CngxDrawerHost {\n /** @internal Host element ref. */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * The `id` of the drawer's panel element. `CngxDrawerPanel` renders it as\n * its `id` unless the panel carries a static one, and a panel trigger\n * points `aria-controls` at it.\n */\n readonly panelId = input<string | undefined>(undefined);\n\n /** Controlled opened state. When bound, takes precedence over internal state. */\n readonly openedInput = input<boolean | undefined>(undefined, { alias: 'cngxDrawerOpened' });\n\n private readonly openedState = signal(false);\n\n /** Resolved opened state - controlled input wins over internal state. */\n readonly opened = computed(() => this.openedInput() ?? this.openedState());\n\n /** {@link CngxPanelTarget} view of {@link panelId}; empty when unset. */\n readonly id = computed(() => this.panelId() ?? '');\n\n /** {@link CngxPanelTarget} view of {@link opened}. */\n readonly expanded = this.opened;\n\n private readonly panelSlot = createSlotRegistry<CngxDrawerPanelPresentation>();\n\n /** {@link CngxPanelTarget} view of the panel's `mode`; `over` until a panel registers. */\n readonly mode = computed<CngxPanelMode>(() => this.panelSlot.current()?.mode() ?? 'over');\n\n /**\n * {@link CngxPanelTarget}: whether the panel's resolved modality blocks\n * anything; `false` until a panel connects, like an unset `modal`.\n */\n readonly modal = computed(() => this.panelSlot.current()?.modal() ?? false);\n\n /** {@link CngxPanelTarget} view of the panel's `position`; `left` until a panel registers. */\n readonly side = computed<CngxPanelSide>(() => this.panelSlot.current()?.position() ?? 'left');\n\n /** Emitted when the opened state changes. Wire to a signal for two-way binding. */\n readonly openedChange = output<boolean>();\n /** Emitted when the drawer closes. Convenience shorthand for close-only listeners. */\n readonly closed = output<void>();\n\n /** Opens the drawer. No-op when already open. */\n open(): void {\n if (this.opened()) {\n return;\n }\n this.openedState.set(true);\n this.openedChange.emit(true);\n }\n\n /** Closes the drawer. */\n close(): void {\n if (!this.opened()) {\n return;\n }\n this.openedState.set(false);\n this.openedChange.emit(false);\n this.closed.emit();\n }\n\n // The open panel's surface already closed the drawer for an Escape inside\n // it. A controlled drawer still reads the bound input as open until the\n // owner writes it back, so a second close() here would emit twice. An open\n // popover inside the drawer (a menu in the content) takes the keypress\n // first.\n protected handleEscape(event: Event): void {\n if (!this.opened() || escapeOwnedAbove(event, this.host)) {\n return;\n }\n const panel = this.panelSlot.current()?.element;\n if (panel && event.target instanceof Node && panel.contains(event.target)) {\n return;\n }\n claimEscape(event);\n this.close();\n }\n\n /** {@link CngxDrawerHost}: connects a panel; the latest panel wins. */\n connectPanel(panel: CngxDrawerPanelPresentation): () => void {\n this.panelSlot.register(panel);\n return () => this.panelSlot.unregister(panel);\n }\n\n /** Toggles the drawer between open and closed. */\n toggle(): void {\n if (this.opened()) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n","// Pulls the augmented module into the program; ng-packagr rejects `declare module` (TS2664) otherwise.\nimport type { CngxMessage } from '@cngx/core/i18n';\n\n/**\n * The layout section of a {@link CngxLanguagePack}: the copy of the\n * `@cngx/common/layout` atoms. It feeds `CNGX_LAYOUT_I18N`.\n *\n * @since 0.3.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport interface CngxLayoutLanguageSection {\n /** Label of the `CngxExpandableText` expand control. */\n readonly expandableTextMore: string;\n /** Label of the `CngxExpandableText` collapse control. */\n readonly expandableTextLess: string;\n /** Accessible name of a `CngxResizable` handle. */\n readonly resizeHandle: string;\n /** `aria-valuetext` of a `CngxResizable` handle. Placeholder: `{size}` (px). */\n readonly resizeValueText: CngxMessage;\n /** Accessible name of a `CngxPanelTrigger` without text content whose panel has no label. */\n readonly panelTrigger: string;\n /** Accessible name of a `CngxSidebar` region without a bound label. */\n readonly sidebarRegion: string;\n /** Accessible name of an open page-modal drawer panel or surface without a bound label. */\n readonly drawerDialog: string;\n}\n\n/**\n * The English layout section: the single source of the layout atoms'\n * English copy. `CNGX_LAYOUT_I18N` defaults to it.\n *\n * @since 0.3.0\n * @relatedTo CNGX_LAYOUT_I18N\n */\nexport const CNGX_LAYOUT_LANGUAGE_EN: CngxLayoutLanguageSection = {\n expandableTextMore: 'Show more',\n expandableTextLess: 'Show less',\n resizeHandle: 'Resize',\n resizeValueText: '{size} pixels',\n panelTrigger: 'Panel',\n sidebarRegion: 'Sidebar',\n drawerDialog: 'Drawer',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly layout: CngxLayoutLanguageSection;\n }\n}\n","import { inject, InjectionToken, type Provider, type Signal } from '@angular/core';\nimport { createLanguageSection, createSectionBundle, formatMessage } from '@cngx/core/i18n';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport { CNGX_LAYOUT_LANGUAGE_EN, type CngxLayoutLanguageSection } from './layout-language-section';\n\n/**\n * Layout i18n surface. Library defaults are English; consumers override via\n * {@link provideLayoutI18n}. Reactive from birth: the token carries a\n * `Signal`, and {@link withLayoutI18nLabels} accepts a `Signal` of a partial\n * bundle.\n *\n * Every key is the fallback of a copy input on a layout atom, resolved in a\n * `computed()`: a bound input wins, and an unbound one follows a language\n * switch. The keys mirror the layout section of a language pack\n * ({@link CngxLayoutLanguageSection}); composed copy is a function of its\n * parameters, formatted for the reading locale.\n *\n * @since 0.3.0\n */\nexport interface CngxLayoutI18n {\n /** Fallback of `CngxExpandableText.moreLabel`. */\n readonly expandableTextMore: string;\n /** Fallback of `CngxExpandableText.lessLabel`. */\n readonly expandableTextLess: string;\n /** Fallback of `CngxResizable.label`, the handle's accessible name. */\n readonly resizeHandle: string;\n /** Fallback of `CngxResizable.valueText`: the handle's `aria-valuetext` for a px size. */\n readonly resizeValueText: (size: number) => string;\n /**\n * Fallback of `CngxPanelTrigger.label` on a trigger without text content\n * whose panel has no `label`. Stable: the panel state is `aria-expanded`.\n */\n readonly panelTrigger: string;\n /** Fallback of `CngxSidebar.label`, the region's accessible name. */\n readonly sidebarRegion: string;\n /**\n * Fallback of `CngxDrawerPanel.label` and `CngxDrawerSurface.label`: the\n * name of an engaged page modal (a `dialog`) without a bound label or a\n * static `aria-label` / `aria-labelledby`.\n */\n readonly drawerDialog: string;\n}\n\n/** @internal The English section with the active pack's layout section on top. */\nconst injectLayoutSection = createLanguageSection('layout', CNGX_LAYOUT_LANGUAGE_EN);\n\n/** @internal Turns a layout section into the token's keys for a locale. */\nfunction layoutBundleFrom(section: CngxLayoutLanguageSection, locale: string): CngxLayoutI18n {\n return {\n expandableTextMore: section.expandableTextMore,\n expandableTextLess: section.expandableTextLess,\n resizeHandle: section.resizeHandle,\n resizeValueText: (size) => formatMessage(section.resizeValueText, { size }, locale),\n panelTrigger: section.panelTrigger,\n sidebarRegion: section.sidebarRegion,\n drawerDialog: section.drawerDialog,\n };\n}\n\n/** @internal Builds and reads the token, formatted for the reading locale. */\nconst layoutBundle = createSectionBundle<CngxLayoutLanguageSection, CngxLayoutI18n>({\n section: injectLayoutSection,\n toBundle: layoutBundleFrom,\n});\n\n/**\n * DI token for the layout i18n bundle. `providedIn: 'root'`: the layout\n * section of the active language pack over the English defaults; the value\n * is a `Signal`, shared by every reader under one injector.\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/i18n/layout-i18n.ts\n * @since 0.3.0\n * @relatedTo CngxExpandableText, CngxResizable, CngxPanelTrigger, CngxSidebar, CngxDrawerPanel\n */\nexport const CNGX_LAYOUT_I18N = new InjectionToken<Signal<CngxLayoutI18n>>('CngxLayoutI18n', {\n providedIn: 'root',\n factory: () => layoutBundle.build(),\n});\n\n/**\n * A label override feature of `provideLayoutI18n`.\n *\n * @since 0.3.0\n * @relatedTo CNGX_LAYOUT_I18N, withLayoutI18nLabels\n */\nexport type CngxLayoutI18nFeature = (bundle: Signal<CngxLayoutI18n>) => Signal<CngxLayoutI18n>;\n\n/**\n * Override layout labels via a partial bundle - unset keys keep the\n * language pack's copy, or the English default. Pass a `Signal` of a partial\n * bundle to switch languages at runtime.\n *\n * @since 0.3.0\n */\nexport function withLayoutI18nLabels(\n overrides: Partial<CngxLayoutI18n> | Signal<Partial<CngxLayoutI18n>>,\n): CngxLayoutI18nFeature {\n return (bundle) => createOverrideMerge(bundle, overrides);\n}\n\n/**\n * Provider for the layout i18n bundle. Returns a plain `Provider`, so it\n * also scopes a subtree through `viewProviders`. The features apply on top\n * of the active language pack.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideLayoutI18n(\n * withLayoutI18nLabels({ expandableTextMore: 'Mehr anzeigen', expandableTextLess: 'Weniger anzeigen' }),\n * ),\n * ],\n * });\n * ```\n *\n * @since 0.3.0\n */\nexport function provideLayoutI18n(...features: readonly CngxLayoutI18nFeature[]): Provider {\n return {\n provide: CNGX_LAYOUT_I18N,\n useFactory: () => layoutBundle.build(features),\n };\n}\n\n/**\n * Inject the resolved layout i18n bundle signal. Read it inside a\n * `computed()` or template so a runtime override flip re-derives.\n *\n * @since 0.3.0\n */\nexport function injectLayoutI18n(): Signal<CngxLayoutI18n> {\n return layoutBundle.resolve(inject(CNGX_LAYOUT_I18N));\n}\n","/**\n * Ref-count per locked element. Module-private on purpose: this file is the\n * single owner of the lock state. A second copy of this map (the pre-extraction\n * state: one in `CngxScrollLock`, one in `CngxDialog`) shares the dataset keys\n * below without sharing the count, so interleaved acquire/release across the\n * two owners corrupts each other's saved overflow values.\n *\n * @internal\n */\nconst lockCounts = new WeakMap<HTMLElement, number>();\n\n/**\n * Acquire a ref-counted scroll lock on an element and get back the matching\n * release function.\n *\n * The target is the element that scrolls: the document root\n * (`document.documentElement`) for the page, or any scroll container (a\n * panel with `overflow-y: auto`) for a surface that overlays only that\n * container. Each element keeps its own count, so locks on two containers\n * never interfere.\n *\n * The first active lock on a target saves its inline `overflow` /\n * `scrollbar-gutter` and sets `overflow: hidden` + `scrollbar-gutter: stable`\n * (no layout shift when the scrollbar disappears). Releasing the last active\n * lock on that target restores the saved values. The returned release\n * function is idempotent - calling it twice cannot over-decrement the count.\n *\n * Shared engine behind `CngxScrollLock` and `CngxDialog`'s modal scroll lock;\n * consumers composing their own overlay primitives can use it directly.\n *\n * ```typescript\n * const release = createScrollLock(document.documentElement);\n * // ... overlay open ...\n * release();\n * ```\n *\n * @param target - The scrolling element to lock.\n * @returns Release function for this acquisition. Idempotent.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts\n * @since 0.3.0\n * @relatedTo CngxScrollLock, CngxDialog\n */\nexport function createScrollLock(target: HTMLElement): () => void {\n const count = lockCounts.get(target) ?? 0;\n if (count === 0) {\n target.dataset['cngxPrevOverflow'] = target.style.overflow;\n target.dataset['cngxPrevScrollbarGutter'] = target.style.scrollbarGutter;\n target.style.overflow = 'hidden';\n target.style.scrollbarGutter = 'stable';\n }\n lockCounts.set(target, count + 1);\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n const current = lockCounts.get(target) ?? 0;\n if (current <= 1) {\n target.style.overflow = target.dataset['cngxPrevOverflow'] ?? '';\n target.style.scrollbarGutter = target.dataset['cngxPrevScrollbarGutter'] ?? '';\n delete target.dataset['cngxPrevOverflow'];\n delete target.dataset['cngxPrevScrollbarGutter'];\n lockCounts.set(target, 0);\n } else {\n lockCounts.set(target, current - 1);\n }\n };\n}\n\n// The body properties the pin writes. Only these are saved and restored, so a\n// style another owner sets on body while the pin is held survives the release.\nconst PINNED_BODY_PROPERTIES = ['position', 'top', 'inset-inline', 'overflow'] as const;\n\ninterface SavedProperty {\n readonly value: string;\n readonly priority: string;\n}\n\ninterface PinState {\n count: number;\n readonly saved: ReadonlyMap<string, SavedProperty>;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly releaseHtml: () => void;\n}\n\n/**\n * Pin state per document root, separate from `lockCounts`: a pin also holds\n * one `createScrollLock` acquisition, so the html overflow stays shared with\n * every other owner.\n *\n * @internal\n */\nconst pins = new WeakMap<HTMLElement, PinState>();\n\n/**\n * Acquire a ref-counted scroll lock that pins the page body in place, for\n * overlays that must hold on iOS Safari.\n *\n * `overflow: hidden` on the root does not stop iOS Safari from scrolling a\n * page that was already scrolled, and the visual viewport drifts with it, so\n * a bottom-fixed overlay ends above the visible bottom. The first pin saves\n * the body's inline `position`, `top`, `inset-inline` and `overflow` and the\n * scroll position, fixes the body at `top: -scrollY`, and acquires\n * {@link createScrollLock} on the root. The last\n * release restores the body, releases the root lock and scrolls back to the\n * saved position. The returned release function is idempotent.\n *\n * `CngxDialog` and `CngxScrollLock` keep {@link createScrollLock}; reach for\n * this one when the overlay is pinned to the viewport bottom on touch devices.\n *\n * ```typescript\n * const release = createPinnedScrollLock(document.documentElement);\n * // ... sheet open ...\n * release();\n * ```\n *\n * @param html - The document root (`document.documentElement`) to lock.\n * @returns Release function for this acquisition. Idempotent.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts\n * @since 0.3.0\n * @relatedTo createScrollLock, CngxPopoverSheet\n */\nexport function createPinnedScrollLock(html: HTMLElement): () => void {\n const body = html.ownerDocument.body;\n const view = html.ownerDocument.defaultView;\n const existing = pins.get(html);\n if (existing) {\n existing.count += 1;\n } else {\n const scrollX = view?.scrollX ?? 0;\n const scrollY = view?.scrollY ?? 0;\n pins.set(html, {\n count: 1,\n saved: new Map(\n PINNED_BODY_PROPERTIES.map((name) => [\n name,\n {\n value: body.style.getPropertyValue(name),\n priority: body.style.getPropertyPriority(name),\n },\n ]),\n ),\n scrollX,\n scrollY,\n releaseHtml: createScrollLock(html),\n });\n body.style.position = 'fixed';\n body.style.top = `${-scrollY}px`;\n body.style.insetInline = '0';\n body.style.overflow = 'hidden';\n }\n\n let released = false;\n return () => {\n if (released) {\n return;\n }\n released = true;\n const state = pins.get(html);\n if (!state) {\n return;\n }\n state.count -= 1;\n if (state.count > 0) {\n return;\n }\n pins.delete(html);\n for (const [name, { value, priority }] of state.saved) {\n if (value) {\n body.style.setProperty(name, value, priority);\n } else {\n body.style.removeProperty(name);\n }\n }\n state.releaseHtml();\n view?.scrollTo({ left: state.scrollX, top: state.scrollY, behavior: 'instant' });\n };\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n InjectionToken,\n Injector,\n input,\n output,\n type Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n CNGX_FOCUS_RESTORE_DRIVER,\n CNGX_FOCUS_TRAP_DRIVER,\n CngxFocusRestore,\n type CngxFocusRestoreDriver,\n CngxFocusTrap,\n type CngxFocusTrapDriver,\n} from '@cngx/common/a11y';\nimport {\n CNGX_CLICK_OUTSIDE_DRIVER,\n CNGX_HOTKEY_SCOPE,\n CngxClickOutside,\n type CngxClickOutsideDriver,\n type CngxHotkeyScopeNode,\n createHotkeyScope,\n} from '@cngx/common/interactive';\nimport { injectWindow } from '@cngx/core/tokens';\nimport { createCloseWatcher } from '@cngx/core/utils';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport { createScrollLock } from '../scroll/scroll-lock-core';\nimport { claimEscape, escapeOwnedAbove } from './escape-layer';\nimport { createInertSiblings } from './inert-siblings';\n\n/**\n * How far an engaged `CngxDrawerSurface` takes over the page.\n *\n * - `'page'`: a modal dialog. Focus trap, `role=\"dialog\"` + `aria-modal`,\n * everything outside the host `inert` up to `<body>`, scroll lock on the\n * nearest scroll container above the host.\n * - `'contained'`: modal only inside a boundary element (for a drawer, the\n * `[cngxDrawer]` host). The host's siblings inside the boundary are\n * `inert` and a scroll container inside the boundary is locked; everything\n * outside the boundary (an app header above a clipped drawer) stays live.\n * No trap and no `aria-modal`: focus moves into the host on activation\n * and Tab can reach the live page around the boundary.\n * - `'none'`: the page stays operable. No trap, no inert, no lock.\n *\n * @since 0.3.0\n */\nexport type CngxDrawerModality = 'page' | 'contained' | 'none';\n\n/**\n * @internal Lets a directive that composes `CngxDrawerSurface` as a host\n * directive drive it from its own state instead of `[active]` / `[modality]`.\n * Provided by the composer on the same element (`useExisting`); the surface\n * resolves it lazily with `self: true`, because the composer constructs after\n * its host directives.\n */\nexport interface CngxDrawerSurfaceDriver {\n /** Whether the surface is engaged; wins over `[active]`. */\n readonly surfaceActive: Signal<boolean>;\n /** The modality of the engaged surface; wins over `[modality]`. */\n readonly surfaceModality: Signal<CngxDrawerModality>;\n /**\n * The boundary of a `contained` surface. Without it, or when it does not\n * contain the host, the host's parent element is the boundary.\n */\n readonly surfaceBoundary?: Signal<HTMLElement | null>;\n /**\n * Landmark role while the surface is not an engaged page modal. Without it\n * the surface renders its own `[role]`.\n */\n readonly surfaceLandmarkRole?: Signal<string | null>;\n /** Whether a press outside the host asks for dismissal. Without it, it does. */\n readonly surfaceOutsideDismiss?: Signal<boolean>;\n /**\n * Accessible name of the host in every state; wins over `[label]`, the\n * static `aria-label` and the dialog fallback. For a composer that names\n * the host itself, so the surface never writes a different name.\n */\n readonly surfaceLabel?: Signal<string>;\n /** Called for every dismissal request (Escape, back gesture, outside press). */\n surfaceDismiss(): void;\n}\n\n/** @internal See {@link CngxDrawerSurfaceDriver}. */\nexport const CNGX_DRAWER_SURFACE_DRIVER = new InjectionToken<CngxDrawerSurfaceDriver>(\n 'CngxDrawerSurfaceDriver',\n);\n\nconst SCROLLING_OVERFLOW = new Set(['auto', 'scroll']);\n\n/**\n * The transient-surface behaviour of a drawer or an overlay rail, with an\n * explicit modality.\n *\n * While `active`, the surface asks to be dismissed on Escape with focus\n * inside (in every browser: the close Chromium derives from an Escape\n * keypress is not a back gesture and is dropped), on the platform back\n * gesture (`CloseWatcher`) and on a press outside the\n * host. A press on the element whose `aria-controls` names the host `id` is\n * not outside, so the trigger can toggle the surface itself. One Escape\n * dismisses one layer: an inner surface or an open popover inside the host\n * (a menu, a select panel) takes the keypress first. Focus returns\n * to the element focused at activation when the surface deactivates.\n *\n * `modality` decides how far the engaged surface takes over the page:\n *\n * - `'page'` (default) additionally traps focus, renders `role=\"dialog\"` +\n * `aria-modal=\"true\"`, makes everything outside the host `inert` up to\n * `<body>` (the siblings of the host and of every ancestor, like a modal\n * dialog) and locks scrolling on the nearest scroll container above the\n * host (the nearest ancestor with a computed `overflow-y` of `auto` or\n * `scroll`, else the document root).\n * - `'contained'` does the same inside a boundary only: the host's siblings\n * inside the boundary are `inert`, the nearest scroll container between\n * the host and the boundary (inclusive) is locked if there is one, and\n * nothing outside the boundary is touched. The element whose `aria-controls`\n * names the host stays live wherever it sits. No trap and no\n * `aria-modal` (the page around the boundary is operable, so the surface\n * must not claim it is not); the landmark role stays and focus moves to\n * the first tabbable element inside the host on activation. The\n * boundary is the host's parent element unless a composer names one\n * (`CngxDrawerPanel` names its `[cngxDrawer]` host).\n * - `'none'` keeps the page around it operable: no trap, no lock, no\n * inert, the landmark `role` (default `complementary`, `null` keeps the\n * host's implicit role).\n *\n * In every modality focus-trap anchors, live regions, the CDK overlay\n * container, the toast and banner outlets and a visible `CngxBackdrop` stay\n * live, and an `inert` set by someone else is kept on release. Escape, the\n * back gesture and an outside press ask for dismissal in all three.\n *\n * The surface does not own the open state: it reports `dismiss` and the\n * owner decides. It composes `CngxFocusTrap`, `CngxFocusRestore` and\n * `CngxClickOutside` and drives them; none of their inputs is re-exposed.\n *\n * ```html\n * <aside id=\"filters\" cngxDrawerSurface [active]=\"open()\" modality=\"none\"\n * (dismiss)=\"open.set(false)\">…</aside>\n * <button aria-controls=\"filters\" [attr.aria-expanded]=\"open()\"\n * (click)=\"open.set(!open())\">Filters</button>\n * ```\n *\n * `CngxDrawerPanel` hosts the surface for drawers; consumers rarely bind it\n * directly.\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-surface.directive.ts\n * @since 0.3.0\n * @relatedTo CngxDrawerPanel, CngxFocusTrap, CngxFocusRestore, CngxClickOutside, createScrollLock\n * <example-url>/#/common/layout/drawer/standalone-surface</example-url>\n * @axis level molecule\n */\n@Directive({\n selector: '[cngxDrawerSurface]',\n exportAs: 'cngxDrawerSurface',\n standalone: true,\n hostDirectives: [\n { directive: CngxFocusTrap, inputs: [], outputs: [] },\n { directive: CngxFocusRestore, inputs: [], outputs: [] },\n { directive: CngxClickOutside, inputs: [], outputs: [] },\n ],\n providers: [\n { provide: CNGX_FOCUS_TRAP_DRIVER, useExisting: CngxDrawerSurface },\n { provide: CNGX_FOCUS_RESTORE_DRIVER, useExisting: CngxDrawerSurface },\n { provide: CNGX_CLICK_OUTSIDE_DRIVER, useExisting: CngxDrawerSurface },\n { provide: CNGX_HOTKEY_SCOPE, useFactory: () => inject(CngxDrawerSurface).hotkeyScope },\n ],\n host: {\n '[attr.role]': 'surfaceRole()',\n '[attr.aria-modal]': \"engagedPage() ? 'true' : null\",\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.tabindex]': 'hostTabindex()',\n '(keydown.escape)': 'handleEscape($event)',\n },\n})\nexport class CngxDrawerSurface\n implements CngxFocusTrapDriver, CngxFocusRestoreDriver, CngxClickOutsideDriver\n{\n /**\n * Whether the surface is engaged (the drawer or overlay is open). Bind it\n * to the owner's open state.\n */\n readonly active = input<boolean>(false);\n /**\n * How far the engaged surface takes over the page: `'page'` (modal dialog,\n * inert up to `<body>`), `'contained'` (inert and scroll lock inside the\n * boundary only, no trap) or `'none'`. See {@link CngxDrawerModality}.\n */\n readonly modality = input<CngxDrawerModality>('page');\n /**\n * Landmark role while the surface is not an engaged page modal. Defaults\n * to `complementary`; pass `navigation` for a nav surface, or `null` on a\n * `<nav>` / `<aside>` host to keep its implicit role. A composer's driver\n * wins over it.\n */\n readonly role = input<string | null>('complementary');\n /**\n * Accessible name of the surface. An engaged page modal (a `dialog`)\n * without one falls back to a static `aria-label` on the host, then to\n * `CNGX_LAYOUT_I18N.drawerDialog`; a host with a static `aria-labelledby`\n * keeps that name. Outside an engaged page modal only a bound label or a\n * static `aria-label` names the landmark.\n */\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n /**\n * Emitted when the user asks to dismiss the engaged surface: Escape, the\n * back gesture, or a press outside the host. The owner closes it.\n */\n readonly dismiss = output<void>();\n\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly doc = inject(DOCUMENT);\n private readonly domReady = signal(false);\n private readonly focusTrap = inject(CngxFocusTrap, { self: true });\n private readonly i18n = injectLayoutI18n();\n private readonly staticLabel = inject(new HostAttributeToken('aria-label'), { optional: true });\n private readonly staticLabelledBy = inject(new HostAttributeToken('aria-labelledby'), {\n optional: true,\n });\n private readonly staticTabindex = inject(new HostAttributeToken('tabindex'), { optional: true });\n private destroyed = false;\n // Chromium also turns an unhandled Escape keydown, wherever focus is, into\n // a CloseWatcher close. Escape belongs to the keydown path (focus inside\n // the host, the drawer for its content), so a watcher close from the same\n // keypress is not a back gesture. The flag lives for the keydown task only.\n private escapeKeyTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly escapeKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape') {\n return;\n }\n this.clearEscapeKey();\n this.escapeKeyTimer = setTimeout(() => {\n this.escapeKeyTimer = null;\n });\n };\n\n // Swallows the click that trails the outside press which dismissed an\n // engaged page modal. iOS Safari fires pointerdown at touchstart but hit\n // tests the synthesized click again after touchend; by then the dismissal\n // has dropped `inert` and the click lands on the live opener, reopening it.\n private releaseTrailingClick: (() => void) | null = null;\n\n private resolvedDriver: CngxDrawerSurfaceDriver | null | undefined = undefined;\n private driver(): CngxDrawerSurfaceDriver | null {\n if (this.resolvedDriver === undefined) {\n this.resolvedDriver = this.injector.get(CNGX_DRAWER_SURFACE_DRIVER, null, { self: true });\n }\n return this.resolvedDriver;\n }\n\n /** Whether the surface is engaged, after the driver. */\n readonly isActive = computed(() => this.driver()?.surfaceActive() ?? this.active());\n /** The modality of the surface, after the driver. */\n readonly resolvedModality = computed<CngxDrawerModality>(\n () => this.driver()?.surfaceModality() ?? this.modality(),\n );\n\n /** The modality while engaged; `'none'` while the surface is not active. */\n protected readonly engagedModality = computed<CngxDrawerModality>(() =>\n this.isActive() ? this.resolvedModality() : 'none',\n );\n protected readonly engagedPage = computed(() => this.engagedModality() === 'page');\n\n /**\n * @internal Hotkey scope of the surface subtree: modal while engaged as\n * `'page'` or `'contained'`, so app bindings outside stay quiet while focus\n * is inside. Always active: the drawer's own bindings (toggle, close) must\n * fire whether the surface is engaged or not.\n */\n readonly hotkeyScope: CngxHotkeyScopeNode = createHotkeyScope({\n element: this.host,\n modal: computed(() => this.engagedModality() !== 'none'),\n parent: inject(CNGX_HOTKEY_SCOPE, { optional: true, skipSelf: true }),\n destroyRef: inject(DestroyRef),\n });\n protected readonly surfaceRole = computed(() => {\n if (this.engagedPage()) {\n return 'dialog';\n }\n const landmark = this.driver()?.surfaceLandmarkRole;\n return landmark ? landmark() : this.role();\n });\n\n // A static aria-label or aria-labelledby names the host already; the\n // fallback only fills a nameless engaged dialog.\n private readonly namesWithFallback = computed(\n () => this.engagedPage() && this.staticLabel === null && this.staticLabelledBy === null,\n );\n /**\n * The resolved accessible name: the bound `label`, else a static\n * `aria-label`, else (engaged page modal without a static name)\n * `CNGX_LAYOUT_I18N.drawerDialog`.\n */\n readonly label = computed<string | undefined>(() => {\n const driven = this.driver()?.surfaceLabel;\n if (driven) {\n return driven();\n }\n return this.namesWithFallback()\n ? (this.labelInput() ?? this.i18n().drawerDialog)\n : (this.labelInput() ?? this.staticLabel ?? undefined);\n });\n protected readonly ariaLabel = computed(() => this.label() ?? null);\n\n /** @internal Drives the composed `CngxFocusTrap`. */\n readonly focusTrapEnabled = this.engagedPage;\n /** @internal Drives the composed `CngxFocusTrap`. */\n readonly focusTrapAutoFocus = true;\n /**\n * @internal Drives the composed `CngxFocusRestore`. The restore edge can\n * run before the scope effect below releases `inert` around the host; the\n * restore then focuses the opener after the render, once it is live.\n */\n readonly focusRestoreActive = this.isActive;\n\n /**\n * @internal Drives the composed `CngxFocusRestore`: when the surface was\n * engaged with focus already inside it (a docked rail that turned into a\n * drawer), there is no opener to return to, so focus goes to the element\n * whose `aria-controls` names the host, the same relation an outside press\n * is exempted by.\n */\n focusRestoreFallback(): HTMLElement | null {\n const id = this.host.id;\n if (!id) {\n return null;\n }\n const trigger = this.doc.querySelector(`[aria-controls~=\"${id.replace(/[\"\\\\]/g, '\\\\$&')}\"]`);\n return trigger instanceof HTMLElement && !this.host.contains(trigger) ? trigger : null;\n }\n // A press on a non-focusable spot inside an engaged surface would drop\n // focus to <body>, out of reach of the host Escape listener (and of the\n // page modal's own boundary). tabindex=\"-1\" keeps focus on the host there,\n // like a native <dialog>; it adds no Tab stop. A consumer tabindex wins.\n protected readonly hostTabindex = computed(\n () => this.staticTabindex ?? (this.isActive() ? '-1' : null),\n );\n /** @internal Drives the composed `CngxClickOutside`. */\n readonly clickOutsideEnabled = computed(\n () => this.isActive() && (this.driver()?.surfaceOutsideDismiss?.() ?? true),\n );\n\n private readonly closeWatcher = createCloseWatcher(\n () => this.handleCloseRequest(),\n injectWindow(),\n );\n\n constructor() {\n afterNextRender(() => this.domReady.set(true));\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.clearEscapeKey();\n this.closeWatcher.disarm();\n this.releaseTrailingClick?.();\n });\n\n inject(CngxClickOutside, { self: true }).clickOutside.subscribe(() => {\n if (untracked(this.engagedPage)) {\n this.swallowTrailingClick();\n }\n this.requestDismiss();\n });\n\n effect((onCleanup) => {\n if (!this.isActive()) {\n return;\n }\n untracked(() => {\n this.doc.addEventListener('keydown', this.escapeKeydown, true);\n this.closeWatcher.arm();\n });\n onCleanup(() => {\n this.doc.removeEventListener('keydown', this.escapeKeydown, true);\n this.clearEscapeKey();\n this.closeWatcher.disarm();\n });\n });\n\n effect((onCleanup) => {\n const modality = this.engagedModality();\n if (!this.domReady() || modality === 'none') {\n return;\n }\n const release = untracked(() =>\n modality === 'page' ? this.holdPageScope() : this.holdContainedScope(),\n );\n onCleanup(release);\n });\n }\n\n private holdPageScope(): () => void {\n const releaseInert = createInertSiblings(this.host, { scope: 'outside' });\n const releaseLock = createScrollLock(this.scrollScope(this.doc.documentElement));\n return () => {\n releaseInert();\n releaseLock();\n };\n }\n\n // No trap: focus moves in once, Tab may leave for the live page around\n // the boundary. The trap's focusFirst() waits for the render that drops\n // the closed panel's inert.\n private holdContainedScope(): () => void {\n const boundary = this.containedBoundary();\n const id = this.host.id;\n const releaseInert = createInertSiblings(this.host, {\n scope: 'outside',\n within: boundary,\n keepLive: id ? `[aria-controls~=\"${id.replace(/[\"\\\\]/g, '\\\\$&')}\"]` : undefined,\n });\n const scroller = this.scrollScope(null, boundary);\n const releaseLock = scroller ? createScrollLock(scroller) : null;\n this.focusTrap.focusFirst();\n return () => {\n releaseInert();\n releaseLock?.();\n };\n }\n\n private containedBoundary(): HTMLElement {\n const named = this.driver()?.surfaceBoundary?.();\n if (named && named !== this.host && named.contains(this.host)) {\n return named;\n }\n return this.host.parentElement ?? this.doc.body;\n }\n\n // An inner surface or an open popover inside the host takes the keypress\n // first; one Escape dismisses one layer.\n protected handleEscape(event: Event): void {\n if (!this.isActive() || escapeOwnedAbove(event, this.host)) {\n return;\n }\n claimEscape(event);\n this.emitDismiss();\n }\n\n private clearEscapeKey(): void {\n if (this.escapeKeyTimer !== null) {\n clearTimeout(this.escapeKeyTimer);\n this.escapeKeyTimer = null;\n }\n }\n\n private handleCloseRequest(): void {\n if (this.escapeKeyTimer === null) {\n this.emitDismiss();\n }\n this.rearmIfEngaged();\n }\n\n // One shot: the next click is the trailing one of the dismissing gesture.\n // A gesture that ends without a click (a scroll, a cancelled touch) is\n // followed by a pointerdown or a keydown before any later click, so either\n // drops the guard. Listeners added during the dismissing pointerdown's\n // bubble phase do not see that same event.\n private swallowTrailingClick(): void {\n this.releaseTrailingClick?.();\n const doc = this.doc;\n const swallow = (event: Event): void => {\n event.preventDefault();\n event.stopImmediatePropagation();\n release();\n };\n const release = (): void => {\n doc.removeEventListener('click', swallow, true);\n doc.removeEventListener('pointerdown', release, true);\n doc.removeEventListener('keydown', release, true);\n this.releaseTrailingClick = null;\n };\n doc.addEventListener('click', swallow, true);\n doc.addEventListener('pointerdown', release, true);\n doc.addEventListener('keydown', release, true);\n this.releaseTrailingClick = release;\n }\n\n private requestDismiss(): void {\n this.emitDismiss();\n this.rearmIfEngaged();\n }\n\n private emitDismiss(): void {\n this.dismiss.emit();\n this.driver()?.surfaceDismiss();\n }\n\n // A blocked dismissal leaves the surface engaged; the spent watcher would\n // let the next back gesture leave the page.\n private rearmIfEngaged(): void {\n if (!this.destroyed && untracked(this.isActive)) {\n this.closeWatcher.arm();\n }\n }\n\n // The nearest ancestor with a scrolling overflow-y, searched up to `stop`\n // (inclusive) or to the document root.\n private scrollScope<T extends HTMLElement | null>(\n fallback: T,\n stop?: HTMLElement,\n ): HTMLElement | T {\n const view = this.doc.defaultView;\n let node = this.host.parentElement;\n while (node && node !== this.doc.body && node !== this.doc.documentElement) {\n const overflowY = view?.getComputedStyle(node).overflowY ?? '';\n if (SCROLLING_OVERFLOW.has(overflowY)) {\n return node;\n }\n if (node === stop) {\n break;\n }\n node = node.parentElement;\n }\n return fallback;\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n input,\n type OnChanges,\n type OnInit,\n untracked,\n} from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\nimport type { DrawerPosition } from './drawer.directive';\nimport {\n CNGX_DRAWER_HOST,\n type CngxDrawerHost,\n type CngxDrawerPanelPresentation,\n} from './drawer-host';\nimport {\n CNGX_DRAWER_SURFACE_DRIVER,\n type CngxDrawerModality,\n CngxDrawerSurface,\n type CngxDrawerSurfaceDriver,\n} from './drawer-surface.directive';\n\n/**\n * How the drawer panel interacts with the content area.\n */\nexport type DrawerMode = 'over' | 'push';\n\n/**\n * The sliding panel of a drawer. Reads its open state from an explicit\n * `[cngxDrawerPanel]` reference, or from the `CNGX_DRAWER_HOST` a\n * `CngxDrawer` on the same element provides when the attribute is bare - no\n * ancestor injection. Both go through the `CngxDrawerHost` contract, never\n * the concrete `CngxDrawer` class.\n *\n * The open panel is a transient surface (`CngxDrawerSurface`): Escape, the\n * Android back gesture and a press outside the panel close the drawer\n * (`closeOnClickOutside`, default `true`). A press on the trigger whose\n * `aria-controls` names the panel `id` is not outside, so the trigger\n * toggles the drawer itself. While closed the panel\n * is `aria-hidden` AND `inert`. On close, focus returns to the element that\n * was focused when the drawer opened - unless the user moved focus to\n * another element themselves.\n *\n * **Modality.** `modality` defaults to `'page'` for `over` and `'none'` for\n * `push`:\n *\n * - `'page'`: the open panel traps focus, renders `role=\"dialog\"` +\n * `aria-modal=\"true\"` (named by `label`, else a static `aria-label` /\n * `aria-labelledby`, else `CNGX_LAYOUT_I18N.drawerDialog`), makes\n * everything outside it `inert` up to `<body>`\n * (focus-trap anchors, live regions and a visible backdrop stay live) and\n * locks scrolling on the nearest scroll container above it (else the\n * document root). The full-height drawer that covers the app header.\n * - `'contained'`: the same inside the `[cngxDrawer]` host only. The\n * panel's siblings inside the host are `inert` and a scroll container\n * between the panel and the host is locked; everything outside the host\n * stays live. No trap and no `aria-modal`: focus moves into the panel on\n * open, returns to the opener on close, and Tab can reach the page\n * around the host. The clipped drawer below a live app header: place the\n * header outside `[cngxDrawer]`.\n * - `'none'`: the page around the panel stays operable.\n *\n * `push` is never modal: it lays the panel out next to the content, which\n * stays in use; `'page'` or `'contained'` with `push` resolve to `'none'`\n * and warn [`CNGX1076`](/error-codes/cngx1076.md) in development.\n *\n * **Scrim.** The panel renders `cngx-drawer-panel--modal` while its\n * resolved modality is `'page'` or `'contained'` (plus\n * `cngx-drawer-panel--contained` for the latter). The opt-in stylesheet\n * `cngx-drawer.css` skins the panel from its classes: add the `cngx-drawer`\n * class to the `[cngxDrawer]` host and the panel sits on its `position`\n * side with a surface and a border toward the content, slides in (in\n * `push` mode the content moves aside by its size), and the host shows a scrim over itself\n * while a modal panel inside it is open (`--cngx-drawer-scrim-bg`, default\n * `--cngx-backdrop-bg`). A press on the scrim is a press outside the panel\n * and closes the drawer. The panel sits above the scrim\n * (`--cngx-drawer-panel-z-index`, `2`, over `--cngx-drawer-scrim-z-index`,\n * `1`).\n *\n * The `role` input (landmark while not an open page modal) defaults to\n * `complementary`. On a `<nav>` host pass `[role]=\"null\"` so the implicit\n * navigation landmark survives:\n *\n * ```html\n * <button aria-controls=\"nav-panel\" [attr.aria-expanded]=\"drawer.opened()\"\n * (click)=\"drawer.toggle()\">Menu</button>\n * <nav id=\"nav-panel\" [cngxDrawerPanel]=\"drawer\" position=\"left\" mode=\"over\" [role]=\"null\">\n * <a href=\"/home\">Home</a>\n * </nav>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-panel.directive.ts\n * @since 0.3.0\n * @relatedTo CngxDrawer, CngxDrawerContent, CngxFocusTrap\n * <example-url>/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>/#/common/layout/drawer/app-header-clipped</example-url>\n * <example-url>/#/common/layout/drawer/full-height-modal</example-url>\n * <example-url>/#/common/layout/drawer/filter-panel-push</example-url>\n * <example-url>/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerPanel]',\n exportAs: 'cngxDrawerPanel',\n standalone: true,\n hostDirectives: [{ directive: CngxDrawerSurface, inputs: ['label'], outputs: [] }],\n providers: [{ provide: CNGX_DRAWER_SURFACE_DRIVER, useExisting: CngxDrawerPanel }],\n host: {\n '[class.cngx-drawer-panel]': 'true',\n '[class.cngx-drawer-panel--open]': 'isOpen()',\n '[class.cngx-drawer-panel--left]': \"position() === 'left'\",\n '[class.cngx-drawer-panel--right]': \"position() === 'right'\",\n '[class.cngx-drawer-panel--top]': \"position() === 'top'\",\n '[class.cngx-drawer-panel--bottom]': \"position() === 'bottom'\",\n '[class.cngx-drawer-panel--over]': \"mode() === 'over'\",\n '[class.cngx-drawer-panel--push]': \"mode() === 'push'\",\n '[class.cngx-drawer-panel--modal]': \"surfaceModality() !== 'none'\",\n '[class.cngx-drawer-panel--contained]': \"surfaceModality() === 'contained'\",\n '[attr.id]': 'panelId()',\n '[attr.aria-hidden]': 'isOpen() ? null : true',\n '[attr.inert]': \"isOpen() ? null : ''\",\n },\n})\nexport class CngxDrawerPanel implements CngxDrawerSurfaceDriver, OnInit, OnChanges {\n /**\n * The drawer state owner (a `CngxDrawer`, or anything implementing\n * `CngxDrawerHost`). Bind it explicitly (`[cngxDrawerPanel]=\"drawer\"`), or\n * leave the attribute bare on an element that also carries `cngxDrawer`.\n */\n readonly drawerInput = input<CngxDrawerHost | undefined, CngxDrawerHost | '' | undefined>(\n undefined,\n {\n alias: 'cngxDrawerPanel',\n transform: (v) => (typeof v === 'string' ? undefined : v),\n },\n );\n\n /** Direction the panel slides from. */\n readonly position = input<DrawerPosition>('left');\n\n /**\n * How the panel interacts with the content area:\n * - `'over'` (default) - overlays content (absolute positioned)\n * - `'push'` - pushes content aside (content gets margin)\n */\n readonly mode = input<DrawerMode>('over');\n\n /**\n * How much of the page the open panel blocks:\n *\n * - `'page'`: the whole page is blocked. The panel is a modal dialog,\n * focus is trapped in it and everything outside it is `inert` up to\n * `<body>`.\n * - `'contained'`: only the `[cngxDrawer]` host is blocked. The content\n * beside the panel is `inert` and scroll-locked, everything outside the\n * host (an app header above it) stays clickable, and focus moves into\n * the panel without being trapped.\n * - `'none'`: nothing is blocked. No `inert`, no lock, no trap.\n *\n * With the `cngx-drawer` stylesheet, `'page'` and `'contained'` show a\n * scrim over the `[cngxDrawer]` host. Unbound, it follows the mode: `over`\n * is `'page'`, `push` is `'none'`. `push` never blocks: `'page'` or\n * `'contained'` with `push` resolve to `'none'` and warn [`CNGX1076`](/error-codes/cngx1076.md) in\n * development. See {@link CngxDrawerModality}.\n */\n readonly modality = input<CngxDrawerModality | undefined>(undefined);\n\n /** Whether a press outside the panel closes the drawer. */\n readonly closeOnClickOutside = input<boolean>(true);\n\n /**\n * Landmark role rendered on the panel while it is not an open page modal\n * (an open `'page'` panel is a `dialog`; a `'contained'` one keeps this\n * role). Defaults to `complementary`; pass `navigation` for nav drawers or\n * `null` to keep the element's implicit role (e.g. on a `<nav>` host).\n */\n readonly role = input<string | null>('complementary');\n\n private readonly hostDrawer = inject(CNGX_DRAWER_HOST, { self: true, optional: true });\n\n /** The resolved drawer: the explicit reference wins over a drawer host on the element. */\n readonly drawerRef = computed(() => this.drawerInput() ?? this.hostDrawer);\n\n private readonly staticId = inject(new HostAttributeToken('id'), { optional: true });\n\n /** The panel's `id`: a static `id` attribute wins over the drawer's `panelId`. */\n protected readonly panelId = computed(() => {\n const fromDrawer = this.drawerRef()?.panelId();\n if (this.staticId !== null) {\n return this.staticId;\n }\n return fromDrawer === undefined || fromDrawer === '' ? null : fromDrawer;\n });\n\n /** Whether the drawer is currently open (derived from the drawer ref). */\n readonly isOpen = computed(() => this.drawerRef()?.opened() ?? false);\n\n /** @internal Drives the composed `CngxDrawerSurface`. */\n readonly surfaceActive = this.isOpen;\n /** @internal Drives the composed `CngxDrawerSurface`. */\n readonly surfaceModality = computed<CngxDrawerModality>(() =>\n this.mode() === 'push' ? 'none' : (this.modality() ?? 'page'),\n );\n /** @internal Drives the composed `CngxDrawerSurface`: the `[cngxDrawer]` host. */\n readonly surfaceBoundary = computed<HTMLElement | null>(\n () => this.drawerRef()?.elementRef.nativeElement ?? null,\n );\n /** @internal Drives the composed `CngxDrawerSurface`. */\n readonly surfaceLandmarkRole = this.role;\n\n private readonly presentation: CngxDrawerPanelPresentation = {\n mode: this.mode,\n modal: computed(() => this.surfaceModality() !== 'none'),\n position: this.position,\n element: inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n };\n /** @internal Drives the composed `CngxDrawerSurface`. */\n readonly surfaceOutsideDismiss = this.closeOnClickOutside;\n\n private connection: { readonly drawer: CngxDrawerHost; readonly disconnect: () => void } | null =\n null;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.disconnect());\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n effect(() => {\n const requested = this.modality();\n if (this.mode() !== 'push' || requested === undefined || requested === 'none') {\n return;\n }\n untracked(() =>\n cngxDevWarn(\n 'CNGX1076',\n '[cngxDrawerPanel] mode=\"push\" is never modal; a page or contained modality resolves to \"none\". ' +\n 'A push drawer lays out next to the content, which stays in use. ' +\n 'Use mode=\"over\" for a modal drawer.',\n { modality: requested },\n ),\n );\n });\n }\n }\n\n // Connecting registers the presentation in the drawer's slot, a signal\n // write; lifecycle hooks are no reactive context. ngOnChanges follows a\n // rebound reference, ngOnInit covers a panel without bound inputs.\n ngOnChanges(): void {\n this.syncConnection();\n }\n\n ngOnInit(): void {\n this.syncConnection();\n }\n\n private syncConnection(): void {\n const drawer = untracked(this.drawerRef);\n if (this.connection?.drawer === drawer) {\n return;\n }\n this.disconnect();\n if (drawer) {\n this.connection = { drawer, disconnect: drawer.connectPanel(this.presentation) };\n }\n }\n\n private disconnect(): void {\n const connection = this.connection;\n this.connection = null;\n connection?.disconnect();\n }\n\n /** @internal Drives the composed `CngxDrawerSurface`. */\n surfaceDismiss(): void {\n this.drawerRef()?.close();\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport type { CngxDrawer } from './drawer.directive';\n\n/**\n * Marks the main content area adjacent to a drawer panel.\n *\n * Adds a CSS class when the drawer is open so the consumer can offset\n * the content via CSS transitions or transforms. While a `push` panel is\n * open it also writes `data-drawer-push` with the panel's side (`left`,\n * `right`, `top`, `bottom`); `cngx-drawer.css` moves the content aside by\n * the panel size from it, so the panel itself slides at full size.\n *\n * ```html\n * <main [cngxDrawerContent]=\"drawer\">\n * Page content\n * </main>\n * ```\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/drawer/drawer-content.directive.ts\n * @since 0.3.0\n * @relatedTo CngxDrawer, CngxDrawerPanel\n * <example-url>/#/common/layout/drawer/basic-scroll-lock-backdrop</example-url>\n * <example-url>/#/common/layout/drawer/controlled-mode</example-url>\n * <example-url>/#/common/layout/drawer/direction-all-four-sides</example-url>\n * <example-url>/#/common/layout/drawer/events-openedchange-closed</example-url>\n * <example-url>/#/common/layout/drawer/app-header-clipped</example-url>\n * <example-url>/#/common/layout/drawer/full-height-modal</example-url>\n * <example-url>/#/common/layout/drawer/filter-panel-push</example-url>\n * <example-url>/#/common/layout/drawer/pattern-consumer-wiring</example-url>\n */\n@Directive({\n selector: '[cngxDrawerContent]',\n exportAs: 'cngxDrawerContent',\n standalone: true,\n host: {\n '[class.cngx-drawer-content]': 'true',\n '[class.cngx-drawer-content--shifted]': 'isOpen()',\n '[attr.data-drawer-push]': 'pushSide()',\n },\n})\nexport class CngxDrawerContent {\n /** Reference to the parent `CngxDrawer` state owner. */\n readonly drawerRef = input.required<CngxDrawer>({ alias: 'cngxDrawerContent' });\n\n /** Whether the drawer is currently open (derived from the drawer ref). */\n readonly isOpen = computed(() => this.drawerRef().opened());\n\n /** Side of the open `push` panel the content gives way to; `null` otherwise. */\n protected readonly pushSide = computed(() => {\n const drawer = this.drawerRef();\n const pushing = drawer.opened() && drawer.mode() === 'push';\n return pushing ? drawer.side() : null;\n });\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Observes whether the host element is visible in the viewport or a scroll container.\n *\n * Wraps the browser's `IntersectionObserver` API and exposes its state as\n * Angular signals. The observer is automatically recreated when `root`,\n * `rootMargin`, or `threshold` inputs change, and disconnected on destroy.\n *\n * Use cases: lazy loading images, infinite scroll sentinels, scroll-triggered\n * animations, \"back to top\" buttons, analytics viewport tracking.\n *\n * ### Lazy load sentinel\n * ```html\n * <div cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * (entered)=\"loadNextPage()\">\n * @if (io.isIntersecting()) { Loading... }\n * </div>\n * ```\n *\n * ### Scroll-triggered animation\n * ```html\n * <section cngxIntersectionObserver #io=\"cngxIntersectionObserver\"\n * [threshold]=\"0.5\"\n * [class.visible]=\"io.isIntersecting()\">\n * Content fades in at 50% visibility\n * </section>\n * ```\n *\n * ### Custom scroll container\n * ```html\n * <div cngxIntersectionObserver [root]=\"'.scroll-container'\" [rootMargin]=\"'100px'\">\n * Observed within a scrollable parent\n * </div>\n * ```\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/intersection-observer.directive.ts\n * @since 0.3.0\n * @relatedTo CngxResizeObserver, CngxMediaQuery, CngxInfiniteScroll, CngxScrollSpy\n * <example-url>/#/common/layout/intersection-observer/scroll-sentinel</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxIntersectionObserver]',\n exportAs: 'cngxIntersectionObserver',\n standalone: true,\n})\nexport class CngxIntersectionObserver {\n /** CSS selector for the scroll container root. `null` (default) uses the viewport. */\n readonly root = input<string | null>(null);\n /** Margin around the root, using CSS margin syntax (e.g. `'100px 0px'`). */\n readonly rootMargin = input<string>('0px');\n /** Visibility ratio(s) at which the callback fires. `0` = any pixel visible, `1` = fully visible. */\n readonly threshold = input<number | number[]>(0);\n\n private readonly entryState = signal<IntersectionObserverEntry | null>(null);\n\n /** `true` when any part of the element is visible within the root. */\n readonly isIntersecting = computed(() => this.entryState()?.isIntersecting ?? false);\n /** The fraction of the element currently visible (0–1). */\n readonly intersectionRatio = computed(() => this.entryState()?.intersectionRatio ?? 0);\n\n /** Emitted on every intersection change with the raw `IntersectionObserverEntry`. */\n readonly intersectionChange = output<IntersectionObserverEntry>();\n /** Emitted once when the element enters the observed area. */\n readonly entered = output<void>();\n /** Emitted once when the element leaves the observed area. */\n readonly left = output<void>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (typeof ngDevMode !== 'undefined' && ngDevMode && root && !resolvedRoot) {\n cngxDevWarn(\n 'CNGX1032',\n `[cngxIntersectionObserver] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n const wasIntersecting = this.entryState()?.isIntersecting ?? false;\n this.entryState.set(entry);\n this.intersectionChange.emit(entry);\n if (entry.isIntersecting && !wasIntersecting) {\n this.entered.emit();\n }\n if (!entry.isIntersecting && wasIntersecting) {\n this.left.emit();\n }\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Directive, effect, inject, input, signal } from '@angular/core';\nimport { observeMediaQuery } from '@cngx/core/utils';\n\n/**\n * Reactive media query directive that exposes a `matches` signal.\n *\n * Wraps `window.matchMedia()` with automatic cleanup. Usable for\n * responsive layouts, drawer mode switching, conditional rendering,\n * or any behavior that depends on viewport/preference queries.\n *\n * ### Responsive drawer mode\n * ```html\n * <div cngxMediaQuery=\"(min-width: 1024px)\" #mq=\"cngxMediaQuery\">\n * <nav [cngxDrawerPanel]=\"drawer\"\n * [mode]=\"mq.matches() ? 'push' : 'over'\">\n * …\n * </nav>\n * </div>\n * ```\n *\n * ### Conditional content\n * ```html\n * <div cngxMediaQuery=\"(prefers-color-scheme: dark)\" #dark=\"cngxMediaQuery\">\n * @if (dark.matches()) { <span>Dark mode active</span> }\n * </div>\n * ```\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/media-query.directive.ts\n * @since 0.3.0\n * @relatedTo CngxResizeObserver, CngxIntersectionObserver\n * <example-url>/#/common/layout/media-query/viewport-breakpoints</example-url>\n * <example-url>/#/ui/breadcrumb/recipes/mobile-parent-only</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxMediaQuery]',\n exportAs: 'cngxMediaQuery',\n standalone: true,\n})\nexport class CngxMediaQuery {\n /** The CSS media query string to evaluate. */\n readonly query = input.required<string>({ alias: 'cngxMediaQuery' });\n\n private readonly matchesState = signal(false);\n private readonly win = inject(DOCUMENT).defaultView;\n\n /** Whether the media query currently matches. */\n readonly matches = this.matchesState.asReadonly();\n\n constructor() {\n effect((onCleanup) => {\n onCleanup(\n observeMediaQuery(this.win, this.query(), (matches) => this.matchesState.set(matches)),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, inject, type Signal } from '@angular/core';\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\n/**\n * Inject-form of {@link CngxMediaQuery}: returns a reactive\n * `Signal<boolean>` that reflects whether the host window currently matches\n * a CSS media query, without needing a host element.\n *\n * Use it where the directive form has nowhere to attach - inside a route\n * guard, a store, a `computed()`, or any injection context that reacts to a\n * viewport or preference query. For host-bound templates, prefer the\n * `[cngxMediaQuery]` directive; for pure styling, prefer CSS `@media` /\n * `@container`.\n *\n * Wraps `window.matchMedia()`: seeds the signal from `MediaQueryList.matches`,\n * updates on the `change` event, and removes the listener via `DestroyRef`\n * when the injection scope is destroyed. In SSR / non-DOM environments (no\n * `defaultView` or no `matchMedia`) it returns a static `false` signal and\n * wires no listener, so it never throws off the browser.\n *\n * Returns a `Signal<boolean>` - never an `Observable`; the reactive boundary\n * stays inside cngx.\n *\n * ```typescript\n * @Component({ … })\n * export class Dashboard {\n * private readonly compact = injectMediaQuery('(max-width: 640px)');\n * protected readonly layout = computed(() => (this.compact() ? 'stacked' : 'grid'));\n * }\n * ```\n *\n * @param query A CSS media query string, e.g. `(max-width: 640px)`.\n * @returns A reactive `Signal<boolean>` tracking the query's match state.\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/inject-media-query.ts\n * @since 0.3.0\n * @relatedTo CngxMediaQuery, CngxResizeObserver\n * <example-url>/#/common/layout/media-query/inject-breakpoint-signal</example-url>\n */\nexport function injectMediaQuery(query: string): Signal<boolean> {\n return createMediaQuerySignal(query, inject(DestroyRef), inject(DOCUMENT).defaultView);\n}\n","import { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Dev-warning the query-param sync kernel emits when `@angular/router` is\n * not provided. Mirrors {@link warnTabsRouterAbsent} in `@cngx/common/tabs`\n * so the message stays identical across the two sync surfaces; only the\n * `enables` clause differs. A deliberate small copy rather than a shared\n * import - sharing would force the helper onto a `public-api.ts`, and\n * `warn*` matches no approved public-API prefix.\n *\n * @internal\n */\nexport function warnRouterAbsent(enables: string): void {\n if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {\n return;\n }\n cngxDevWarn(\n 'CNGX1031',\n `injectQueryParamSync(): no Router / ActivatedRoute available - the URL sync is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n","import { effect, inject, untracked, type Signal, type WritableSignal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { coerceSignal } from '@cngx/core/utils';\n\nimport { warnRouterAbsent } from './warn-router-absent';\n\n/**\n * Options for {@link injectQueryParamSync}.\n *\n * `param` accepts a live `Signal<string>` so a bound `[param]` rename stays\n * reactive; a plain string is wrapped internally. `serialize`/`deserialize`\n * default to a boolean codec (`true` -> `'open'`, absence -> `false`); pass an\n * identity codec (`v => v ?? null` / `raw => raw`) to sync string ids.\n */\nexport interface QueryParamSyncOptions<T = boolean> {\n /** Query-param key. A `Signal<string>` keeps a bound rename live. */\n readonly param: string | Signal<string>;\n /** `T` -> URL string, or `null` to remove the key. Default: boolean codec. */\n readonly serialize?: (value: T) => string | null;\n /** URL string (or `null` when absent) -> `T`. Default: boolean codec. */\n readonly deserialize?: (raw: string | null) => T;\n /** Invoked with the rejection reason when `router.navigate` rejects. */\n readonly onSyncError?: (err: unknown) => void;\n}\n\n/**\n * Bidirectional sync between a caller-owned `WritableSignal<T>` and a named\n * query param. URL wins on initial load (deep-link intent); after hydrate the\n * signal is the source and reflects outward. Re-hydrates on browser\n * back/forward. Dev-warns once and no-ops when `@angular/router` is absent.\n *\n * The key, the initial hydrate and the bookkeeping are resolved on the first\n * effect run, not in the call: a `Signal<string>` key backed by an input is\n * read after the input is bound, and in a directive the hydrated state is in\n * place before the caller's view first renders. A read of `state()` in the\n * caller's constructor or `ngOnInit` still sees the un-hydrated value. Called\n * from an environment injector (a service, `runInInjectionContext`), the\n * effects are root effects: `state()` is hydrated on the first application\n * tick, not when the call returns.\n *\n * Loop-safety (the core of this helper): the reflect effect writes the URL in\n * `untracked()` and skips `navigate` when the serialized `state()` equals the\n * last value it wrote - a local closure seeded from the initial URL read, not\n * the live URL param (the live param races the navigate-settle window). The\n * hydrate path updates that same closure whenever it accepts a URL value, so\n * back/forward re-hydration never triggers a reflex navigate. A `param` rename\n * is migrated in one navigate (`{ [old]: null, [new]: serialize(state()) }`)\n * by a dedicated effect whose only tracked source is the normalized param\n * signal; its first run finds the key `init()` seeded and never navigates.\n *\n * The `state.set` inside the hydrate effect is a deliberate signal-write-in-\n * effect: the URL is an external system and `state` is a caller-owned signal\n * the consumer must stay able to toggle, so hydrate cannot be a `computed`. It\n * is edge-guarded by serialized equality and wrapped in `untracked()`.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/router/inject-query-param-sync.ts\n * @since 0.3.0\n * @relatedTo CngxStepperRouterSync\n * <example-url>/#/common/layout/router/persisted-toggle</example-url>\n */\nexport function injectQueryParamSync<T = boolean>(\n state: WritableSignal<T>,\n opts: QueryParamSyncOptions<T>,\n): void {\n const router = inject(Router, { optional: true });\n // Router is providedIn: 'root' and resolves without provideRouter(...);\n // ActivatedRoute does not, so it is the \"router is set up\" signal.\n const route = inject(ActivatedRoute, { optional: true });\n\n if (!router || !route) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n warnRouterAbsent('query-param URL sync');\n }\n return;\n }\n\n const paramSignal: Signal<string> = coerceSignal(opts.param);\n const serialize: (value: T) => string | null =\n opts.serialize ?? ((value) => (value ? 'open' : null));\n const deserialize: (raw: string | null) => T = opts.deserialize ?? ((raw) => (raw != null) as T);\n\n // Closure bookkeeping, seeded by `init()` from the initial URL read.\n // `lastWritten` is the serialized value the reflect path last pushed to the\n // URL; the hydrate path also updates it so an accepted URL value is not\n // reflected back.\n let lastWritten: string | null = null;\n let previousParam = '';\n let initialized = false;\n\n // Runs once, on the first run of whichever effect runs first, so an\n // input-backed key is read after binding. URL wins on initial load.\n const init = (): void => {\n if (initialized) {\n return;\n }\n initialized = true;\n previousParam = paramSignal();\n lastWritten = route.snapshot.queryParamMap.get(previousParam) ?? null;\n if (lastWritten != null) {\n const hydrated = deserialize(lastWritten);\n if (!Object.is(hydrated, state())) {\n state.set(hydrated);\n }\n }\n };\n\n // Reflect: signal change -> URL. Tracks `state()` only; param read untracked.\n effect(() => {\n untracked(init);\n const raw = serialize(state());\n untracked(() => {\n if (raw === lastWritten) {\n return;\n }\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [paramSignal()]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n\n // Re-hydrate: URL change (back/forward) -> signal. Tracks the query-param\n // emission only; param and state reads are untracked. The first run mirrors\n // the initial snapshot already handled by `init()`, so it is skipped\n // - processing it would race the reflect effect's still-pending initial\n // navigate and reset `state` to a stale value. Later runs skip our own\n // reflect echo via the `lastWritten` guard.\n const queryMap = toSignal(route.queryParamMap, {\n initialValue: route.snapshot.queryParamMap,\n });\n let hydrateInitialized = false;\n effect(() => {\n const map = queryMap();\n untracked(() => {\n init();\n if (!hydrateInitialized) {\n hydrateInitialized = true;\n return;\n }\n const raw = map.get(paramSignal()) ?? null;\n if (raw === lastWritten) {\n return;\n }\n const next = deserialize(raw);\n if (!Object.is(next, state())) {\n state.set(next);\n }\n lastWritten = raw;\n });\n });\n\n // Rename migration: param change -> one merged navigate that removes the old\n // key and writes the current value under the new one. Tracks the param\n // signal only; the first run finds the `previousParam` `init()` seeded and\n // never navigates.\n effect(() => {\n const param = paramSignal();\n untracked(() => {\n init();\n if (param === previousParam) {\n return;\n }\n const oldParam = previousParam;\n previousParam = param;\n const raw = serialize(state());\n lastWritten = raw;\n router\n .navigate([], {\n queryParams: { [oldParam]: null, [param]: raw },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch((err: unknown) => opts.onSyncError?.(err));\n });\n });\n}\n","import { type DestroyRef, signal, type Signal } from '@angular/core';\n\n/**\n * Structural window surface the resize helpers read: `window`, `globalThis`,\n * or a test double. `ResizeObserver` is optional so SSR and jsdom hosts pass\n * the type and hit the runtime guard instead.\n *\n * @since 0.3.0\n */\nexport interface ResizeObserverHost {\n ResizeObserver?: typeof ResizeObserver;\n}\n\n/** @internal Whether `host` can observe at all: false on SSR and jsdom hosts. */\nexport function canObserveResize(\n host: ResizeObserverHost | null | undefined,\n): host is Required<ResizeObserverHost> {\n return typeof host?.ResizeObserver === 'function';\n}\n\n/**\n * Subscribes `apply` to size changes of `element` on `host`.\n *\n * Re-applies on every observation and returns the teardown that disconnects\n * the observer. On a host without `ResizeObserver` (SSR, jsdom) nothing is\n * wired, `apply` never fires, and the returned teardown is a no-op. Unlike the\n * media-query twin there is no synchronous seed: the first size is whatever the\n * observer reports after the next layout.\n *\n * Reach for this low-level form when the observed element or the box model is\n * reactive and the subscription must follow it (re-wire per `effect` run via\n * `onCleanup`); for a static target, {@link createResizeSignal} owns the\n * teardown via `DestroyRef`.\n *\n * @param host The window-like object to read `ResizeObserver` from.\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param apply Receives the first entry of every observation batch.\n * @returns Teardown that disconnects the observer.\n * @relatedTo createResizeSignal, observeMediaQuery\n * @since 0.3.0\n */\nexport function observeResize(\n host: ResizeObserverHost | null | undefined,\n element: Element,\n box: ResizeObserverBoxOptions,\n apply: (entry: ResizeObserverEntry) => void,\n): () => void {\n if (!canObserveResize(host)) {\n return () => undefined;\n }\n const observer = new host.ResizeObserver((entries) => apply(entries[0]));\n observer.observe(element, { box });\n return () => observer.disconnect();\n}\n\n/**\n * Creates a `Signal<ResizeObserverEntry | null>` that carries the most recent\n * observation of `element`, `null` until the first one arrives.\n *\n * Disconnects when `destroyRef` is destroyed. On a host without\n * `ResizeObserver` (SSR, jsdom) the signal stays `null` and no observer is\n * created, so it never throws off the browser.\n *\n * This is the shared kernel behind `CngxResizeObserver` and\n * `createContainerSize`; consumers that hand-roll a `ResizeObserver` should\n * route through it instead.\n *\n * ```typescript\n * const entry = createResizeSignal(\n * host,\n * 'border-box',\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const width = computed(() => entry()?.borderBoxSize[0]?.inlineSize ?? 0);\n * ```\n *\n * @param element The element to observe.\n * @param box Which box model to report.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param host The window-like object to read `ResizeObserver` from.\n * @returns A readonly signal carrying the latest entry.\n * @relatedTo observeResize, createMediaQuerySignal\n * @since 0.3.0\n */\nexport function createResizeSignal(\n element: Element,\n box: ResizeObserverBoxOptions,\n destroyRef: DestroyRef,\n host: ResizeObserverHost | null | undefined,\n): Signal<ResizeObserverEntry | null> {\n const entry = signal<ResizeObserverEntry | null>(null);\n const unsubscribe = observeResize(host, element, box, (value) => entry.set(value));\n destroyRef.onDestroy(unsubscribe);\n return entry.asReadonly();\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from './resize-signal';\n\n/**\n * Observes size changes of the host element via the `ResizeObserver` API.\n *\n * Exposes `width()`, `height()`, `contentRect()`, and `isReady()` as Angular\n * signals that update on every resize. The observer is automatically\n * disconnected on destroy and recreated when the `box` input changes.\n *\n * Use cases: responsive component logic in TypeScript (not just CSS),\n * container queries without CSS support, dynamic canvas/chart sizing,\n * resize-aware layouts.\n *\n * ### Display current size\n * ```html\n * <div cngxResizeObserver #ro=\"cngxResizeObserver\" style=\"resize: horizontal; overflow: auto;\">\n * {{ ro.width() | number:'1.0-0' }} × {{ ro.height() | number:'1.0-0' }} px\n * </div>\n * ```\n *\n * ### Responsive logic in TypeScript\n * ```typescript\n * readonly ro = viewChild(CngxResizeObserver);\n * readonly columns = computed(() => (this.ro()?.width() ?? 0) > 600 ? 3 : 1);\n * ```\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/resize-observer.directive.ts\n * @since 0.3.0\n * @relatedTo CngxIntersectionObserver, CngxMediaQuery\n * <example-url>/#/common/layout/resize-observer/live-size</example-url>\n * <example-url>/#/ui/breadcrumb/recipes/responsive-collapse</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxResizeObserver]',\n exportAs: 'cngxResizeObserver',\n standalone: true,\n})\nexport class CngxResizeObserver {\n /** Which box model to observe. `'content-box'` (default), `'border-box'`, or `'device-pixel-content-box'`. */\n readonly box = input<ResizeObserverBoxOptions>('content-box');\n\n private readonly entryState = signal<ResizeObserverEntry | null>(null);\n\n /** The full `DOMRectReadOnly` of the content box. `null` before first observation. */\n readonly contentRect = computed(() => this.entryState()?.contentRect ?? null);\n /** Current width in pixels. `0` before first observation. */\n readonly width = computed(() => this.entryState()?.contentRect.width ?? 0);\n /** Current height in pixels. `0` before first observation. */\n readonly height = computed(() => this.entryState()?.contentRect.height ?? 0);\n /** `true` after the first resize observation has been received. */\n readonly isReady = computed(() => this.entryState() !== null);\n\n /** Emitted on every resize with the raw `ResizeObserverEntry`. */\n readonly resize = output<ResizeObserverEntry>();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n\n // One subscription per `box` value: `onCleanup` disconnects the previous\n // observer before `observeResize` wires the next, which is also the\n // teardown on destroy. The kernel no-ops when the host ships no\n // `ResizeObserver` (SSR, jsdom), so no host guard is needed here.\n effect((onCleanup) => {\n onCleanup(\n observeResize(win, this.el.nativeElement as HTMLElement, this.box(), (entry) => {\n this.entryState.set(entry);\n this.resize.emit(entry);\n }),\n );\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n type DestroyRef,\n DestroyRef as DestroyRefToken,\n ElementRef,\n inject,\n InjectionToken,\n type Signal,\n} from '@angular/core';\n\nimport { canObserveResize, createResizeSignal, type ResizeObserverHost } from './resize-signal';\n\n/**\n * Reactive read of a query container: its size, and the custom properties its\n * `@container` rules resolved to.\n *\n * @since 0.3.0\n */\nexport interface CngxContainerSize {\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize: Signal<number>;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize: Signal<number>;\n /** `true` once the first observation has arrived. */\n readonly isReady: Signal<boolean>;\n /**\n * `false` on a host without `ResizeObserver` (SSR, jsdom): no observation\n * ever arrives there, so `isReady` stays `false` for good.\n */\n readonly observes: boolean;\n /**\n * The resolved value of a custom property, re-read on every resize of the\n * container.\n *\n * **The `@container` rule must style a descendant, never the container\n * itself.** A container query resolves against an *ancestor* query container\n * of the element it styles, so a rule whose subject is the container element\n * matches nothing and the property never changes. Pass that descendant as\n * `on`; it defaults to the container host, which is only correct for\n * properties no container query writes.\n *\n * A component that is container and reader at once has no descendant to\n * carry the value. Pass `pseudo` instead: the query container for a\n * pseudo-element is selected from its originating element's *inclusive*\n * ancestors, so `.host::after` resolves against `.host` while a rule on\n * `.host` itself still matches nothing. No sentinel node enters the\n * template.\n *\n * ```css\n * .cngx-thing::after { --cngx-thing-narrow: 0; }\n * &#64;container cngx-thing (max-inline-size: 30rem) {\n * .cngx-thing::after { --cngx-thing-narrow: 1; }\n * }\n * ```\n *\n * Returns the empty string before the first observation and in environments\n * without layout (SSR, jsdom).\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string>;\n}\n\n/**\n * The nearest query container declared by {@link CngxContainer}.\n *\n * Deliberately has no root factory: absence is meaningful. A component that\n * needs a container and finds none must say so (a dev-mode warning), not\n * silently observe itself.\n *\n * @since 0.3.0\n */\nexport const CNGX_CONTAINER_SIZE = new InjectionToken<CngxContainerSize>('CNGX_CONTAINER_SIZE');\n\n/**\n * Creates a {@link CngxContainerSize} over `element`.\n *\n * Observes the border box, so the reported size matches what an\n * `inline-size` container query measures. The `property()` reads are plain\n * `computed()`s over the same resize signal - the browser has already\n * re-evaluated every container query by the time a `ResizeObserver` callback\n * runs, so the read returns the current value without a second scheduling hop.\n *\n * @param element The container host.\n * @param destroyRef Scope whose destruction disconnects the observer.\n * @param win The window-like object providing `ResizeObserver` and `getComputedStyle`.\n * @relatedTo injectContainerSize, CngxContainer\n * @since 0.3.0\n */\nexport function createContainerSize(\n element: Element,\n destroyRef: DestroyRef,\n win: (ResizeObserverHost & Pick<Window, 'getComputedStyle'>) | null | undefined,\n): CngxContainerSize {\n const entry = createResizeSignal(element, 'border-box', destroyRef, win);\n\n const inlineSize = computed(() => entry()?.borderBoxSize?.[0]?.inlineSize ?? 0);\n const blockSize = computed(() => entry()?.borderBoxSize?.[0]?.blockSize ?? 0);\n const isReady = computed(() => entry() !== null);\n\n // Weak on the element: the container outlives descendants that get\n // destroyed, so a strong Map would pin every dead node it ever read.\n const cache = new WeakMap<Element, Map<string, Signal<string>>>();\n\n const property = (\n name: string,\n on?: Element,\n pseudo?: '::before' | '::after',\n ): Signal<string> => {\n const target = on ?? element;\n let byName = cache.get(target);\n if (!byName) {\n byName = new Map();\n cache.set(target, byName);\n }\n const key = `${pseudo ?? ''}|${name}`;\n const cached = byName.get(key);\n if (cached) {\n return cached;\n }\n // A DOM read inside a computed() is deliberate here, not an oversight: the\n // only tracked dependency is the resize entry, and a ResizeObserver\n // callback runs after layout, when every container query has already been\n // re-evaluated. The read is therefore idempotent for a given entry and\n // never forces a recalc of its own. An effect writing into a signal would\n // add a scheduling hop for nothing.\n const value = computed(() => {\n if (entry() === null || !win?.getComputedStyle) {\n return '';\n }\n return win\n .getComputedStyle(target, pseudo ?? null)\n .getPropertyValue(name)\n .trim();\n });\n byName.set(key, value);\n return value;\n };\n\n return { inlineSize, blockSize, isReady, observes: canObserveResize(win), property };\n}\n\n/**\n * Reads the nearest query container declared by a `[cngxContainer]` ancestor,\n * or observes `target` (default: the host element) when there is none.\n *\n * Use it where a component must branch structurally on the width it was given\n * - a different template, a focus move, an `aria-modal` flip. Purely visual\n * adaptation needs no TypeScript at all: write a `@container` rule.\n *\n * ```typescript\n * private readonly container = inject(CNGX_CONTAINER_SIZE, { optional: true });\n * private readonly wide = this.container?.property('--cngx-thing-wide', this.host) ?? signal('').asReadonly();\n * readonly mode = computed(() => (this.wide() === '1' ? 'push' : 'over'));\n * ```\n *\n * A component that declares the container in its own stylesheet and reads it\n * itself passes its host explicitly and reads the property off `::after` -\n * there is no descendant to carry the value:\n *\n * ```typescript\n * private readonly host = inject(ElementRef).nativeElement as Element;\n * private readonly container = injectContainerSize(this.host);\n * private readonly narrow = this.container.property('--cngx-thing-narrow', this.host, '::after');\n * ```\n *\n * @param target Element to observe when no ancestor container exists.\n * @relatedTo CngxContainer, injectMediaQuery\n * @since 0.3.0\n */\nexport function injectContainerSize(target?: ElementRef<Element> | Element): CngxContainerSize {\n const ancestor = inject(CNGX_CONTAINER_SIZE, { optional: true, skipSelf: true });\n if (ancestor && !target) {\n return ancestor;\n }\n const resolved: Element =\n target instanceof ElementRef\n ? target.nativeElement\n : (target ?? (inject(ElementRef).nativeElement as Element));\n return createContainerSize(resolved, inject(DestroyRefToken), inject(DOCUMENT).defaultView);\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, type Signal } from '@angular/core';\n\nimport { CNGX_CONTAINER_SIZE, type CngxContainerSize, createContainerSize } from './container-size';\n\n/**\n * Observes a query container and publishes its size to descendants through\n * {@link CNGX_CONTAINER_SIZE}.\n *\n * The directive declares nothing visual. **Both `container-type` and\n * `container-name` belong in the stylesheet**, next to the `@container` rules\n * that use them: the name is API (an unnamed query matches the nearest\n * container of any name, so a consumer wrapping the component in their own\n * container would silently re-target it), and containment is a layout\n * decision a skin must be able to opt out of with a plain CSS rule rather\n * than `!important` against a host style.\n *\n * ```css\n * cngx-thing-layout {\n * container-type: inline-size;\n * container-name: cngx-thing-layout;\n * }\n *\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 0; }\n *\n * @container cngx-thing-layout (min-inline-size: 64rem) {\n * cngx-thing-layout > cngx-thing { --cngx-thing-wide: 1; }\n * }\n * ```\n *\n * ```html\n * <div cngxContainer>\n * <app-panel />\n * </div>\n * ```\n *\n * A descendant reads the resolved value with `injectContainerSize()`, so the\n * breakpoint exists exactly once - in CSS. Note that `container-type:\n * inline-size` applies size containment: an element that must shrink-wrap its\n * content (an inline chip, a `width: max-content` bar) must not be a\n * container.\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/observers/container.directive.ts\n * @since 0.3.0\n * @relatedTo injectContainerSize, CngxResizeObserver, CngxMediaQuery\n * <example-url>/#/common/layout/container/css-decides-js-reads</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxContainer]',\n exportAs: 'cngxContainer',\n standalone: true,\n providers: [{ provide: CNGX_CONTAINER_SIZE, useExisting: CngxContainer }],\n})\nexport class CngxContainer implements CngxContainerSize {\n private readonly size = createContainerSize(\n inject(ElementRef).nativeElement as Element,\n inject(DestroyRef),\n inject(DOCUMENT).defaultView,\n );\n\n /** Border-box inline size in pixels. `0` before the first observation. */\n readonly inlineSize = this.size.inlineSize;\n /** Border-box block size in pixels. `0` before the first observation. */\n readonly blockSize = this.size.blockSize;\n /** `true` once the first observation has arrived. */\n readonly isReady = this.size.isReady;\n /** `false` on a host without `ResizeObserver` (SSR, jsdom). */\n readonly observes = this.size.observes;\n\n /**\n * The resolved value of a custom property on `on` (default: this host),\n * re-read on every resize. The `@container` rule must style a descendant,\n * or a pseudo-element of the container itself - see\n * {@link CngxContainerSize.property}.\n */\n property(name: string, on?: Element, pseudo?: '::before' | '::after'): Signal<string> {\n return this.size.property(name, on, pseudo);\n }\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n HostAttributeToken,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { createActivationKeyHandler } from '@cngx/common/interactive';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport { CNGX_PANEL_TARGET, type CngxPanelTarget } from './panel-target';\n\n/**\n * What a `CngxPanelTrigger` does on activation.\n *\n * @since 0.3.0\n */\nexport type CngxPanelTriggerAction = 'toggle' | 'peek';\n\n/**\n * The trigger of a drawer, sidebar or sidenav panel. It owns no state: it\n * mirrors the target's `expanded` as `aria-expanded`, points\n * `aria-controls` at the target's `id`, and calls `toggle()` (or `peek()`)\n * on click, Enter and Space.\n *\n * The target is an explicit reference (`[cngxPanelTrigger]=\"drawer\"`). A\n * bare `cngxPanelTrigger` inside the panel resolves the surrounding\n * `CNGX_PANEL_TARGET` (a pin or close button). Because the trigger names\n * the panel in `aria-controls`, a press on it is not an outside press for\n * the panel's dismissal, so one press toggles once.\n *\n * On a native `<button>` the browser turns Enter and Space into the click.\n * Any other host gets `role=\"button\"`, `tabindex=\"0\"` and its own\n * Enter / Space handling. An icon-only trigger (no text content; text\n * inside `hidden` or `aria-hidden` elements does not count) is named after\n * the panel: a bound `label`, else a static `aria-label`, else the\n * target's `label`, else\n * `CNGX_LAYOUT_I18N.panelTrigger`. The name stays the same while the panel\n * opens and closes; `aria-expanded` carries the state. A trigger with\n * visible text keeps its text as its name. The check follows the host\n * content: text added to or removed from the trigger later (an\n * interpolation, an `@if`) switches between the two.\n *\n * The trigger draws nothing: the host's content is the consumer's. For an\n * icon button with a glyph that follows the panel, use\n * `button[cngxPanelToggle]`, which composes this directive.\n *\n * ```html\n * <button type=\"button\" [cngxPanelTrigger]=\"drawer\">Menu</button>\n * <div cngxDrawer #drawer=\"cngxDrawer\" panelId=\"nav\">\n * <nav [cngxDrawerPanel]=\"drawer\">…</nav>\n * </div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/panel-trigger/panel-trigger.directive.ts\n * @since 0.3.0\n * @relatedTo CngxPanelToggle, CngxPanelTarget, CNGX_PANEL_TARGET, CngxDrawer, CngxSidebar\n * <example-url>/#/common/layout/sidebar/clipped-below-header</example-url>\n * <example-url>/#/common/layout/sidebar/collapsible-rail</example-url>\n * <example-url>/#/common/layout/sidebar/inset-app-sidebar</example-url>\n * <example-url>/#/common/layout/drawer/app-header-clipped</example-url>\n * <example-url>/#/common/layout/drawer/full-height-modal</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxPanelTrigger]',\n exportAs: 'cngxPanelTrigger',\n standalone: true,\n host: {\n '[attr.aria-expanded]': 'expanded()',\n '[attr.aria-controls]': 'controls()',\n '[attr.aria-label]': 'resolvedLabel()',\n '[attr.role]': \"nativeButton ? null : 'button'\",\n '[attr.tabindex]': \"nativeButton ? null : '0'\",\n '(click)': 'activate()',\n '(keydown.enter)': 'handleActivationKey($event)',\n '(keydown.space)': 'handleActivationKey($event)',\n },\n})\nexport class CngxPanelTrigger {\n /**\n * The panel to control. Bind it explicitly, or leave the attribute bare\n * inside a panel that provides `CNGX_PANEL_TARGET`.\n */\n readonly targetInput = input<CngxPanelTarget | undefined, CngxPanelTarget | '' | undefined>(\n undefined,\n {\n alias: 'cngxPanelTrigger',\n transform: (v) => (typeof v === 'string' ? undefined : v),\n },\n );\n /**\n * `toggle` (default) flips the panel. `peek` shows it temporarily; a target\n * without `peek()` toggles instead.\n */\n readonly action = input<CngxPanelTriggerAction>('toggle');\n /**\n * Accessible name. Unbound, a static `aria-label` on the host stays; on a\n * trigger without text content or a static `aria-label` it falls back to\n * the target's `label`, then to `CNGX_LAYOUT_I18N.panelTrigger`. It does\n * not follow the panel state; `aria-expanded` does.\n */\n readonly label = input<string | undefined>(undefined);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly providedTarget = inject(CNGX_PANEL_TARGET, { optional: true });\n private readonly i18n = injectLayoutI18n();\n // The aria-label binding would drop a static aria-label, so it renders it.\n private readonly staticLabel = inject(new HostAttributeToken('aria-label'), { optional: true });\n private readonly rendered = signal(false);\n // Bumped by a MutationObserver on the host: the text and the attributes\n // that decide the name are not signals, so hasOwnName reads the DOM and\n // tracks this version instead of a written copy.\n private readonly nameVersion = signal(0);\n // Until the first render the projected content is not there yet; assume a\n // named trigger so no fallback label flashes onto a text trigger.\n private readonly hasOwnName = computed(() => {\n if (!this.rendered()) {\n return true;\n }\n this.nameVersion();\n return nameText(this.host).trim() !== '' || this.host.hasAttribute('aria-labelledby');\n });\n\n protected readonly nativeButton = this.host.tagName === 'BUTTON';\n\n /** The resolved target: the explicit reference wins over the provided one. */\n readonly target = computed(() => this.targetInput() ?? this.providedTarget);\n\n /**\n * Whether the controlled panel is shown in its resting state. A peek is\n * transient pointer presentation, so a peeked target reads as collapsed.\n */\n readonly expanded = computed(() => {\n const target = this.target();\n return !!target && target.expanded() && !(target.peeked?.() ?? false);\n });\n\n protected readonly controls = computed(() => {\n const id = this.target()?.id();\n return id === undefined || id === '' ? null : id;\n });\n private readonly fallbackLabel = computed(() => {\n if (this.hasOwnName()) {\n return null;\n }\n return this.target()?.label?.() ?? this.i18n().panelTrigger;\n });\n protected readonly resolvedLabel = computed(\n () => this.label() ?? this.staticLabel ?? this.fallbackLabel(),\n );\n\n protected readonly handleActivationKey = createActivationKeyHandler(this.host, () =>\n this.activate(),\n );\n\n constructor() {\n let observer: MutationObserver | null = null;\n inject(DestroyRef).onDestroy(() => observer?.disconnect());\n afterNextRender(() => {\n this.rendered.set(true);\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n observer = new MutationObserver(() => this.nameVersion.update((v) => v + 1));\n observer.observe(this.host, {\n characterData: true,\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['hidden', 'aria-hidden', 'aria-labelledby'],\n });\n });\n }\n\n /** Runs the action on the target. */\n activate(): void {\n const target = this.target();\n if (!target) {\n return;\n }\n if (this.action() === 'peek' && target.peek) {\n target.peek();\n return;\n }\n target.toggle();\n }\n}\n\n/**\n * The text that names the host: its text content without `hidden` and\n * `aria-hidden` subtrees, which the accessible name skips as well (a\n * component's hidden disabled reason, an `aria-hidden` glyph slot).\n */\nfunction nameText(node: Node): string {\n if (node.nodeType === Node.TEXT_NODE) {\n return node.textContent ?? '';\n }\n return Array.from(node.childNodes)\n .filter(\n (child) =>\n !(child instanceof Element) ||\n !(child.hasAttribute('hidden') || child.getAttribute('aria-hidden') === 'true'),\n )\n .map(nameText)\n .join('');\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport { CngxButtonAdornment, CngxButtonBrain, provideButtonHost } from '@cngx/common/button';\nimport { CngxIconSvg } from '@cngx/common/display';\nimport { injectDirection } from '@cngx/core';\nimport {\n CNGX_ICON_MENU,\n CNGX_ICON_PANEL_CLOSE,\n CNGX_ICON_PANEL_OPEN,\n CNGX_ICON_X,\n} from '@cngx/utils';\n\nimport { CngxPanelTrigger } from '../panel-trigger/panel-trigger.directive';\n\n/**\n * Icon button that opens and closes a drawer or sidebar and draws its own\n * glyph. The behaviour is a composed `CngxPanelTrigger`: `aria-expanded`\n * mirrors the panel, `aria-controls` names it, a press toggles it (or peeks\n * it with `action=\"peek\"`), and the accessible name is the panel's: a\n * bound `label`, else the target's `label`, else\n * `CNGX_LAYOUT_I18N.panelTrigger`. The name stays the same while the panel\n * opens and closes.\n *\n * The glyph follows how the target presents the panel right now, so it\n * changes with a breakpoint that switches the panel's `mode`:\n *\n * - a modal over-drawer (the mobile nav: `mode=\"over\"` with a `page` or\n * `contained` modality) shows three bars while closed and a cross while\n * open;\n * - every other presentation (an inline sidebar or rail, a push drawer, a\n * non-modal over-drawer) shows a panel glyph that draws what a press\n * does: a frame with a column on the panel's side and a chevron pointing\n * away from the column while the panel is closed (open it), toward the\n * column while it is open (close it). `aria-expanded` carries the same\n * state for assistive technology. The glyph mirrors for a panel\n * on the right: `position=\"right\"`, or the end side in LTR and the start\n * side in RTL (`CNGX_DIRECTION`).\n *\n * A target without `mode` / `modal` / `side` (a consumer-built\n * `CngxPanelTarget`) reads as an inline panel on the start side. The glyph\n * is `aria-hidden`; project an icon to replace it. The state the default\n * glyph follows is public on the exported instance (`expanded`,\n * `modalOverlay`, `mirrored`), so a projected glyph can follow it too:\n *\n * ```html\n * <button type=\"button\" [cngxPanelToggle]=\"nav\" #toggle=\"cngxPanelToggle\">\n * <cngx-icon [style.transform]=\"toggle.mirrored() ? 'scaleX(-1)' : null\">\n * <mat-icon>{{ toggle.expanded() ? 'menu_open' : 'menu' }}</mat-icon>\n * </cngx-icon>\n * </button>\n * ```\n *\n * Shares the button family's state surface: `disabled` renders\n * `aria-disabled` (the button stays focusable and swallows activation) and\n * `disabledReason` is read through `aria-describedby`. The emphasis stays\n * `ghost` unless `variant` is set; `size` and `tone` fall through to the\n * group, `provideButtonConfig` and the icon-button defaults.\n *\n * ```html\n * <button type=\"button\" [cngxPanelToggle]=\"nav\"></button>\n * <div cngxDrawer #nav=\"cngxDrawer\" panelId=\"main-nav\">\n * <nav [cngxDrawerPanel]=\"nav\" [mode]=\"mobile() ? 'over' : 'push'\">…</nav>\n * </div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/panel-toggle/panel-toggle.component.ts\n * @since 0.3.0\n * @relatedTo CngxPanelTrigger, CngxPanelTarget, CngxDrawer, CngxSidebar, CngxIconButton\n * <example-url>/#/common/layout/sidebar/inset-app-sidebar</example-url>\n * <example-url>/#/common/layout/sidebar/collapsible-rail</example-url>\n * <example-url>/#/common/layout/drawer/app-header-clipped</example-url>\n * <example-url>/#/common/layout/drawer/full-height-modal</example-url>\n * <example-url>/#/common/layout/drawer/filter-panel-push</example-url>\n * <example-url>/#/common/layout/sidebar/projected-toggle-glyph</example-url>\n * @axis level molecule\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector -- attribute selector by design (sits on the native button)\n selector: 'button[cngxPanelToggle]',\n standalone: true,\n exportAs: 'cngxPanelToggle',\n imports: [CngxIconSvg, CngxButtonAdornment],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [\n {\n directive: CngxPanelTrigger,\n inputs: ['cngxPanelTrigger: cngxPanelToggle', 'action', 'label'],\n },\n {\n directive: CngxButtonBrain,\n inputs: ['variant', 'tone', 'size', 'disabled', 'disabledReason', 'cngxDescribedBy', 'type'],\n },\n ],\n providers: [provideButtonHost('cngxPanelToggle', { defaultVariant: 'ghost', iconOnly: true })],\n host: { class: 'cngx-button cngx-icon-button cngx-panel-toggle' },\n template: `\n <span class=\"cngx-button__label cngx-icon-button__glyph\" aria-hidden=\"true\">\n <ng-content>\n <svg\n class=\"cngx-panel-toggle__icon\"\n [class.cngx-panel-toggle__icon--mirrored]=\"mirrored()\"\n [cngxIconSvg]=\"icon()\"\n ></svg>\n </ng-content>\n </span>\n <cngx-button-adornment />\n `,\n styleUrls: ['./panel-toggle.component.css'],\n})\nexport class CngxPanelToggle {\n private readonly trigger = inject(CngxPanelTrigger, { host: true });\n private readonly direction = injectDirection();\n\n /**\n * Whether the target shows the panel right now. Read it from a projected\n * glyph through `#toggle=\"cngxPanelToggle\"`.\n */\n readonly expanded = this.trigger.expanded;\n\n /**\n * Whether the target presents the panel as a modal over-drawer right now\n * (`mode=\"over\"` with a blocking modality). The default glyph draws menu\n * bars and a cross then; a projected glyph can follow the same switch.\n */\n readonly modalOverlay = computed(() => {\n const target = this.trigger.target();\n const mode = target?.mode?.() ?? 'inline';\n return mode === 'over' && (target?.modal?.() ?? false);\n });\n\n /**\n * Whether a panel glyph drawn for a left panel must be flipped: the panel\n * sits on the right (`right`, `end` in LTR, `start` in RTL). Always\n * `false` while {@link modalOverlay} holds.\n */\n readonly mirrored = computed(() => {\n if (this.modalOverlay()) {\n return false;\n }\n const side = this.trigger.target()?.side?.() ?? 'start';\n const rtl = this.direction() === 'rtl';\n switch (side) {\n case 'right':\n return true;\n case 'start':\n return rtl;\n case 'end':\n return !rtl;\n default:\n return false;\n }\n });\n\n /** @internal - the default glyph for the current presentation and state. */\n protected readonly icon = computed(() => {\n const expanded = this.expanded();\n if (this.modalOverlay()) {\n return expanded ? CNGX_ICON_X : CNGX_ICON_MENU;\n }\n return expanded ? CNGX_ICON_PANEL_CLOSE : CNGX_ICON_PANEL_OPEN;\n });\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n inject,\n InjectionToken,\n input,\n model,\n signal,\n} from '@angular/core';\nimport { injectDirection } from '@cngx/core';\nimport { clamp } from '@cngx/utils';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\n\n/**\n * Which inline edge of the resized panel the handle sits on. Logical, so the\n * drag and arrow-key direction follow the writing direction.\n *\n * @since 0.3.0\n */\nexport type CngxResizableEdge = 'inline-start' | 'inline-end';\n\n/**\n * Optional app-wide defaults for `CngxResizable`'s bounds and key step.\n * Provide it to move the `min` / `max` / `step` fallbacks an organism\n * composes the handle with, without touching the per-instance input surface.\n * Every key is optional - an unset key keeps the atom's literal\n * (120 / 600 / 16).\n *\n * @since 0.3.0\n */\nexport interface CngxResizableDefaults {\n /** Fallback for `min` (px) when the input is not bound. */\n readonly min?: number;\n /** Fallback for `max` (px) when the input is not bound. */\n readonly max?: number;\n /** Fallback for `step` (px per arrow-key press) when the input is not bound. */\n readonly step?: number;\n}\n\n/**\n * Optional DI fallback for `CngxResizable`'s `min` / `max` / `step` input\n * defaults. Resolution is `bound input -> injected default -> literal`\n * (120 / 600 / 16). A hostDirective input default cannot be overridden by the\n * host that composes it, so this token is the layered extension point a\n * resizable organism uses to set app-wide bounds. `optional`, so standalone\n * `[cngxResizable]` stays byte-identical when the token is absent.\n *\n * @relatedTo CngxResizable\n * @since 0.3.0\n */\nexport const CNGX_RESIZABLE_DEFAULTS = new InjectionToken<CngxResizableDefaults>(\n 'CNGX_RESIZABLE_DEFAULTS',\n);\n\n/**\n * A resize handle for a side panel: the WAI-ARIA window-splitter pattern on\n * the handle element.\n *\n * The handle owns no layout. It reads and writes `size` (px) through a\n * two-way binding; the consumer applies the size to the panel (an inline\n * size or a custom property). Pointer drag runs with pointer capture and\n * writes at most once per animation frame; the handle sets\n * `touch-action: none`, so a touch drag resizes instead of panning the page.\n * The keyboard path makes the handle operable without a pointer (WCAG\n * 2.1.1): Arrow Left / Right move the handle by `step`, Home / End jump to\n * `min` / `max`. Modified keys pass through.\n *\n * `edge` names the panel edge the handle sits on: `inline-end` for a panel at\n * the start of the row (the handle grows the panel toward the end),\n * `inline-start` for a panel at the end. Under `dir=\"rtl\"` the physical\n * directions flip with the writing direction.\n *\n * ARIA lives in the `computed()` graph: `role=\"separator\"`,\n * `aria-orientation=\"vertical\"`, `aria-valuenow` / `-min` / `-max`,\n * `aria-valuetext` and `aria-label` (copy from `CNGX_LAYOUT_I18N` unless the\n * `label` / `valueText` inputs are bound).\n * The pattern also refers the handle to the resized panel through\n * `aria-controls`; the handle does not know the panel, so set it on the host\n * (`aria-controls=\"filters\"`) next to the panel's `id`. The handle never binds\n * it, so a static attribute stays.\n *\n * `min`, `max` and `step` fall back to `CNGX_RESIZABLE_DEFAULTS`, then to\n * 120 / 600 / 16.\n *\n * ```html\n * <aside id=\"side\" [style.inline-size.px]=\"width()\">…</aside>\n * <div cngxResizable [(size)]=\"width\" [min]=\"200\" [max]=\"480\" aria-controls=\"side\"></div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/resizable/resizable.directive.ts\n * @since 0.3.0\n * @relatedTo CngxSidebar, CngxDrawerPanel, CNGX_LAYOUT_I18N\n * <example-url>/#/common/layout/resizable/side-panel</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxResizable]',\n exportAs: 'cngxResizable',\n standalone: true,\n host: {\n role: 'separator',\n tabindex: '0',\n 'aria-orientation': 'vertical',\n style: 'touch-action: none',\n '[attr.aria-valuenow]': 'valueNow()',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuetext]': 'resolvedValueText()',\n '[attr.aria-label]': 'resolvedLabel()',\n '[class.cngx-resizable--resizing]': 'resizing()',\n '(keydown)': 'handleKeydown($event)',\n '(pointerdown)': 'handlePointerDown($event)',\n },\n})\nexport class CngxResizable {\n /**\n * Optional app-wide bounds. Declared first so the input initialisers below\n * can source their fallback from it. Absent by default - standalone\n * `[cngxResizable]` then keeps the 120 / 600 / 16 literals.\n */\n private readonly defaults = inject(CNGX_RESIZABLE_DEFAULTS, { optional: true });\n\n /** Size of the resized panel in px. Two-way: `[(size)]=\"width\"`. */\n readonly size = model.required<number>();\n /** Smallest size in px a drag or key can reach. */\n readonly min = input<number>(this.defaults?.min ?? 120);\n /** Largest size in px a drag or key can reach. */\n readonly max = input<number>(this.defaults?.max ?? 600);\n /** The panel edge the handle sits on; sets the drag and arrow-key direction. */\n readonly edge = input<CngxResizableEdge>('inline-end');\n /** Size change in px per arrow-key press. */\n readonly step = input<number>(this.defaults?.step ?? 16);\n /** Accessible name of the handle. Falls back to `CNGX_LAYOUT_I18N.resizeHandle`. */\n readonly label = input<string | undefined>(undefined);\n /**\n * `aria-valuetext` for a px size. Falls back to\n * `CNGX_LAYOUT_I18N.resizeValueText`.\n */\n readonly valueText = input<((size: number) => string) | undefined>(undefined);\n\n private readonly doc = inject(DOCUMENT);\n private readonly direction = injectDirection();\n private readonly i18n = injectLayoutI18n();\n private readonly resizingState = signal(false);\n private dragAbort: AbortController | null = null;\n\n /** Whether a pointer drag is in progress. */\n readonly resizing = this.resizingState.asReadonly();\n\n protected readonly valueNow = computed(() => Math.round(this.clamped(this.size())));\n protected readonly resolvedLabel = computed(() => this.label() ?? this.i18n().resizeHandle);\n protected readonly resolvedValueText = computed(() => {\n const format = this.valueText() ?? this.i18n().resizeValueText;\n return format(this.valueNow());\n });\n\n /** +1 when moving the handle physically right grows the panel, else -1. */\n private readonly growSign = computed(() => {\n const endIsRight = this.direction() !== 'rtl';\n const onRight = this.edge() === 'inline-end' ? endIsRight : !endIsRight;\n return onRight ? 1 : -1;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.dragAbort?.abort());\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) {\n return;\n }\n const target = this.keyTarget(event.key);\n if (target === null) {\n return;\n }\n event.preventDefault();\n this.size.set(Math.round(this.clamped(target)));\n }\n\n protected handlePointerDown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n event.preventDefault();\n const handle = event.currentTarget as HTMLElement;\n handle.setPointerCapture?.(event.pointerId);\n\n this.dragAbort?.abort();\n const controller = new AbortController();\n this.dragAbort = controller;\n this.resizingState.set(true);\n\n const startX = event.clientX;\n const startSize = this.size();\n const sign = this.growSign();\n const view = this.doc.defaultView;\n let pending = startSize;\n let frame = 0;\n // Destroying the handle mid-drag aborts the controller; the queued\n // frame must not write the size of a gone handle.\n controller.signal.addEventListener('abort', () => {\n if (frame) {\n view?.cancelAnimationFrame(frame);\n frame = 0;\n }\n });\n\n const flush = (): void => {\n frame = 0;\n this.size.set(pending);\n };\n const onMove = (ev: PointerEvent): void => {\n pending = Math.round(this.clamped(startSize + (ev.clientX - startX) * sign));\n if (!frame) {\n frame = view?.requestAnimationFrame(flush) ?? 0;\n }\n };\n const onEnd = (): void => {\n if (frame) {\n view?.cancelAnimationFrame(frame);\n }\n flush();\n this.resizingState.set(false);\n controller.abort();\n if (this.dragAbort === controller) {\n this.dragAbort = null;\n }\n };\n\n const options = { signal: controller.signal };\n this.doc.addEventListener('pointermove', onMove, options);\n this.doc.addEventListener('pointerup', onEnd, options);\n this.doc.addEventListener('pointercancel', onEnd, options);\n }\n\n private keyTarget(key: string): number | null {\n const current = this.size();\n const step = this.step() * this.growSign();\n switch (key) {\n case 'ArrowRight':\n return current + step;\n case 'ArrowLeft':\n return current - step;\n case 'Home':\n return this.min();\n case 'End':\n return this.max();\n default:\n return null;\n }\n }\n\n private clamped(value: number): number {\n return clamp(value, this.min(), this.max());\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\nimport { createScrollLock } from './scroll-lock-core';\n\n/**\n * Prevents scrolling on the document, or on a given scroll container, when\n * enabled.\n *\n * Sets `overflow: hidden` and `scrollbar-gutter: stable` on the target\n * (`<html>` unless `[cngxScrollLockTarget]` names another element) to\n * prevent layout shift when the scrollbar disappears. Restores original\n * values when all lock instances on that target are released.\n *\n * Multiple instances are ref-counted per target - the original styles are\n * only restored when the last lock on that element is released.\n *\n * ### With a drawer\n * ```html\n * <div cngxDrawer #drawer=\"cngxDrawer\" [cngxScrollLock]=\"drawer.opened()\">\n * …\n * </div>\n * ```\n *\n * ### With a modal\n * ```html\n * <div [cngxScrollLock]=\"isModalOpen()\">…</div>\n * ```\n *\n * ### Inside a scroll container\n * ```html\n * <section #pane class=\"pane\">\n * <aside [cngxScrollLock]=\"open()\" [cngxScrollLockTarget]=\"pane\">…</aside>\n * </section>\n * ```\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock.directive.ts\n * @since 0.3.0\n * @relatedTo CngxDrawer, CngxBackdrop\n * <example-url>/#/common/layout/scroll-lock/toggle</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxScrollLock]',\n exportAs: 'cngxScrollLock',\n standalone: true,\n})\nexport class CngxScrollLock {\n /** Whether scroll lock is active. */\n readonly enabled = input<boolean>(false, { alias: 'cngxScrollLock' });\n /**\n * The scrolling element to lock. Defaults to the document root\n * (`document.documentElement`). Changing it while locked moves the lock.\n */\n readonly target = input<HTMLElement | null | undefined>(undefined, {\n alias: 'cngxScrollLockTarget',\n });\n\n constructor() {\n const root = inject(DOCUMENT).documentElement;\n let locked: HTMLElement | null = null;\n let release: (() => void) | null = null;\n\n effect(() => {\n const wanted = this.enabled() ? (this.target() ?? root) : null;\n if (wanted === locked) {\n return;\n }\n release?.();\n release = wanted ? createScrollLock(wanted) : null;\n locked = wanted;\n });\n\n inject(DestroyRef).onDestroy(() => {\n release?.();\n });\n }\n}\n","import { computed, type DestroyRef, signal, type Signal } from '@angular/core';\n\nimport { observeResize, type ResizeObserverHost } from '../observers/resize-signal';\n\n/**\n * Structural window surface `createScrollEdges` reads: `window`, `globalThis`,\n * or a test double. Every member is optional so SSR and jsdom hosts pass the\n * type and fall back at runtime: no `ResizeObserver` means no resize\n * tracking, no `MutationObserver` means the child set is captured once, no\n * `requestAnimationFrame` means every trigger reads synchronously, no\n * `getComputedStyle` means the scrollport is read as horizontal-tb.\n *\n * @since 0.3.0\n */\nexport interface ScrollEdgesHost extends ResizeObserverHost {\n MutationObserver?: typeof MutationObserver;\n requestAnimationFrame?: (callback: FrameRequestCallback) => number;\n cancelAnimationFrame?: (handle: number) => void;\n getComputedStyle?: (element: Element) => CSSStyleDeclaration;\n}\n\n/**\n * Per-edge scroll state of one scrollport. Each signal is `true` while content\n * is hidden toward that edge, i.e. while the user can still scroll toward it.\n * The edges are logical: under a `vertical-*` or `sideways-*` writing mode the\n * block edges are the horizontal ones and the inline edges the vertical ones.\n * The writing mode is read once per scrollport, so a runtime `writing-mode`\n * flip on a live scrollport is not picked up.\n *\n * @since 0.3.0\n */\nexport interface CngxScrollEdgesState {\n /** Content is hidden toward the block-start edge (top in horizontal writing modes). */\n readonly canScrollBlockStart: Signal<boolean>;\n /** Content is hidden toward the block-end edge (bottom in horizontal writing modes). */\n readonly canScrollBlockEnd: Signal<boolean>;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL, horizontally). */\n readonly canScrollInlineStart: Signal<boolean>;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL, horizontally). */\n readonly canScrollInlineEnd: Signal<boolean>;\n}\n\ninterface ScrollEdgesSnapshot {\n readonly blockStart: boolean;\n readonly blockEnd: boolean;\n readonly inlineStart: boolean;\n readonly inlineEnd: boolean;\n}\n\n/** Distances up to this many px count as \"at the edge\" (sub-pixel and zoom rounding). */\nconst EDGE_TOLERANCE = 1;\n\nconst NO_EDGES: ScrollEdgesSnapshot = {\n blockStart: false,\n blockEnd: false,\n inlineStart: false,\n inlineEnd: false,\n};\n\nfunction sameEdges(a: ScrollEdgesSnapshot, b: ScrollEdgesSnapshot): boolean {\n return (\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd &&\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd\n );\n}\n\n/** `vertical-*` and `sideways-*` both lay the block axis out horizontally. */\nfunction isVerticalWritingMode(writingMode: string): boolean {\n return writingMode.startsWith('vertical-') || writingMode.startsWith('sideways-');\n}\n\n/**\n * One read of the six scroll metrics. RTL `scrollLeft` runs over `[-max, 0]`\n * in every evergreen engine and LTR over `[0, max]`, so its magnitude is the\n * distance from the inline-start edge in both directions - no direction lookup\n * in the scroll path. A vertical writing mode swaps the axes: the block axis\n * runs on `scrollLeft` (negative under `vertical-rl`, whose block-start is the\n * right edge) and the inline axis on `scrollTop`.\n */\nfunction readEdges(element: HTMLElement, vertical: boolean): ScrollEdgesSnapshot {\n const horizontalOffset = Math.abs(element.scrollLeft);\n const verticalOffset = Math.abs(element.scrollTop);\n const horizontalMax = element.scrollWidth - element.clientWidth;\n const verticalMax = element.scrollHeight - element.clientHeight;\n const blockOffset = vertical ? horizontalOffset : verticalOffset;\n const blockMax = vertical ? horizontalMax : verticalMax;\n const inlineOffset = vertical ? verticalOffset : horizontalOffset;\n const inlineMax = vertical ? verticalMax : horizontalMax;\n return {\n blockStart: blockOffset > EDGE_TOLERANCE,\n blockEnd: blockMax - blockOffset > EDGE_TOLERANCE,\n inlineStart: inlineOffset > EDGE_TOLERANCE,\n inlineEnd: inlineMax - inlineOffset > EDGE_TOLERANCE,\n };\n}\n\n/**\n * Tracks which edges of a scrollport still hide content, as four boolean\n * signals.\n *\n * Triggers are a passive `scroll` listener, one `observeResize` per observed\n * element (the scrollport itself plus every direct element child) and a\n * `childList`-only `MutationObserver` that keeps that child set current. All\n * of them only schedule work: the metrics are read once per animation frame\n * however many triggers fired, and the result lands in one snapshot signal\n * with a structural `equal`, so the four projections only notify when an edge\n * actually flips. A distance of 1px or less counts as \"at the edge\".\n *\n * Only direct children are resize-observed. A long item list should sit inside\n * one content element rather than be N direct children (one observer each);\n * growth deep inside a fixed-size child is picked up on the next scroll.\n *\n * A `null` host (SSR) wires nothing and all four signals stay `false`.\n *\n * ```typescript\n * const edges = createScrollEdges(\n * inject(ElementRef).nativeElement,\n * inject(DestroyRef),\n * inject(DOCUMENT).defaultView,\n * );\n * const showStartShadow = edges.canScrollBlockStart;\n * ```\n *\n * @param element The scrollport to read.\n * @param destroyRef Scope whose destruction removes the listener, disconnects\n * every observer and cancels a pending frame.\n * @param host The window-like object to read the observer and frame APIs from.\n * @returns The four per-edge signals.\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges-core.ts\n * @since 0.3.0\n * @relatedTo CngxScrollEdges, observeResize\n */\nexport function createScrollEdges(\n element: HTMLElement,\n destroyRef: DestroyRef,\n host: ScrollEdgesHost | null | undefined,\n): CngxScrollEdgesState {\n const edges = signal<ScrollEdgesSnapshot>(NO_EDGES, { equal: sameEdges });\n const state: CngxScrollEdgesState = {\n canScrollBlockStart: computed(() => edges().blockStart),\n canScrollBlockEnd: computed(() => edges().blockEnd),\n canScrollInlineStart: computed(() => edges().inlineStart),\n canScrollInlineEnd: computed(() => edges().inlineEnd),\n };\n\n if (!host) {\n return state;\n }\n\n let destroyed = false;\n let framePending = false;\n let frameHandle = 0;\n // Resolved on the first frame read, not here: a getComputedStyle at\n // construction would force a style recalc before the first render.\n let vertical: boolean | null = null;\n\n const read = (): void => {\n framePending = false;\n if (destroyed) {\n return;\n }\n vertical ??= isVerticalWritingMode(host.getComputedStyle?.(element).writingMode ?? '');\n edges.set(readEdges(element, vertical));\n };\n\n const schedule = (): void => {\n if (destroyed || framePending) {\n return;\n }\n if (typeof host.requestAnimationFrame !== 'function') {\n read();\n return;\n }\n framePending = true;\n frameHandle = host.requestAnimationFrame(read);\n };\n\n const resizeTeardowns = new Map<Element, () => void>();\n const observe = (target: Element): void => {\n if (resizeTeardowns.has(target)) {\n return;\n }\n resizeTeardowns.set(\n target,\n observeResize(host, target, 'border-box', () => schedule()),\n );\n };\n const syncChildren = (): void => {\n const children = new Set<Element>(Array.from(element.children));\n for (const [target, teardown] of resizeTeardowns) {\n if (target !== element && !children.has(target)) {\n teardown();\n resizeTeardowns.delete(target);\n }\n }\n children.forEach(observe);\n };\n\n element.addEventListener('scroll', schedule, { passive: true });\n observe(element);\n syncChildren();\n\n let mutationObserver: MutationObserver | null = null;\n if (typeof host.MutationObserver === 'function') {\n mutationObserver = new host.MutationObserver(() => {\n syncChildren();\n schedule();\n });\n mutationObserver.observe(element, { childList: true });\n }\n\n schedule();\n\n destroyRef.onDestroy(() => {\n destroyed = true;\n element.removeEventListener('scroll', schedule);\n mutationObserver?.disconnect();\n resizeTeardowns.forEach((teardown) => teardown());\n resizeTeardowns.clear();\n if (framePending && typeof host.cancelAnimationFrame === 'function') {\n host.cancelAnimationFrame(frameHandle);\n }\n framePending = false;\n });\n\n return state;\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, inject, PLATFORM_ID } from '@angular/core';\n\nimport { createScrollEdges } from './scroll-edges-core';\n\n/**\n * Reports which edges of a scrollport still hide content and reflects them as\n * host attributes, so an edge shadow or fade appears only while there really\n * is something to scroll to in that direction.\n *\n * Put it on the element that scrolls (`overflow: auto` / `scroll`). The four\n * signals and the four logical host attributes are derived from one read of\n * the scroll metrics per animation frame; the attributes are present (empty\n * value) while true and absent otherwise:\n *\n * - `data-scroll-block-start` / `canScrollBlockStart()` - hidden toward block start\n * - `data-scroll-block-end` / `canScrollBlockEnd()` - hidden toward block end\n * - `data-scroll-inline-start` / `canScrollInlineStart()` - hidden toward inline start\n * - `data-scroll-inline-end` / `canScrollInlineEnd()` - hidden toward inline end\n *\n * In a horizontal writing mode block start / end are the top and bottom\n * edges; under a `vertical-*` or `sideways-*` writing mode they are the\n * horizontal ones. Inline start / end follow the writing direction: in\n * `dir=\"rtl\"` the start edge is on the right. The direction is derived from\n * the scroll offset itself, so a `dir=\"rtl\"` subtree inside an LTR page\n * reports correctly.\n *\n * The directive paints nothing. The four attributes (present only while true)\n * are its public, stable contract; every visual belongs to the consumer CSS,\n * keyed on them. Three common cues:\n *\n * Shadow (Material 2 elevate-on-scroll):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { box-shadow: 0 2px 4px -2px rgb(0 0 0 / 0.3); }\n * ```\n *\n * Hairline that appears (iOS scroll-edge appearance; transparent border at rest):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { border-block-end-color: var(--cngx-color-border); }\n * ```\n *\n * Tonal surface change (Material 3 top app bar):\n *\n * ```css\n * .sheet[data-scroll-block-start] .bar { background: var(--app-bar-scrolled-surface); }\n * ```\n *\n * Forced colors strips `box-shadow`, so a shadow-only cue disappears there;\n * prefer a border or pair the shadow with one under `forced-colors: active`.\n *\n * ```html\n * <div class=\"sheet\" cngxScrollEdges #edges=\"cngxScrollEdges\">...</div>\n * ```\n *\n * The edge state is purely visual and is not announced: the hidden content\n * stays in the DOM and in the reading order, and the scrollport remains\n * reachable by keyboard scrolling. Make the scrollport focusable (and named)\n * when it holds no focusable content of its own.\n *\n * Upgrade path: the attributes map 1:1 onto CSS\n * `@container scroll-state(scrollable: block-start)` and its siblings, so the\n * CSS can swap to native scroll-state queries once they are Baseline.\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-edges.directive.ts\n * @since 0.3.0\n * @relatedTo CngxStickyHeader, CngxScrollSpy, createScrollEdges\n * <example-url>/#/common/layout/scroll-edges/edge-shadows</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxScrollEdges]',\n exportAs: 'cngxScrollEdges',\n standalone: true,\n host: {\n '[attr.data-scroll-block-start]': \"canScrollBlockStart() ? '' : null\",\n '[attr.data-scroll-block-end]': \"canScrollBlockEnd() ? '' : null\",\n '[attr.data-scroll-inline-start]': \"canScrollInlineStart() ? '' : null\",\n '[attr.data-scroll-inline-end]': \"canScrollInlineEnd() ? '' : null\",\n },\n})\nexport class CngxScrollEdges {\n private readonly edges = createScrollEdges(\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n inject(DestroyRef),\n isPlatformBrowser(inject(PLATFORM_ID)) ? inject(DOCUMENT).defaultView : null,\n );\n\n /** Content is hidden toward the block-start edge (top in horizontal writing modes). */\n readonly canScrollBlockStart = this.edges.canScrollBlockStart;\n /** Content is hidden toward the block-end edge (bottom in horizontal writing modes). */\n readonly canScrollBlockEnd = this.edges.canScrollBlockEnd;\n /** Content is hidden toward the inline-start edge (left in LTR, right in RTL, horizontally). */\n readonly canScrollInlineStart = this.edges.canScrollInlineStart;\n /** Content is hidden toward the inline-end edge (right in LTR, left in RTL, horizontally). */\n readonly canScrollInlineEnd = this.edges.canScrollInlineEnd;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n InjectionToken,\n Injector,\n input,\n linkedSignal,\n model,\n type Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n CNGX_HOVER_INTENT_DRIVER,\n CngxHoverIntent,\n type CngxHoverIntentDriver,\n} from '@cngx/common/interactive';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { claimEscape, escapeOwnedAbove } from '../drawer/escape-layer';\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport {\n CNGX_PANEL_TARGET,\n type CngxPanelMode,\n type CngxPanelTarget,\n} from '../panel-trigger/panel-target';\n\n/**\n * How a collapsed `CngxSidebar` rests: as a narrow, operable `rail`, or\n * `hidden` (no reserved space, `inert`).\n *\n * @since 0.3.0\n */\nexport type CngxSidebarCollapsedAs = 'rail' | 'hidden';\n\n/**\n * The edge a `CngxSidebar` sits on, in the writing direction: a `start`\n * sidebar peeks towards the end, an `end` sidebar towards the start.\n *\n * @since 0.3.0\n */\nexport type CngxSidebarSide = 'start' | 'end';\n\n/**\n * The resting state a `CngxSidebar` renders as `data-sidebar-state`.\n *\n * @since 0.3.0\n */\nexport type CngxSidebarState = 'expanded' | 'rail' | 'hidden' | 'peek';\n\n/**\n * @internal Lets a component that composes `CngxSidebar` as a host directive\n * decide what the sidebar renders from its own state (a sidenav maps its\n * width class onto the sidebar). Provided by the composer on the same\n * element (`useExisting`); the sidebar resolves it lazily with `self: true`,\n * because the composer constructs after its host directives. The consumer's\n * `[(collapsed)]` stays the persisted user decision; the driver only decides\n * what is rendered.\n */\nexport interface CngxSidebarDriver {\n /** The collapsed state the sidebar renders; wins over `[(collapsed)]`. */\n readonly sidebarCollapsed: Signal<boolean>;\n /** The collapsed rest the sidebar renders; wins over `[collapsedAs]`. */\n readonly sidebarCollapsedAs?: Signal<CngxSidebarCollapsedAs>;\n /** Shows a collapsed sidebar at full size over the content while `true`. */\n readonly sidebarPeek?: Signal<boolean>;\n /** Conceals the sidebar (`inert` + `aria-hidden`) while `true`, in any state. */\n readonly sidebarConcealed?: Signal<boolean>;\n /** Accessible name; wins over `[label]` and the i18n fallback. */\n readonly sidebarLabel?: Signal<string>;\n /** Landmark role the sidebar renders while no `[role]` is bound. */\n readonly sidebarRole?: Signal<string | null>;\n}\n\n/** @internal See {@link CngxSidebarDriver}. */\nexport const CNGX_SIDEBAR_DRIVER = new InjectionToken<CngxSidebarDriver>('CngxSidebarDriver');\n\n/**\n * The brain of a persistent side region: a sidebar that stays in the layout\n * and reserves inline space, unlike a drawer, which is transient.\n *\n * `collapsed` (two-way) switches between the expanded size and the\n * collapsed rest, `collapsedAs` picks the rest: a `rail` stays operable at\n * `--cngx-sidebar-rail-size`, `hidden` reserves nothing and becomes `inert`\n * + `aria-hidden`. A collapsed sidebar can **peek**: it shows at full size\n * over the content without reflowing it (the reserved space stays at the\n * rest size). Peek comes from the pointer resting on the host\n * (`CngxHoverIntent`, gated by `expandOnHover`) or from `peek()`, and ends\n * on Escape (wherever focus is, so a hover peek over the page is\n * dismissible without moving focus, WCAG 1.4.13), on a press outside the\n * host (a press on the trigger whose `aria-controls` names the sidebar is\n * left to the trigger), when focus leaves the host, or when the pointer\n * leaves the host after resting on it. A `peek()` from a trigger outside the\n * host therefore stays until one of these happens, even if the pointer never\n * enters.\n * `pin()` turns a peek into the expanded state.\n *\n * `side` names the edge the sidebar sits on (`start`, default, or `end` for\n * an inspector after the content); a peek grows away from it.\n *\n * Sizes are tokens with fallbacks: `--cngx-sidebar-size` (expanded, default\n * `16rem`) and `--cngx-sidebar-rail-size` (default `3.5rem`), plus\n * `--cngx-sidebar-peek-z-index`. The host renders `data-sidebar-state`\n * (`expanded | rail | hidden | peek`) and `data-sidebar-side` for skins.\n * The base skin is opt-in with the `cngx-sidebar` class (`cngx-sidebar.css`\n * in `@cngx/themes/cngx.css`): surface, border and peek shadow of the box,\n * nothing for its content.\n *\n * The sidebar is a `CngxPanelTarget` and provides `CNGX_PANEL_TARGET`: a\n * `[cngxPanelTrigger]=\"sidebar\"` mirrors `expanded` and toggles `collapsed`;\n * `action=\"peek\"` peeks. It knows no nav model; `[cngxNavRailed]` crops the\n * nav rows inside it on the rail and adds the rail tooltip and group flyout.\n *\n * ```html\n * <button type=\"button\" [cngxPanelTrigger]=\"sidebar\"></button>\n * <div style=\"display: flex\">\n * <nav cngxSidebar #sidebar=\"cngxSidebar\" [(collapsed)]=\"collapsed\" [role]=\"null\">…</nav>\n * <main>…</main>\n * </div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/sidebar/sidebar.directive.ts\n * @since 0.3.0\n * @relatedTo CngxPanelTrigger, CngxDrawer, CngxHoverIntent, CngxResizable\n * <example-url>/#/common/layout/sidebar/clipped-below-header</example-url>\n * <example-url>/#/common/layout/sidebar/collapsible-rail</example-url>\n * <example-url>/#/common/layout/sidebar/inset-app-sidebar</example-url>\n * <example-url>/#/common/layout/sidebar/projected-toggle-glyph</example-url>\n * @axis level molecule\n */\n@Directive({\n selector: '[cngxSidebar]',\n exportAs: 'cngxSidebar',\n standalone: true,\n hostDirectives: [CngxHoverIntent],\n providers: [\n { provide: CNGX_PANEL_TARGET, useExisting: CngxSidebar },\n { provide: CNGX_HOVER_INTENT_DRIVER, useExisting: CngxSidebar },\n ],\n host: {\n '[attr.id]': 'id()',\n '[attr.role]': 'role()',\n '[attr.aria-label]': 'label() ?? null',\n '[attr.inert]': \"concealed() ? '' : null\",\n '[attr.aria-hidden]': \"concealed() ? 'true' : null\",\n '[attr.data-sidebar-state]': 'state()',\n '[attr.data-sidebar-side]': 'side()',\n '[style.inline-size]': 'inlineSize()',\n '[style.margin-inline-end]': \"side() === 'start' ? peekOffset() : null\",\n '[style.margin-inline-start]': \"side() === 'end' ? peekOffset() : null\",\n '[style.z-index]': \"peeked() ? 'var(--cngx-sidebar-peek-z-index, 2)' : null\",\n '(keydown.escape)': 'handleEscape($event)',\n '(focusout)': 'handleFocusOut($event)',\n },\n})\nexport class CngxSidebar implements CngxPanelTarget, CngxHoverIntentDriver {\n /** Whether the sidebar rests collapsed. Two-way: `[(collapsed)]`. */\n readonly collapsed = model<boolean>(false);\n /** How a collapsed sidebar rests: an operable `rail` or `hidden`. */\n readonly collapsedAs = input<CngxSidebarCollapsedAs>('rail');\n /**\n * {@link CngxPanelTarget}: the edge the sidebar sits on, in the writing\n * direction. A peek grows away from it.\n */\n readonly side = input<CngxSidebarSide>('start');\n /** Whether the pointer resting on a collapsed sidebar peeks it. */\n readonly expandOnHover = input<boolean>(true);\n /**\n * ms the pointer rests on a collapsed sidebar before it peeks. Unbound,\n * `CNGX_HOVER_INTENT_DEFAULTS` applies, then 120.\n */\n readonly expandDelay = input<number | undefined>(undefined);\n /**\n * ms after the pointer leaves before a hover peek ends. Unbound,\n * `CNGX_HOVER_INTENT_DEFAULTS` applies, then 0.\n */\n readonly collapseDelay = input<number | undefined>(undefined);\n /** @internal Drives the composed `CngxHoverIntent`. */\n readonly hoverEnterDelay = this.expandDelay;\n /** @internal Drives the composed `CngxHoverIntent`. */\n readonly hoverLeaveDelay = this.collapseDelay;\n /**\n * Landmark role. Defaults to `complementary`; pass `navigation` for a nav\n * sidebar, or `null` on a `<nav>` / `<aside>` host to keep its implicit role.\n */\n readonly roleInput = input<string | null | undefined>(undefined, { alias: 'role' });\n /**\n * Accessible name of the region. Falls back to `CNGX_LAYOUT_I18N.sidebarRegion`\n * while the role is `complementary`.\n */\n readonly labelInput = input<string | undefined>(undefined, { alias: 'label' });\n\n private readonly hover = inject(CngxHoverIntent, { self: true });\n private readonly injector = inject(Injector);\n private resolvedDriver: CngxSidebarDriver | null | undefined = undefined;\n private driver(): CngxSidebarDriver | null {\n if (this.resolvedDriver === undefined) {\n this.resolvedDriver = this.injector.get(CNGX_SIDEBAR_DRIVER, null, { self: true });\n }\n return this.resolvedDriver;\n }\n // What the sidebar renders: the driver wins over the inputs.\n private readonly restCollapsed = computed(\n () => this.driver()?.sidebarCollapsed() ?? this.collapsed(),\n );\n private readonly restAs = computed(\n () => this.driver()?.sidebarCollapsedAs?.() ?? this.collapsedAs(),\n );\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly doc = inject(DOCUMENT);\n private readonly i18n = injectLayoutI18n();\n // An explicit peek ends when the pointer leaves the host after resting on\n // it; a pointer that never entered (a peek from an outside trigger) keeps\n // it until a press outside, Escape or focus leaving.\n private readonly peekState = linkedSignal<boolean, boolean>({\n source: this.hover.active,\n computation: (active, previous) => active && (previous?.value ?? false),\n });\n // Escape ends a hover peek while the pointer still rests on the host; the\n // next hover edge lifts the suppression.\n private readonly hoverSuppressed = linkedSignal({\n source: this.hover.active,\n computation: () => false,\n });\n\n /**\n * The host `id` (a static `id` attribute, else a generated one); the\n * trigger's `aria-controls`.\n */\n readonly id = signal(\n inject(new HostAttributeToken('id'), { optional: true }) ?? nextUid('cngx-sidebar'),\n ).asReadonly();\n\n /** {@link CngxPanelTarget}: a sidebar reserves inline space, it is never an overlay. */\n readonly mode = signal<CngxPanelMode>('inline').asReadonly();\n\n /** Whether a collapsed sidebar currently shows at full size over the content. */\n readonly peeked = computed(() => {\n if (!this.restCollapsed()) {\n return false;\n }\n if (this.peekState() || (this.driver()?.sidebarPeek?.() ?? false)) {\n return true;\n }\n return this.expandOnHover() && this.hover.active() && !this.hoverSuppressed();\n });\n\n /** Whether the sidebar shows at full size: expanded, or collapsed and peeked. */\n readonly expanded = computed(() => !this.restCollapsed() || this.peeked());\n\n /** The rendered state: `expanded`, `peek`, or the collapsed rest. */\n readonly state = computed<CngxSidebarState>(() => {\n if (!this.restCollapsed()) {\n return 'expanded';\n }\n return this.peeked() ? 'peek' : this.restAs();\n });\n\n /**\n * The rendered landmark role: the bound `role` (`null` keeps the host's\n * implicit role), else the composer's, else `complementary`.\n */\n readonly role = computed(() => {\n const bound = this.roleInput();\n if (bound !== undefined) {\n return bound;\n }\n return this.driver()?.sidebarRole?.() ?? 'complementary';\n });\n\n protected readonly concealed = computed(\n () => this.state() === 'hidden' || (this.driver()?.sidebarConcealed?.() ?? false),\n );\n /**\n * {@link CngxPanelTarget}: the region's resolved accessible name, the bound\n * `label`, else `CNGX_LAYOUT_I18N.sidebarRegion` while the role is\n * `complementary` (a `navigation` landmark announces its role already). An\n * icon-only trigger takes it as its name.\n */\n readonly label = computed<string | undefined>(() => {\n // A composer that names the region itself wins outright; its own\n // cascade already resolved input, config and copy.\n const driven = this.driver()?.sidebarLabel;\n if (driven) {\n return driven();\n }\n const fallback = this.role() === 'complementary' ? this.i18n().sidebarRegion : undefined;\n return this.labelInput() ?? fallback;\n });\n\n protected readonly inlineSize = computed(() => {\n switch (this.state()) {\n case 'rail':\n return 'var(--cngx-sidebar-rail-size, 3.5rem)';\n case 'hidden':\n return '0px';\n default:\n return 'var(--cngx-sidebar-size, 16rem)';\n }\n });\n\n // A peek keeps the rest footprint: a negative margin on the edge facing\n // the content cancels the growth, so the content does not reflow.\n protected readonly peekOffset = computed(() => {\n if (!this.peeked()) {\n return null;\n }\n const rest = this.restAs() === 'rail' ? 'var(--cngx-sidebar-rail-size, 3.5rem)' : '0px';\n return `calc(${rest} - var(--cngx-sidebar-size, 16rem))`;\n });\n\n constructor() {\n // The hidden rest moves focus out first: aria-hidden on an element that\n // holds focus is blocked (and warned about) by the browser, and inert\n // alone would only drop focus on the next rendering step. A composer that\n // conceals through the driver owns that move, since it may keep focus\n // inside by changing its own state in the same pass.\n effect(() => {\n if (this.state() !== 'hidden') {\n return;\n }\n untracked(() => {\n const active = this.doc.activeElement;\n if (active instanceof HTMLElement && this.host.contains(active)) {\n active.blur();\n }\n });\n });\n\n // A peek is content shown on hover: Escape must dismiss it even while\n // focus sits elsewhere on the page. Listen on the document only while\n // peeked; an Escape inside the host is the host binding's.\n effect((onCleanup) => {\n if (!this.peeked()) {\n return;\n }\n const onKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Escape') {\n return;\n }\n if (event.target instanceof Node && this.host.contains(event.target)) {\n return;\n }\n this.unpeek();\n };\n // A press on the page beside the peek ends it; the trigger that names\n // the sidebar in aria-controls handles its own press.\n const onPointerDown = (event: PointerEvent): void => {\n const target = event.target;\n if (!(target instanceof Element) || this.host.contains(target)) {\n return;\n }\n if (this.isController(target)) {\n return;\n }\n this.unpeek();\n };\n this.doc.addEventListener('keydown', onKeydown);\n this.doc.addEventListener('pointerdown', onPointerDown, true);\n onCleanup(() => {\n this.doc.removeEventListener('keydown', onKeydown);\n this.doc.removeEventListener('pointerdown', onPointerDown, true);\n });\n });\n }\n\n /** Collapses an expanded sidebar, expands a collapsed one. Ends a peek. */\n toggle(): void {\n this.peekState.set(false);\n this.collapsed.update((collapsed) => !collapsed);\n }\n\n /** Shows a collapsed sidebar at full size over the content until dismissed. */\n peek(): void {\n if (this.restCollapsed()) {\n this.peekState.set(true);\n }\n }\n\n /** Ends a peek without changing `collapsed`. */\n unpeek(): void {\n this.peekState.set(false);\n if (this.hover.active()) {\n this.hoverSuppressed.set(true);\n }\n }\n\n /** Keeps the sidebar expanded: `collapsed = false`, any peek ends. */\n pin(): void {\n this.peekState.set(false);\n this.collapsed.set(false);\n }\n\n private isController(target: Element): boolean {\n const controller = target.closest('[aria-controls]');\n const ids = controller?.getAttribute('aria-controls')?.split(/\\s+/) ?? [];\n return ids.includes(this.id());\n }\n\n // One Escape dismisses one layer: an open popover inside the host or an\n // inner surface goes first. A driven peek is the composer's to dismiss, so\n // its Escape stays unclaimed for the composer's own surface.\n protected handleEscape(event: Event): void {\n if (!this.peeked() || escapeOwnedAbove(event, this.host)) {\n return;\n }\n if (this.driver()?.sidebarPeek?.()) {\n return;\n }\n claimEscape(event);\n this.unpeek();\n }\n\n protected handleFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget;\n if (next instanceof Node && this.host.contains(next)) {\n return;\n }\n this.peekState.set(false);\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { injectEffectiveMotion } from '@cngx/core';\n\n/**\n * Headless skeleton loading placeholder.\n *\n * Toggles between loading and content states via CSS classes and ARIA attributes.\n * No template -- the consumer renders the skeleton UI.\n *\n * Exposes an `indices()` signal for `@for` rendering of repeated skeleton elements.\n * Respects reduced motion, the in-app `CNGX_MOTION` pick or the OS query\n * (disables shimmer animation class).\n *\n * ### Basic loading placeholder\n * ```html\n * <div [cngxSkeleton]=\"isLoading()\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-line\" aria-hidden=\"true\"></div>\n * }\n * } @else {\n * <p>{{ content() }}</p>\n * }\n * </div>\n * ```\n *\n * ### Card list with repeat count\n * ```html\n * <div [cngxSkeleton]=\"loading()\" [count]=\"3\" #sk=\"cngxSkeleton\">\n * @if (sk.loading()) {\n * @for (i of sk.indices(); track i) {\n * <div class=\"skeleton-card\" aria-hidden=\"true\">\n * <div class=\"skeleton-avatar\"></div>\n * <div class=\"skeleton-line\"></div>\n * </div>\n * }\n * } @else {\n * @for (card of cards(); track card.id) {\n * <app-card [data]=\"card\" />\n * }\n * }\n * </div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/skeleton.directive.ts\n * @since 0.3.0\n * @relatedTo CngxTruncate, CngxExpandableText, CngxHighlight\n * <example-url>/#/common/layout/skeleton/basic-skeleton</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxSkeleton]',\n standalone: true,\n exportAs: 'cngxSkeleton',\n host: {\n class: 'cngx-skeleton',\n '[class.cngx-skeleton--loading]': 'loading()',\n '[class.cngx-skeleton--shimmer]': 'showShimmer()',\n '[attr.aria-busy]': 'loading() || null',\n '[attr.data-cngx-busy]': 'loading() || null',\n },\n})\nexport class CngxSkeleton {\n /** Controls the loading state. */\n readonly skeleton = input<boolean>(false, { alias: 'cngxSkeleton' });\n\n /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */\n readonly shimmer = input<boolean>(true);\n\n /** Repeat count - exposed via the `indices()` signal for `@for` rendering. */\n readonly count = input<number>(1);\n\n private readonly motion = injectEffectiveMotion();\n\n /** Whether the skeleton is in loading state. Mirrors the `cngxSkeleton` input. */\n readonly loading = computed(() => this.skeleton());\n\n /** Array of indices for `@for` rendering of repeated skeleton elements. */\n readonly indices = computed(() => Array.from({ length: this.count() }, (_, i) => i));\n\n /** @internal - shimmer class condition. */\n protected readonly showShimmer = computed(\n () => this.loading() && this.shimmer() && this.motion() !== 'reduced',\n );\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { createTransitionTracker } from '@cngx/core/utils';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Infinite scroll trigger using `IntersectionObserver`.\n *\n * Place on a sentinel element at the bottom of a list. Fires `loadMore`\n * when the sentinel enters the viewport. Includes a debounce guard and\n * a `loading` input to prevent re-triggers during fetch.\n *\n * The observer is automatically recreated when `root`, `rootMargin`, or\n * `threshold` inputs change, and disconnected on destroy or when `enabled`\n * is set to `false`. When `loading` settles back to `false` the sentinel is\n * re-observed, so a fetched page that did not push the sentinel out of view\n * still re-fires `loadMore` instead of stalling the list.\n *\n * ### Basic infinite list\n * ```html\n * <div class=\"item-list\">\n * @for (item of items(); track item.id) {\n * <app-item [data]=\"item\" />\n * }\n * <div cngxInfiniteScroll [loading]=\"isFetching()\" (loadMore)=\"fetchNext()\">\n * @if (scroll.isLoading()) { <mat-spinner diameter=\"24\" /> }\n * </div>\n * </div>\n * ```\n *\n * ### Disable when all loaded\n * ```html\n * <div cngxInfiniteScroll\n * [enabled]=\"hasNextPage()\"\n * [loading]=\"isFetching()\"\n * (loadMore)=\"fetchNext()\">\n * @if (!hasNextPage()) { <p>All items loaded</p> }\n * </div>\n * ```\n *\n * ### Custom scroll container with pre-fetch margin\n * ```html\n * <div cngxInfiniteScroll\n * [root]=\"'.scroll-container'\"\n * [rootMargin]=\"'0px 0px 400px 0px'\"\n * [loading]=\"loading()\"\n * (loadMore)=\"loadMore()\">\n * </div>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/infinite-scroll.directive.ts\n * @since 0.3.0\n * @relatedTo CngxIntersectionObserver, CngxScrollSpy, CngxStickyHeader\n * <example-url>/#/common/layout/infinite-scroll/scrollable-list</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxInfiniteScroll]',\n standalone: true,\n exportAs: 'cngxInfiniteScroll',\n host: {\n class: 'cngx-infinite-scroll',\n '[class.cngx-infinite-scroll--loading]': 'isLoading()',\n '[attr.aria-busy]': 'isLoading() || null',\n },\n})\nexport class CngxInfiniteScroll {\n /** IntersectionObserver threshold (0–1). */\n readonly threshold = input<number>(0);\n\n /** Pre-fetch margin. `'0px 0px 200px 0px'` triggers 200px before the sentinel is visible. */\n readonly rootMargin = input<string>('0px 0px 200px 0px');\n\n /** CSS selector for a custom scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n\n /** When `false`, the observer disconnects entirely. Use to stop loading when all items are fetched. */\n readonly enabled = input<boolean>(true);\n\n /** Set to `true` while fetching. Prevents re-trigger until the fetch completes. */\n readonly loading = input<boolean>(false);\n\n /** Minimum ms between consecutive `loadMore` emissions. */\n readonly debounceMs = input<number>(200);\n\n /** Emitted when the sentinel is visible, not loading, and debounce has elapsed. */\n readonly loadMore = output<void>();\n\n /** Readonly mirror of the `loading` input. */\n readonly isLoading: Signal<boolean> = computed(() => this.loading());\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n private lastEmitTime = 0;\n private observer: IntersectionObserver | null = null;\n\n constructor() {\n const win = this.doc.defaultView;\n if (!win) {\n return;\n }\n\n effect((onCleanup) => {\n const enabled = this.enabled();\n const root = this.root();\n const rootMargin = this.rootMargin();\n const threshold = this.threshold();\n const debounceMs = this.debounceMs();\n\n if (!enabled) {\n return;\n }\n\n const isLoading = () => this.loading();\n const resolvedRoot = root ? this.doc.querySelector(root) : null;\n if (typeof ngDevMode !== 'undefined' && ngDevMode && root && !resolvedRoot) {\n cngxDevWarn(\n 'CNGX1032',\n `[cngxInfiniteScroll] root selector \"${root}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const entry = entries[entries.length - 1];\n if (!entry.isIntersecting) {\n return;\n }\n if (isLoading()) {\n return;\n }\n\n const now = Date.now();\n if (now - this.lastEmitTime < debounceMs) {\n return;\n }\n\n this.lastEmitTime = now;\n this.loadMore.emit();\n },\n { root: resolvedRoot, rootMargin, threshold },\n );\n\n observer.observe(this.el.nativeElement as HTMLElement);\n this.observer = observer;\n\n onCleanup(() => {\n observer.disconnect();\n this.observer = null;\n });\n });\n\n const loadingTransition = createTransitionTracker(() => this.loading());\n effect(() => {\n const loading = loadingTransition.current();\n const wasLoading = loadingTransition.previous();\n if (!wasLoading || loading) {\n return;\n }\n // IO reports intersection CHANGES only: when a fetched page does not\n // push the sentinel out of view there is no new entry after loading\n // settles, and the list stalls. Re-observing forces a fresh entry;\n // the debounce window is reset so that entry may emit immediately.\n untracked(() => {\n const sentinel = this.el.nativeElement as HTMLElement;\n this.lastEmitTime = 0;\n this.observer?.unobserve(sentinel);\n this.observer?.observe(sentinel);\n });\n });\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Communicates when a sticky-positioned element becomes stuck.\n *\n * Applies `position: sticky; top: 0` on the host automatically.\n * The directive adds a sentinel element before the host and uses\n * `IntersectionObserver` to detect when the sentinel scrolls out,\n * meaning the header is now stuck. Toggles a CSS class for shadow,\n * elevation, or background changes.\n *\n * The sentinel is observed against the **nearest scroll-container ancestor**\n * (the first ancestor whose computed `overflow-y` is not `visible`), not the\n * page - that is the scrollport `position: sticky` resolves against, so\n * `isSticky()` reports the state the host actually has. A scrollport whose\n * height is content-driven never scrolls in the block axis, so a header inside\n * it never pins; in dev mode the directive warns once when it resolves against\n * such a scrollport. The observer is recreated when `threshold` changes,\n * matching the sibling observer directives.\n *\n * ### Sticky header with shadow\n * ```html\n * <header cngxStickyHeader #sh=\"cngxStickyHeader\"\n * style=\"position: sticky; top: 0;\">\n * Page header\n * </header>\n * ```\n *\n * ```css\n * .cngx-sticky--active { box-shadow: 0 2px 4px rgba(0,0,0,.1); }\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/sticky-header.directive.ts\n * @since 0.3.0\n * @relatedTo CngxScrollSpy, CngxIntersectionObserver\n * <example-url>/#/common/layout/sticky-header/sticky-header-with-shadow</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxStickyHeader]',\n exportAs: 'cngxStickyHeader',\n standalone: true,\n host: {\n style: 'position: sticky; top: 0; z-index: var(--cngx-sticky-z-index, 1)',\n '[class.cngx-sticky--active]': 'isSticky()',\n },\n})\nexport class CngxStickyHeader {\n /** Intersection threshold - `0` triggers as soon as the sentinel leaves. */\n readonly threshold = input<number>(0);\n\n /** Emitted when the sticky state changes. */\n readonly stickyChange = output<boolean>();\n\n private readonly isStickyState = signal(false);\n /** Whether the header is currently in its stuck position. */\n readonly isSticky = this.isStickyState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /** Sentinel + scrollport resolved once after render; the observer effect keys on it. */\n private readonly observeSetup = signal<{\n sentinel: HTMLElement;\n scrollport: HTMLElement | null;\n } | null>(null);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // IntersectionObserver sentinel pattern - host is stuck once the 1px sentinel leaves\n // the scrollport the host actually sticks to.\n afterNextRender(() => {\n const host = this.el.nativeElement as HTMLElement;\n // Root the sentinel at the scrollport `position: sticky` resolves against, not the\n // viewport. Observing against the viewport reports a different thing entirely: a\n // header inside a never-scrolling scrollport would read `isSticky() === true` while\n // it visibly scrolls away with its content.\n const scrollport = this.resolveScrollParent(host);\n\n // A scrollport whose content fits never scrolls in the block axis, so a header\n // inside it can never pin - `isSticky()` stays false while the whole scrollport\n // moves. Flag the misconfiguration once, in dev only; a one-shot read here is\n // exactly what `afterNextRender` is for (no reactive-graph node, unlike a\n // dep-less effect). The 1px tolerance absorbs sub-pixel layout and browser-zoom\n // rounding: \"cannot meaningfully scroll\" instead of exact equality.\n if (\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n scrollport &&\n scrollport.scrollHeight - scrollport.clientHeight <= 1\n ) {\n cngxDevWarn(\n 'CNGX1034',\n '[cngxStickyHeader] resolves against a scroll container that cannot scroll ' +\n 'in the block axis (client height equals scroll height), so this header ' +\n 'will never pin. Give the scrollport a bounded block-size, or drop ' +\n 'cngxStickyHeader.',\n { host, scrollport },\n );\n }\n\n const sentinel = this.doc.createElement('div');\n sentinel.style.height = '1px';\n sentinel.style.width = '1px';\n sentinel.style.marginBottom = '-1px';\n sentinel.style.visibility = 'hidden';\n sentinel.style.pointerEvents = 'none';\n sentinel.setAttribute('aria-hidden', 'true');\n host.parentElement?.insertBefore(sentinel, host);\n\n this.observeSetup.set({ sentinel, scrollport });\n destroyRef.onDestroy(() => sentinel.remove());\n });\n\n // Observer creation lives in an effect so a later threshold change\n // recreates it - the one-shot afterNextRender above only resolves DOM.\n effect((onCleanup) => {\n const setup = this.observeSetup();\n const threshold = this.threshold();\n if (!setup) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n // batched records arrive oldest-first; only the newest reflects reality\n const isSticky = !entries[entries.length - 1].isIntersecting;\n if (isSticky !== this.isStickyState()) {\n this.isStickyState.set(isSticky);\n this.stickyChange.emit(isSticky);\n }\n },\n { threshold, root: setup.scrollport },\n );\n\n observer.observe(setup.sentinel);\n\n onCleanup(() => observer.disconnect());\n });\n }\n\n /**\n * The nearest ancestor that is a scroll container in the block axis - the scrollport\n * `position: sticky` resolves against. Walks up from the host's parent to the first\n * ancestor whose computed `overflow-y` is `auto`, `scroll` or `hidden`; `null` means\n * no such ancestor, i.e. the header sticks to the viewport. `clip` clips without\n * creating a scroll container, so it is skipped. A used `overflow-x` of `auto`,\n * `scroll` or `hidden` coerces the computed `overflow-y` to `auto`, so this also\n * catches a horizontal scroll container (e.g. a data grid that scrolls sideways).\n */\n private resolveScrollParent(host: HTMLElement): HTMLElement | null {\n const view = this.doc.defaultView;\n for (let node = host.parentElement; node; node = node.parentElement) {\n const overflowY = view?.getComputedStyle(node).overflowY;\n if (overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'hidden') {\n return node;\n }\n }\n return null;\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport { afterNextRender, Directive, effect, inject, input, output, signal } from '@angular/core';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Tracks which section is currently most visible in the viewport.\n *\n * Observes a list of elements by their IDs using `IntersectionObserver`\n * and reports the one with the highest intersection ratio as the active section.\n * Ideal for scroll-based navigation highlighting and reading progress.\n *\n * Section IDs are resolved when the inputs change - sections rendered later\n * (`@if`/`@defer`) are not picked up automatically; re-bind `[cngxScrollSpy]`\n * once they exist. In dev mode the directive warns about IDs it cannot find.\n *\n * ### Navigation highlighting\n * ```html\n * <nav [cngxScrollSpy]=\"['intro', 'features', 'pricing']\"\n * #spy=\"cngxScrollSpy\">\n * <a [class.active]=\"spy.activeId() === 'intro'\" href=\"#intro\">Intro</a>\n * <a [class.active]=\"spy.activeId() === 'features'\" href=\"#features\">Features</a>\n * <a [class.active]=\"spy.activeId() === 'pricing'\" href=\"#pricing\">Pricing</a>\n * </nav>\n *\n * <section id=\"intro\">…</section>\n * <section id=\"features\">…</section>\n * <section id=\"pricing\">…</section>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-spy.directive.ts\n * @since 0.3.0\n * @relatedTo CngxIntersectionObserver, CngxStickyHeader, CngxInfiniteScroll\n * <example-url>/#/common/layout/scroll-spy/scroll-based-navigation</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxScrollSpy]',\n exportAs: 'cngxScrollSpy',\n standalone: true,\n})\nexport class CngxScrollSpy {\n /** IDs of the sections to observe. */\n readonly sections = input.required<string[]>({ alias: 'cngxScrollSpy' });\n /** Minimum visibility ratio to consider a section as a candidate. */\n readonly threshold = input<number>(0.3);\n /** CSS selector for the scroll container root. `null` uses the viewport. */\n readonly root = input<string | null>(null);\n /** Root margin for the observer. */\n readonly rootMargin = input<string>('0px');\n\n /** Emitted when the active section changes. */\n readonly activeIdChange = output<string | null>();\n\n private readonly activeIdState = signal<string | null>(null);\n /** ID of the section with the highest intersection ratio. */\n readonly activeId = this.activeIdState.asReadonly();\n\n private readonly doc = inject(DOCUMENT);\n /** Last observed intersection ratio keyed by section ID. */\n private readonly ratios = new Map<string, number>();\n private readonly initialized = signal(false);\n private activeCleanup: (() => void) | undefined;\n\n constructor() {\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // Recreate the observer whenever inputs change (deferred until DOM is ready).\n effect((onCleanup) => {\n this.sections();\n this.threshold();\n this.root();\n this.rootMargin();\n\n if (!this.initialized()) {\n return;\n }\n\n this.activeCleanup?.();\n this.activeCleanup = this.setupObserver();\n\n onCleanup(() => {\n this.activeCleanup?.();\n this.activeCleanup = undefined;\n });\n });\n }\n\n /** Builds an `IntersectionObserver` for the current section IDs. Returns a disconnect callback. */\n private setupObserver(): (() => void) | undefined {\n const ids = this.sections();\n const thresholdValue = this.threshold();\n const rootSelector = this.root();\n const rootMarginValue = this.rootMargin();\n\n this.ratios.clear();\n\n const elements = ids\n .map((id) => this.doc.getElementById(id))\n .filter((el): el is HTMLElement => el !== null);\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode && elements.length < ids.length) {\n const missing = ids.filter((id) => !this.doc.getElementById(id));\n cngxDevWarn(\n 'CNGX1033',\n `[cngxScrollSpy] section id(s) not found: ${missing.join(', ')}. ` +\n 'Late-rendered sections are not observed - re-bind [cngxScrollSpy] once they exist.',\n );\n }\n\n if (elements.length === 0) {\n return undefined;\n }\n\n const resolvedRoot = rootSelector ? this.doc.querySelector(rootSelector) : null;\n if (typeof ngDevMode !== 'undefined' && ngDevMode && rootSelector && !resolvedRoot) {\n cngxDevWarn(\n 'CNGX1032',\n `[cngxScrollSpy] root selector \"${rootSelector}\" matched no element - ` +\n 'falling back to the viewport. A late-rendered root needs a re-bind of [root].',\n );\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => this.ratios.set(entry.target.id, entry.intersectionRatio));\n\n const best = Array.from(this.ratios).reduce<{ id: string | null; ratio: number }>(\n (acc, [id, ratio]) =>\n ratio >= thresholdValue && ratio > acc.ratio ? { id, ratio } : acc,\n { id: null, ratio: 0 },\n );\n\n if (best.id !== this.activeIdState()) {\n this.activeIdState.set(best.id);\n this.activeIdChange.emit(best.id);\n }\n },\n {\n root: resolvedRoot,\n rootMargin: rootMarginValue,\n threshold: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],\n },\n );\n\n elements.forEach((el) => observer.observe(el));\n\n return () => observer.disconnect();\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { observeResize } from '../observers/resize-signal';\n\n/**\n * Manages text truncation with expand/collapse state detection.\n *\n * Applies `-webkit-line-clamp` when collapsed and detects whether the text\n * is actually clamped (content overflows). Exposes `isClamped` so the consumer\n * can conditionally show a \"Show more\" toggle only when needed.\n *\n * The `expanded` state supports two-way binding (controlled + uncontrolled).\n *\n * ### Basic truncation with toggle\n * ```html\n * <p [cngxTruncate]=\"3\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n * Long text content that may or may not overflow…\n * </p>\n * @if (trunc.isClamped() || trunc.expanded()) {\n * <button (click)=\"expanded.set(!expanded())\"\n * [attr.aria-expanded]=\"expanded()\">\n * {{ expanded() ? 'Show less' : 'Show more' }}\n * </button> * }\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/truncate.directive.ts\n * @since 0.3.0\n * @relatedTo CngxExpandableText, CngxExpandableToggle, CngxHighlight\n * <example-url>/#/common/layout/truncate/short-text-no-toggle</example-url>\n * <example-url>/#/common/layout/truncate/truncated-text-with-toggle</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxTruncate]',\n exportAs: 'cngxTruncate',\n standalone: true,\n host: {\n '[style.-webkit-line-clamp]': 'clampValue()',\n '[style.display]': 'displayValue()',\n '[style.-webkit-box-orient]': 'orientValue()',\n '[style.overflow]': 'overflowValue()',\n },\n})\nexport class CngxTruncate {\n /** Maximum number of visible lines when collapsed. */\n readonly lines = input<number>(3, { alias: 'cngxTruncate' });\n /** Whether the text is expanded (full content visible). Supports two-way binding. */\n readonly expanded = model<boolean>(false);\n\n private readonly isClampedState = signal(false);\n /** Whether the text content actually exceeds the line limit and is being clamped. */\n readonly isClamped = this.isClampedState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private stopResize: (() => void) | null = null;\n private rafHandle: number | null = null;\n\n // null strips the host binding - preferred over an empty string for -webkit-line-clamp.\n /** @internal */\n protected readonly clampValue = computed(() => (this.expanded() ? null : String(this.lines())));\n /** @internal */\n protected readonly displayValue = computed(() => (this.expanded() ? null : '-webkit-box'));\n /** @internal */\n protected readonly orientValue = computed(() => (this.expanded() ? null : 'vertical'));\n /** @internal */\n protected readonly overflowValue = computed(() => (this.expanded() ? null : 'hidden'));\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // SSR guard: no window, no measuring - the style bindings above still render.\n const win = inject(DOCUMENT).defaultView;\n if (!win) {\n return;\n }\n\n afterNextRender(() => {\n this.checkClamped();\n this.stopResize = observeResize(\n win,\n this.el.nativeElement as HTMLElement,\n 'content-box',\n () => this.checkClamped(),\n );\n });\n\n // Re-check after expanded/lines change; RAF ensures styles are applied first.\n effect(() => {\n this.expanded(); // track\n this.lines(); // track\n this.cancelRaf();\n this.rafHandle = requestAnimationFrame(() => this.checkClamped());\n });\n\n destroyRef.onDestroy(() => {\n this.stopResize?.();\n this.cancelRaf();\n });\n }\n\n private cancelRaf(): void {\n if (this.rafHandle !== null) {\n cancelAnimationFrame(this.rafHandle);\n this.rafHandle = null;\n }\n }\n\n /**\n * Compares `scrollHeight` vs `clientHeight` to detect overflow.\n * Only meaningful when collapsed - when expanded, the last known\n * clamped state is preserved (can't measure hypothetical clamp height\n * while showing full content).\n */\n private checkClamped(): void {\n const el = this.el.nativeElement as HTMLElement;\n if (this.expanded()) {\n return;\n }\n this.isClampedState.set(el.scrollHeight > el.clientHeight);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Search-text highlighting via `<mark>` elements.\n *\n * Walks `TEXT_NODE` children of the host element, splits at match boundaries,\n * and wraps matched portions in `<mark>` elements. No `innerHTML` - safe by\n * construction. The `<mark>` element has correct native SR semantics (announced\n * as \"highlighted\" in most screen readers).\n *\n * The original text nodes are kept by reference and re-inserted when the\n * term changes or the directive is destroyed - Angular bindings targeting\n * them (interpolations, structural directives) stay live.\n *\n * ### Search result highlighting\n * ```html\n * <p [cngxHighlight]=\"searchTerm()\">\n * Angular Signals represent a fundamental shift in reactivity.\n * </p>\n * ```\n *\n * ### Case-sensitive matching\n * ```html\n * <p [cngxHighlight]=\"term()\" [highlightCaseSensitive]=\"true\">\n * CamelCase matters here.\n * </p>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/highlight.directive.ts\n * @since 0.3.0\n * @relatedTo CngxTruncate, CngxExpandableText\n * <example-url>/#/common/layout/highlight/live-search-highlighting</example-url>\n * <example-url>/#/common/layout/highlight/multiple-paragraphs</example-url>\n * @axis level atom\n */\n@Directive({\n selector: '[cngxHighlight]',\n exportAs: 'cngxHighlight',\n standalone: true,\n})\nexport class CngxHighlight {\n /** The search term to highlight. Empty string clears all highlights. */\n readonly term = input<string>('', { alias: 'cngxHighlight' });\n /** Whether matching is case-sensitive. */\n readonly caseSensitive = input<boolean>(false, { alias: 'highlightCaseSensitive' });\n\n private readonly matchCountState = signal(0);\n /** Number of matches found in the current highlight pass. */\n readonly matchCount = this.matchCountState.asReadonly();\n\n private readonly el = inject(ElementRef<HTMLElement>);\n private readonly doc = inject(DOCUMENT);\n /**\n * The text nodes replaced by the current highlight pass, by reference,\n * with the nodes standing in for them. Undone before every re-highlight\n * and on destroy - re-inserting the original references keeps LView\n * bindings (interpolations) attached to live DOM.\n */\n private replacements: { original: Text; inserted: Node[] }[] = [];\n private readonly initialized = signal(false);\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.restoreNodes());\n\n afterNextRender(() => {\n this.initialized.set(true);\n });\n\n // The highlight pass writes matchCountState - untracked, so the write\n // cannot re-trigger this effect.\n effect(() => {\n const term = this.term();\n const caseSensitive = this.caseSensitive();\n if (this.initialized()) {\n untracked(() => this.applyHighlight(term, caseSensitive));\n }\n });\n }\n\n /**\n * Performs the highlight pass: restores original DOM, then wraps matches\n * in `<mark>` elements. Updates `matchCountState` with the result count.\n */\n private applyHighlight(term: string, caseSensitive: boolean): void {\n const host = this.el.nativeElement as HTMLElement;\n\n this.restoreNodes();\n\n if (!term) {\n this.matchCountState.set(0);\n return;\n }\n\n let count = 0;\n const walker = this.doc.createTreeWalker(host, NodeFilter.SHOW_TEXT);\n const textNodes: Text[] = [];\n\n // Collect nodes before modifying the DOM during the walk.\n let node: Text | null;\n while ((node = walker.nextNode() as Text | null)) {\n textNodes.push(node);\n }\n\n for (const textNode of textNodes) {\n const text = textNode.textContent ?? '';\n const flags = caseSensitive ? 'g' : 'gi';\n const regex = new RegExp(this.escapeRegex(term), flags);\n const matches = [...text.matchAll(regex)];\n\n if (matches.length === 0) {\n continue;\n }\n\n count += matches.length;\n const fragment = this.doc.createDocumentFragment();\n let lastIndex = 0;\n\n for (const match of matches) {\n const matchStart = match.index;\n const matchEnd = matchStart + match[0].length;\n\n if (matchStart > lastIndex) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex, matchStart)));\n }\n\n const mark = this.doc.createElement('mark');\n mark.textContent = text.slice(matchStart, matchEnd);\n fragment.appendChild(mark);\n\n lastIndex = matchEnd;\n }\n\n if (lastIndex < text.length) {\n fragment.appendChild(this.doc.createTextNode(text.slice(lastIndex)));\n }\n\n // Capture before replaceChild - inserting a fragment empties it.\n const inserted = Array.from(fragment.childNodes);\n textNode.parentNode!.replaceChild(fragment, textNode);\n this.replacements.push({ original: textNode, inserted });\n }\n\n this.matchCountState.set(count);\n }\n\n /** Puts the original text nodes back and removes the highlight nodes. */\n private restoreNodes(): void {\n for (const { original, inserted } of this.replacements) {\n const parent = inserted[0]?.parentNode;\n if (!parent) {\n continue;\n }\n parent.insertBefore(original, inserted[0]);\n for (const node of inserted) {\n if (node.parentNode === parent) {\n parent.removeChild(node);\n }\n }\n }\n this.replacements = [];\n }\n\n /** Escapes special regex characters in the search term. */\n private escapeRegex(str: string): string {\n return str.replaceAll(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n inject,\n input,\n model,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { injectLayoutI18n } from '../i18n/layout-i18n';\nimport { CngxTruncate } from './truncate.directive';\n\n/**\n * Template context for the custom toggle template.\n */\nexport interface CngxExpandableToggleContext {\n /** Whether the text is currently expanded. */\n $implicit: boolean;\n /** Whether the text is currently expanded. */\n expanded: boolean;\n /** Call to toggle the expanded state. */\n toggle: () => void;\n}\n\n/**\n * Marks a custom toggle template inside `cngx-expandable-text`.\n *\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\" class=\"icon-btn\">\n * <mat-icon>{{ expanded ? 'expand_less' : 'expand_more' }}</mat-icon>\n * </button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.3.0\n * @relatedTo CngxExpandableText, CngxTruncate\n */\n@Directive({\n selector: 'ng-template[cngxExpandableToggle]',\n standalone: true,\n})\nexport class CngxExpandableToggle {\n readonly templateRef = inject<TemplateRef<CngxExpandableToggleContext>>(TemplateRef);\n}\n\n/**\n * Molecule wrapping `CngxTruncate` with a built-in expand/collapse toggle.\n *\n * Projects content into a truncated container and conditionally renders\n * a \"Show more\" / \"Show less\" button when the content is actually clamped.\n * Handles `aria-expanded` automatically.\n *\n * Supports custom toggle templates via `ng-template[cngxExpandableToggle]` -\n * use for icon buttons or any custom UI instead of plain text labels.\n *\n * ### Basic usage\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text that may or may not overflow the container…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom labels\n * ```html\n * <cngx-expandable-text [lines]=\"2\" moreLabel=\"Mehr\" lessLabel=\"Weniger\">\n * Langer Text…\n * </cngx-expandable-text>\n * ```\n *\n * ### Custom toggle template\n * ```html\n * <cngx-expandable-text [lines]=\"3\">\n * Long text…\n * <ng-template cngxExpandableToggle let-expanded let-toggle=\"toggle\">\n * <button (click)=\"toggle()\">{{ expanded ? 'Collapse' : 'Expand' }}</button>\n * </ng-template>\n * </cngx-expandable-text>\n * ```\n *\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/text/expandable-text.ts\n * @since 0.3.0\n * @relatedTo CngxTruncate, CngxExpandableToggle, CngxHighlight\n * @slot cngxExpandableToggle Replaces the show-more control; gets the current expanded state.\n * <example-url>/#/common/layout/expandable-text/auto-toggle</example-url>\n * <example-url>/#/common/layout/expandable-text/custom-labels</example-url>\n * <example-url>/#/common/layout/expandable-text/custom-toggle-template</example-url>\n * <example-url>/#/common/layout/expandable-text/card-with-expandable-text</example-url>\n * @axis level molecule\n */\n@Component({\n selector: 'cngx-expandable-text',\n exportAs: 'cngxExpandableText',\n standalone: true,\n imports: [CngxTruncate, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n style: 'display:block',\n },\n template: `\n <div [cngxTruncate]=\"lines()\" [(expanded)]=\"expanded\" #trunc=\"cngxTruncate\">\n <ng-content />\n </div>\n @if (trunc.isClamped() || expanded()) {\n @if (customToggle(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.templateRef\"\n [ngTemplateOutletContext]=\"toggleContext()\"\n />\n } @else {\n <button\n type=\"button\"\n class=\"cngx-expandable-text__toggle\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? resolvedLessLabel() : resolvedMoreLabel() }}\n </button>\n }\n }\n `,\n})\nexport class CngxExpandableText {\n private readonly i18n = injectLayoutI18n();\n\n /** Maximum visible lines when collapsed. */\n readonly lines = input<number>(3);\n /** Whether the text is expanded. Supports two-way `[(expanded)]` binding. */\n readonly expanded = model<boolean>(false);\n /**\n * Label for the \"show more\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextMore`.\n */\n readonly moreLabel = input<string | undefined>(undefined);\n /**\n * Label for the \"show less\" button. Unbound, it follows\n * `CNGX_LAYOUT_I18N.expandableTextLess`.\n */\n readonly lessLabel = input<string | undefined>(undefined);\n protected readonly resolvedMoreLabel = computed(\n () => this.moreLabel() ?? this.i18n().expandableTextMore,\n );\n protected readonly resolvedLessLabel = computed(\n () => this.lessLabel() ?? this.i18n().expandableTextLess,\n );\n\n /** Optional custom toggle template projected by the consumer. */\n protected readonly customToggle = contentChild(CngxExpandableToggle);\n\n /** Stable toggle closure - a fresh closure per context would defeat the equal fn below. */\n private readonly toggleFn = (): void => this.expanded.set(!this.expanded());\n\n /**\n * Template context for the custom toggle. Structural `equal` fn so\n * `ngTemplateOutletContext` does not rebind the embedded view on every\n * CD cycle (same rule as the CngxTag slot contexts).\n */\n protected readonly toggleContext = computed<CngxExpandableToggleContext>(\n () => ({\n $implicit: this.expanded(),\n expanded: this.expanded(),\n toggle: this.toggleFn,\n }),\n { equal: (a, b) => a.expanded === b.expanded },\n );\n}\n","/**\n * @module `@cngx/common/layout`\n */\nexport { CngxBackdrop } from './drawer/backdrop.directive';\nexport { CngxDrawer, type DrawerPosition } from './drawer/drawer.directive';\nexport {\n CNGX_DRAWER_HOST,\n type CngxDrawerHost,\n type CngxDrawerPanelPresentation,\n} from './drawer/drawer-host';\nexport { CngxDrawerPanel, type DrawerMode } from './drawer/drawer-panel.directive';\nexport { CngxDrawerContent } from './drawer/drawer-content.directive';\nexport {\n CngxDrawerSurface,\n CNGX_DRAWER_SURFACE_DRIVER,\n type CngxDrawerModality,\n type CngxDrawerSurfaceDriver,\n} from './drawer/drawer-surface.directive';\nexport { CngxIntersectionObserver } from './observers/intersection-observer.directive';\nexport { CngxMediaQuery } from './observers/media-query.directive';\nexport { injectMediaQuery } from './observers/inject-media-query';\nexport { injectQueryParamSync, type QueryParamSyncOptions } from './router/inject-query-param-sync';\nexport { CngxResizeObserver } from './observers/resize-observer.directive';\nexport {\n createResizeSignal,\n observeResize,\n type ResizeObserverHost,\n} from './observers/resize-signal';\nexport { CngxContainer } from './observers/container.directive';\nexport {\n CNGX_CONTAINER_SIZE,\n type CngxContainerSize,\n createContainerSize,\n injectContainerSize,\n} from './observers/container-size';\nexport {\n CNGX_PANEL_TARGET,\n type CngxPanelMode,\n type CngxPanelSide,\n type CngxPanelTarget,\n} from './panel-trigger/panel-target';\nexport { CngxPanelToggle } from './panel-toggle/panel-toggle.component';\nexport {\n CngxPanelTrigger,\n type CngxPanelTriggerAction,\n} from './panel-trigger/panel-trigger.directive';\nexport {\n CNGX_RESIZABLE_DEFAULTS,\n CngxResizable,\n type CngxResizableDefaults,\n type CngxResizableEdge,\n} from './resizable/resizable.directive';\nexport { CngxScrollLock } from './scroll/scroll-lock.directive';\nexport { createPinnedScrollLock, createScrollLock } from './scroll/scroll-lock-core';\nexport { CngxScrollEdges } from './scroll/scroll-edges.directive';\nexport {\n createScrollEdges,\n type CngxScrollEdgesState,\n type ScrollEdgesHost,\n} from './scroll/scroll-edges-core';\nexport {\n CNGX_SIDEBAR_DRIVER,\n CngxSidebar,\n type CngxSidebarCollapsedAs,\n type CngxSidebarDriver,\n type CngxSidebarSide,\n type CngxSidebarState,\n} from './sidebar/sidebar.directive';\nexport { CngxSkeleton } from './text/skeleton.directive';\nexport { CngxInfiniteScroll } from './scroll/infinite-scroll.directive';\nexport { CngxStickyHeader } from './scroll/sticky-header.directive';\nexport { CngxScrollSpy } from './scroll/scroll-spy.directive';\nexport { CngxTruncate } from './text/truncate.directive';\nexport { CngxHighlight } from './text/highlight.directive';\nexport {\n CngxExpandableText,\n CngxExpandableToggle,\n type CngxExpandableToggleContext,\n} from './text/expandable-text';\nexport {\n CNGX_LAYOUT_I18N,\n injectLayoutI18n,\n provideLayoutI18n,\n withLayoutI18nLabels,\n type CngxLayoutI18n,\n type CngxLayoutI18nFeature,\n} from './i18n/layout-i18n';\nexport {\n CNGX_LAYOUT_LANGUAGE_EN,\n type CngxLayoutLanguageSection,\n} from './i18n/layout-language-section';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.CngxDrawerSurface","DestroyRefToken","i1.CngxPanelTrigger","i2","i1"],"mappings":";;;;;;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;AAeG;AACH,MAAM,kBAAkB,GAAG;IACzB,wBAAwB;IACxB,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,cAAc;IACd,6BAA6B;IAC7B,0BAA0B;IAC1B,wBAAwB;IACxB,sBAAsB;AACvB,CAAA,CAAC,IAAI,CAAC,IAAI,CAAC;AAsBZ;;;;;AAKG;AACH,MAAM,kBAAkB,GAAG,mBAAmB;AAE9C;;;;;;;;;;;;;;;;AAgBG;SACa,mBAAmB,CACjC,IAAiB,EACjB,UAAoC,EAAE,EAAA;AAEtC,IAAA,MAAM,EAAE,KAAK,GAAG,UAAU,EAAE,OAAO,GAAG,MAAM,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO;IAC/E,MAAM,IAAI,GAAG,KAAK,KAAK,SAAS,IAAI,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa;AAC3F,IAAA,MAAM,YAAY,GAAG,QAAQ,GAAG,CAAA,EAAG,kBAAkB,CAAA,EAAA,EAAK,QAAQ,CAAA,CAAE,GAAG,kBAAkB;AACzF,IAAA,MAAM,gBAAgB,GAAG,CAAA,EAAG,YAAY,CAAA,EAAA,EAAK,kBAAkB,EAAE;IACjE,MAAM,OAAO,GAAkB,EAAE;IACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,g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