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

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 (101) hide show
  1. package/README.md +0 -1
  2. package/a11y/README.md +11 -5
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +227 -0
  7. package/data-grid-accordion/README.md +76 -2
  8. package/feedback/README.md +40 -0
  9. package/fesm2022/cngx-ui-a11y.mjs +189 -57
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +120 -36
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +121 -56
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +204 -62
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +395 -119
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +209 -40
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +1074 -460
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
  32. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  34. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  36. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
  38. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  40. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-paginator.mjs +553 -198
  42. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  43. package/fesm2022/cngx-ui-sidenav.mjs +344 -109
  44. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-skeleton.mjs +4 -16
  46. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-speak.mjs +107 -8
  48. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-stat-card.mjs +146 -46
  50. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-stepper.mjs +234 -99
  52. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-tabs.mjs +88 -25
  54. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-timeline.mjs +98 -23
  56. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-toc.mjs +101 -33
  58. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  59. package/fesm2022/cngx-ui.mjs +15 -20
  60. package/fesm2022/cngx-ui.mjs.map +1 -1
  61. package/mat-paginator/README.md +9 -2
  62. package/mat-tabs/README.md +30 -6
  63. package/mat-tabs/styles/mat-tabs.css +188 -42
  64. package/overlay/README.md +9 -4
  65. package/package.json +31 -7
  66. package/paginator/README.md +8 -4
  67. package/schematics/collection.json +9 -0
  68. package/schematics/ng-add/index.js +9 -0
  69. package/schematics/ng-add/schema.json +91 -0
  70. package/schematics/package.json +3 -0
  71. package/sidenav/README.md +33 -11
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +14 -2
  74. package/timeline/README.md +1 -1
  75. package/toc/README.md +4 -1
  76. package/types/cngx-ui-a11y.d.ts +121 -30
  77. package/types/cngx-ui-accordion.d.ts +100 -28
  78. package/types/cngx-ui-action-button.d.ts +44 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +167 -60
  80. package/types/cngx-ui-chart-panel.d.ts +122 -18
  81. package/types/cngx-ui-collection.d.ts +157 -55
  82. package/types/cngx-ui-command-palette.d.ts +297 -183
  83. package/types/cngx-ui-context-menu.d.ts +140 -10
  84. package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +605 -59
  87. package/types/cngx-ui-mat-accordion.d.ts +30 -1
  88. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  89. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  90. package/types/cngx-ui-mat-tabs.d.ts +250 -34
  91. package/types/cngx-ui-overlay.d.ts +56 -10
  92. package/types/cngx-ui-paginator.d.ts +425 -136
  93. package/types/cngx-ui-sidenav.d.ts +248 -74
  94. package/types/cngx-ui-skeleton.d.ts +6 -7
  95. package/types/cngx-ui-speak.d.ts +118 -5
  96. package/types/cngx-ui-stat-card.d.ts +117 -33
  97. package/types/cngx-ui-stepper.d.ts +88 -49
  98. package/types/cngx-ui-tabs.d.ts +6 -4
  99. package/types/cngx-ui-timeline.d.ts +35 -11
  100. package/types/cngx-ui-toc.d.ts +93 -16
  101. package/types/cngx-ui.d.ts +7 -4
