@cngx/ui 0.1.0-rc.5 → 0.1.0-rc.7

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 (79) hide show
  1. package/README.md +112 -0
  2. package/a11y/README.md +81 -0
  3. package/context-menu/README.md +98 -0
  4. package/data-grid-accordion/README.md +27 -0
  5. package/feedback/README.md +2 -0
  6. package/fesm2022/cngx-ui-a11y.mjs +320 -0
  7. package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
  8. package/fesm2022/cngx-ui-accordion.mjs +19 -8
  9. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  10. package/fesm2022/cngx-ui-action-button.mjs +5 -2
  11. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  12. package/fesm2022/cngx-ui-breadcrumb.mjs +11 -6
  13. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  14. package/fesm2022/cngx-ui-chart-panel.mjs +429 -0
  15. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
  16. package/fesm2022/cngx-ui-collection.mjs +15 -6
  17. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-command-palette.mjs +1005 -0
  19. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-context-menu.mjs +742 -0
  21. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
  22. package/fesm2022/cngx-ui-data-grid-accordion.mjs +90 -20
  23. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  24. package/fesm2022/cngx-ui-feedback.mjs +97 -106
  25. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  26. package/fesm2022/cngx-ui-layout.mjs +18 -9
  27. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  28. package/fesm2022/cngx-ui-mat-accordion.mjs +9 -9
  29. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  30. package/fesm2022/cngx-ui-mat-tabs.mjs +64 -70
  31. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  32. package/fesm2022/cngx-ui-paginator.mjs +18 -8
  33. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  34. package/fesm2022/cngx-ui-sidenav.mjs +2 -2
  35. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  36. package/fesm2022/cngx-ui-skeleton.mjs +20 -7
  37. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  38. package/fesm2022/cngx-ui-speak.mjs +2 -2
  39. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  40. package/fesm2022/cngx-ui-stat-card.mjs +618 -0
  41. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
  42. package/fesm2022/cngx-ui-stepper.mjs +38 -19
  43. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  44. package/fesm2022/cngx-ui-tabs.mjs +36 -19
  45. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  46. package/fesm2022/cngx-ui-timeline.mjs +495 -0
  47. package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
  48. package/fesm2022/cngx-ui-toc.mjs +704 -0
  49. package/fesm2022/cngx-ui-toc.mjs.map +1 -0
  50. package/fesm2022/cngx-ui.mjs +2 -2
  51. package/fesm2022/cngx-ui.mjs.map +1 -1
  52. package/mat-accordion/README.md +1 -1
  53. package/mat-tabs/styles/mat-tabs.css +20 -17
  54. package/package.json +32 -1
  55. package/skeleton/README.md +2 -0
  56. package/stepper/README.md +2 -2
  57. package/timeline/README.md +350 -0
  58. package/toc/README.md +183 -0
  59. package/types/cngx-ui-a11y.d.ts +303 -0
  60. package/types/cngx-ui-accordion.d.ts +9 -4
  61. package/types/cngx-ui-action-button.d.ts +3 -0
  62. package/types/cngx-ui-breadcrumb.d.ts +5 -0
  63. package/types/cngx-ui-chart-panel.d.ts +278 -0
  64. package/types/cngx-ui-collection.d.ts +12 -3
  65. package/types/cngx-ui-command-palette.d.ts +451 -0
  66. package/types/cngx-ui-context-menu.d.ts +467 -0
  67. package/types/cngx-ui-data-grid-accordion.d.ts +72 -15
  68. package/types/cngx-ui-feedback.d.ts +71 -18
  69. package/types/cngx-ui-layout.d.ts +8 -3
  70. package/types/cngx-ui-mat-accordion.d.ts +3 -3
  71. package/types/cngx-ui-mat-tabs.d.ts +11 -9
  72. package/types/cngx-ui-paginator.d.ts +13 -3
  73. package/types/cngx-ui-skeleton.d.ts +13 -1
  74. package/types/cngx-ui-stat-card.d.ts +327 -0
  75. package/types/cngx-ui-stepper.d.ts +18 -4
  76. package/types/cngx-ui-tabs.d.ts +20 -4
  77. package/types/cngx-ui-timeline.d.ts +479 -0
  78. package/types/cngx-ui-toc.d.ts +514 -0
  79. package/types/cngx-ui.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-skeleton.mjs","sources":["../../../projects/ui/skeleton/skeleton-placeholder.ts","../../../projects/ui/skeleton/skeleton-container.ts","../../../projects/ui/skeleton/public-api.ts","../../../projects/ui/skeleton/cngx-ui-skeleton.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive that registers a `<ng-template>` as the\n * loading-state stand-in for `<cngx-skeleton>`. The container reads\n * it via `contentChild(CngxSkeletonPlaceholder)`; the directive\n * holds only the `TemplateRef` and contributes no DOM of its own.\n *\n * One-per-container contract: the container uses `contentChild`\n * (single), not `contentChildren`. Multiple sibling\n * `<ng-template cngxSkeletonPlaceholder>` blocks resolve to the\n * first match; the rest are dead code. Pick the variant at author\n * time, do not stack alternatives.\n *\n * Repetition: while the container's `loading()` (or\n * `state.isFirstLoad()`) is `true`, the template renders `[count]`\n * times inside the container's internal `@for`. When loading flips\n * to `false`, the skeleton DOM tears down and the projected sibling\n * content renders in its place.\n *\n * Context fields ({@link CngxSkeletonPlaceholderContext}):\n * - `$implicit` / `index` - 0-based iteration index. Drive per-row\n * width variance with it (`i === 0 ? '60%' : '100%'`).\n * - `count` - total placeholders being rendered, mirrors the\n * container's `[count]` input.\n * - `first` / `last` - row markers for end-of-block treatments\n * (e.g. last row without a trailing border).\n *\n * Bind via `let-i` for the implicit index, or `let-x=\"<field>\"`\n * for any other field:\n *\n * ```html\n * <cngx-skeleton [loading]=\"loading()\" [count]=\"3\">\n * <ng-template cngxSkeletonPlaceholder let-i>\n * <div class=\"skeleton-line\"\n * [style.width]=\"i === 0 ? '60%' : '100%'\"></div>\n * </ng-template>\n * <p>Real content</p>\n * </cngx-skeleton>\n * ```\n *\n * Last-row variant using `let-last`:\n *\n * ```html\n * <ng-template cngxSkeletonPlaceholder let-i let-last=\"last\">\n * <div class=\"skeleton-row\" [class.is-last]=\"last\"></div>\n * </ng-template>\n * ```\n *\n * @category ui/skeleton\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/skeleton/skeleton-placeholder.ts\n * @since 0.1.0\n * @relatedTo CngxSkeletonContainer\n */\n@Directive({\n selector: 'ng-template[cngxSkeletonPlaceholder]',\n standalone: true,\n})\nexport class CngxSkeletonPlaceholder {\n /** Reference to the projected template. Used internally by `CngxSkeletonContainer`. */\n readonly templateRef = inject<TemplateRef<CngxSkeletonPlaceholderContext>>(TemplateRef);\n}\n\n/**\n * Template context for `cngxSkeletonPlaceholder`.\n *\n * @category ui/skeleton\n */\nexport interface CngxSkeletonPlaceholderContext {\n /** Current index (0-based). */\n $implicit: number;\n /** Current index (named). */\n index: number;\n /** Total count. */\n count: number;\n /** Whether this is the first item. */\n first: boolean;\n /** Whether this is the last item. */\n last: boolean;\n}\n","import { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n inject,\n input,\n signal,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\n\nimport {\n CngxSkeletonPlaceholder,\n type CngxSkeletonPlaceholderContext,\n} from './skeleton-placeholder';\n\n/**\n * Skeleton loading container with built-in placeholder repetition.\n *\n * Manages CSS classes, ARIA, and reduced-motion handling internally\n * (same behavior as the `CngxSkeleton` atom directive). Adds template projection\n * so the consumer doesn't need `@if`/`@for` boilerplate.\n *\n * - Project a `<ng-template cngxSkeletonPlaceholder>` for the loading state (repeated `count` times).\n * - Project content directly for the loaded state.\n * - Uses `display: contents` - no extra DOM wrapper.\n *\n * ### Basic usage\n * ```html\n * <cngx-skeleton [loading]=\"loading()\" [count]=\"3\">\n * <ng-template cngxSkeletonPlaceholder>\n * <div class=\"skeleton-card\"></div>\n * </ng-template>\n * <app-real-content />\n * </cngx-skeleton>\n * ```\n *\n * ### With template context (index, first, last)\n * ```html\n * <cngx-skeleton [loading]=\"loading()\" [count]=\"5\">\n * <ng-template cngxSkeletonPlaceholder let-i let-last=\"last\">\n * <div class=\"skeleton-line\" [style.width]=\"last ? '60%' : '100%'\"></div>\n * </ng-template>\n * <p>Loaded content here</p>\n * </cngx-skeleton>\n * ```\n *\n * @category ui/skeleton\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/skeleton/skeleton-container.ts\n * @since 0.1.0\n * @relatedTo CngxSkeletonPlaceholder, CngxAsyncState, CngxEmptyState\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 * <example-url>http://localhost:4200/#/ui/skeleton/card-skeleton</example-url>\n * <example-url>http://localhost:4200/#/ui/skeleton/template-context</example-url>\n */\n@Component({\n selector: 'cngx-skeleton',\n standalone: true,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxSkeletonContainer',\n host: {\n style: 'display: contents',\n class: 'cngx-skeleton',\n '[class.cngx-skeleton--loading]': 'isLoading()',\n '[class.cngx-skeleton--shimmer]': 'showShimmer()',\n '[attr.aria-busy]': 'isLoading() || null',\n },\n template: `\n @if (isLoading()) {\n @for (i of indices(); track i) {\n <ng-container\n *ngTemplateOutlet=\"placeholderTpl()?.templateRef ?? null; context: getContext(i)\"\n />\n }\n } @else {\n <ng-content />\n }\n `,\n styleUrls: ['./skeleton-container.css'],\n})\nexport class CngxSkeletonContainer {\n /** Controls the loading state directly. */\n readonly loading = input<boolean>(false);\n\n /** Bind an async state - shows skeleton during first load. Takes precedence over `loading`. */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */\n readonly shimmer = input<boolean>(true);\n\n /** Repeat count for the placeholder template. */\n readonly count = input<number>(1);\n\n /** Derived loading state: `state.isFirstLoad` takes precedence over `loading` input. */\n protected readonly isLoading = computed(() => this.state()?.isFirstLoad() ?? this.loading());\n\n /** @internal - projected placeholder template. */\n protected readonly placeholderTpl = contentChild(CngxSkeletonPlaceholder);\n\n /** Array of indices for internal `@for` rendering. */\n readonly indices = computed(() => Array.from({ length: this.count() }, (_, i) => i));\n\n private readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n const pref = signal(false);\n if (win?.matchMedia) {\n const mq = win.matchMedia('(prefers-reduced-motion: reduce)');\n pref.set(mq.matches);\n const listener = (e: MediaQueryListEvent) => pref.set(e.matches);\n mq.addEventListener('change', listener);\n inject(DestroyRef).onDestroy(() => mq.removeEventListener('change', listener));\n }\n this.prefersReducedMotion = pref.asReadonly();\n }\n\n /** @internal */\n protected readonly showShimmer = computed(\n () => this.isLoading() && this.shimmer() && !this.prefersReducedMotion(),\n );\n\n /** @internal */\n protected getContext(index: number): CngxSkeletonPlaceholderContext {\n const total = this.count();\n return {\n $implicit: index,\n index,\n count: total,\n first: index === 0,\n last: index === total - 1,\n };\n }\n}\n","/**\n * @module @cngx/ui/skeleton\n */\n\nexport { CngxSkeletonContainer } from './skeleton-container';\nexport {\n CngxSkeletonPlaceholder,\n type CngxSkeletonPlaceholderContext,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A,CAAA,2lDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EArBS,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAwBf,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA3BjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,cACb,IAAI,EAAA,OAAA,EACP,CAAC,gBAAgB,CAAC,EAAA,eAAA,EACV,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAC3B,uBAAuB,EAAA,IAAA,EAC3B;AACJ,wBAAA,KAAK,EAAE,mBAAmB;AAC1B,wBAAA,KAAK,EAAE,eAAe;AACtB,wBAAA,gCAAgC,EAAE,aAAa;AAC/C,wBAAA,gCAAgC,EAAE,eAAe;AACjD,wBAAA,kBAAkB,EAAE,qBAAqB;qBAC1C,EAAA,QAAA,EACS;;;;;;;;;;AAUT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,2lDAAA,CAAA,EAAA;6eAoBgD,uBAAuB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC1G1E;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-skeleton.mjs","sources":["../../../projects/ui/skeleton/skeleton-placeholder.ts","../../../projects/ui/skeleton/skeleton-container.ts","../../../projects/ui/skeleton/public-api.ts","../../../projects/ui/skeleton/cngx-ui-skeleton.ts"],"sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive that registers a `<ng-template>` as the\n * loading-state stand-in for `<cngx-skeleton>`. The container reads\n * it via `contentChild(CngxSkeletonPlaceholder)`; the directive\n * holds only the `TemplateRef` and contributes no DOM of its own.\n *\n * One-per-container contract: the container uses `contentChild`\n * (single), not `contentChildren`. Multiple sibling\n * `<ng-template cngxSkeletonPlaceholder>` blocks resolve to the\n * first match; the rest are dead code. Pick the variant at author\n * time, do not stack alternatives.\n *\n * Repetition: while the container's `loading()` (or\n * `state.isFirstLoad()`) is `true`, the template renders `[count]`\n * times inside the container's internal `@for`. When loading flips\n * to `false`, the skeleton DOM tears down and the projected sibling\n * content renders in its place.\n *\n * Context fields ({@link CngxSkeletonPlaceholderContext}):\n * - `$implicit` / `index` - 0-based iteration index. Drive per-row\n * width variance with it (`i === 0 ? '60%' : '100%'`).\n * - `count` - total placeholders being rendered, mirrors the\n * container's `[count]` input.\n * - `first` / `last` - row markers for end-of-block treatments\n * (e.g. last row without a trailing border).\n *\n * Bind via `let-i` for the implicit index, or `let-x=\"<field>\"`\n * for any other field:\n *\n * ```html\n * <cngx-skeleton [loading]=\"loading()\" [count]=\"3\">\n * <ng-template cngxSkeletonPlaceholder let-i>\n * <div class=\"skeleton-line\"\n * [style.width]=\"i === 0 ? '60%' : '100%'\"></div>\n * </ng-template>\n * <p>Real content</p>\n * </cngx-skeleton>\n * ```\n *\n * Last-row variant using `let-last`:\n *\n * ```html\n * <ng-template cngxSkeletonPlaceholder let-i let-last=\"last\">\n * <div class=\"skeleton-row\" [class.is-last]=\"last\"></div>\n * </ng-template>\n * ```\n *\n * @category ui/skeleton\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/skeleton/skeleton-placeholder.ts\n * @since 0.1.0\n * @relatedTo CngxSkeletonContainer\n */\n@Directive({\n selector: 'ng-template[cngxSkeletonPlaceholder]',\n standalone: true,\n})\nexport class CngxSkeletonPlaceholder {\n /** Reference to the projected template. Used internally by `CngxSkeletonContainer`. */\n readonly templateRef = inject<TemplateRef<CngxSkeletonPlaceholderContext>>(TemplateRef);\n}\n\n/**\n * Template context for `cngxSkeletonPlaceholder`.\n *\n * @category ui/skeleton\n */\nexport interface CngxSkeletonPlaceholderContext {\n /** Current index (0-based). */\n $implicit: number;\n /** Current index (named). */\n index: number;\n /** Total count. */\n count: number;\n /** Whether this is the first item. */\n first: boolean;\n /** Whether this is the last item. */\n last: boolean;\n}\n","import { DOCUMENT, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n inject,\n input,\n signal,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { createVisibilityGate, injectLoadingConfig, type CngxAsyncState } from '@cngx/core/utils';\n\nimport {\n CngxSkeletonPlaceholder,\n type CngxSkeletonPlaceholderContext,\n} from './skeleton-placeholder';\n\n/**\n * Skeleton loading container with built-in placeholder repetition.\n *\n * Manages CSS classes, ARIA, and reduced-motion handling internally\n * (same behavior as the `CngxSkeleton` atom directive). Adds template projection\n * so the consumer doesn't need `@if`/`@for` boilerplate.\n *\n * - Project a `<ng-template cngxSkeletonPlaceholder>` for the loading state (repeated `count` times).\n * - Project content directly for the loaded state.\n * - Uses `display: contents` - no extra DOM wrapper.\n *\n * ### Basic usage\n * ```html\n * <cngx-skeleton [loading]=\"loading()\" [count]=\"3\">\n * <ng-template cngxSkeletonPlaceholder>\n * <div class=\"skeleton-card\"></div>\n * </ng-template>\n * <app-real-content />\n * </cngx-skeleton>\n * ```\n *\n * ### With template context (index, first, last)\n * ```html\n * <cngx-skeleton [loading]=\"loading()\" [count]=\"5\">\n * <ng-template cngxSkeletonPlaceholder let-i let-last=\"last\">\n * <div class=\"skeleton-line\" [style.width]=\"last ? '60%' : '100%'\"></div>\n * </ng-template>\n * <p>Loaded content here</p>\n * </cngx-skeleton>\n * ```\n *\n * @category ui/skeleton\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/skeleton/skeleton-container.ts\n * @since 0.1.0\n * @relatedTo CngxSkeletonPlaceholder, CngxAsyncState, CngxEmptyState\n * @slot cngxSkeletonPlaceholder Replaces the generated placeholder shape.\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 * <example-url>http://localhost:4200/#/ui/skeleton/card-skeleton</example-url>\n * <example-url>http://localhost:4200/#/ui/skeleton/template-context</example-url>\n */\n@Component({\n selector: 'cngx-skeleton',\n standalone: true,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxSkeletonContainer',\n host: {\n style: 'display: contents',\n class: 'cngx-skeleton',\n '[class.cngx-skeleton--loading]': 'gatedLoading()',\n '[class.cngx-skeleton--shimmer]': 'showShimmer()',\n '[attr.aria-busy]': 'gatedLoading() || null',\n },\n template: `\n @if (gatedLoading()) {\n @for (i of indices(); track i) {\n <ng-container\n *ngTemplateOutlet=\"placeholderTpl()?.templateRef ?? null; context: getContext(i)\"\n />\n }\n } @else {\n <ng-content />\n }\n `,\n styleUrls: ['./skeleton-container.css'],\n})\nexport class CngxSkeletonContainer {\n private readonly loadingConfig = injectLoadingConfig();\n\n /** Controls the loading state directly. */\n readonly loading = input<boolean>(false);\n\n /** Bind an async state - shows skeleton during first load. Takes precedence over `loading`. */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */\n readonly shimmer = input<boolean>(true);\n\n /** Repeat count for the placeholder template. */\n readonly count = input<number>(1);\n\n /** Delay in ms before the placeholder shows. Defaults to `CNGX_LOADING_CONFIG.showDelay`. */\n readonly showDelay = input<number>(this.loadingConfig.showDelay);\n\n /** Minimum time in ms the placeholder stays once shown. Defaults to `CNGX_LOADING_CONFIG.minDwell`. */\n readonly minDwell = input<number>(this.loadingConfig.minDwell);\n\n /** Derived loading state: `state.isFirstLoad` takes precedence over `loading` input. */\n protected readonly isLoading = computed(() => this.state()?.isFirstLoad() ?? this.loading());\n\n /**\n * @internal - flash-suppressed loading. A sub-`showDelay` blip never renders the\n * placeholder; once shown it holds for `minDwell`. Drives the placeholder, the\n * `--loading` class, and `aria-busy` so AT and DOM agree.\n */\n protected readonly gatedLoading = createVisibilityGate(\n this.isLoading,\n this.showDelay,\n this.minDwell,\n );\n\n /** @internal - projected placeholder template. */\n protected readonly placeholderTpl = contentChild(CngxSkeletonPlaceholder);\n\n /** Array of indices for internal `@for` rendering. */\n readonly indices = computed(() => Array.from({ length: this.count() }, (_, i) => i));\n\n private readonly prefersReducedMotion: Signal<boolean>;\n\n constructor() {\n const win = inject(DOCUMENT).defaultView;\n const pref = signal(false);\n if (win?.matchMedia) {\n const mq = win.matchMedia('(prefers-reduced-motion: reduce)');\n pref.set(mq.matches);\n const listener = (e: MediaQueryListEvent) => pref.set(e.matches);\n mq.addEventListener('change', listener);\n inject(DestroyRef).onDestroy(() => mq.removeEventListener('change', listener));\n }\n this.prefersReducedMotion = pref.asReadonly();\n }\n\n /** @internal */\n protected readonly showShimmer = computed(\n () => this.gatedLoading() && this.shimmer() && !this.prefersReducedMotion(),\n );\n\n /** @internal */\n protected getContext(index: number): CngxSkeletonPlaceholderContext {\n const total = this.count();\n return {\n $implicit: index,\n index,\n count: total,\n first: index === 0,\n last: index === total - 1,\n };\n }\n}\n","/**\n * @module @cngx/ui/skeleton\n */\n\nexport { CngxSkeletonContainer } from './skeleton-container';\nexport {\n CngxSkeletonPlaceholder,\n type CngxSkeletonPlaceholderContext,\n} from './skeleton-placeholder';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDG;MAKU,uBAAuB,CAAA;;AAEzB,IAAA,WAAW,GAAG,MAAM,CAA8C,WAAW,CAAC;uGAF5E,uBAA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Ae;AACjD,wBAAA,kBAAkB,EAAE,wBAAwB;qBAC7C,EAAA,QAAA,EACS;;;;;;;;;;AAUT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,2lDAAA,CAAA,EAAA;+qBAuCgD,uBAAuB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC9H1E;;AAEG;;ACFH;;AAEG;;;;"}
