@molecule/app-author-bio-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/LICENSE +202 -0
- package/README.md +387 -2
- package/dist/author-bio-card.component.d.ts +173 -0
- package/dist/author-bio-card.component.d.ts.map +1 -0
- package/dist/author-bio-card.component.js +528 -0
- package/dist/author-bio-card.component.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +71 -4
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
2
|
+
import type { AuthorBioCardAuthor } from './types.js';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
declare const SOCIAL_KEYS: readonly ["twitter", "github", "linkedin", "mastodon", "website"];
|
|
5
|
+
/**
|
|
6
|
+
* One social platform key.
|
|
7
|
+
*/
|
|
8
|
+
type SocialKey = (typeof SOCIAL_KEYS)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a social value (URL or bare handle) into an `href`. URLs pass
|
|
11
|
+
* through unchanged; bare handles are routed to a sensible per-platform
|
|
12
|
+
* default. Mastodon handles of the form `@user@instance` become
|
|
13
|
+
* `https://instance/@user`.
|
|
14
|
+
*
|
|
15
|
+
* @param key - Which platform the value is for.
|
|
16
|
+
* @param value - The raw social value (URL or handle).
|
|
17
|
+
* @returns A fully-qualified URL safe to use as `<a href>`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveSocialHref(key: SocialKey, value: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Author bio card — avatar + name + bio + social links + optional follow
|
|
22
|
+
* button. Designed for blog/podcast/video-streaming article footers and
|
|
23
|
+
* other user-profile previews. Two layouts:
|
|
24
|
+
*
|
|
25
|
+
* - `compact` (default): single horizontal row, suitable for inline
|
|
26
|
+
* author bylines or sidebar "About the author" panels.
|
|
27
|
+
* - `full`: stacked layout with a larger avatar and a dedicated social row
|
|
28
|
+
* beneath the bio paragraph.
|
|
29
|
+
*
|
|
30
|
+
* The host IS the Card `div` (`div[mol-author-bio-card]`), matching React's
|
|
31
|
+
* root exactly — same classes, same `data-mol-id`. All user-facing strings
|
|
32
|
+
* (Follow / Following labels, social aria-labels) route through
|
|
33
|
+
* `useTranslation()` so apps can override text via the companion locale bond
|
|
34
|
+
* `@molecule/app-locales-author-bio-card`.
|
|
35
|
+
*
|
|
36
|
+
* This is the Angular counterpart of `@molecule/app-author-bio-card-react`.
|
|
37
|
+
*/
|
|
38
|
+
export declare class AuthorBioCard {
|
|
39
|
+
/** Author identity + bio + socials. */
|
|
40
|
+
author?: AuthorBioCardAuthor;
|
|
41
|
+
/** Layout preset: `compact` (default) or `full`. */
|
|
42
|
+
layout?: 'compact' | 'full';
|
|
43
|
+
/** Whether the viewer currently follows this author. */
|
|
44
|
+
following?: boolean;
|
|
45
|
+
/** Toggle handler for the follow button. Omit to hide the button entirely. */
|
|
46
|
+
onFollow?: (following: boolean) => void;
|
|
47
|
+
/** Extra classes on the outer card. */
|
|
48
|
+
className?: string;
|
|
49
|
+
/** `data-mol-id` for AI-agent selectors. Defaults to `author-bio-card`. */
|
|
50
|
+
dataMolId?: string;
|
|
51
|
+
/** The i18n handle (locale-reactive), read in an injection context. */
|
|
52
|
+
private readonly i18n;
|
|
53
|
+
/**
|
|
54
|
+
* The current class map.
|
|
55
|
+
* @returns The UIClassMap.
|
|
56
|
+
*/
|
|
57
|
+
cm(): UIClassMap;
|
|
58
|
+
/**
|
|
59
|
+
* The `data-mol-id` on the card (React's default parameter).
|
|
60
|
+
* @returns The card's `data-mol-id`.
|
|
61
|
+
*/
|
|
62
|
+
containerId(): string;
|
|
63
|
+
/**
|
|
64
|
+
* A child `data-mol-id` (React's `${dataMolId}-<suffix>`).
|
|
65
|
+
* @param suffix - The child selector suffix.
|
|
66
|
+
* @returns The child's `data-mol-id`.
|
|
67
|
+
*/
|
|
68
|
+
id(suffix: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* The card class list (React's `<Card>` with its default variant/padding).
|
|
71
|
+
* @returns The class string.
|
|
72
|
+
*/
|
|
73
|
+
classes(): string;
|
|
74
|
+
/**
|
|
75
|
+
* A fixed-width wrapper (React's `cm.shrink0`).
|
|
76
|
+
* @returns The class string.
|
|
77
|
+
*/
|
|
78
|
+
shrink0Classes(): string;
|
|
79
|
+
/**
|
|
80
|
+
* The compact row's class list (React's `cm.flex({ align: 'center', gap: 'md' })`).
|
|
81
|
+
* @returns The class string.
|
|
82
|
+
*/
|
|
83
|
+
rowCompactClasses(): string;
|
|
84
|
+
/**
|
|
85
|
+
* The full row's class list (React's `cm.flex({ align: 'start', gap: 'md' })`).
|
|
86
|
+
* @returns The class string.
|
|
87
|
+
*/
|
|
88
|
+
rowFullClasses(): string;
|
|
89
|
+
/**
|
|
90
|
+
* The compact body column (React's `cm.cn(cm.flex1, cm.stack(1))`).
|
|
91
|
+
* @returns The class string.
|
|
92
|
+
*/
|
|
93
|
+
bodyCompactClasses(): string;
|
|
94
|
+
/**
|
|
95
|
+
* The full body column (React's `cm.cn(cm.flex1, cm.stack(2))`).
|
|
96
|
+
* @returns The class string.
|
|
97
|
+
*/
|
|
98
|
+
bodyFullClasses(): string;
|
|
99
|
+
/**
|
|
100
|
+
* The name row (React's `cm.flex({ align: 'baseline', gap: 'sm', wrap: 'wrap' })`).
|
|
101
|
+
* @returns The class string.
|
|
102
|
+
*/
|
|
103
|
+
baselineClasses(): string;
|
|
104
|
+
/**
|
|
105
|
+
* The full social/follow row (React's between-aligned flex row).
|
|
106
|
+
* @returns The class string.
|
|
107
|
+
*/
|
|
108
|
+
betweenClasses(): string;
|
|
109
|
+
/**
|
|
110
|
+
* The social row (React's `cm.flex({ align: 'center', gap: 'sm', wrap: 'wrap' })`).
|
|
111
|
+
* @returns The class string.
|
|
112
|
+
*/
|
|
113
|
+
socialRowClasses(): string;
|
|
114
|
+
/**
|
|
115
|
+
* The social link (React's `cm.cn(cm.textSize('sm'), cm.fontWeight('medium'))`).
|
|
116
|
+
* @returns The class string.
|
|
117
|
+
*/
|
|
118
|
+
socialLinkClasses(): string;
|
|
119
|
+
/**
|
|
120
|
+
* The author name (React's `cm.cn(cm.fontWeight('semibold'), cm.textSize('base'))`).
|
|
121
|
+
* @returns The class string.
|
|
122
|
+
*/
|
|
123
|
+
nameClasses(): string;
|
|
124
|
+
/**
|
|
125
|
+
* The bio paragraph (React's `cm.textSize('sm')`).
|
|
126
|
+
* @returns The class string.
|
|
127
|
+
*/
|
|
128
|
+
bioClasses(): string;
|
|
129
|
+
/**
|
|
130
|
+
* The translated follow-button label.
|
|
131
|
+
* @returns `Following` or `Follow`.
|
|
132
|
+
*/
|
|
133
|
+
followLabel(): string;
|
|
134
|
+
/**
|
|
135
|
+
* The social platforms the author actually has, in display order.
|
|
136
|
+
* @returns `[key, value]` pairs for the social row.
|
|
137
|
+
*/
|
|
138
|
+
socialEntries(): Array<[SocialKey, string]>;
|
|
139
|
+
/**
|
|
140
|
+
* One social entry's `href`.
|
|
141
|
+
* @param entry - A `[key, value]` pair.
|
|
142
|
+
* @returns The resolved URL.
|
|
143
|
+
*/
|
|
144
|
+
hrefOf(entry: [SocialKey, string]): string;
|
|
145
|
+
/**
|
|
146
|
+
* One social link's `data-mol-id`.
|
|
147
|
+
* @param key - The social-network key.
|
|
148
|
+
* @returns The link's `data-mol-id`.
|
|
149
|
+
*/
|
|
150
|
+
socialId(key: SocialKey): string;
|
|
151
|
+
/**
|
|
152
|
+
* The translated accessible label of a social link. Every platform is a
|
|
153
|
+
* literal key (the locale bond owns `authorBioCard.social.<platform>`).
|
|
154
|
+
* @param key - The social-network key.
|
|
155
|
+
* @returns The link's `aria-label`.
|
|
156
|
+
*/
|
|
157
|
+
socialAriaLabel(key: SocialKey): string;
|
|
158
|
+
/**
|
|
159
|
+
* The translated visible label of a social link. Every platform is a
|
|
160
|
+
* literal key (the locale bond owns `authorBioCard.social.<platform>.label`).
|
|
161
|
+
* @param key - The social-network key.
|
|
162
|
+
* @returns The link's text.
|
|
163
|
+
*/
|
|
164
|
+
socialText(key: SocialKey): string;
|
|
165
|
+
/**
|
|
166
|
+
* Reports the toggled follow state through the caller's handler.
|
|
167
|
+
*/
|
|
168
|
+
toggleFollow(): void;
|
|
169
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthorBioCard, never>;
|
|
170
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AuthorBioCard, "div[mol-author-bio-card]", never, { "author": { "alias": "author"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "following": { "alias": "following"; "required": false; }; "onFollow": { "alias": "onFollow"; "required": false; }; "className": { "alias": "className"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; }, {}, never, never, true, never>;
|
|
171
|
+
}
|
|
172
|
+
export {};
|
|
173
|
+
//# sourceMappingURL=author-bio-card.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"author-bio-card.component.d.ts","sourceRoot":"","sources":["../src/author-bio-card.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,YAAY,CAAA;;AAEpE,QAAA,MAAM,WAAW,mEAAoE,CAAA;AAErF;;GAEG;AACH,KAAK,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAcvE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAkCa,aAAa;IACxB,uCAAuC;IACvC,MAAM,CAAC,EAAE,mB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