@molecule/app-vendor-card-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.
package/dist/index.js ADDED
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Vendor / seller / agent profile card.
3
+ *
4
+ * Exports `VendorCard` — Avatar/logo + name + tagline + rating/review count
5
+ * + member-since + badges + actions row, on the shared Card. It is the
6
+ * Angular counterpart of `@molecule/app-vendor-card-react`: same props and
7
+ * the same DOM for the same input.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * import { Component } from '@angular/core'
12
+ * import { VendorCard } from '@molecule/app-vendor-card-angular'
13
+ * import { Button } from '@molecule/app-ui-angular'
14
+ *
15
+ * @Component({
16
+ * selector: 'vendor-page',
17
+ * standalone: true,
18
+ * imports: [VendorCard, Button],
19
+ * template: `
20
+ * <div mol-vendor-card
21
+ * name="Acme Supplies"
22
+ * logoSrc="/logos/acme.png"
23
+ * description="Industrial parts, fast shipping"
24
+ * [rating]="4.7"
25
+ * [reviewCount]="312"
26
+ * memberSince="Jan 2021"
27
+ * (click)="openVendorPage()">
28
+ * <span slot="badges">Verified</span>
29
+ * <button mol-button size="sm" slot="actions" (click)="follow()">Follow</button>
30
+ * </div>
31
+ * `,
32
+ * })
33
+ * export class VendorPage {}
34
+ * ```
35
+ *
36
+ * @remarks
37
+ * Composes `Avatar` from `@molecule/app-ui-angular` on the shared Card
38
+ * surface (`cm.card({ variant: 'elevated' })` + `cm.cardPadding('md')`). The
39
+ * host IS the card's root `<div>`, so a click anywhere on the card fires the
40
+ * host's `(click)` — no keyboard handler or role is added; put primary
41
+ * navigation in `actions` buttons for accessibility. `rating` renders a
42
+ * single ★ plus the number (`toFixed(1)`), not a five-star row;
43
+ * `reviewCount` renders only when `rating` is also set. When `name` is not a
44
+ * plain string the Avatar alt falls back to hardcoded 'Vendor'. All text
45
+ * slots (description, memberSince, badges, actions) are pre-translated — no
46
+ * locale bond. Node props are projected content: `name`, `description`,
47
+ * `memberSince`, `badges` and `actions` are selected by `[slot=<name>]`,
48
+ * everything else binds as inputs. Props (documented on the exported
49
+ * `VendorCardProps` interface): name, logoSrc, description, rating,
50
+ * reviewCount, memberSince, badges, actions, onClick, className.
51
+ *
52
+ * @module
53
+ */
54
+ export * from './types.js';
55
+ export * from './vendor-card.component.js';
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,cAAc,YAAY,CAAA;AAC1B,cAAc,4BAA4B,CAAA"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Types of `@molecule/app-vendor-card-angular` — the Angular counterpart of
3
+ * `@molecule/app-vendor-card-react`, same props and DOM.
4
+ *
5
+ * @module
6
+ */
7
+ /**
8
+ * Props accepted by {@link VendorCard} — the same props
9
+ * `@molecule/app-vendor-card-react` accepts. Node props (`name`,
10
+ * `description`, `memberSince`, `badges`, `actions`) are projected content in
11
+ * Angular (an input cannot carry a node), so they are typed `unknown`: pass a
12
+ * string or number value through the input, and element content in the host
13
+ * template as `[slot=<name>]` content.
14
+ */
15
+ export interface VendorCardProps {
16
+ /** Vendor / seller display name: text, or `[slot=name]` content. */
17
+ name?: unknown;
18
+ /** Optional logo URL — falls back to Avatar text initials. */
19
+ logoSrc?: string;
20
+ /** Tagline / one-liner: text, or `[slot=description]` content. */
21
+ description?: unknown;
22
+ /** 0-5 average rating. */
23
+ rating?: number;
24
+ /** Total review count. */
25
+ reviewCount?: number;
26
+ /** Member-since date display: text, or `[slot=memberSince]` content. */
27
+ memberSince?: unknown;
28
+ /** Optional badges row (Verified, Top seller, etc.): text, or `[slot=badges]` content. */
29
+ badges?: unknown;
30
+ /** Right-side actions: text, or `[slot=actions]` content. */
31
+ actions?: unknown;
32
+ /** Optional click handler on the body (a native `(click)` on the host element). */
33
+ onClick?: unknown;
34
+ /** Extra classes. */
35
+ className?: string;
36
+ }
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
package/dist/types.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Types of `@molecule/app-vendor-card-angular` — the Angular counterpart of
3
+ * `@molecule/app-vendor-card-react`, same props and DOM.
4
+ *
5
+ * @module
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,198 @@
1
+ /**
2
+ * VendorCard component (React parity).
3
+ *
4
+ * @module
5
+ */
6
+ import { type AfterViewInit } from '@angular/core';
7
+ import type { UIClassMap } from '@molecule/app-ui';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * VendorCard component.
11
+ *
12
+ * Vendor / seller / agent profile card — Avatar/logo + name + tagline +
13
+ * rating/review count + member-since + badges + actions row. Used in
14
+ * marketplaces, agent directories, multi-tenant catalogs. The host IS the
15
+ * Card's root `<div>` (`div[mol-vendor-card]` wearing `cm.card({ variant:
16
+ * 'elevated' })` + `cm.cardPadding('md')`), matching React's root exactly;
17
+ * `onClick` is a native `(click)` on the host, with no keyboard handler or
18
+ * role — put primary navigation in `actions` buttons for accessibility.
19
+ * `rating` renders a single ★ plus the number (`toFixed(1)`), not a
20
+ * five-star row; `reviewCount` renders only when `rating` is also set. When
21
+ * `name` is not a plain string the Avatar alt falls back to hardcoded
22
+ * 'Vendor'. Same props, same DOM as `@molecule/app-vendor-card-react`'s
23
+ * `VendorCard`. Node-valued `name`, `description`, `memberSince`, `badges`
24
+ * and `actions` content is projected (`[slot=<name>]`); a string or number
25
+ * input renders as text. The optional wrappers (`description`, `memberSince`,
26
+ * `actions`) render optimistically so a projection can land, then withdraw at
27
+ * view init when neither a text input nor a projection is present — React
28
+ * renders no wrapper at all for them.
29
+ */
30
+ export declare class VendorCard implements AfterViewInit {
31
+ /** Vendor / seller display name: text, or `[slot=name]` content. */
32
+ name?: unknown;
33
+ /** Optional logo URL — falls back to Avatar text initials. */
34
+ logoSrc?: string;
35
+ /** Tagline / one-liner: text, or `[slot=description]` content. */
36
+ description?: unknown;
37
+ /** 0-5 average rating. */
38
+ rating?: number;
39
+ /** Total review count. */
40
+ reviewCount?: number;
41
+ /** Member-since date display: text, or `[slot=memberSince]` content. */
42
+ memberSince?: unknown;
43
+ /** Optional badges row: text, or `[slot=badges]` content. */
44
+ badges?: unknown;
45
+ /** Right-side actions: text, or `[slot=actions]` content. */
46
+ actions?: unknown;
47
+ /** Extra classes. */
48
+ className?: string;
49
+ /** The optional description paragraph (projected content lands here). */
50
+ private descriptionEl?;
51
+ /** The optional member-since span (projected content lands here). */
52
+ private memberSinceEl?;
53
+ /** The optional actions row (projected content lands here). */
54
+ private actionsEl?;
55
+ /** The host element, scanned for projected `[slot=<name>]` content. */
56
+ private readonly elementRef;
57
+ /** Whether a `[slot=description]` projection landed (true until proven otherwise). */
58
+ private readonly descriptionProjected;
59
+ /** Whether a `[slot=memberSince]` projection landed (true until proven otherwise). */
60
+ private readonly memberSinceProjected;
61
+ /** Whether a `[slot=actions]` projection landed (true until proven otherwise). */
62
+ private readonly actionsProjected;
63
+ /**
64
+ * Withdraws the optimistic optional wrappers whose slot projections did not
65
+ * land: when neither a text input nor projected content is present, React
66
+ * renders no wrapper at all. View queries resolve at view init, and a
67
+ * projected slot's content is in place by then.
68
+ */
69
+ ngAfterViewInit(): void;
70
+ /**
71
+ * The current class map.
72
+ * @returns The UIClassMap.
73
+ */
74
+ cm(): UIClassMap;
75
+ /**
76
+ * Computes the Card root class list (Card's elevated variant and md
77
+ * padding defaults, plus the extra classes).
78
+ * @returns The class string.
79
+ */
80
+ classes(): string;
81
+ /**
82
+ * The avatar row's class.
83
+ * @returns The class string.
84
+ */
85
+ avatarRowClass(): string;
86
+ /**
87
+ * The body column's class.
88
+ * @returns The class string.
89
+ */
90
+ bodyClass(): string;
91
+ /**
92
+ * The name heading's class.
93
+ * @returns The class string.
94
+ */
95
+ headingClass(): string;
96
+ /**
97
+ * The description paragraph's class.
98
+ * @returns The class string.
99
+ */
100
+ descriptionClass(): string;
101
+ /**
102
+ * The rating / badges row's class.
103
+ * @returns The class string.
104
+ */
105
+ metaRowClass(): string;
106
+ /**
107
+ * The rating chip's class.
108
+ * @returns The class string.
109
+ */
110
+ ratingClass(): string;
111
+ /**
112
+ * The member-since text's class.
113
+ * @returns The class string.
114
+ */
115
+ memberSinceClass(): string;
116
+ /**
117
+ * The actions row's class.
118
+ * @returns The class string.
119
+ */
120
+ actionsClass(): string;
121
+ /**
122
+ * The Avatar's alt/name (React's `typeof name === 'string' ? name :
123
+ * 'Vendor'`).
124
+ * @returns The display name.
125
+ */
126
+ displayName(): string;
127
+ /**
128
+ * The formatted rating, one decimal place (React's `rating.toFixed(1)`).
129
+ * @returns The rating text.
130
+ */
131
+ ratingText(): string;
132
+ /**
133
+ * The review count in parentheses (React's `({reviewCount})`).
134
+ * @returns The review count text.
135
+ */
136
+ reviewText(): string;
137
+ /**
138
+ * Whether a text name input is present (a projected name is not).
139
+ * @returns True when the name renders as text.
140
+ */
141
+ get hasName(): boolean;
142
+ /**
143
+ * Whether the description renders as text: React's `description && …`
144
+ * truthiness.
145
+ * @returns True when the tagline text shows.
146
+ */
147
+ get hasDescription(): boolean;
148
+ /**
149
+ * Whether the description paragraph renders at all: the text input or
150
+ * projected `[slot=description]` content.
151
+ * @returns True when the tagline shows.
152
+ */
153
+ get showDescription(): boolean;
154
+ /**
155
+ * Whether a rating renders: React's `rating !== undefined` (a zero rating
156
+ * still renders).
157
+ * @returns True when the ★ chip shows.
158
+ */
159
+ get hasRating(): boolean;
160
+ /**
161
+ * Whether the review count renders: React's `reviewCount !== undefined`,
162
+ * only inside a rating.
163
+ * @returns True when the count shows.
164
+ */
165
+ get hasReviewCount(): boolean;
166
+ /**
167
+ * Whether the member-since text renders: React's `memberSince && …`
168
+ * truthiness.
169
+ * @returns True when the date text shows.
170
+ */
171
+ get hasMemberSince(): boolean;
172
+ /**
173
+ * Whether the member-since span renders at all: the text input or projected
174
+ * `[slot=memberSince]` content.
175
+ * @returns True when the date shows.
176
+ */
177
+ get showMemberSince(): boolean;
178
+ /**
179
+ * Whether the badges text renders: React's `badges && …` truthiness (the
180
+ * `[slot=badges]` projection renders regardless).
181
+ * @returns True when the badges text shows.
182
+ */
183
+ get hasBadges(): boolean;
184
+ /**
185
+ * Whether the actions text renders: React's `actions && …` truthiness.
186
+ * @returns True when the actions text shows.
187
+ */
188
+ get hasActions(): boolean;
189
+ /**
190
+ * Whether the actions row renders at all: the text input or projected
191
+ * `[slot=actions]` content.
192
+ * @returns True when the actions row shows.
193
+ */
194
+ get showActions(): boolean;
195
+ static ɵfac: i0.ɵɵFactoryDeclaration<VendorCard, never>;
196
+ static ɵcmp: i0.ɵɵComponentDeclaration<VendorCard, "div[mol-vendor-card]", never, { "name": { "alias": "name"; "required": false; }; "logoSrc": { "alias": "logoSrc"; "required": false; }; "description": { "alias": "description"; "required": false; }; "rating": { "alias": "rating"; "required": false; }; "reviewCount": { "alias": "reviewCount"; "required": false; }; "memberSince": { "alias": "memberSince"; "required": false; }; "badges": { "alias": "badges"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, ["[slot=name]", "[slot=description]", "[slot=memberSince]", "[slot=badges]", "[slot=actions]"], true, never>;
197
+ }
198
+ //# sourceMappingURL=vendor-card.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendor-card.component.d.ts","sourceRoot":"","sources":["../src/vendor-card.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAoD,MAAM,eAAe,CAAA;AAEpG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAsBlD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBA6Ba,UAAW,YAAW,aAAa;IAC9C,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kEAAkE;IAClE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,yEAAyE;IAC7C,OAAO,CAAC,aAAa,CAAC,CAAkC;IACpF,qEAAqE;IACzC,OAAO,CAA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