@sproutsocial/seeds-react-profile 0.1.3 → 0.2.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +44 -0
- package/dist/esm/index.js +289 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +81 -15
- package/dist/index.d.ts +81 -15
- package/dist/index.js +284 -27
- package/dist/index.js.map +1 -1
- package/package.json +11 -8
- package/src/InlineProfile.stories.tsx +74 -15
- package/src/InlineProfile.tsx +107 -30
- package/src/ProfileCard.stories.tsx +264 -0
- package/src/ProfileCard.tsx +186 -0
- package/src/ProfileToken.stories.tsx +90 -32
- package/src/ProfileToken.tsx +19 -7
- package/src/VerifiedProfileIcon.tsx +64 -0
- package/src/__tests__/InlineProfile.test.tsx +19 -20
- package/src/__tests__/ProfileCard.test.tsx +182 -0
- package/src/__tests__/ProfileToken.test.tsx +2 -1
- package/src/index.ts +1 -0
- package/src/types.ts +95 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,14 +8,14 @@ $ tsup --dts
|
|
|
8
8
|
[34mCLI[39m Cleaning output folder
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
12
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
-
[32mESM[39m [1mdist/esm/index.js [22m[
|
|
15
|
-
[32mESM[39m [1mdist/esm/index.js.map [22m[
|
|
16
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m13.21 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m18.11 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 117ms
|
|
14
|
+
[32mESM[39m [1mdist/esm/index.js [22m[32m9.61 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/esm/index.js.map [22m[32m17.97 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 115ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
21
|
-
Done in
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 8909ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.53 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.53 KB[39m
|
|
21
|
+
Done in 11.50s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-profile
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9ab0098: Add ProfileCard and ProfileToken components to seeds-react-profile package. Update InlineProfile component.
|
|
8
|
+
|
|
9
|
+
## New Components
|
|
10
|
+
|
|
11
|
+
### ProfileCard
|
|
12
|
+
|
|
13
|
+
A flexible card component for displaying user profiles across different social networks with consistent styling and behavior.
|
|
14
|
+
|
|
15
|
+
**Features:**
|
|
16
|
+
|
|
17
|
+
- Display profile information (name, handle, subtext, description)
|
|
18
|
+
- Social network branding with partner logos
|
|
19
|
+
- Verification badges (blue, gray, standard) displayed with handle
|
|
20
|
+
- Profile URL links (only displayed when secondaryName is provided)
|
|
21
|
+
- Location display with icon
|
|
22
|
+
- Metadata array for stats (followers, posts, etc.)
|
|
23
|
+
- Banner with customizable color (defaults to network theme color)
|
|
24
|
+
- Banner content slot for alerts/status messages
|
|
25
|
+
- Profile actions slot for buttons/menus
|
|
26
|
+
- Footer slot for custom content
|
|
27
|
+
- Fully themed and responsive
|
|
28
|
+
|
|
29
|
+
### ProfileToken
|
|
30
|
+
|
|
31
|
+
A token-based profile component that wraps InlineProfile with interactive capabilities, ideal for clickable profile elements in lists and compact spaces.
|
|
32
|
+
|
|
33
|
+
## Updates
|
|
34
|
+
|
|
35
|
+
### InlineProfile
|
|
36
|
+
|
|
37
|
+
- Simplified internal implementation
|
|
38
|
+
- Removed unnecessary utility abstractions
|
|
39
|
+
- Improved type definitions
|
|
40
|
+
- Consolidated verification type handling
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [95d2b96]
|
|
45
|
+
- @sproutsocial/seeds-react-card@1.1.14
|
|
46
|
+
|
|
3
47
|
## 0.1.3
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -1,57 +1,318 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/ProfileCard.tsx
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
-
import { Text } from "@sproutsocial/seeds-react-text";
|
|
4
3
|
import { PartnerLogo } from "@sproutsocial/seeds-react-partner-logo";
|
|
5
4
|
import { Avatar } from "@sproutsocial/seeds-react-avatar";
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardContent,
|
|
9
|
+
CardFooter
|
|
10
|
+
} from "@sproutsocial/seeds-react-card";
|
|
11
|
+
import { Icon as Icon2 } from "@sproutsocial/seeds-react-icon";
|
|
12
|
+
import { Link } from "@sproutsocial/seeds-react-link";
|
|
13
|
+
import { Text } from "@sproutsocial/seeds-react-text";
|
|
14
|
+
|
|
15
|
+
// src/VerifiedProfileIcon.tsx
|
|
16
|
+
import { Icon } from "@sproutsocial/seeds-react-icon";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
var VERIFICATION_COLORS = {
|
|
19
|
+
twitter: "#000000",
|
|
20
|
+
facebook: "#1877F2",
|
|
21
|
+
x: "#000000",
|
|
22
|
+
linkedin: "#0A66C2",
|
|
23
|
+
instagram: "#e4405f",
|
|
24
|
+
gray: "#515e5f"
|
|
25
|
+
};
|
|
26
|
+
var getVerificationColor = (partnerName, verificationType) => {
|
|
27
|
+
if (!verificationType || verificationType === "not_verified") return "";
|
|
28
|
+
switch (verificationType) {
|
|
29
|
+
case "blue_verified":
|
|
30
|
+
return partnerName === "facebook" ? VERIFICATION_COLORS.facebook : VERIFICATION_COLORS.twitter;
|
|
31
|
+
case "gray_verified":
|
|
32
|
+
return VERIFICATION_COLORS.gray;
|
|
33
|
+
case "verified":
|
|
34
|
+
default:
|
|
35
|
+
if (partnerName && partnerName in VERIFICATION_COLORS) {
|
|
36
|
+
return VERIFICATION_COLORS[partnerName];
|
|
37
|
+
}
|
|
38
|
+
return VERIFICATION_COLORS.twitter;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var VerifiedProfileIcon = ({
|
|
42
|
+
partnerName,
|
|
43
|
+
verificationType
|
|
44
|
+
}) => {
|
|
45
|
+
if (!verificationType || verificationType === "not_verified") return;
|
|
46
|
+
const verificationColor = getVerificationColor(partnerName, verificationType);
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
Icon,
|
|
49
|
+
{
|
|
50
|
+
title: "Verified",
|
|
51
|
+
"aria-label": "Verified account",
|
|
52
|
+
color: verificationColor,
|
|
53
|
+
name: "verified",
|
|
54
|
+
ml: "150"
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/ProfileCard.tsx
|
|
60
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
61
|
+
var StyledProfileCard = styled(Card)`
|
|
62
|
+
max-width: 300px;
|
|
63
|
+
`;
|
|
64
|
+
var StyledCardHeader = styled(CardHeader)`
|
|
65
|
+
position: relative;
|
|
66
|
+
height: 80px;
|
|
67
|
+
padding: ${(props) => props.theme.space[400]}
|
|
68
|
+
${(props) => props.theme.space[400]} 0 ${(props) => props.theme.space[400]};
|
|
69
|
+
margin-bottom: 0;
|
|
70
|
+
color: ${(props) => props.theme.colors.text.inverse};
|
|
71
|
+
border-radius: ${(props) => props.theme.radii[500]}
|
|
72
|
+
${(props) => props.theme.radii[500]} 0 0;
|
|
73
|
+
${(props) => {
|
|
74
|
+
if (props.$bannerColor) {
|
|
75
|
+
return `background: ${props.$bannerColor};`;
|
|
76
|
+
}
|
|
77
|
+
if (props.$partnerName && props.theme.colors.network) {
|
|
78
|
+
const networkColor = props.theme.colors.network[props.$partnerName];
|
|
79
|
+
return networkColor ? `background: ${networkColor};` : "";
|
|
80
|
+
}
|
|
81
|
+
return "";
|
|
82
|
+
}}
|
|
83
|
+
`;
|
|
84
|
+
var BannerContent = styled.div`
|
|
8
85
|
display: flex;
|
|
86
|
+
justify-content: flex-end;
|
|
87
|
+
width: 100%;
|
|
88
|
+
`;
|
|
89
|
+
var ActionsSection = styled.div`
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
gap: ${(props) => props.theme.space[100]};
|
|
93
|
+
padding: 0 ${(props) => props.theme.space[300]};
|
|
94
|
+
|
|
95
|
+
&:empty {
|
|
96
|
+
min-height: 44px;
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
var StyledCardContent = styled(CardContent)`
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
gap: ${(props) => props.theme.space[300]};
|
|
103
|
+
padding: 0 ${(props) => props.theme.space[400]}
|
|
104
|
+
${(props) => props.theme.space[400]};
|
|
105
|
+
`;
|
|
106
|
+
var ProfileNameSection = styled.div`
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
gap: ${(props) => props.theme.space[200]};
|
|
110
|
+
`;
|
|
111
|
+
var InfoRow = styled.div`
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: ${(props) => props.theme.space[300]};
|
|
115
|
+
`;
|
|
116
|
+
var ProfileCard = ({
|
|
117
|
+
partnerName,
|
|
118
|
+
name,
|
|
119
|
+
secondaryName,
|
|
120
|
+
avatarUrl,
|
|
121
|
+
subtext,
|
|
122
|
+
description,
|
|
123
|
+
verificationType,
|
|
124
|
+
profileUrl,
|
|
125
|
+
location,
|
|
126
|
+
bannerColor,
|
|
127
|
+
bannerContent,
|
|
128
|
+
metadata,
|
|
129
|
+
profileActions,
|
|
130
|
+
footer,
|
|
131
|
+
cardProps
|
|
132
|
+
}) => {
|
|
133
|
+
return /* @__PURE__ */ jsxs(StyledProfileCard, { role: "presentation", ...cardProps, children: [
|
|
134
|
+
/* @__PURE__ */ jsxs(StyledCardHeader, { $bannerColor: bannerColor, $partnerName: partnerName, children: [
|
|
135
|
+
/* @__PURE__ */ jsx2(Avatar, { src: avatarUrl, name, size: "60px", mt: 450 }),
|
|
136
|
+
bannerContent && /* @__PURE__ */ jsx2(BannerContent, { children: bannerContent })
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ jsx2(ActionsSection, { children: profileActions }),
|
|
139
|
+
/* @__PURE__ */ jsxs(StyledCardContent, { children: [
|
|
140
|
+
/* @__PURE__ */ jsxs(ProfileNameSection, { children: [
|
|
141
|
+
partnerName && /* @__PURE__ */ jsx2(
|
|
142
|
+
PartnerLogo,
|
|
143
|
+
{
|
|
144
|
+
partnerName,
|
|
145
|
+
"aria-label": `${partnerName} profile`,
|
|
146
|
+
size: "small"
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsx2(Text.SubHeadline, { as: "h2", children: name })
|
|
150
|
+
] }),
|
|
151
|
+
subtext && /* @__PURE__ */ jsx2(Text, { fontSize: 200, color: "text.subtext", children: subtext }),
|
|
152
|
+
secondaryName && /* @__PURE__ */ jsxs(InfoRow, { children: [
|
|
153
|
+
profileUrl ? /* @__PURE__ */ jsxs(Link, { href: profileUrl, external: true, children: [
|
|
154
|
+
/* @__PURE__ */ jsx2(Text, { fontSize: 200, children: secondaryName }),
|
|
155
|
+
/* @__PURE__ */ jsx2(
|
|
156
|
+
Icon2,
|
|
157
|
+
{
|
|
158
|
+
name: "arrow-right-up-outline",
|
|
159
|
+
"aria-hidden": true,
|
|
160
|
+
ml: 100,
|
|
161
|
+
size: "small"
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
] }) : /* @__PURE__ */ jsx2(Text.SmallByline, { color: "text.subtext", children: secondaryName }),
|
|
165
|
+
verificationType && /* @__PURE__ */ jsx2(
|
|
166
|
+
VerifiedProfileIcon,
|
|
167
|
+
{
|
|
168
|
+
partnerName,
|
|
169
|
+
verificationType
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] }),
|
|
173
|
+
description && /* @__PURE__ */ jsx2(Text, { fontSize: 200, children: description }),
|
|
174
|
+
location && /* @__PURE__ */ jsxs(InfoRow, { children: [
|
|
175
|
+
/* @__PURE__ */ jsx2(Icon2, { name: "location-pin-outline", "aria-hidden": true, size: "small" }),
|
|
176
|
+
/* @__PURE__ */ jsx2(Text, { fontSize: 200, children: location })
|
|
177
|
+
] }),
|
|
178
|
+
metadata && metadata.length > 0 && /* @__PURE__ */ jsx2(InfoRow, { children: metadata.map((info, index) => /* @__PURE__ */ jsx2(Text, { fontSize: 200, children: info }, index)) })
|
|
179
|
+
] }),
|
|
180
|
+
footer && /* @__PURE__ */ jsx2(CardFooter, { children: footer })
|
|
181
|
+
] });
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// src/InlineProfile.tsx
|
|
185
|
+
import styled2 from "styled-components";
|
|
186
|
+
import { PartnerLogo as PartnerLogo2 } from "@sproutsocial/seeds-react-partner-logo";
|
|
187
|
+
import { Avatar as Avatar2 } from "@sproutsocial/seeds-react-avatar";
|
|
188
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
189
|
+
var InlineProfileContainer = styled2.span`
|
|
190
|
+
display: inline-flex;
|
|
9
191
|
flex-direction: row;
|
|
10
192
|
align-items: center;
|
|
193
|
+
gap: ${(props) => props.theme.space[200]};
|
|
11
194
|
max-width: 100%;
|
|
195
|
+
${(props) => props.theme.typography[200]}
|
|
196
|
+
color: ${(props) => props.theme.colors.text.subtext};
|
|
197
|
+
text-align: inherit;
|
|
12
198
|
`;
|
|
13
|
-
var
|
|
14
|
-
display: flex;
|
|
199
|
+
var InlineProfileAvatar = styled2.span`
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
flex-shrink: 0;
|
|
202
|
+
`;
|
|
203
|
+
var InlineProfileContent = styled2.span`
|
|
204
|
+
display: inline-flex;
|
|
15
205
|
align-items: center;
|
|
16
|
-
|
|
206
|
+
gap: ${(props) => props.theme.space[200]};
|
|
207
|
+
min-width: 0;
|
|
208
|
+
flex: 1;
|
|
17
209
|
`;
|
|
210
|
+
var InlineProfileNetwork = styled2.span`
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
flex-shrink: 0;
|
|
214
|
+
`;
|
|
215
|
+
var InlineProfileText = styled2.span`
|
|
216
|
+
display: inline-flex;
|
|
217
|
+
flex-direction: row;
|
|
218
|
+
align-items: center;
|
|
219
|
+
gap: ${(props) => props.theme.space[200]};
|
|
220
|
+
min-width: 0;
|
|
221
|
+
flex: 1;
|
|
222
|
+
`;
|
|
223
|
+
var InlineProfileName = styled2.span`
|
|
224
|
+
display: inline-block;
|
|
225
|
+
${(props) => props.theme.typography[200]}
|
|
226
|
+
font-family: ${(props) => props.theme.fontFamily};
|
|
227
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
228
|
+
text-transform: lowercase;
|
|
229
|
+
color: ${(props) => props.theme.colors.text.body};
|
|
230
|
+
max-width: 100%;
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
text-overflow: ellipsis;
|
|
233
|
+
white-space: nowrap;
|
|
234
|
+
`;
|
|
235
|
+
var InlineProfileHandle = styled2.span`
|
|
236
|
+
display: inline-block;
|
|
237
|
+
${(props) => props.theme.typography[200]}
|
|
238
|
+
font-family: ${(props) => props.theme.fontFamily};
|
|
239
|
+
color: ${(props) => props.theme.colors.text.subtext};
|
|
240
|
+
max-width: 100%;
|
|
241
|
+
overflow: hidden;
|
|
242
|
+
text-overflow: ellipsis;
|
|
243
|
+
white-space: nowrap;
|
|
244
|
+
`;
|
|
245
|
+
var avatarSizeMap = {
|
|
246
|
+
small: "16px",
|
|
247
|
+
medium: "20px",
|
|
248
|
+
large: "24px"
|
|
249
|
+
};
|
|
18
250
|
var InlineProfile = ({
|
|
19
251
|
name,
|
|
20
252
|
secondaryName,
|
|
21
253
|
partnerName,
|
|
22
254
|
partnerLogoLabel,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
255
|
+
size = "medium",
|
|
256
|
+
avatarSize: avatarSizeOverride,
|
|
257
|
+
avatarUrl,
|
|
258
|
+
verificationType,
|
|
259
|
+
className
|
|
26
260
|
}) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
261
|
+
const displayName = name || secondaryName || "Unknown Profile";
|
|
262
|
+
const avatarSize = avatarSizeOverride || avatarSizeMap[size];
|
|
263
|
+
return /* @__PURE__ */ jsxs2(InlineProfileContainer, { className, $size: size, children: [
|
|
264
|
+
/* @__PURE__ */ jsx3(InlineProfileAvatar, { children: /* @__PURE__ */ jsx3(Avatar2, { src: avatarUrl, name: displayName, size: avatarSize }) }),
|
|
265
|
+
/* @__PURE__ */ jsxs2(InlineProfileContent, { children: [
|
|
266
|
+
partnerName && /* @__PURE__ */ jsx3(InlineProfileNetwork, { children: /* @__PURE__ */ jsx3(
|
|
267
|
+
PartnerLogo2,
|
|
268
|
+
{
|
|
269
|
+
partnerName,
|
|
270
|
+
"aria-label": partnerLogoLabel || `${partnerName} profile`,
|
|
271
|
+
size: "small"
|
|
272
|
+
}
|
|
273
|
+
) }),
|
|
274
|
+
/* @__PURE__ */ jsxs2(InlineProfileText, { children: [
|
|
275
|
+
name && /* @__PURE__ */ jsx3(InlineProfileName, { children: name }),
|
|
276
|
+
secondaryName && /* @__PURE__ */ jsx3(InlineProfileHandle, { children: secondaryName })
|
|
277
|
+
] }),
|
|
278
|
+
verificationType && /* @__PURE__ */ jsx3(
|
|
279
|
+
VerifiedProfileIcon,
|
|
280
|
+
{
|
|
281
|
+
partnerName,
|
|
282
|
+
verificationType
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
] })
|
|
41
286
|
] });
|
|
42
287
|
};
|
|
43
288
|
|
|
44
289
|
// src/ProfileToken.tsx
|
|
45
|
-
import "
|
|
290
|
+
import styled3 from "styled-components";
|
|
46
291
|
import { Token } from "@sproutsocial/seeds-react-token";
|
|
47
|
-
import { jsx as
|
|
292
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
293
|
+
var StyledProfileToken = styled3(Token)`
|
|
294
|
+
box-sizing: border-box;
|
|
295
|
+
display: inline-flex;
|
|
296
|
+
max-width: 100%;
|
|
297
|
+
`;
|
|
48
298
|
var ProfileToken = ({
|
|
49
|
-
tokenProps,
|
|
50
299
|
className,
|
|
300
|
+
onClick,
|
|
301
|
+
tokenProps,
|
|
51
302
|
...props
|
|
52
|
-
}) => /* @__PURE__ */
|
|
303
|
+
}) => /* @__PURE__ */ jsx4(
|
|
304
|
+
StyledProfileToken,
|
|
305
|
+
{
|
|
306
|
+
className,
|
|
307
|
+
closeable: false,
|
|
308
|
+
onClick,
|
|
309
|
+
...tokenProps,
|
|
310
|
+
children: /* @__PURE__ */ jsx4(InlineProfile, { size: "small", ...props })
|
|
311
|
+
}
|
|
312
|
+
);
|
|
53
313
|
export {
|
|
54
314
|
InlineProfile,
|
|
315
|
+
ProfileCard,
|
|
55
316
|
ProfileToken
|
|
56
317
|
};
|
|
57
318
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InlineProfile.tsx","../../src/ProfileToken.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { PartnerLogo } from \"@sproutsocial/seeds-react-partner-logo\";\nimport { Avatar } from \"@sproutsocial/seeds-react-avatar\";\nimport type { TypeInlineProfileProps } from \"./types\";\n\nconst InlineProfileContainer = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n max-width: 100%;\n`;\n\nconst InlineProfileBody = styled.span`\n display: flex;\n align-items: center;\n margin-left: 8px;\n`;\n\n/**\n *\n * @param props - Profile props\n * @param props.name - Name of the profile\n * @param props.secondaryName - Secondary name of the profile\n * @param props.partnerName - Partner logo name\n * @param props.partnerLogoLabel - Aria-label for the partner logo\n * @param props.avatarSize - Size of the avatar\n * @param props.img - Image URL for the avatar\n * @param props.children - Additional elements to render within the profile component\n * @returns JSX.Element representing a user profile\n *\n * @example\n * <InlineProfile\n * name=\"John Doe\"\n * secondaryName=\"johndoe123\"\n * partnerName=\"facebook\"\n * partnerLogoLabel=\"Facebook Logo\"\n * avatarSize=\"24px\"\n * img=\"https://example.com/avatar.jpg\"\n * >\n * <Badge text=\"Moderator\" badgeColor=\"green\" />\n * </InlineProfile>\n */\nexport const InlineProfile = ({\n name,\n secondaryName,\n partnerName,\n partnerLogoLabel,\n avatarSize = \"22px\",\n img,\n children,\n}: TypeInlineProfileProps) => {\n return (\n <InlineProfileContainer>\n <Avatar size={avatarSize} src={img} name={name} />\n {partnerName && (\n <PartnerLogo\n size=\"small\"\n partnerName={partnerName}\n ml={300}\n aria-label={partnerLogoLabel}\n />\n )}\n <Text fontSize={200} fontWeight=\"semibold\" ml={300} truncated={true}>\n {name}\n </Text>\n {secondaryName && (\n <Text fontSize={200} ml={300} fontWeight=\"normal\" truncated={true}>\n {secondaryName}\n </Text>\n )}\n <InlineProfileBody>{children}</InlineProfileBody>\n </InlineProfileContainer>\n );\n};\n","import React from \"react\";\nimport { Token } from \"@sproutsocial/seeds-react-token\";\nimport { InlineProfile } from \"./InlineProfile\";\nimport type { ProfileTokenProps } from \"./types\";\n\n/**\n * A ProfileToken component that wraps CompactProfile in a Seeds Token component.\n * This token is not closable and provides a compact way to display profile information inline.\n */\nexport const ProfileToken: React.FC<ProfileTokenProps> = ({\n tokenProps,\n className,\n ...props\n}) => (\n <Token className={className} closeable={false} {...tokenProps}>\n <InlineProfile {...props} />\n </Token>\n);\n\nexport default ProfileToken;\n"],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AAkDnB,SACE,KADF;AA/CJ,IAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtC,IAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AA8B1B,IAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AACF,MAA8B;AAC5B,SACE,qBAAC,0BACC;AAAA,wBAAC,UAAO,MAAM,YAAY,KAAK,KAAK,MAAY;AAAA,IAC/C,eACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACA,IAAI;AAAA,QACJ,cAAY;AAAA;AAAA,IACd;AAAA,IAEF,oBAAC,QAAK,UAAU,KAAK,YAAW,YAAW,IAAI,KAAK,WAAW,MAC5D,gBACH;AAAA,IACC,iBACC,oBAAC,QAAK,UAAU,KAAK,IAAI,KAAK,YAAW,UAAS,WAAW,MAC1D,yBACH;AAAA,IAEF,oBAAC,qBAAmB,UAAS;AAAA,KAC/B;AAEJ;;;AC1EA,OAAkB;AAClB,SAAS,aAAa;AAclB,gBAAAA,YAAA;AANG,IAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,gBAAAA,KAAC,SAAM,WAAsB,WAAW,OAAQ,GAAG,YACjD,0BAAAA,KAAC,iBAAe,GAAG,OAAO,GAC5B;","names":["jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/ProfileCard.tsx","../../src/VerifiedProfileIcon.tsx","../../src/InlineProfile.tsx","../../src/ProfileToken.tsx"],"sourcesContent":["import styled from \"styled-components\";\nimport { PartnerLogo } from \"@sproutsocial/seeds-react-partner-logo\";\nimport { Avatar } from \"@sproutsocial/seeds-react-avatar\";\nimport {\n Card,\n CardHeader,\n CardContent,\n CardFooter,\n} from \"@sproutsocial/seeds-react-card\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\nimport { Link } from \"@sproutsocial/seeds-react-link\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport type { TypeProfileCardProps } from \"./types\";\nimport { VerifiedProfileIcon } from \"./VerifiedProfileIcon\";\n\n// Styled Components\nconst StyledProfileCard = styled(Card)`\n max-width: 300px;\n`;\n\nconst StyledCardHeader = styled(CardHeader)<{\n $bannerColor?: string;\n $partnerName?: string;\n}>`\n position: relative;\n height: 80px;\n padding: ${(props) => props.theme.space[400]}\n ${(props) => props.theme.space[400]} 0 ${(props) => props.theme.space[400]};\n margin-bottom: 0;\n color: ${(props) => props.theme.colors.text.inverse};\n border-radius: ${(props) => props.theme.radii[500]}\n ${(props) => props.theme.radii[500]} 0 0;\n ${(props) => {\n // Use explicit bannerColor if provided\n if (props.$bannerColor) {\n return `background: ${props.$bannerColor};`;\n }\n // Fall back to theme.colors.network[partnerName] if partnerName is available\n if (props.$partnerName && props.theme.colors.network) {\n const networkColor =\n props.theme.colors.network[\n props.$partnerName as keyof typeof props.theme.colors.network\n ];\n return networkColor ? `background: ${networkColor};` : \"\";\n }\n return \"\";\n }}\n`;\n\nconst BannerContent = styled.div`\n display: flex;\n justify-content: flex-end;\n width: 100%;\n`;\n\nconst ActionsSection = styled.div`\n display: flex;\n justify-content: flex-end;\n gap: ${(props) => props.theme.space[100]};\n padding: 0 ${(props) => props.theme.space[300]};\n\n &:empty {\n min-height: 44px;\n }\n`;\n\nconst StyledCardContent = styled(CardContent)`\n display: flex;\n flex-direction: column;\n gap: ${(props) => props.theme.space[300]};\n padding: 0 ${(props) => props.theme.space[400]}\n ${(props) => props.theme.space[400]};\n`;\n\nconst ProfileNameSection = styled.div`\n display: flex;\n align-items: center;\n gap: ${(props) => props.theme.space[200]};\n`;\n\nconst InfoRow = styled.div`\n display: flex;\n align-items: center;\n gap: ${(props) => props.theme.space[300]};\n`;\n\n/**\n * A flexible profile component that can display user profiles in various formats\n * across different social networks with consistent styling and behavior.\n */\nexport const ProfileCard = ({\n partnerName,\n name,\n secondaryName,\n avatarUrl,\n subtext,\n description,\n verificationType,\n profileUrl,\n location,\n bannerColor,\n bannerContent,\n metadata,\n profileActions,\n footer,\n cardProps,\n}: TypeProfileCardProps) => {\n return (\n <StyledProfileCard role=\"presentation\" {...cardProps}>\n <StyledCardHeader $bannerColor={bannerColor} $partnerName={partnerName}>\n <Avatar src={avatarUrl} name={name} size=\"60px\" mt={450} />\n {bannerContent && <BannerContent>{bannerContent}</BannerContent>}\n </StyledCardHeader>\n\n <ActionsSection>{profileActions}</ActionsSection>\n\n <StyledCardContent>\n <ProfileNameSection>\n {partnerName && (\n <PartnerLogo\n partnerName={partnerName}\n aria-label={`${partnerName} profile`}\n size=\"small\"\n />\n )}\n <Text.SubHeadline as=\"h2\">{name}</Text.SubHeadline>\n </ProfileNameSection>\n\n {subtext && (\n <Text fontSize={200} color=\"text.subtext\">\n {subtext}\n </Text>\n )}\n\n {secondaryName && (\n <InfoRow>\n {profileUrl ? (\n <Link href={profileUrl} external>\n <Text fontSize={200}>{secondaryName}</Text>\n <Icon\n name=\"arrow-right-up-outline\"\n aria-hidden\n ml={100}\n size=\"small\"\n />\n </Link>\n ) : (\n <Text.SmallByline color=\"text.subtext\">\n {secondaryName}\n </Text.SmallByline>\n )}\n {verificationType && (\n <VerifiedProfileIcon\n partnerName={partnerName}\n verificationType={verificationType}\n />\n )}\n </InfoRow>\n )}\n\n {description && <Text fontSize={200}>{description}</Text>}\n\n {location && (\n <InfoRow>\n <Icon name=\"location-pin-outline\" aria-hidden size=\"small\" />\n <Text fontSize={200}>{location}</Text>\n </InfoRow>\n )}\n\n {metadata && metadata.length > 0 && (\n <InfoRow>\n {metadata.map((info, index) => (\n <Text fontSize={200} key={index}>\n {info}\n </Text>\n ))}\n </InfoRow>\n )}\n </StyledCardContent>\n\n {footer && <CardFooter>{footer}</CardFooter>}\n </StyledProfileCard>\n );\n};\n\nexport default ProfileCard;\n","import { Icon } from \"@sproutsocial/seeds-react-icon\";\nimport type { TypeProfileNetwork, TypeProfileVerification } from \"./types\";\n\n// TODO: Move these to a more appropriate location\nconst VERIFICATION_COLORS = {\n twitter: \"#000000\",\n facebook: \"#1877F2\",\n x: \"#000000\",\n linkedin: \"#0A66C2\",\n instagram: \"#e4405f\",\n gray: \"#515e5f\",\n} as const;\n\n/**\n * Gets the verification color based on partnerName and verification type\n */\nexport const getVerificationColor = (\n partnerName?: TypeProfileNetwork,\n verificationType?: TypeProfileVerification\n): string => {\n if (!verificationType || verificationType === \"not_verified\") return \"\";\n\n switch (verificationType) {\n case \"blue_verified\":\n // Use partner-specific blue color\n return partnerName === \"facebook\"\n ? VERIFICATION_COLORS.facebook\n : VERIFICATION_COLORS.twitter;\n case \"gray_verified\":\n return VERIFICATION_COLORS.gray;\n case \"verified\":\n default:\n // Default to partner color or Twitter blue\n if (partnerName && partnerName in VERIFICATION_COLORS) {\n return VERIFICATION_COLORS[\n partnerName as keyof typeof VERIFICATION_COLORS\n ];\n }\n return VERIFICATION_COLORS.twitter;\n }\n};\n\nexport interface TypeVerifiedProfileIconProps {\n partnerName?: TypeProfileNetwork;\n verificationType: TypeProfileVerification;\n}\n\nexport const VerifiedProfileIcon = ({\n partnerName,\n verificationType,\n}: TypeVerifiedProfileIconProps) => {\n if (!verificationType || verificationType === \"not_verified\") return;\n\n const verificationColor = getVerificationColor(partnerName, verificationType);\n return (\n <Icon\n title=\"Verified\"\n aria-label=\"Verified account\"\n color={verificationColor}\n name=\"verified\"\n ml=\"150\"\n />\n );\n};\n","import styled from \"styled-components\";\nimport { PartnerLogo } from \"@sproutsocial/seeds-react-partner-logo\";\nimport { Avatar } from \"@sproutsocial/seeds-react-avatar\";\nimport type { TypeInlineProfileProps } from \"./types\";\nimport { VerifiedProfileIcon } from \"./VerifiedProfileIcon\";\n\nconst InlineProfileContainer = styled.span<{\n $size?: \"small\" | \"medium\" | \"large\";\n}>`\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n gap: ${(props) => props.theme.space[200]};\n max-width: 100%;\n ${(props) => props.theme.typography[200]}\n color: ${(props) => props.theme.colors.text.subtext};\n text-align: inherit;\n`;\n\nconst InlineProfileAvatar = styled.span`\n display: inline-flex;\n flex-shrink: 0;\n`;\n\nconst InlineProfileContent = styled.span`\n display: inline-flex;\n align-items: center;\n gap: ${(props) => props.theme.space[200]};\n min-width: 0;\n flex: 1;\n`;\n\nconst InlineProfileNetwork = styled.span`\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n`;\n\nconst InlineProfileText = styled.span`\n display: inline-flex;\n flex-direction: row;\n align-items: center;\n gap: ${(props) => props.theme.space[200]};\n min-width: 0;\n flex: 1;\n`;\n\nconst InlineProfileName = styled.span`\n display: inline-block;\n ${(props) => props.theme.typography[200]}\n font-family: ${(props) => props.theme.fontFamily};\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n text-transform: lowercase;\n color: ${(props) => props.theme.colors.text.body};\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst InlineProfileHandle = styled.span`\n display: inline-block;\n ${(props) => props.theme.typography[200]}\n font-family: ${(props) => props.theme.fontFamily};\n color: ${(props) => props.theme.colors.text.subtext};\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst avatarSizeMap = {\n small: \"16px\",\n medium: \"20px\",\n large: \"24px\",\n} as const;\n\n/**\n * A compact inline profile component that displays avatar, name/handle, and verification.\n * Perfect for use in post headers, comments, or other compact spaces.\n *\n * @param props - Profile props\n * @param props.name - Name of the profile\n * @param props.secondaryName - Secondary name of the profile\n * @param props.partnerName - Partner logo name\n * @param props.partnerLogoLabel - Aria-label for the partner logo\n * @param props.avatarSize - Size of the avatar\n * @param props.avatarUrl - Image URL for the avatar\n * @param props.children - Additional elements to render within the profile component\n * @returns JSX.Element representing a user profile\n *\n * @example\n * <InlineProfile\n * name=\"John Doe\"\n * secondaryName=\"johndoe123\"\n * partnerName=\"facebook\"\n * partnerLogoLabel=\"Facebook Logo\"\n * avatarSize=\"24px\"\n * avatarUrl=\"https://example.com/avatar.jpg\"\n * >\n * <Badge text=\"Moderator\" badgeColor=\"green\" />\n * </InlineProfile>\n */\nexport const InlineProfile = ({\n name,\n secondaryName,\n partnerName,\n partnerLogoLabel,\n size = \"medium\",\n avatarSize: avatarSizeOverride,\n avatarUrl,\n verificationType,\n className,\n}: TypeInlineProfileProps) => {\n const displayName = name || secondaryName || \"Unknown Profile\";\n const avatarSize = avatarSizeOverride || avatarSizeMap[size];\n\n return (\n <InlineProfileContainer className={className} $size={size}>\n <InlineProfileAvatar>\n <Avatar src={avatarUrl} name={displayName} size={avatarSize} />\n </InlineProfileAvatar>\n\n <InlineProfileContent>\n {partnerName && (\n <InlineProfileNetwork>\n <PartnerLogo\n partnerName={partnerName}\n aria-label={partnerLogoLabel || `${partnerName} profile`}\n size=\"small\"\n />\n </InlineProfileNetwork>\n )}\n\n <InlineProfileText>\n {name && <InlineProfileName>{name}</InlineProfileName>}\n\n {secondaryName && (\n <InlineProfileHandle>{secondaryName}</InlineProfileHandle>\n )}\n </InlineProfileText>\n\n {verificationType && (\n <VerifiedProfileIcon\n partnerName={partnerName}\n verificationType={verificationType}\n />\n )}\n </InlineProfileContent>\n </InlineProfileContainer>\n );\n};\n","import styled from \"styled-components\";\nimport { Token } from \"@sproutsocial/seeds-react-token\";\nimport { InlineProfile } from \"./InlineProfile\";\nimport type { ProfileTokenProps } from \"./types\";\n\nconst StyledProfileToken = styled(Token)`\n box-sizing: border-box;\n display: inline-flex;\n max-width: 100%;\n`;\n\n/**\n * A ProfileToken component that wraps CompactProfile in a Seeds Token component.\n * This token is not closable and provides a compact way to display profile information inline.\n */\nexport const ProfileToken = ({\n className,\n onClick,\n tokenProps,\n ...props\n}: ProfileTokenProps) => (\n <StyledProfileToken\n className={className}\n closeable={false}\n onClick={onClick}\n {...tokenProps}\n >\n <InlineProfile size=\"small\" {...props} />\n </StyledProfileToken>\n);\n\nexport default ProfileToken;\n"],"mappings":";AAAA,OAAO,YAAY;AACnB,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,QAAAA,aAAY;AACrB,SAAS,YAAY;AACrB,SAAS,YAAY;;;ACXrB,SAAS,YAAY;AAuDjB;AAnDJ,IAAM,sBAAsB;AAAA,EAC1B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,GAAG;AAAA,EACH,UAAU;AAAA,EACV,WAAW;AAAA,EACX,MAAM;AACR;AAKO,IAAM,uBAAuB,CAClC,aACA,qBACW;AACX,MAAI,CAAC,oBAAoB,qBAAqB,eAAgB,QAAO;AAErE,UAAQ,kBAAkB;AAAA,IACxB,KAAK;AAEH,aAAO,gBAAgB,aACnB,oBAAoB,WACpB,oBAAoB;AAAA,IAC1B,KAAK;AACH,aAAO,oBAAoB;AAAA,IAC7B,KAAK;AAAA,IACL;AAEE,UAAI,eAAe,eAAe,qBAAqB;AACrD,eAAO,oBACL,WACF;AAAA,MACF;AACA,aAAO,oBAAoB;AAAA,EAC/B;AACF;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAoC;AAClC,MAAI,CAAC,oBAAoB,qBAAqB,eAAgB;AAE9D,QAAM,oBAAoB,qBAAqB,aAAa,gBAAgB;AAC5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C9C,MAAK;AAAA;AAAA,MACP,GACF;AAAA,MAGF,gBAAAH,MAAC,qBACE;AAAA,gBAAQ,gBAAAD,KAAC,qBAAmB,gBAAK;AAAA,QAEjC,iBACC,gBAAAA,KAAC,uBAAqB,yBAAc;AAAA,SAExC;AAAA,MAEC,oBACC,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA;AAAA,MACF;AAAA,OAEJ;AAAA,KACF;AAEJ;;;ACvJA,OAAOK,aAAY;AACnB,SAAS,aAAa;AA0BlB,gBAAAC,YAAA;AAtBJ,IAAM,qBAAqBC,QAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAUhC,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,gBAAAD;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACC,GAAG;AAAA,IAEJ,0BAAAA,KAAC,iBAAc,MAAK,SAAS,GAAG,OAAO;AAAA;AACzC;","names":["Icon","jsx","Icon","styled","PartnerLogo","Avatar","jsx","jsxs","styled","Avatar","PartnerLogo","styled","jsx","styled"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { EnumLogoNamesWithoutVariants } from '@sproutsocial/seeds-partner-logos';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { TypeTokenProps } from '@sproutsocial/seeds-react-token';
|
|
4
|
+
import { TypeCardProps } from '@sproutsocial/seeds-react-card';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Profile Component Types
|
|
@@ -10,23 +10,89 @@ import React$1 from 'react';
|
|
|
10
10
|
* that can be used by backend services to render user profile data.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Social network types supported by the Profile component
|
|
15
|
+
* This is a subset of EnumLogoNamesWithoutVariants that only includes actual social networks
|
|
16
|
+
*/
|
|
17
|
+
type TypeProfileNetwork = Extract<EnumLogoNamesWithoutVariants, "twitter" | "facebook" | "instagram" | "linkedin" | "youtube" | "tiktok" | "threads" | "bluesky" | "reddit" | "pinterest" | "whatsapp" | "glassdoor" | "trustpilot" | "tumblr" | "yelp" | "x-twitter">;
|
|
18
|
+
/**
|
|
19
|
+
* Profile verification types
|
|
20
|
+
*/
|
|
21
|
+
type TypeProfileVerification = "blue_verified" | "gray_verified" | "verified" | "not_verified";
|
|
22
|
+
/**
|
|
23
|
+
* Base props interface shared between Profile and InlineProfile components
|
|
24
|
+
*/
|
|
25
|
+
interface TypeBaseProfileProps {
|
|
26
|
+
/** The network of the profile */
|
|
27
|
+
partnerName?: TypeProfileNetwork;
|
|
28
|
+
/** A custom label to apply to the partner logo */
|
|
29
|
+
partnerLogoLabel?: string;
|
|
30
|
+
/** The display name of the profile */
|
|
14
31
|
name: string;
|
|
32
|
+
/** The handle or username of the profile */
|
|
15
33
|
secondaryName?: string;
|
|
34
|
+
/** The profile picture URL */
|
|
35
|
+
avatarUrl?: string;
|
|
36
|
+
/** The type of verification for the profile, if applicable */
|
|
37
|
+
verificationType?: TypeProfileVerification;
|
|
38
|
+
/** Additional CSS class name */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props interface for the InlineProfile component
|
|
43
|
+
*/
|
|
44
|
+
interface TypeInlineProfileProps extends Omit<TypeBaseProfileProps, "name"> {
|
|
45
|
+
/** The display name of the profile (optional for inline) */
|
|
46
|
+
name?: string;
|
|
47
|
+
/** Size variant for the inline profile */
|
|
48
|
+
size?: "small" | "medium" | "large";
|
|
49
|
+
/** The px size of the avatar, which has a default based on the size prop */
|
|
16
50
|
avatarSize?: string;
|
|
17
|
-
partnerName?: EnumLogoNamesWithoutVariants;
|
|
18
|
-
partnerLogoLabel?: string;
|
|
19
|
-
img?: string;
|
|
20
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
21
51
|
}
|
|
22
52
|
interface ProfileTokenProps extends TypeInlineProfileProps {
|
|
23
|
-
/**
|
|
24
|
-
|
|
53
|
+
/** Click handler for the entire inline profile */
|
|
54
|
+
onClick?: TypeTokenProps["onClick"];
|
|
25
55
|
/** Additional props to pass to the Token component */
|
|
26
|
-
tokenProps?: Omit<
|
|
56
|
+
tokenProps?: Omit<TypeTokenProps, "children">;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Main props interface for the Profile component
|
|
60
|
+
*/
|
|
61
|
+
interface TypeProfileCardProps extends TypeBaseProfileProps {
|
|
62
|
+
/** Subtext for below the profile name */
|
|
63
|
+
subtext?: string;
|
|
64
|
+
/** Profile description or bio */
|
|
65
|
+
description?: string;
|
|
66
|
+
/** External profile URL (e.g., "https://twitter.com/username"), only displayed if secondaryName is provided */
|
|
67
|
+
profileUrl?: string;
|
|
68
|
+
/** Location text (e.g., "San Francisco, CA") */
|
|
69
|
+
location?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Background color for the banner header.
|
|
72
|
+
* If not provided, will use theme.colors.network[partnerName] when partnerName is available.
|
|
73
|
+
*/
|
|
74
|
+
bannerColor?: string;
|
|
75
|
+
/** Generic content slot for banners, alerts, or status messages */
|
|
76
|
+
bannerContent?: React.ReactNode;
|
|
77
|
+
/** Array of metadata strings (e.g., ["1.2K followers", "500 following"]) */
|
|
78
|
+
metadata?: string[];
|
|
79
|
+
/** Action buttons or overflow menus for profile operations. Rendered in order provided, right-aligned. */
|
|
80
|
+
profileActions?: React.ReactNode;
|
|
81
|
+
/** Custom footer content */
|
|
82
|
+
footer?: React.ReactNode;
|
|
83
|
+
/** Props to pass down to the Card */
|
|
84
|
+
cardProps?: TypeCardProps;
|
|
27
85
|
}
|
|
28
86
|
|
|
29
87
|
/**
|
|
88
|
+
* A flexible profile component that can display user profiles in various formats
|
|
89
|
+
* across different social networks with consistent styling and behavior.
|
|
90
|
+
*/
|
|
91
|
+
declare const ProfileCard: ({ partnerName, name, secondaryName, avatarUrl, subtext, description, verificationType, profileUrl, location, bannerColor, bannerContent, metadata, profileActions, footer, cardProps, }: TypeProfileCardProps) => react_jsx_runtime.JSX.Element;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A compact inline profile component that displays avatar, name/handle, and verification.
|
|
95
|
+
* Perfect for use in post headers, comments, or other compact spaces.
|
|
30
96
|
*
|
|
31
97
|
* @param props - Profile props
|
|
32
98
|
* @param props.name - Name of the profile
|
|
@@ -34,7 +100,7 @@ interface ProfileTokenProps extends TypeInlineProfileProps {
|
|
|
34
100
|
* @param props.partnerName - Partner logo name
|
|
35
101
|
* @param props.partnerLogoLabel - Aria-label for the partner logo
|
|
36
102
|
* @param props.avatarSize - Size of the avatar
|
|
37
|
-
* @param props.
|
|
103
|
+
* @param props.avatarUrl - Image URL for the avatar
|
|
38
104
|
* @param props.children - Additional elements to render within the profile component
|
|
39
105
|
* @returns JSX.Element representing a user profile
|
|
40
106
|
*
|
|
@@ -45,17 +111,17 @@ interface ProfileTokenProps extends TypeInlineProfileProps {
|
|
|
45
111
|
* partnerName="facebook"
|
|
46
112
|
* partnerLogoLabel="Facebook Logo"
|
|
47
113
|
* avatarSize="24px"
|
|
48
|
-
*
|
|
114
|
+
* avatarUrl="https://example.com/avatar.jpg"
|
|
49
115
|
* >
|
|
50
116
|
* <Badge text="Moderator" badgeColor="green" />
|
|
51
117
|
* </InlineProfile>
|
|
52
118
|
*/
|
|
53
|
-
declare const InlineProfile: ({ name, secondaryName, partnerName, partnerLogoLabel, avatarSize,
|
|
119
|
+
declare const InlineProfile: ({ name, secondaryName, partnerName, partnerLogoLabel, size, avatarSize: avatarSizeOverride, avatarUrl, verificationType, className, }: TypeInlineProfileProps) => react_jsx_runtime.JSX.Element;
|
|
54
120
|
|
|
55
121
|
/**
|
|
56
122
|
* A ProfileToken component that wraps CompactProfile in a Seeds Token component.
|
|
57
123
|
* This token is not closable and provides a compact way to display profile information inline.
|
|
58
124
|
*/
|
|
59
|
-
declare const ProfileToken:
|
|
125
|
+
declare const ProfileToken: ({ className, onClick, tokenProps, ...props }: ProfileTokenProps) => react_jsx_runtime.JSX.Element;
|
|
60
126
|
|
|
61
|
-
export { InlineProfile, ProfileToken, type ProfileTokenProps, type TypeInlineProfileProps };
|
|
127
|
+
export { InlineProfile, ProfileCard, ProfileToken, type ProfileTokenProps, type TypeBaseProfileProps, type TypeInlineProfileProps, type TypeProfileCardProps, type TypeProfileNetwork, type TypeProfileVerification };
|