@molecule/app-empty-state-angular 0.0.0-stage → 1.1.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.
@@ -0,0 +1,134 @@
1
+ import { type AfterViewInit, type DoCheck, type TemplateRef } from '@angular/core';
2
+ import type { UIClassMap } from '@molecule/app-ui';
3
+ import type { EmptyStateProps } from './types.js';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Generic centred empty-state panel for lists, feeds, boards, and tables.
7
+ *
8
+ * Renders a vertical stack of [icon, title, description, action]. Typography
9
+ * and spacing come from the wired ClassMap; per-app accent chrome (dashed
10
+ * borders, tinted backgrounds, gradient CTAs) is passed via `className` on the
11
+ * outer element.
12
+ *
13
+ * The host IS the outer `<section>` (`section[mol-empty-state]`), matching
14
+ * React's root exactly. Node props are an input (a string, or a `TemplateRef`)
15
+ * or projected content: `[slot=icon]`, `[slot=title]`, `[slot=description]` and
16
+ * `[slot=action]`.
17
+ *
18
+ * This is the Angular counterpart of `@molecule/app-empty-state-react`.
19
+ *
20
+ * @remarks
21
+ * Angular projection needs the `<ng-content>` capture points mounted, so the
22
+ * optional icon badge and description render optimistically and
23
+ * {@link EmptyState.ngDoCheck} detaches the ones React would not render. A
24
+ * selected `view` owns its message: the view's own content is rendered, so an
25
+ * app passes either a view or the generic message, never both.
26
+ */
27
+ export declare class EmptyState implements AfterViewInit, DoCheck {
28
+ /** Visual — an icon node as a `TemplateRef`, a string, or `[slot=icon]` content. */
29
+ icon?: unknown;
30
+ /** Primary heading for a general, unselected collection. */
31
+ title?: unknown;
32
+ /** Supporting description shown below the heading. */
33
+ description?: unknown;
34
+ /** Optional action for a general empty state. */
35
+ action?: unknown;
36
+ /** The selected view's translated message and required recovery element. */
37
+ view?: EmptyStateProps['view'];
38
+ /** `data-mol-id` for AI-agent selectors. */
39
+ dataMolId?: string;
40
+ /** Override outer wrapper classes (for per-app dashed-border, background, padding, etc.). */
41
+ className?: string;
42
+ /** Override the icon-badge wrapper classes. */
43
+ iconWrapperClassName?: string;
44
+ /** The optional icon badge (the projected icon lands here). */
45
+ private iconEl?;
46
+ /** The optional description paragraph (the projected description lands here). */
47
+ private descriptionEl?;
48
+ /** The action's capture point (the projected action lands here). */
49
+ private actionEl?;
50
+ /** The host element (the outer `<section>`). */
51
+ private readonly host;
52
+ /** The DOM renderer, for the wrapper attach/detach. */
53
+ private readonly renderer;
54
+ /** Reconciles the optional wrappers against React's DOM. */
55
+ private readonly guard;
56
+ /** Whether a `[slot=icon]` projection landed. */
57
+ private readonly iconProjected;
58
+ /** Whether a `[slot=description]` projection landed. */
59
+ private readonly descriptionProjected;
60
+ /** Whether a `[slot=action]` projection landed. */
61
+ private readonly actionProjected;
62
+ /**
63
+ * The current class map.
64
+ * @returns The UIClassMap.
65
+ */
66
+ cm(): UIClassMap;
67
+ /**
68
+ * The host's class list (React's root `<section>` classes).
69
+ * @returns The class string.
70
+ */
71
+ classes(): string;
72
+ /**
73
+ * The icon badge's class list.
74
+ * @returns The class string.
75
+ */
76
+ iconWrapperClasses(): string;
77
+ /**
78
+ * The heading's class list.
79
+ * @returns The class string.
80
+ */
81
+ titleClasses(): string;
82
+ /**
83
+ * The description paragraph's class list (React's `mb` follows a present action).
84
+ * @returns The class string.
85
+ */
86
+ descriptionClasses(): string;
87
+ /**
88
+ * The message to render: the selected view, or the general props.
89
+ * @returns The title, description and action nodes.
90
+ */
91
+ content(): {
92
+ title?: unknown;
93
+ description?: unknown;
94
+ action?: unknown;
95
+ };
96
+ /**
97
+ * A node value as a template, when the caller passed one.
98
+ * @param value - The prop value.
99
+ * @returns The template, or null for text.
100
+ */
101
+ templateOf(value: unknown): TemplateRef<unknown> | null;
102
+ /**
103
+ * A node value as text, when the caller passed one.
104
+ * @param value - The prop value.
105
+ * @returns The text, or null for a template.
106
+ */
107
+ textOf(value: unknown): string | null;
108
+ /**
109
+ * Whether the icon badge renders.
110
+ * @returns True when an icon text/template input or a projected icon is present.
111
+ */
112
+ showIcon(): boolean;
113
+ /**
114
+ * Whether the description paragraph renders.
115
+ * @returns True when a description content node or a projected description is present.
116
+ */
117
+ showDescription(): boolean;
118
+ /**
119
+ * Whether the action renders (React's truthiness check on `content.action`).
120
+ * @returns True when an action content node or a projected action is present.
121
+ */
122
+ showAction(): boolean;
123
+ /**
124
+ * Reads the projected capture points and reconciles the optional wrappers.
125
+ */
126
+ reconcile(): void;
127
+ /** Reconciles the wrappers once the view (and its projections) exist. */
128
+ ngAfterViewInit(): void;
129
+ /** Reconciles the wrappers after input writes, as React re-renders on a prop change. */
130
+ ngDoCheck(): void;
131
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmptyState, never>;
132
+ static ɵcmp: i0.ɵɵComponentDeclaration<EmptyState, "section[mol-empty-state]", never, { "icon": { "alias": "icon"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "action": { "alias": "action"; "required": false; }; "view": { "alias": "view"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "className": { "alias": "className"; "required": false; }; "iconWrapperClassName": { "alias": "iconWrapperClassName"; "required": false; }; }, {}, never, ["[slot=icon]", "[slot=title]", "[slot=description]", "[slot=action]"], true, never>;
133
+ }
134
+ //# sourceMappingURL=empty-state.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.component.d.ts","sourceRoot":"","sources":["../src/empty-state.component.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,OAAO,EAMZ,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;;AAwBjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAqBa,UAAW,YAAW,aAAa,EAAE,OAAO;IACvD,oFAAoF;IACpF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,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AAA;KAAE;IAIvE;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI;IAIvD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAIrC;;;OAGG;IACH,QAAQ,IAAI,OAAO;IAInB;;;OAGG;IACH,eAAe,IAAI,OAAO;IAI1B;;;OAGG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,SAAS,IAAI,IAAI;IAWjB,yEAAyE;IACzE,eAAe,IAAI,IAAI;IAIvB,wFAAwF;IACxF,SAAS,IAAI,IAAI;yCApKN,UAAU;2CAAV,UAAU;CAuKtB"}
@@ -0,0 +1,324 @@
1
+ /**
2
+ * EmptyState component (React parity).
3
+ *
4
+ * @module
5
+ */
6
+ import { NgTemplateOutlet } from '@angular/common';
7
+ import { Component, ElementRef, inject, RendererFactory2, signal, ViewChild, } from '@angular/core';
8
+ import { getClassMap } from '@molecule/app-ui';
9
+ import { hasNodes, SlotGuard } from './slot-dom.js';
10
+ import * as i0 from "@angular/core";
11
+ const _c0 = ["iconEl"];
12
+ const _c1 = ["descriptionEl"];
13
+ const _c2 = ["actionEl"];
14
+ const _c3 = [[["", "slot", "icon"]], [["", "slot", "title"]], [["", "slot", "description"]], [["", "slot", "action"]]];
15
+ const _c4 = ["[slot=icon]", "[slot=title]", "[slot=description]", "[slot=action]"];
16
+ function EmptyState_Conditional_2_Template(rf, ctx) { if (rf & 1) {
17
+ i0.ɵɵelementContainer(0, 3);
18
+ } if (rf & 2) {
19
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
20
+ } }
21
+ function EmptyState_Conditional_3_Template(rf, ctx) { if (rf & 1) {
22
+ i0.ɵɵtext(0);
23
+ } if (rf & 2) {
24
+ i0.ɵɵtextInterpolate(ctx);
25
+ } }
26
+ function EmptyState_Conditional_6_Template(rf, ctx) { if (rf & 1) {
27
+ i0.ɵɵelementContainer(0, 3);
28
+ } if (rf & 2) {
29
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
30
+ } }
31
+ function EmptyState_Conditional_7_Template(rf, ctx) { if (rf & 1) {
32
+ i0.ɵɵtext(0);
33
+ } if (rf & 2) {
34
+ i0.ɵɵtextInterpolate(ctx);
35
+ } }
36
+ function EmptyState_Conditional_11_Template(rf, ctx) { if (rf & 1) {
37
+ i0.ɵɵelementContainer(0, 3);
38
+ } if (rf & 2) {
39
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
40
+ } }
41
+ function EmptyState_Conditional_12_Template(rf, ctx) { if (rf & 1) {
42
+ i0.ɵɵtext(0);
43
+ } if (rf & 2) {
44
+ i0.ɵɵtextInterpolate(ctx);
45
+ } }
46
+ function EmptyState_Conditional_16_Template(rf, ctx) { if (rf & 1) {
47
+ i0.ɵɵelementContainer(0, 3);
48
+ } if (rf & 2) {
49
+ i0.ɵɵproperty("ngTemplateOutlet", ctx);
50
+ } }
51
+ function EmptyState_Conditional_17_Template(rf, ctx) { if (rf & 1) {
52
+ i0.ɵɵtext(0);
53
+ } if (rf & 2) {
54
+ i0.ɵɵtextInterpolate(ctx);
55
+ } }
56
+ /**
57
+ * Whether a node-valued prop is an Angular template (a node) rather than plain
58
+ * text. Checked structurally — `TemplateRef` is a type-only import in the
59
+ * emitted metadata, so `instanceof` is not dependable across bundles.
60
+ *
61
+ * @param value - The prop value.
62
+ * @returns True when it can be rendered with `ngTemplateOutlet`.
63
+ */
64
+ const isTemplate = (value) => typeof value === 'object' &&
65
+ value !== null &&
66
+ typeof value.createEmbeddedView === 'function';
67
+ /**
68
+ * Renders a text value the way React renders a node string.
69
+ *
70
+ * @param value - The prop value.
71
+ * @returns The text to render, or `null` when there is none.
72
+ */
73
+ const textOf = (value) => typeof value === 'string' || typeof value === 'number' ? String(value) : null;
74
+ /**
75
+ * Generic centred empty-state panel for lists, feeds, boards, and tables.
76
+ *
77
+ * Renders a vertical stack of [icon, title, description, action]. Typography
78
+ * and spacing come from the wired ClassMap; per-app accent chrome (dashed
79
+ * borders, tinted backgrounds, gradient CTAs) is passed via `className` on the
80
+ * outer element.
81
+ *
82
+ * The host IS the outer `<section>` (`section[mol-empty-state]`), matching
83
+ * React's root exactly. Node props are an input (a string, or a `TemplateRef`)
84
+ * or projected content: `[slot=icon]`, `[slot=title]`, `[slot=description]` and
85
+ * `[slot=action]`.
86
+ *
87
+ * This is the Angular counterpart of `@molecule/app-empty-state-react`.
88
+ *
89
+ * @remarks
90
+ * Angular projection needs the `<ng-content>` capture points mounted, so the
91
+ * optional icon badge and description render optimistically and
92
+ * {@link EmptyState.ngDoCheck} detaches the ones React would not render. A
93
+ * selected `view` owns its message: the view's own content is rendered, so an
94
+ * app passes either a view or the generic message, never both.
95
+ */
96
+ export class EmptyState {
97
+ /** Visual — an icon node as a `TemplateRef`, a string, or `[slot=icon]` content. */
98
+ icon;
99
+ /** Primary heading for a general, unselected collection. */
100
+ title;
101
+ /** Supporting description shown below the heading. */
102
+ description;
103
+ /** Optional action for a general empty state. */
104
+ action;
105
+ /** The selected view's translated message and required recovery element. */
106
+ view;
107
+ /** `data-mol-id` for AI-agent selectors. */
108
+ dataMolId;
109
+ /** Override outer wrapper classes (for per-app dashed-border, background, padding, etc.). */
110
+ className;
111
+ /** Override the icon-badge wrapper classes. */
112
+ iconWrapperClassName;
113
+ /** The optional icon badge (the projected icon lands here). */
114
+ iconEl;
115
+ /** The optional description paragraph (the projected description lands here). */
116
+ descriptionEl;
117
+ /** The action's capture point (the projected action lands here). */
118
+ actionEl;
119
+ /** The host element (the outer `<section>`). */
120
+ host = inject((ElementRef));
121
+ /** The DOM renderer, for the wrapper attach/detach. */
122
+ renderer = inject(RendererFactory2).createRenderer(null, null);
123
+ /** Reconciles the optional wrappers against React's DOM. */
124
+ guard = new SlotGuard(this.host, this.renderer);
125
+ /** Whether a `[slot=icon]` projection landed. */
126
+ iconProjected = signal(false, /* @ts-ignore */
127
+ ...(ngDevMode ? [{ debugName: "iconProjected" }] : /* istanbul ignore next */ []));
128
+ /** Whether a `[slot=description]` projection landed. */
129
+ descriptionProjected = signal(false, /* @ts-ignore */
130
+ ...(ngDevMode ? [{ debugName: "descriptionProjected" }] : /* istanbul ignore next */ []));
131
+ /** Whether a `[slot=action]` projection landed. */
132
+ actionProjected = signal(false, /* @ts-ignore */
133
+ ...(ngDevMode ? [{ debugName: "actionProjected" }] : /* istanbul ignore next */ []));
134
+ /**
135
+ * The current class map.
136
+ * @returns The UIClassMap.
137
+ */
138
+ cm() {
139
+ return getClassMap();
140
+ }
141
+ /**
142
+ * The host's class list (React's root `<section>` classes).
143
+ * @returns The class string.
144
+ */
145
+ classes() {
146
+ const cm = this.cm();
147
+ return cm.cn(cm.flex({ direction: 'col', align: 'center', justify: 'center' }), cm.textCenter, cm.sp('p', 12), this.className);
148
+ }
149
+ /**
150
+ * The icon badge's class list.
151
+ * @returns The class string.
152
+ */
153
+ iconWrapperClasses() {
154
+ const cm = this.cm();
155
+ return cm.cn(cm.w(20), cm.h(20), cm.roundedFull, cm.flex({ align: 'center', justify: 'center' }), cm.sp('mb', 6), this.iconWrapperClassName);
156
+ }
157
+ /**
158
+ * The heading's class list.
159
+ * @returns The class string.
160
+ */
161
+ titleClasses() {
162
+ const cm = this.cm();
163
+ return cm.cn(cm.textSize('2xl'), cm.fontWeight('bold'), cm.sp('mb', 2));
164
+ }
165
+ /**
166
+ * The description paragraph's class list (React's `mb` follows a present action).
167
+ * @returns The class string.
168
+ */
169
+ descriptionClasses() {
170
+ const cm = this.cm();
171
+ return cm.cn(cm.maxW('md'), cm.sp('mb', this.showAction() ? 6 : 0));
172
+ }
173
+ /**
174
+ * The message to render: the selected view, or the general props.
175
+ * @returns The title, description and action nodes.
176
+ */
177
+ content() {
178
+ return this.view ?? { title: this.title, description: this.description, action: this.action };
179
+ }
180
+ /**
181
+ * A node value as a template, when the caller passed one.
182
+ * @param value - The prop value.
183
+ * @returns The template, or null for text.
184
+ */
185
+ templateOf(value) {
186
+ return isTemplate(value) ? value : null;
187
+ }
188
+ /**
189
+ * A node value as text, when the caller passed one.
190
+ * @param value - The prop value.
191
+ * @returns The text, or null for a template.
192
+ */
193
+ textOf(value) {
194
+ return textOf(value);
195
+ }
196
+ /**
197
+ * Whether the icon badge renders.
198
+ * @returns True when an icon text/template input or a projected icon is present.
199
+ */
200
+ showIcon() {
201
+ return textOf(this.icon) !== null || this.templateOf(this.icon) !== null || this.iconProjected();
202
+ }
203
+ /**
204
+ * Whether the description paragraph renders.
205
+ * @returns True when a description content node or a projected description is present.
206
+ */
207
+ showDescription() {
208
+ return this.content().description != null || this.descriptionProjected();
209
+ }
210
+ /**
211
+ * Whether the action renders (React's truthiness check on `content.action`).
212
+ * @returns True when an action content node or a projected action is present.
213
+ */
214
+ showAction() {
215
+ return this.content().action != null || this.actionProjected();
216
+ }
217
+ /**
218
+ * Reads the projected capture points and reconciles the optional wrappers.
219
+ */
220
+ reconcile() {
221
+ const icon = this.iconEl?.nativeElement;
222
+ if (icon)
223
+ this.iconProjected.set(hasNodes(icon));
224
+ const description = this.descriptionEl?.nativeElement;
225
+ if (description)
226
+ this.descriptionProjected.set(hasNodes(description));
227
+ const action = this.actionEl?.nativeElement;
228
+ if (action)
229
+ this.actionProjected.set(hasNodes(action));
230
+ this.guard.toggle(this.iconEl?.nativeElement, this.showIcon());
231
+ this.guard.toggle(this.descriptionEl?.nativeElement, this.showDescription());
232
+ }
233
+ /** Reconciles the wrappers once the view (and its projections) exist. */
234
+ ngAfterViewInit() {
235
+ this.reconcile();
236
+ }
237
+ /** Reconciles the wrappers after input writes, as React re-renders on a prop change. */
238
+ ngDoCheck() {
239
+ this.reconcile();
240
+ }
241
+ static ɵfac = function EmptyState_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EmptyState)(); };
242
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EmptyState, selectors: [["section", "mol-empty-state", ""]], viewQuery: function EmptyState_Query(rf, ctx) { if (rf & 1) {
243
+ i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5);
244
+ } if (rf & 2) {
245
+ let _t;
246
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.iconEl = _t.first);
247
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.descriptionEl = _t.first);
248
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.actionEl = _t.first);
249
+ } }, hostVars: 3, hostBindings: function EmptyState_HostBindings(rf, ctx) { if (rf & 2) {
250
+ i0.ɵɵattribute("data-mol-id", ctx.dataMolId ?? null);
251
+ i0.ɵɵclassMap(ctx.classes());
252
+ } }, inputs: { icon: "icon", title: "title", description: "description", action: "action", view: "view", dataMolId: "dataMolId", className: "className", iconWrapperClassName: "iconWrapperClassName" }, ngContentSelectors: _c4, decls: 19, vars: 10, consts: [["iconEl", ""], ["descriptionEl", ""], ["actionEl", ""], [3, "ngTemplateOutlet"], ["data-parity-unwrap", ""]], template: function EmptyState_Template(rf, ctx) { if (rf & 1) {
253
+ i0.ɵɵprojectionDef(_c3);
254
+ i0.ɵɵelementStart(0, "div", null, 0);
255
+ i0.ɵɵconditionalCreate(2, EmptyState_Conditional_2_Template, 1, 1, "ng-container", 3)(3, EmptyState_Conditional_3_Template, 1, 1);
256
+ i0.ɵɵprojection(4);
257
+ i0.ɵɵelementEnd();
258
+ i0.ɵɵelementStart(5, "h3");
259
+ i0.ɵɵconditionalCreate(6, EmptyState_Conditional_6_Template, 1, 1, "ng-container", 3)(7, EmptyState_Conditional_7_Template, 1, 1);
260
+ i0.ɵɵprojection(8, 1);
261
+ i0.ɵɵelementEnd();
262
+ i0.ɵɵelementStart(9, "p", null, 1);
263
+ i0.ɵɵconditionalCreate(11, EmptyState_Conditional_11_Template, 1, 1, "ng-container", 3)(12, EmptyState_Conditional_12_Template, 1, 1);
264
+ i0.ɵɵprojection(13, 2);
265
+ i0.ɵɵelementEnd();
266
+ i0.ɵɵelementStart(14, "div", 4, 2);
267
+ i0.ɵɵconditionalCreate(16, EmptyState_Conditional_16_Template, 1, 1, "ng-container", 3)(17, EmptyState_Conditional_17_Template, 1, 1);
268
+ i0.ɵɵprojection(18, 3);
269
+ i0.ɵɵelementEnd();
270
+ } if (rf & 2) {
271
+ let tmp_4_0;
272
+ let tmp_6_0;
273
+ let tmp_8_0;
274
+ let tmp_9_0;
275
+ i0.ɵɵclassMap(ctx.iconWrapperClasses());
276
+ i0.ɵɵadvance(2);
277
+ i0.ɵɵconditional((tmp_4_0 = ctx.templateOf(ctx.icon)) ? 2 : (tmp_4_0 = ctx.textOf(ctx.icon)) ? 3 : -1, tmp_4_0);
278
+ i0.ɵɵadvance(3);
279
+ i0.ɵɵclassMap(ctx.titleClasses());
280
+ i0.ɵɵadvance();
281
+ i0.ɵɵconditional((tmp_6_0 = ctx.templateOf(ctx.content().title)) ? 6 : (tmp_6_0 = ctx.textOf(ctx.content().title)) ? 7 : -1, tmp_6_0);
282
+ i0.ɵɵadvance(3);
283
+ i0.ɵɵclassMap(ctx.descriptionClasses());
284
+ i0.ɵɵadvance(2);
285
+ i0.ɵɵconditional((tmp_8_0 = ctx.templateOf(ctx.content().description)) ? 11 : (tmp_8_0 = ctx.textOf(ctx.content().description)) ? 12 : -1, tmp_8_0);
286
+ i0.ɵɵadvance(5);
287
+ i0.ɵɵconditional((tmp_9_0 = ctx.templateOf(ctx.content().action)) ? 16 : (tmp_9_0 = ctx.textOf(ctx.content().action)) ? 17 : -1, tmp_9_0);
288
+ } }, dependencies: [NgTemplateOutlet], encapsulation: 2 });
289
+ }
290
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EmptyState, [{
291
+ type: Component,
292
+ args: [{
293
+ selector: 'section[mol-empty-state]',
294
+ standalone: true,
295
+ imports: [NgTemplateOutlet],
296
+ inputs: [
297
+ 'icon',
298
+ 'title',
299
+ 'description',
300
+ 'action',
301
+ 'view',
302
+ 'dataMolId',
303
+ 'className',
304
+ 'iconWrapperClassName',
305
+ ],
306
+ host: {
307
+ '[class]': 'classes()',
308
+ '[attr.data-mol-id]': 'dataMolId ?? null',
309
+ },
310
+ // prettier-ignore
311
+ template: `<div #iconEl [class]="iconWrapperClasses()">@if (templateOf(icon); as tpl) {<ng-container [ngTemplateOutlet]="tpl" />} @else if (textOf(icon); as t) {{{ t }}}<ng-content select="[slot=icon]"></ng-content></div><h3 [class]="titleClasses()">@if (templateOf(content().title); as tpl) {<ng-container [ngTemplateOutlet]="tpl" />} @else if (textOf(content().title); as t) {{{ t }}}<ng-content select="[slot=title]"></ng-content></h3><p #descriptionEl [class]="descriptionClasses()">@if (templateOf(content().description); as tpl) {<ng-container [ngTemplateOutlet]="tpl" />} @else if (textOf(content().description); as t) {{{ t }}}<ng-content select="[slot=description]"></ng-content></p><div #actionEl data-parity-unwrap>@if (templateOf(content().action); as tpl) {<ng-container [ngTemplateOutlet]="tpl" />} @else if (textOf(content().action); as t) {{{ t }}}<ng-content select="[slot=action]"></ng-content></div>`,
312
+ }]
313
+ }], null, { iconEl: [{
314
+ type: ViewChild,
315
+ args: ['iconEl']
316
+ }], descriptionEl: [{
317
+ type: ViewChild,
318
+ args: ['descriptionEl']
319
+ }], actionEl: [{
320
+ type: ViewChild,
321
+ args: ['actionEl']
322
+ }] }); })();
323
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EmptyState, { className: "EmptyState", filePath: "empty-state.component.ts", lineNumber: 92 }); })();
324
+ //# sourceMappingURL=empty-state.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.component.js","sourceRoot":"","sources":["../src/empty-state.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAEL,SAAS,EAET,UAAU,EACV,MAAM,EAEN,gBAAgB,EAChB,MAAM,EAEN,SAAS,GACV,MAAM,eAAe,CAAA;AAG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AC;;;YAFV,oCAA4C;YAA2E,AAA3E,qFAAgC,4CAA0E;YAAQ,kBAA8C;YAAA,iBAAM;YAAA,0BAA6B;YAAsF,AAAtF,qFAA2C,4CAAqF;YAAQ,qBAA+C;YAAA,iBAAK;YAAA,kCAAiD;YAA4F,AAA5F,uFAAiD,8CAA2F;YAAQ,sBAAqD;YAAA,iBAAI;YAAA,kCAAkC;YAAuF,AAAvF,uFAA4C,8CAAsF;YAAQ,sBAAgD;YAAA,iBAAM;;;;;;YAA93B,uCAA8B;YAAC,eAAkH;YAAlH,+GAAkH;YAAwD,eAAwB;YAAxB,iCAAwB;YAAC,cAAwI;YAAxI,qIAAwI;YAAsE,eAA8B;YAA9B,uCAA8B;YAAC,eAAoJ;YAApJ,mJAAoJ;YAA2F,eAA0I;YAA1I,yIAA0I;4BAhBt1B,gBAAgB;;iFAkBf,UAAU;cArBtB,SAAS;eAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;gBAC3B,MAAM,EAAE;oBACN,MAAM;oBACN,OAAO;oBACP,aAAa;oBACb,QAAQ;oBACR,MAAM;oBACN,WAAW;oBACX,WAAW;oBACX,sBAAsB;iBACvB;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;oBACtB,oBAAoB,EAAE,mBAAmB;iBAC1C;gBACD,kBAAkB;gBAClB,QAAQ,EAAE,64BAA64B;aACx5B;;kBAoBE,SAAS;mBAAC,QAAQ;;kBAElB,SAAS;mBAAC,eAAe;;kBAEzB,SAAS;mBAAC,UAAU;;kFAvBV,UAAU"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Angular empty-state and CTA-card primitives — the counterpart of
3
+ * `@molecule/app-empty-state-react`: the same props and the same DOM for the
4
+ * same input.
5
+ *
6
+ * Exports:
7
+ * - `<EmptyState>` — centred icon + title + description + action for lists,
8
+ * feeds, boards, or tables that have no rows to render yet.
9
+ * - `<CtaCard>` — horizontal or vertical promotional card for "next-step"
10
+ * actions inside a page body.
11
+ *
12
+ * Both components accept a `className` input so apps can layer per-brand
13
+ * accent chrome (dashed borders, gradient CTAs, tinted backgrounds) on
14
+ * top of the structural layout.
15
+ *
16
+ * A selected list view passes `view={emptyByView[selection]}`. Each entry pairs
17
+ * its translated `title`, optional `description`, and required `action` element.
18
+ * Keep those entries beside the view definitions so a personal or filtered list
19
+ * does not reuse the whole collection's empty message. The action can be a router
20
+ * link to another view or a button that clears filters. General empty states keep
21
+ * the existing `title` and optional `action` props.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { Component } from '@angular/core'
26
+ * import { RouterLink } from '@angular/router'
27
+ * import { CtaCard, EmptyState } from '@molecule/app-empty-state-angular'
28
+ * import { Button, Icon } from '@molecule/app-ui-angular'
29
+ *
30
+ * @Component({
31
+ * selector: 'app-messages-empty',
32
+ * standalone: true,
33
+ * imports: [EmptyState, Icon, RouterLink],
34
+ * template: `
35
+ * <section mol-empty-state [title]="t('messages.empty.title')">
36
+ * <icon slot="icon" name="mail" [size]="40" />
37
+ * <p slot="description">{{ t('messages.empty.description') }}</p>
38
+ * <a slot="action" routerLink="/compose">Send one</a>
39
+ * </section>
40
+ * `,
41
+ * })
42
+ * export class MessagesEmpty {}
43
+ * ```
44
+ *
45
+ * @remarks
46
+ * - **Name collision:** `@molecule/app-ui-angular` also exports an
47
+ * `EmptyState` (the ClassMap-token variant driven by `cm.emptyState*`).
48
+ * Use THAT one for plain framework-styled empty states; use THIS
49
+ * package when you want the circular icon badge
50
+ * (`iconWrapperClassName`), per-brand chrome via `className`, a
51
+ * `dataMolId`, or the companion `<CtaCard>`. If you import both
52
+ * packages, alias one import to avoid the clash.
53
+ * - All text arrives via props — translate with your `t()` calls; this
54
+ * package has no locale bond of its own.
55
+ * - Styling resolves through `getClassMap()` — requires a wired ClassMap
56
+ * bond (standard molecule app setup).
57
+ * - Node props are inputs (a string, or a `TemplateRef`) or projected
58
+ * content selected by `[slot=<name>]`; components accept either.
59
+ *
60
+ * @module
61
+ */
62
+ export * from './cta-card.component.js';
63
+ export * from './empty-state.component.js';
64
+ export * from './types.js';
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Angular empty-state and CTA-card primitives — the counterpart of
3
+ * `@molecule/app-empty-state-react`: the same props and the same DOM for the
4
+ * same input.
5
+ *
6
+ * Exports:
7
+ * - `<EmptyState>` — centred icon + title + description + action for lists,
8
+ * feeds, boards, or tables that have no rows to render yet.
9
+ * - `<CtaCard>` — horizontal or vertical promotional card for "next-step"
10
+ * actions inside a page body.
11
+ *
12
+ * Both components accept a `className` input so apps can layer per-brand
13
+ * accent chrome (dashed borders, gradient CTAs, tinted backgrounds) on
14
+ * top of the structural layout.
15
+ *
16
+ * A selected list view passes `view={emptyByView[selection]}`. Each entry pairs
17
+ * its translated `title`, optional `description`, and required `action` element.
18
+ * Keep those entries beside the view definitions so a personal or filtered list
19
+ * does not reuse the whole collection's empty message. The action can be a router
20
+ * link to another view or a button that clears filters. General empty states keep
21
+ * the existing `title` and optional `action` props.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * import { Component } from '@angular/core'
26
+ * import { RouterLink } from '@angular/router'
27
+ * import { CtaCard, EmptyState } from '@molecule/app-empty-state-angular'
28
+ * import { Button, Icon } from '@molecule/app-ui-angular'
29
+ *
30
+ * @Component({
31
+ * selector: 'app-messages-empty',
32
+ * standalone: true,
33
+ * imports: [EmptyState, Icon, RouterLink],
34
+ * template: `
35
+ * <section mol-empty-state [title]="t('messages.empty.title')">
36
+ * <icon slot="icon" name="mail" [size]="40" />
37
+ * <p slot="description">{{ t('messages.empty.description') }}</p>
38
+ * <a slot="action" routerLink="/compose">Send one</a>
39
+ * </section>
40
+ * `,
41
+ * })
42
+ * export class MessagesEmpty {}
43
+ * ```
44
+ *
45
+ * @remarks
46
+ * - **Name collision:** `@molecule/app-ui-angular` also exports an
47
+ * `EmptyState` (the ClassMap-token variant driven by `cm.emptyState*`).
48
+ * Use THAT one for plain framework-styled empty states; use THIS
49
+ * package when you want the circular icon badge
50
+ * (`iconWrapperClassName`), per-brand chrome via `className`, a
51
+ * `dataMolId`, or the companion `<CtaCard>`. If you import both
52
+ * packages, alias one import to avoid the clash.
53
+ * - All text arrives via props — translate with your `t()` calls; this
54
+ * package has no locale bond of its own.
55
+ * - Styling resolves through `getClassMap()` — requires a wired ClassMap
56
+ * bond (standard molecule app setup).
57
+ * - Node props are inputs (a string, or a `TemplateRef`) or projected
58
+ * content selected by `[slot=<name>]`; components accept either.
59
+ *
60
+ * @module
61
+ */
62
+ export * from './cta-card.component.js';
63
+ export * from './empty-state.component.js';
64
+ export * from './types.js';
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,YAAY,CAAA"}