@@ -66,7 +66,7 @@ class CngxSpeakButton {
66
66
  </svg>
67
67
  }
68
68
  </button>
69
- `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-speak-btn-size{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --cngx-speak-btn-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 18px;}@property --cngx-speak-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-speak-btn-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-speak-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 0 0);}@property --cngx-speak-btn-transition{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --cngx-speak-btn-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-speak-btn-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.72 .18 70);}}@layer cngx.components{@scope(.cngx-speak-button){:scope{display:inline-flex}.cngx-speak-button__btn{display:inline-flex;align-items:center;justify-content:center;width:var(--cngx-speak-btn-size, 36px);height:var(--cngx-speak-btn-size, 36px);padding:0;border:var(--cngx-speak-btn-border-width, 1px) solid var(--cngx-color-border, oklch(.87 0 0));border-radius:var(--cngx-speak-btn-radius, 8px);background:var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0)));color:var(--cngx-speak-btn-color, oklch(.45 0 0));cursor:pointer;transition:color var(--cngx-speak-btn-transition, .15s),background var(--cngx-speak-btn-transition, .15s),border-color var(--cngx-speak-btn-transition, .15s);flex-shrink:0}.cngx-speak-button__btn:hover{color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));border-color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));background:var( --cngx-speak-btn-hover-bg, var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0))) )}:scope.cngx-speak-button--speaking .cngx-speak-button__btn{color:var(--cngx-speak-btn-speaking-color, oklch(1 0 0));background:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) );border-color:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) )}.cngx-speak-button__icon{width:var(--cngx-speak-btn-icon-size, 18px);height:var(--cngx-speak-btn-icon-size, 18px);transform:translate(1px)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
69
+ `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-speak-btn-size{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --cngx-speak-btn-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 18px;}@property --cngx-speak-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-speak-btn-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-speak-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 0 0);}@property --cngx-speak-btn-transition{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --cngx-speak-btn-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-speak-btn-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.72 .18 70);}}@layer cngx.components{@scope(.cngx-speak-button){:scope{display:inline-flex}.cngx-speak-button__btn{display:inline-flex;align-items:center;justify-content:center;width:max(var(--cngx-speak-btn-size, 36px),var(--cngx-target-min, 0px));height:max(var(--cngx-speak-btn-size, 36px),var(--cngx-target-min, 0px));padding:0;border:var(--cngx-speak-btn-border-width, 1px) solid var(--cngx-color-border, oklch(.87 0 0));border-radius:var(--cngx-speak-btn-radius, 8px);background:var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0)));color:var(--cngx-speak-btn-color, oklch(.45 0 0));cursor:pointer;transition:color var(--cngx-speak-btn-transition, .15s),background var(--cngx-speak-btn-transition, .15s),border-color var(--cngx-speak-btn-transition, .15s);flex-shrink:0}.cngx-speak-button__btn:hover{color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));border-color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));background:var( --cngx-speak-btn-hover-bg, var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0))) )}:scope.cngx-speak-button--speaking .cngx-speak-button__btn{color:var(--cngx-speak-btn-speaking-color, oklch(1 0 0));background:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) );border-color:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) )}.cngx-speak-button__icon{width:var(--cngx-speak-btn-icon-size, 18px);height:var(--cngx-speak-btn-icon-size, 18px);transform:translate(1px)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
70
70
  }
