@cngx/ui 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.
- package/README.md +118 -59
- package/action-button/README.md +170 -53
- package/breadcrumb/README.md +5 -6
- package/collection/README.md +1 -1
- package/command-palette/README.md +9 -5
- package/data-grid-accordion/README.md +1 -1
- package/empty-state/README.md +2 -3
- package/feedback/README.md +1 -1
- package/fesm2022/cngx-ui-a11y.mjs +13 -23
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +55 -60
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +220 -339
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +100 -80
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +28 -34
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +29 -51
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +138 -89
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +135 -77
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +17 -44
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +648 -495
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +17 -13
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +6 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +315 -134
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
- package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +9 -10
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +212 -188
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +872 -721
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +17 -19
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +21 -74
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +39 -62
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +259 -130
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +148 -50
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +48 -32
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +59 -48
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +5 -5
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-tabs/README.md +57 -19
- package/mat-tabs/styles/mat-tabs.css +285 -163
- package/nav-rail/README.md +325 -0
- package/package.json +37 -8
- package/paginator/README.md +10 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +96 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +150 -55
- package/skeleton/README.md +1 -1
- package/speak/README.md +1 -2
- package/stepper/README.md +20 -5
- package/tabs/README.md +13 -0
- package/timeline/README.md +1 -1
- package/toc/README.md +1 -1
- package/types/cngx-ui-a11y.d.ts +20 -38
- package/types/cngx-ui-accordion.d.ts +46 -71
- package/types/cngx-ui-action-button.d.ts +113 -151
- package/types/cngx-ui-breadcrumb.d.ts +60 -85
- package/types/cngx-ui-chart-panel.d.ts +22 -40
- package/types/cngx-ui-collection.d.ts +30 -43
- package/types/cngx-ui-command-palette.d.ts +40 -64
- package/types/cngx-ui-context-menu.d.ts +109 -48
- package/types/cngx-ui-data-grid-accordion.d.ts +50 -75
- package/types/cngx-ui-empty-state.d.ts +18 -8
- package/types/cngx-ui-feedback.d.ts +275 -292
- package/types/cngx-ui-layout.d.ts +4 -12
- package/types/cngx-ui-mat-accordion.d.ts +5 -5
- package/types/cngx-ui-mat-paginator.d.ts +4 -10
- package/types/cngx-ui-mat-stepper.d.ts +5 -10
- package/types/cngx-ui-mat-tabs.d.ts +86 -89
- package/types/cngx-ui-nav-rail.d.ts +416 -0
- package/types/cngx-ui-overlay.d.ts +4 -13
- package/types/cngx-ui-paginator.d.ts +186 -161
- package/types/cngx-ui-sidenav.d.ts +557 -437
- package/types/cngx-ui-skeleton.d.ts +7 -13
- package/types/cngx-ui-speak.d.ts +40 -24
- package/types/cngx-ui-stat-card.d.ts +45 -36
- package/types/cngx-ui-stepper.d.ts +205 -84
- package/types/cngx-ui-tabs.d.ts +104 -28
- package/types/cngx-ui-timeline.d.ts +31 -51
- package/types/cngx-ui-toc.d.ts +43 -54
- package/types/cngx-ui.d.ts +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { CngxIconSvg } from '@cngx/common/display';
|
|
3
4
|
import { nextUid } from '@cngx/core/utils';
|
|
5
|
+
import { CNGX_ICON_ARCHIVE } from '@cngx/utils';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Empty-state display organism for grids, tables, lists, and dashboards.
|
|
@@ -21,17 +23,16 @@ import { nextUid } from '@cngx/core/utils';
|
|
|
21
23
|
* </cngx-empty-state>
|
|
22
24
|
* ```
|
|
23
25
|
*
|
|
24
|
-
* @category ui/empty-state
|
|
25
|
-
* @docsKind primary
|
|
26
26
|
* @wcag AA
|
|
27
27
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/empty-state/empty-state.component.ts
|
|
28
|
-
* @since 0.
|
|
28
|
+
* @since 0.3.0
|
|
29
29
|
* @relatedTo CngxAsyncState, CngxSkeletonContainer
|
|
30
|
-
* <example-url
|
|
31
|
-
* <example-url
|
|
32
|
-
* <example-url
|
|
33
|
-
* <example-url
|
|
34
|
-
* <example-url
|
|
30
|
+
* <example-url>/#/ui/empty-state/default-no-icon-projected</example-url>
|
|
31
|
+
* <example-url>/#/ui/empty-state/inside-a-card-grid</example-url>
|
|
32
|
+
* <example-url>/#/ui/empty-state/inside-a-list</example-url>
|
|
33
|
+
* <example-url>/#/ui/empty-state/inside-a-table</example-url>
|
|
34
|
+
* <example-url>/#/ui/empty-state/with-custom-icon-actions</example-url>
|
|
35
|
+
* @axis level organism
|
|
35
36
|
*/
|
|
36
37
|
class CngxEmptyState {
|
|
37
38
|
uid = nextUid('cngx-empty');
|
|
@@ -60,6 +61,8 @@ class CngxEmptyState {
|
|
|
60
61
|
}
|
|
61
62
|
return !s.isEmpty();
|
|
62
63
|
}, ...(ngDevMode ? [{ debugName: "shouldHide" }] : /* istanbul ignore next */ []));
|
|
64
|
+
/** @internal - fallback glyph while no icon is projected. */
|
|
65
|
+
defaultIcon = CNGX_ICON_ARCHIVE;
|
|
63
66
|
/** @internal */
|
|
64
67
|
titleId = `${this.uid}-title`;
|
|
65
68
|
/** @internal */
|
|
@@ -69,22 +72,7 @@ class CngxEmptyState {
|
|
|
69
72
|
<div class="cngx-empty-state__icon-slot">
|
|
70
73
|
<ng-content select="[cngxEmptyStateIcon]" />
|
|
71
74
|
</div>
|
|
72
|
-
<svg
|
|
73
|
-
class="cngx-empty-state__default-icon"
|
|
74
|
-
aria-hidden="true"
|
|
75
|
-
width="48"
|
|
76
|
-
height="48"
|
|
77
|
-
viewBox="0 0 24 24"
|
|
78
|
-
fill="none"
|
|
79
|
-
stroke="currentColor"
|
|
80
|
-
stroke-width="1.5"
|
|
81
|
-
stroke-linecap="round"
|
|
82
|
-
stroke-linejoin="round"
|
|
83
|
-
>
|
|
84
|
-
<path d="M21 8V21H3V8" />
|
|
85
|
-
<path d="M1 3h22v5H1z" />
|
|
86
|
-
<path d="M10 12h4" />
|
|
87
|
-
</svg>
|
|
75
|
+
<svg class="cngx-empty-state__default-icon" [cngxIconSvg]="defaultIcon"></svg>
|
|
88
76
|
<ng-content select="[cngxEmptyStateIllustration]" />
|
|
89
77
|
<h3 [id]="titleId" class="cngx-empty-state__title">{{ title() }}</h3>
|
|
90
78
|
@if (description()) {
|
|
@@ -96,11 +84,11 @@ class CngxEmptyState {
|
|
|
96
84
|
<ng-content select="[cngxEmptyStateAction]" />
|
|
97
85
|
</div>
|
|
98
86
|
<ng-content select="[cngxEmptyStateSecondary]" />
|
|
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
|
|
87
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-empty-gap{syntax: \"*\"; inherits: false; initial-value: 16px;}@property --cngx-empty-icon-size{syntax: \"*\"; inherits: true; initial-value: 48px;}@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, 16px);--cngx-empty-padding: var(--cngx-space-xl, 48px);display:flex;flex-direction:column;align-items:center;gap:var(--cngx-empty-gap);padding:var(--cngx-empty-padding) var(--cngx-space-md, 16px);text-align:center;color:var(--cngx-empty-color)}:scope[hidden]{display:none}.cngx-empty-state__icon-slot:not(:empty)+.cngx-empty-state__default-icon{display:none}.cngx-empty-state__default-icon{--cngx-icon-svg-size: calc(var(--cngx-empty-icon-size, 48px) * 47 / 48 * 24 / 21.4);--cngx-icon-svg-stroke-width: 1.4;margin-block:calc((var(--cngx-empty-icon-size, 48px) - round(nearest,var(--cngx-icon-svg-size, 1em),1px)) / 2);color:var(--cngx-empty-icon-color)}.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)}.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"], dependencies: [{ kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
100
88
|
}
|
|
101
89
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxEmptyState, decorators: [{
|
|
102
90
|
type: Component,
|
|
103
|
-
args: [{ selector: 'cngx-empty-state', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
91
|
+
args: [{ selector: 'cngx-empty-state', standalone: true, imports: [CngxIconSvg], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
104
92
|
class: 'cngx-empty-state',
|
|
105
93
|
role: 'status',
|
|
106
94
|
'aria-live': 'polite',
|
|
@@ -111,22 +99,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
111
99
|
<div class="cngx-empty-state__icon-slot">
|
|
112
100
|
<ng-content select="[cngxEmptyStateIcon]" />
|
|
113
101
|
</div>
|
|
114
|
-
<svg
|
|
115
|
-
class="cngx-empty-state__default-icon"
|
|
116
|
-
aria-hidden="true"
|
|
117
|
-
width="48"
|
|
118
|
-
height="48"
|
|
119
|
-
viewBox="0 0 24 24"
|
|
120
|
-
fill="none"
|
|
121
|
-
stroke="currentColor"
|
|
122
|
-
stroke-width="1.5"
|
|
123
|
-
stroke-linecap="round"
|
|
124
|
-
stroke-linejoin="round"
|
|
125
|
-
>
|
|
126
|
-
<path d="M21 8V21H3V8" />
|
|
127
|
-
<path d="M1 3h22v5H1z" />
|
|
128
|
-
<path d="M10 12h4" />
|
|
129
|
-
</svg>
|
|
102
|
+
<svg class="cngx-empty-state__default-icon" [cngxIconSvg]="defaultIcon"></svg>
|
|
130
103
|
<ng-content select="[cngxEmptyStateIllustration]" />
|
|
131
104
|
<h3 [id]="titleId" class="cngx-empty-state__title">{{ title() }}</h3>
|
|
132
105
|
@if (description()) {
|
|
@@ -138,11 +111,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
138
111
|
<ng-content select="[cngxEmptyStateAction]" />
|
|
139
112
|
</div>
|
|
140
113
|
<ng-content select="[cngxEmptyStateSecondary]" />
|
|
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
|
|
114
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-empty-gap{syntax: \"*\"; inherits: false; initial-value: 16px;}@property --cngx-empty-icon-size{syntax: \"*\"; inherits: true; initial-value: 48px;}@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, 16px);--cngx-empty-padding: var(--cngx-space-xl, 48px);display:flex;flex-direction:column;align-items:center;gap:var(--cngx-empty-gap);padding:var(--cngx-empty-padding) var(--cngx-space-md, 16px);text-align:center;color:var(--cngx-empty-color)}:scope[hidden]{display:none}.cngx-empty-state__icon-slot:not(:empty)+.cngx-empty-state__default-icon{display:none}.cngx-empty-state__default-icon{--cngx-icon-svg-size: calc(var(--cngx-empty-icon-size, 48px) * 47 / 48 * 24 / 21.4);--cngx-icon-svg-stroke-width: 1.4;margin-block:calc((var(--cngx-empty-icon-size, 48px) - round(nearest,var(--cngx-icon-svg-size, 1em),1px)) / 2);color:var(--cngx-empty-icon-color)}.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)}.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"] }]
|
|
142
115
|
}], 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 }] }] } });
|
|
143
116
|
|
|
144
117
|
/**
|
|
145
|
-
* @module
|
|
118
|
+
* @module `@cngx/ui/empty-state`
|
|
146
119
|
*/
|
|
147
120
|
|
|
148
121
|
/**
|
|
@@ -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 * @
|
|
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 { CngxIconSvg } from '@cngx/common/display';\nimport { type CngxAsyncState, nextUid } from '@cngx/core/utils';\nimport { CNGX_ICON_ARCHIVE } from '@cngx/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 * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/empty-state/empty-state.component.ts\n * @since 0.3.0\n * @relatedTo CngxAsyncState, CngxSkeletonContainer\n * <example-url>/#/ui/empty-state/default-no-icon-projected</example-url>\n * <example-url>/#/ui/empty-state/inside-a-card-grid</example-url>\n * <example-url>/#/ui/empty-state/inside-a-list</example-url>\n * <example-url>/#/ui/empty-state/inside-a-table</example-url>\n * <example-url>/#/ui/empty-state/with-custom-icon-actions</example-url>\n * @axis level organism\n */\n@Component({\n selector: 'cngx-empty-state',\n standalone: true,\n imports: [CngxIconSvg],\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 class=\"cngx-empty-state__default-icon\" [cngxIconSvg]=\"defaultIcon\"></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 - fallback glyph while no icon is projected. */\n protected readonly defaultIcon = CNGX_ICON_ARCHIVE;\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":";;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;MAkCU,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;AACrB,IAAA,CAAC,iFAAC;;IAGiB,WAAW,GAAG,iBAAiB;;AAG/B,IAAA,OAAO,GAAG,CAAA,EAAG,IAAI,CAAC,GAAG,QAAQ;;AAE7B,IAAA,aAAa,GAAG,CAAA,EAAG,IAAI,CAAC,GAAG,OAAO;uGAtC1C,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA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