@@ -39,16 +39,26 @@ class CngxEmptyState {
39
39
  title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
40
40
  /** Supporting detail - clarifies context and suggests next steps. */
41
41
  description = input(undefined, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
42
- /** Bind an async state - auto-hides when data is not empty. */
42
+ /**
43
+ * Bind an async state - auto-hides when data is not empty, while an
44
+ * operation is running, or on error status. Error communication belongs
45
+ * to error surfaces (alert, async container). The component shows in two
46
+ * cases: a settled empty result ("loaded, nothing there") and an idle
47
+ * state with no data - the first-use onboarding surface, where nothing
48
+ * has been asked for yet.
49
+ */
43
50
  state = input(undefined, ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
44
- /** @internal - hidden when state is bound and data is not empty or still loading. */
51
+ /** @internal - hidden when state is bound and the view is not a settled empty result. */
45
52
  shouldHide = computed(() => {
46
53
  const s = this.state();
47
54
  if (!s) {
48
55
  return false;
49
56
  }
50
- // Skeleton owns the loading phase; defer until data resolves.
51
- return s.isLoading() || !s.isEmpty();
57
+ // Skeleton owns the loading phase; error surfaces own the error phase.
58
+ if (s.isLoading() || s.status() === 'error') {
59
+ return true;
60
+ }
61
+ return !s.isEmpty();
52
62
  }, ...(ngDevMode ? [{ debugName: "shouldHide" }] : /* istanbul ignore next */ []));
53
63
  /** @internal */
54
64
  titleId = `${this.uid}-title`;
@@ -86,7 +96,7 @@ class CngxEmptyState {
86
96
  <ng-content select="[cngxEmptyStateAction]" />
87
97
  </div>
88
98
  <ng-content select="[cngxEmptyStateSecondary]" />
89
- `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-empty-gap{syntax: \"*\"; inherits: false; initial-value: 16px;}@property --cngx-empty-padding{syntax: \"*\"; inherits: false; initial-value: 48px;}@property --cngx-empty-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-icon-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-title-size{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-empty-title-weight{syntax: \"<number>\"; inherits: false; initial-value: 500;}@property --cngx-empty-title-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.18 .005 290);}@property --cngx-empty-desc-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-empty-color: var(--cngx-color-text, oklch(.34 .005 290));--cngx-empty-icon-color: var(--cngx-color-text, oklch(.34 .005 290));--cngx-empty-title-color: var(--cngx-color-text, oklch(.18 .005 290))}}@layer cngx.components{@scope(.cngx-empty-state){:scope{--cngx-empty-gap: var(--cngx-space-md);--cngx-empty-padding: var(--cngx-space-xl);display:flex;flex-direction:column;align-items:center;gap:var(--cngx-empty-gap, var(--cngx-space-md, 16px));padding:var(--cngx-empty-padding, var(--cngx-space-xl, 48px)) var(--cngx-space-md, 16px);text-align:center;color:var(--cngx-empty-color, var(--cngx-color-text, oklch(.34 .005 290)))}.cngx-empty-state__icon-slot:not(:empty)+.cngx-empty-state__default-icon{display:none}.cngx-empty-state__default-icon{color:var(--cngx-empty-icon-color, var(--cngx-color-text, oklch(.34 .005 290)));opacity:.5}.cngx-empty-state__icon-slot:empty{display:none}.cngx-empty-state__title{margin:0;font-size:var(--cngx-empty-title-size, 1.125rem);font-weight:var(--cngx-empty-title-weight, 500);color:var(--cngx-empty-title-color, var(--cngx-color-text, oklch(.18 .005 290)))}.cngx-empty-state__description{margin:0;font-size:var(--cngx-empty-desc-size, .875rem);line-height:1.5;max-width:40ch}.cngx-empty-state__actions{display:flex;gap:var(--cngx-space-sm, 8px);margin-top:var(--cngx-space-sm, 8px)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
99
+ `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-empty-gap{syntax: \"*\"; inherits: false; initial-value: 16px;}@property --cngx-empty-padding{syntax: \"*\"; inherits: false; initial-value: 48px;}@property --cngx-empty-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-icon-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-title-size{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-empty-title-weight{syntax: \"<number>\"; inherits: false; initial-value: 500;}@property --cngx-empty-title-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.18 .005 290);}@property --cngx-empty-desc-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-empty-color: var(--cngx-color-text, oklch(.34 .005 290));--cngx-empty-icon-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-empty-title-color: var(--cngx-color-text, oklch(.18 .005 290))}}@layer cngx.components{@scope(.cngx-empty-state){:scope{--cngx-empty-gap: var(--cngx-space-md);--cngx-empty-padding: var(--cngx-space-xl);display:flex;flex-direction:column;align-items:center;gap:var(--cngx-empty-gap, var(--cngx-space-md, 16px));padding:var(--cngx-empty-padding, var(--cngx-space-xl, 48px)) var(--cngx-space-md, 16px);text-align:center;color:var(--cngx-empty-color, var(--cngx-color-text, oklch(.34 .005 290)))}:scope[hidden]{display:none}.cngx-empty-state__icon-slot:not(:empty)+.cngx-empty-state__default-icon{display:none}.cngx-empty-state__default-icon{color:var(--cngx-empty-icon-color, var(--cngx-color-text-muted, oklch(.5 .01 250)))}.cngx-empty-state__icon-slot:empty{display:none}.cngx-empty-state__title{margin:0;font-size:var(--cngx-empty-title-size, 1.125rem);font-weight:var(--cngx-empty-title-weight, 500);color:var(--cngx-empty-title-color, var(--cngx-color-text, oklch(.18 .005 290)))}.cngx-empty-state__description{margin:0;font-size:var(--cngx-empty-desc-size, .875rem);line-height:1.5;max-width:40ch}.cngx-empty-state__actions{display:flex;gap:var(--cngx-space-sm, 8px);margin-top:var(--cngx-space-sm, 8px)}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
90
100
  }
91
101
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxEmptyState, decorators: [{
92
102
  type: Component,
@@ -128,7 +138,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
128
138
  <ng-content select="[cngxEmptyStateAction]" />
129
139
  </div>
130
140
  <ng-content select="[cngxEmptyStateSecondary]" />
131
- `, styles: ["@layer cngx.tokens{@property --cngx-empty-gap{syntax: \"*\"; inherits: false; initial-value: 16px;}@property --cngx-empty-padding{syntax: \"*\"; inherits: false; initial-value: 48px;}@property --cngx-empty-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-icon-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-title-size{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-empty-title-weight{syntax: \"<number>\"; inherits: false; initial-value: 500;}@property --cngx-empty-title-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.18 .005 290);}@property --cngx-empty-desc-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-empty-color: var(--cngx-color-text, oklch(.34 .005 290));--cngx-empty-icon-color: var(--cngx-color-text, oklch(.34 .005 290));--cngx-empty-title-color: var(--cngx-color-text, oklch(.18 .005 290))}}@layer cngx.components{@scope(.cngx-empty-state){:scope{--cngx-empty-gap: var(--cngx-space-md);--cngx-empty-padding: var(--cngx-space-xl);display:flex;flex-direction:column;align-items:center;gap:var(--cngx-empty-gap, var(--cngx-space-md, 16px));padding:var(--cngx-empty-padding, var(--cngx-space-xl, 48px)) var(--cngx-space-md, 16px);text-align:center;color:var(--cngx-empty-color, var(--cngx-color-text, oklch(.34 .005 290)))}.cngx-empty-state__icon-slot:not(:empty)+.cngx-empty-state__default-icon{display:none}.cngx-empty-state__default-icon{color:var(--cngx-empty-icon-color, var(--cngx-color-text, oklch(.34 .005 290)));opacity:.5}.cngx-empty-state__icon-slot:empty{display:none}.cngx-empty-state__title{margin:0;font-size:var(--cngx-empty-title-size, 1.125rem);font-weight:var(--cngx-empty-title-weight, 500);color:var(--cngx-empty-title-color, var(--cngx-color-text, oklch(.18 .005 290)))}.cngx-empty-state__description{margin:0;font-size:var(--cngx-empty-desc-size, .875rem);line-height:1.5;max-width:40ch}.cngx-empty-state__actions{display:flex;gap:var(--cngx-space-sm, 8px);margin-top:var(--cngx-space-sm, 8px)}}}\n"] }]
141
+ `, styles: ["@layer cngx.tokens{@property --cngx-empty-gap{syntax: \"*\"; inherits: false; initial-value: 16px;}@property --cngx-empty-padding{syntax: \"*\"; inherits: false; initial-value: 48px;}@property --cngx-empty-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-icon-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}@property --cngx-empty-title-size{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-empty-title-weight{syntax: \"<number>\"; inherits: false; initial-value: 500;}@property --cngx-empty-title-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.18 .005 290);}@property --cngx-empty-desc-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}:root{--cngx-empty-color: var(--cngx-color-text, oklch(.34 .005 290));--cngx-empty-icon-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-empty-title-color: var(--cngx-color-text, oklch(.18 .005 290))}}@layer cngx.components{@scope(.cngx-empty-state){:scope{--cngx-empty-gap: var(--cngx-space-md);--cngx-empty-padding: var(--cngx-space-xl);display:flex;flex-direction:column;align-items:center;gap:var(--cngx-empty-gap, var(--cngx-space-md, 16px));padding:var(--cngx-empty-padding, var(--cngx-space-xl, 48px)) var(--cngx-space-md, 16px);text-align:center;color:var(--cngx-empty-color, var(--cngx-color-text, oklch(.34 .005 290)))}:scope[hidden]{display:none}.cngx-empty-state__icon-slot:not(:empty)+.cngx-empty-state__default-icon{display:none}.cngx-empty-state__default-icon{color:var(--cngx-empty-icon-color, var(--cngx-color-text-muted, oklch(.5 .01 250)))}.cngx-empty-state__icon-slot:empty{display:none}.cngx-empty-state__title{margin:0;font-size:var(--cngx-empty-title-size, 1.125rem);font-weight:var(--cngx-empty-title-weight, 500);color:var(--cngx-empty-title-color, var(--cngx-color-text, oklch(.18 .005 290)))}.cngx-empty-state__description{margin:0;font-size:var(--cngx-empty-desc-size, .875rem);line-height:1.5;max-width:40ch}.cngx-empty-state__actions{display:flex;gap:var(--cngx-space-sm, 8px);margin-top:var(--cngx-space-sm, 8px)}}}\n"] }]
132
142
  }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }] } });