71
71
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSpeakButton, decorators: [{
72
72
  type: Component,
@@ -106,7 +106,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
106
106
  </svg>
107
107
  }
108
108
  </button>
109
- `, styles: ["@layer cngx.tokens{@property --cngx-speak-btn-size{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --cngx-speak-btn-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 18px;}@property --cngx-speak-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-speak-btn-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-speak-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 0 0);}@property --cngx-speak-btn-transition{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --cngx-speak-btn-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-speak-btn-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.72 .18 70);}}@layer cngx.components{@scope(.cngx-speak-button){:scope{display:inline-flex}.cngx-speak-button__btn{display:inline-flex;align-items:center;justify-content:center;width:var(--cngx-speak-btn-size, 36px);height:var(--cngx-speak-btn-size, 36px);padding:0;border:var(--cngx-speak-btn-border-width, 1px) solid var(--cngx-color-border, oklch(.87 0 0));border-radius:var(--cngx-speak-btn-radius, 8px);background:var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0)));color:var(--cngx-speak-btn-color, oklch(.45 0 0));cursor:pointer;transition:color var(--cngx-speak-btn-transition, .15s),background var(--cngx-speak-btn-transition, .15s),border-color var(--cngx-speak-btn-transition, .15s);flex-shrink:0}.cngx-speak-button__btn:hover{color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));border-color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));background:var( --cngx-speak-btn-hover-bg, var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0))) )}:scope.cngx-speak-button--speaking .cngx-speak-button__btn{color:var(--cngx-speak-btn-speaking-color, oklch(1 0 0));background:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) );border-color:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) )}.cngx-speak-button__icon{width:var(--cngx-speak-btn-icon-size, 18px);height:var(--cngx-speak-btn-icon-size, 18px);transform:translate(1px)}}}\n"] }]
109
+ `, styles: ["@layer cngx.tokens{@property --cngx-speak-btn-size{syntax: \"<length>\"; inherits: false; initial-value: 36px;}@property --cngx-speak-btn-icon-size{syntax: \"<length>\"; inherits: false; initial-value: 18px;}@property --cngx-speak-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-speak-btn-border-width{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@property --cngx-speak-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 0 0);}@property --cngx-speak-btn-transition{syntax: \"<time>\"; inherits: false; initial-value: .15s;}@property --cngx-speak-btn-active-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-speak-btn-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-speak-btn-speaking-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.72 .18 70);}}@layer cngx.components{@scope(.cngx-speak-button){:scope{display:inline-flex}.cngx-speak-button__btn{display:inline-flex;align-items:center;justify-content:center;width:max(var(--cngx-speak-btn-size, 36px),var(--cngx-target-min, 0px));height:max(var(--cngx-speak-btn-size, 36px),var(--cngx-target-min, 0px));padding:0;border:var(--cngx-speak-btn-border-width, 1px) solid var(--cngx-color-border, oklch(.87 0 0));border-radius:var(--cngx-speak-btn-radius, 8px);background:var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0)));color:var(--cngx-speak-btn-color, oklch(.45 0 0));cursor:pointer;transition:color var(--cngx-speak-btn-transition, .15s),background var(--cngx-speak-btn-transition, .15s),border-color var(--cngx-speak-btn-transition, .15s);flex-shrink:0}.cngx-speak-button__btn:hover{color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));border-color:var(--cngx-speak-btn-active-color, oklch(.72 .18 70));background:var( --cngx-speak-btn-hover-bg, var(--cngx-speak-btn-bg, var(--cngx-color-surface, oklch(1 0 0))) )}:scope.cngx-speak-button--speaking .cngx-speak-button__btn{color:var(--cngx-speak-btn-speaking-color, oklch(1 0 0));background:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) );border-color:var( --cngx-speak-btn-speaking-bg, var(--cngx-speak-btn-active-color, oklch(.72 .18 70)) )}.cngx-speak-button__icon{width:var(--cngx-speak-btn-icon-size, 18px);height:var(--cngx-speak-btn-icon-size, 18px);transform:translate(1px)}}}\n"] }]
110
110
  }], propDecorators: { speakRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "speakRef", required: true }] }] } });