133
143
 
134
144
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-empty-state.mjs","sources":["../../../projects/ui/empty-state/empty-state.component.ts","../../../projects/ui/empty-state/public-api.ts","../../../projects/ui/empty-state/cngx-ui-empty-state.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { type CngxAsyncState, nextUid } from '@cngx/core/utils';\n\n/**\n * Empty-state display organism for grids, tables, lists, and dashboards.\n *\n * Communicates why a view is empty and what the user can do next.\n * Supports three UX contexts via the parent's `emptyReason`:\n * - **first-use** - onboarding, show what's possible\n * - **no-results** - recovery, offer filter reset or search change\n * - **cleared** - confirmation, everything is done\n *\n * Icon is provided via the `[cngxEmptyStateIcon]` content slot - no Material\n * dependency. Consumers project `<mat-icon>`, `<svg>`, or any icon system.\n *\n * ```html\n * <cngx-empty-state title=\"No results\" description=\"Try a different search term\">\n * <mat-icon cngxEmptyStateIcon>search_off</mat-icon>\n * <button cngxEmptyStateAction (click)=\"resetSearch()\">Reset</button>\n * </cngx-empty-state>\n * ```\n *\n * @category ui/empty-state\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/empty-state/empty-state.component.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncState, CngxSkeletonContainer\n * <example-url>http://localhost:4200/#/ui/empty-state/default-no-icon-projected</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/inside-a-card-grid</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/inside-a-list</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/inside-a-table</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/with-custom-icon-actions</example-url>\n */\n@Component({\n selector: 'cngx-empty-state',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-empty-state',\n role: 'status',\n 'aria-live': 'polite',\n '[attr.aria-labelledby]': 'titleId',\n '[attr.aria-describedby]': 'description() ? descriptionId : null',\n '[attr.hidden]': 'shouldHide() || null',\n },\n template: `\n <div class=\"cngx-empty-state__icon-slot\">\n <ng-content select=\"[cngxEmptyStateIcon]\" />\n </div>\n <svg\n class=\"cngx-empty-state__default-icon\"\n aria-hidden=\"true\"\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M21 8V21H3V8\" />\n <path d=\"M1 3h22v5H1z\" />\n <path d=\"M10 12h4\" />\n </svg>\n <ng-content select=\"[cngxEmptyStateIllustration]\" />\n <h3 [id]=\"titleId\" class=\"cngx-empty-state__title\">{{ title() }}</h3>\n @if (description()) {\n <p [id]=\"descriptionId\" class=\"cngx-empty-state__description\">\n {{ description() }}\n </p>\n }\n <div class=\"cngx-empty-state__actions\">\n <ng-content select=\"[cngxEmptyStateAction]\" />\n </div>\n <ng-content select=\"[cngxEmptyStateSecondary]\" />\n `,\n styleUrls: ['./empty-state.component.css'],\n})\nexport class CngxEmptyState {\n private readonly uid = nextUid('cngx-empty');\n\n /** Primary message - what state the user is in. */\n readonly title = input.required<string>();\n\n /** Supporting detail - clarifies context and suggests next steps. */\n readonly description = input<string | undefined>(undefined);\n\n /** Bind an async state - auto-hides when data is not empty. */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** @internal - hidden when state is bound and data is not empty or still loading. */\n protected readonly shouldHide = computed(() => {\n const s = this.state();\n if (!s) {\n return false;\n }\n // Skeleton owns the loading phase; defer until data resolves.\n return s.isLoading() || !s.isEmpty();\n });\n\n /** @internal */\n protected readonly titleId = `${this.uid}-title`;\n /** @internal */\n protected readonly descriptionId = `${this.uid}-desc`;\n}\n","/**\n * @module @cngx/ui/empty-state\n */\n\nexport { CngxEmptyState } from './empty-state.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;MAgDU,cAAc,CAAA;AACR,IAAA,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC;;AAGnC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;AAGhC,IAAA,WAAW,GAAG,KAAK,CAAqB,SAAS,kFAAC;;AAGlD,IAAA,KAAK,GAAG,KAAK,CAAsC,SAAS,4EAAC;;AAGnD,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AAC5C,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE;QACtB,IAAI,CAAC,CAAC,EAAE;AACN,YAAA,OAAO,KAAK;QACd;;QAEA,OAAO,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE;AACtC,IAAA,CAAC,iFAAC;;AAGiB,IAAA,OAAO,GAAG,CAAA,EAAG,IAAI,CAAC,GAAG,QAAQ;;AAE7B,IAAA,aAAa,GAAG,CAAA,EAAG,IAAI,CAAC,GAAG,OAAO;uGAzB1C,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA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C,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,KAAK,EAAE,kBAAkB;AACzB,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,WAAW,EAAE,QAAQ;AACrB,wBAAA,wBAAwB,EAAE,SAAS;AACnC,wBAAA,yBAAyB,EAAE,sCAAsC;AACjE,wBAAA,eAAe,EAAE,sBAAsB;qBACxC,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ikEAAA,CAAA,EAAA;;;ACpFH;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-empty-state.mjs","sources":["../../../projects/ui/empty-state/empty-state.component.ts","../../../projects/ui/empty-state/public-api.ts","../../../projects/ui/empty-state/cngx-ui-empty-state.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { type CngxAsyncState, nextUid } from '@cngx/core/utils';\n\n/**\n * Empty-state display organism for grids, tables, lists, and dashboards.\n *\n * Communicates why a view is empty and what the user can do next.\n * Supports three UX contexts via the parent's `emptyReason`:\n * - **first-use** - onboarding, show what's possible\n * - **no-results** - recovery, offer filter reset or search change\n * - **cleared** - confirmation, everything is done\n *\n * Icon is provided via the `[cngxEmptyStateIcon]` content slot - no Material\n * dependency. Consumers project `<mat-icon>`, `<svg>`, or any icon system.\n *\n * ```html\n * <cngx-empty-state title=\"No results\" description=\"Try a different search term\">\n * <mat-icon cngxEmptyStateIcon>search_off</mat-icon>\n * <button cngxEmptyStateAction (click)=\"resetSearch()\">Reset</button>\n * </cngx-empty-state>\n * ```\n *\n * @category ui/empty-state\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/empty-state/empty-state.component.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncState, CngxSkeletonContainer\n * <example-url>http://localhost:4200/#/ui/empty-state/default-no-icon-projected</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/inside-a-card-grid</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/inside-a-list</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/inside-a-table</example-url>\n * <example-url>http://localhost:4200/#/ui/empty-state/with-custom-icon-actions</example-url>\n */\n@Component({\n selector: 'cngx-empty-state',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cngx-empty-state',\n role: 'status',\n 'aria-live': 'polite',\n '[attr.aria-labelledby]': 'titleId',\n '[attr.aria-describedby]': 'description() ? descriptionId : null',\n '[attr.hidden]': 'shouldHide() || null',\n },\n template: `\n <div class=\"cngx-empty-state__icon-slot\">\n <ng-content select=\"[cngxEmptyStateIcon]\" />\n </div>\n <svg\n class=\"cngx-empty-state__default-icon\"\n aria-hidden=\"true\"\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M21 8V21H3V8\" />\n <path d=\"M1 3h22v5H1z\" />\n <path d=\"M10 12h4\" />\n </svg>\n <ng-content select=\"[cngxEmptyStateIllustration]\" />\n <h3 [id]=\"titleId\" class=\"cngx-empty-state__title\">{{ title() }}</h3>\n @if (description()) {\n <p [id]=\"descriptionId\" class=\"cngx-empty-state__description\">\n {{ description() }}\n </p>\n }\n <div class=\"cngx-empty-state__actions\">\n <ng-content select=\"[cngxEmptyStateAction]\" />\n </div>\n <ng-content select=\"[cngxEmptyStateSecondary]\" />\n `,\n styleUrls: ['./empty-state.component.css'],\n})\nexport class CngxEmptyState {\n private readonly uid = nextUid('cngx-empty');\n\n /** Primary message - what state the user is in. */\n readonly title = input.required<string>();\n\n /** Supporting detail - clarifies context and suggests next steps. */\n readonly description = input<string | undefined>(undefined);\n\n /**\n * Bind an async state - auto-hides when data is not empty, while an\n * operation is running, or on error status. Error communication belongs\n * to error surfaces (alert, async container). The component shows in two\n * cases: a settled empty result (\"loaded, nothing there\") and an idle\n * state with no data - the first-use onboarding surface, where nothing\n * has been asked for yet.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /** @internal - hidden when state is bound and the view is not a settled empty result. */\n protected readonly shouldHide = computed(() => {\n const s = this.state();\n if (!s) {\n return false;\n }\n // Skeleton owns the loading phase; error surfaces own the error phase.\n if (s.isLoading() || s.status() === 'error') {\n return true;\n }\n return !s.isEmpty();\n });\n\n /** @internal */\n protected readonly titleId = `${this.uid}-title`;\n /** @internal */\n protected readonly descriptionId = `${this.uid}-desc`;\n}\n","/**\n * @module @cngx/ui/empty-state\n */\n\nexport { CngxEmptyState } from './empty-state.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;MAgDU,cAAc,CAAA;AACR,IAAA,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC;;AAGnC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;AAGhC,IAAA,WAAW,GAAG,KAAK,CAAqB,SAAS,kFAAC;AAE3D;;;;;;;AAOG;AACM,IAAA,KAAK,GAAG,KAAK,CAAsC,SAAS,4EAAC;;AAGnD,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AAC5C,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE;QACtB,IAAI,CAAC,CAAC,EAAE;AACN,YAAA,OAAO,KAAK;QACd;;AAEA,QAAA,IAAI,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,OAAO,EAAE;AAC3C,YAAA,OAAO,IAAI;QACb;AACA,QAAA,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE;A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