111
111
 
112
112
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-speak.mjs","sources":["../../../projects/ui/speak/speak-button.ts","../../../projects/ui/speak/public-api.ts","../../../projects/ui/speak/cngx-ui-speak.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\nimport { type CngxSpeak } from '@cngx/common';\n\n/**\n * Ready-made speaker button that connects to a {@link CngxSpeak} directive\n * via an explicit `[speakRef]` input - no ancestor injection.\n *\n * Ships with a speaker/stop SVG icon and CSS custom properties for full\n * theming control. Include `speak-button-theme.scss` for automatic Material\n * theme integration.\n *\n * ### Basic usage\n * ```html\n * <span [cngxSpeak]=\"text\" #tts=\"cngxSpeak\">{{ text }}</span>\n * <cngx-speak-button [speakRef]=\"tts\" />\n * ```\n *\n * ### Material theme integration\n * ```scss\n * @use '@cngx/themes/material/speak-button-theme' as speak;\n * @include speak.theme($theme);\n * ```\n *\n * @category ui/speak\n * @docsKind primary\n * @wcag AAA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/speak/speak-button.ts\n * @since 0.1.0\n * @relatedTo CngxSpeak\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/styled-speaker-icon</example-url>\n */\n@Component({\n selector: 'cngx-speak-button',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-speak-button',\n '[class.cngx-speak-button--speaking]': 'speakRef().speaking()',\n },\n styleUrls: ['./speak-button.css'],\n template: `\n <button\n type=\"button\"\n class=\"cngx-speak-button__btn\"\n [attr.aria-label]=\"speakRef().speaking() ? 'Stop speaking' : 'Read aloud'\"\n (click)=\"speakRef().toggle()\"\n >\n @if (speakRef().speaking()) {\n <svg\n class=\"cngx-speak-button__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" />\n </svg>\n } @else {\n <svg\n class=\"cngx-speak-button__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M11 5L6 9H2v6h4l5 4V5z\" />\n <path d=\"M15.54 8.46a5 5 0 010 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 010 14.14\" />\n </svg>\n }\n </button>\n `,\n})\nexport class CngxSpeakButton {\n /** The `CngxSpeak` directive instance to connect to. */\n readonly speakRef = input.required<CngxSpeak>();\n}\n","/**\n * @module @cngx/ui/speak\n */\n\nexport { CngxSpeakButton } from './speak-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MA8CU,eAAe,CAAA;;AAEjB,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAa;uGAFpC,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,mCAAA,EAAA,uBAAA,EAAA,EAAA,cAAA,EAAA,mBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAnChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,2gFAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAEU,eAAe,EAAA,UAAA,EAAA,CAAA;kBA7C3B,SAAS;+BACE,mBAAmB,EAAA,UAAA,EACjB,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,mBAAmB;AAC1B,wBAAA,qCAAqC,EAAE,uBAAuB;qBAC/D,EAAA,QAAA,EAES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,2gFAAA,CAAA,EAAA;;;AC1EH;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-speak.mjs","sources":["../../../projects/ui/speak/speak-button.ts","../../../projects/ui/speak/public-api.ts","../../../projects/ui/speak/cngx-ui-speak.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\nimport { type CngxSpeak } from '@cngx/common';\n\n/**\n * Ready-made speaker button that connects to a {@link CngxSpeak} directive\n * via an explicit `[speakRef]` input - no ancestor injection.\n *\n * Ships with a speaker/stop SVG icon and CSS custom properties for full\n * theming control. Include `speak-button-theme.scss` for automatic Material\n * theme integration.\n *\n * ### Basic usage\n * ```html\n * <span [cngxSpeak]=\"text\" #tts=\"cngxSpeak\">{{ text }}</span>\n * <cngx-speak-button [speakRef]=\"tts\" />\n * ```\n *\n * ### Material theme integration\n * ```scss\n * @use '@cngx/themes/material/speak-button-theme' as speak;\n * @include speak.theme($theme);\n * ```\n *\n * @category ui/speak\n * @docsKind primary\n * @wcag AAA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/speak/speak-button.ts\n * @since 0.1.0\n * @relatedTo CngxSpeak\n * <example-url>http://localhost:4200/#/ui/speak/speak-button/styled-speaker-icon</example-url>\n */\n@Component({\n selector: 'cngx-speak-button',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-speak-button',\n '[class.cngx-speak-button--speaking]': 'speakRef().speaking()',\n },\n styleUrls: ['./speak-button.css'],\n template: `\n <button\n type=\"button\"\n class=\"cngx-speak-button__btn\"\n [attr.aria-label]=\"speakRef().speaking() ? 'Stop speaking' : 'Read aloud'\"\n (click)=\"speakRef().toggle()\"\n >\n @if (speakRef().speaking()) {\n <svg\n class=\"cngx-speak-button__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" />\n </svg>\n } @else {\n <svg\n class=\"cngx-speak-button__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M11 5L6 9H2v6h4l5 4V5z\" />\n <path d=\"M15.54 8.46a5 5 0 010 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 010 14.14\" />\n </svg>\n }\n </button>\n `,\n})\nexport class CngxSpeakButton {\n /** The `CngxSpeak` directive instance to connect to. */\n readonly speakRef = input.required<CngxSpeak>();\n}\n","/**\n * @module @cngx/ui/speak\n */\n\nexport { CngxSpeakButton } from './speak-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;MA8CU,eAAe,CAAA;;AAEjB,IAAA,QAAQ,GAAG,KAAK,CAAC,QAAQ,8EAAa;uGAFpC,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAA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