@sproutsocial/seeds-react-profile 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +52 -0
- package/dist/esm/index.js +293 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +87 -17
- package/dist/index.d.ts +87 -17
- package/dist/index.js +288 -27
- package/dist/index.js.map +1 -1
- package/package.json +11 -8
- package/src/InlineProfile.stories.tsx +107 -15
- package/src/InlineProfile.tsx +108 -29
- package/src/ProfileCard.stories.tsx +264 -0
- package/src/ProfileCard.tsx +186 -0
- package/src/ProfileToken.stories.tsx +60 -102
- package/src/ProfileToken.tsx +28 -8
- package/src/VerifiedProfileIcon.tsx +64 -0
- package/src/__tests__/InlineProfile.test.tsx +23 -23
- package/src/__tests__/ProfileCard.test.tsx +182 -0
- package/src/__tests__/ProfileToken.test.tsx +14 -13
- package/src/index.ts +1 -0
- package/src/types.ts +100 -10
package/dist/index.d.ts
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;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
21
|
-
}
|
|
22
|
-
interface ProfileTokenProps extends TypeInlineProfileProps {
|
|
34
|
+
/** The profile picture URL */
|
|
35
|
+
avatarUrl?: string;
|
|
36
|
+
/** The type of verification for the profile, if applicable */
|
|
37
|
+
verificationType?: TypeProfileVerification;
|
|
23
38
|
/** Additional CSS class name */
|
|
24
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 */
|
|
50
|
+
avatarSize?: string;
|
|
51
|
+
}
|
|
52
|
+
interface ProfileTokenProps extends Omit<TypeInlineProfileProps, "avatarUrl" | "secondaryName" | "avatarSize"> {
|
|
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,21 @@ 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
|
-
* A ProfileToken component that wraps
|
|
122
|
+
* A ProfileToken component that wraps InlineProfile in a Seeds Token component.
|
|
57
123
|
* This token is not closable and provides a compact way to display profile information inline.
|
|
124
|
+
*
|
|
125
|
+
* ProfileToken enforces design standards by only showing the profile name and network logo.
|
|
126
|
+
* It does not support avatars, secondary names (handles), or custom avatar sizes.
|
|
127
|
+
* Use InlineProfile directly if you need more flexibility.
|
|
58
128
|
*/
|
|
59
|
-
declare const ProfileToken:
|
|
129
|
+
declare const ProfileToken: ({ className, onClick, tokenProps, ...props }: ProfileTokenProps) => react_jsx_runtime.JSX.Element;
|
|
60
130
|
|
|
61
|
-
export { InlineProfile, ProfileToken, type ProfileTokenProps, type TypeInlineProfileProps };
|
|
131
|
+
export { InlineProfile, ProfileCard, ProfileToken, type ProfileTokenProps, type TypeBaseProfileProps, type TypeInlineProfileProps, type TypeProfileCardProps, type TypeProfileNetwork, type TypeProfileVerification };
|
package/dist/index.js
CHANGED
|
@@ -31,65 +31,326 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
InlineProfile: () => InlineProfile,
|
|
34
|
+
ProfileCard: () => ProfileCard,
|
|
34
35
|
ProfileToken: () => ProfileToken
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(index_exports);
|
|
37
38
|
|
|
38
|
-
// src/
|
|
39
|
+
// src/ProfileCard.tsx
|
|
39
40
|
var import_styled_components = __toESM(require("styled-components"));
|
|
40
|
-
var import_seeds_react_text = require("@sproutsocial/seeds-react-text");
|
|
41
41
|
var import_seeds_react_partner_logo = require("@sproutsocial/seeds-react-partner-logo");
|
|
42
42
|
var import_seeds_react_avatar = require("@sproutsocial/seeds-react-avatar");
|
|
43
|
+
var import_seeds_react_card = require("@sproutsocial/seeds-react-card");
|
|
44
|
+
var import_seeds_react_icon2 = require("@sproutsocial/seeds-react-icon");
|
|
45
|
+
var import_seeds_react_link = require("@sproutsocial/seeds-react-link");
|
|
46
|
+
var import_seeds_react_text = require("@sproutsocial/seeds-react-text");
|
|
47
|
+
|
|
48
|
+
// src/VerifiedProfileIcon.tsx
|
|
49
|
+
var import_seeds_react_icon = require("@sproutsocial/seeds-react-icon");
|
|
43
50
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
var
|
|
51
|
+
var VERIFICATION_COLORS = {
|
|
52
|
+
twitter: "#000000",
|
|
53
|
+
facebook: "#1877F2",
|
|
54
|
+
x: "#000000",
|
|
55
|
+
linkedin: "#0A66C2",
|
|
56
|
+
instagram: "#e4405f",
|
|
57
|
+
gray: "#515e5f"
|
|
58
|
+
};
|
|
59
|
+
var getVerificationColor = (partnerName, verificationType) => {
|
|
60
|
+
if (!verificationType || verificationType === "not_verified") return "";
|
|
61
|
+
switch (verificationType) {
|
|
62
|
+
case "blue_verified":
|
|
63
|
+
return partnerName === "facebook" ? VERIFICATION_COLORS.facebook : VERIFICATION_COLORS.twitter;
|
|
64
|
+
case "gray_verified":
|
|
65
|
+
return VERIFICATION_COLORS.gray;
|
|
66
|
+
case "verified":
|
|
67
|
+
default:
|
|
68
|
+
if (partnerName && partnerName in VERIFICATION_COLORS) {
|
|
69
|
+
return VERIFICATION_COLORS[partnerName];
|
|
70
|
+
}
|
|
71
|
+
return VERIFICATION_COLORS.twitter;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var VerifiedProfileIcon = ({
|
|
75
|
+
partnerName,
|
|
76
|
+
verificationType
|
|
77
|
+
}) => {
|
|
78
|
+
if (!verificationType || verificationType === "not_verified") return;
|
|
79
|
+
const verificationColor = getVerificationColor(partnerName, verificationType);
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_seeds_react_icon.Icon,
|
|
82
|
+
{
|
|
83
|
+
title: "Verified",
|
|
84
|
+
"aria-label": "Verified account",
|
|
85
|
+
color: verificationColor,
|
|
86
|
+
name: "verified",
|
|
87
|
+
ml: "150"
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/ProfileCard.tsx
|
|
93
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
94
|
+
var StyledProfileCard = (0, import_styled_components.default)(import_seeds_react_card.Card)`
|
|
95
|
+
max-width: 300px;
|
|
96
|
+
`;
|
|
97
|
+
var StyledCardHeader = (0, import_styled_components.default)(import_seeds_react_card.CardHeader)`
|
|
98
|
+
position: relative;
|
|
99
|
+
height: 80px;
|
|
100
|
+
padding: ${(props) => props.theme.space[400]}
|
|
101
|
+
${(props) => props.theme.space[400]} 0 ${(props) => props.theme.space[400]};
|
|
102
|
+
margin-bottom: 0;
|
|
103
|
+
color: ${(props) => props.theme.colors.text.inverse};
|
|
104
|
+
border-radius: ${(props) => props.theme.radii[500]}
|
|
105
|
+
${(props) => props.theme.radii[500]} 0 0;
|
|
106
|
+
${(props) => {
|
|
107
|
+
if (props.$bannerColor) {
|
|
108
|
+
return `background: ${props.$bannerColor};`;
|
|
109
|
+
}
|
|
110
|
+
if (props.$partnerName && props.theme.colors.network) {
|
|
111
|
+
const networkColor = props.theme.colors.network[props.$partnerName];
|
|
112
|
+
return networkColor ? `background: ${networkColor};` : "";
|
|
113
|
+
}
|
|
114
|
+
return "";
|
|
115
|
+
}}
|
|
116
|
+
`;
|
|
117
|
+
var BannerContent = import_styled_components.default.div`
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: flex-end;
|
|
120
|
+
width: 100%;
|
|
121
|
+
`;
|
|
122
|
+
var ActionsSection = import_styled_components.default.div`
|
|
123
|
+
display: flex;
|
|
124
|
+
justify-content: flex-end;
|
|
125
|
+
gap: ${(props) => props.theme.space[100]};
|
|
126
|
+
padding: 0 ${(props) => props.theme.space[300]};
|
|
127
|
+
|
|
128
|
+
&:empty {
|
|
129
|
+
min-height: 44px;
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
var StyledCardContent = (0, import_styled_components.default)(import_seeds_react_card.CardContent)`
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
gap: ${(props) => props.theme.space[300]};
|
|
136
|
+
padding: 0 ${(props) => props.theme.space[400]}
|
|
137
|
+
${(props) => props.theme.space[400]};
|
|
138
|
+
`;
|
|
139
|
+
var ProfileNameSection = import_styled_components.default.div`
|
|
45
140
|
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
gap: ${(props) => props.theme.space[200]};
|
|
143
|
+
`;
|
|
144
|
+
var InfoRow = import_styled_components.default.div`
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: ${(props) => props.theme.space[300]};
|
|
148
|
+
`;
|
|
149
|
+
var ProfileCard = ({
|
|
150
|
+
partnerName,
|
|
151
|
+
name,
|
|
152
|
+
secondaryName,
|
|
153
|
+
avatarUrl,
|
|
154
|
+
subtext,
|
|
155
|
+
description,
|
|
156
|
+
verificationType,
|
|
157
|
+
profileUrl,
|
|
158
|
+
location,
|
|
159
|
+
bannerColor,
|
|
160
|
+
bannerContent,
|
|
161
|
+
metadata,
|
|
162
|
+
profileActions,
|
|
163
|
+
footer,
|
|
164
|
+
cardProps
|
|
165
|
+
}) => {
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(StyledProfileCard, { role: "presentation", ...cardProps, children: [
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(StyledCardHeader, { $bannerColor: bannerColor, $partnerName: partnerName, children: [
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_avatar.Avatar, { src: avatarUrl, name, size: "60px", mt: 450 }),
|
|
169
|
+
bannerContent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BannerContent, { children: bannerContent })
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ActionsSection, { children: profileActions }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(StyledCardContent, { children: [
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(ProfileNameSection, { children: [
|
|
174
|
+
partnerName && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
175
|
+
import_seeds_react_partner_logo.PartnerLogo,
|
|
176
|
+
{
|
|
177
|
+
partnerName,
|
|
178
|
+
"aria-label": `${partnerName} profile`,
|
|
179
|
+
size: "small"
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text.SubHeadline, { as: "h2", children: name })
|
|
183
|
+
] }),
|
|
184
|
+
subtext && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text, { fontSize: 200, color: "text.subtext", children: subtext }),
|
|
185
|
+
secondaryName && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(InfoRow, { children: [
|
|
186
|
+
profileUrl ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_seeds_react_link.Link, { href: profileUrl, external: true, children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text, { fontSize: 200, children: secondaryName }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
189
|
+
import_seeds_react_icon2.Icon,
|
|
190
|
+
{
|
|
191
|
+
name: "arrow-right-up-outline",
|
|
192
|
+
"aria-hidden": true,
|
|
193
|
+
ml: 100,
|
|
194
|
+
size: "small"
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text.SmallByline, { color: "text.subtext", children: secondaryName }),
|
|
198
|
+
verificationType && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
199
|
+
VerifiedProfileIcon,
|
|
200
|
+
{
|
|
201
|
+
partnerName,
|
|
202
|
+
verificationType
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
] }),
|
|
206
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text, { fontSize: 200, children: description }),
|
|
207
|
+
location && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(InfoRow, { children: [
|
|
208
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "location-pin-outline", "aria-hidden": true, size: "small" }),
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text, { fontSize: 200, children: location })
|
|
210
|
+
] }),
|
|
211
|
+
metadata && metadata.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(InfoRow, { children: metadata.map((info, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_text.Text, { fontSize: 200, children: info }, index)) })
|
|
212
|
+
] }),
|
|
213
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_card.CardFooter, { children: footer })
|
|
214
|
+
] });
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// src/InlineProfile.tsx
|
|
218
|
+
var import_styled_components2 = __toESM(require("styled-components"));
|
|
219
|
+
var import_seeds_react_partner_logo2 = require("@sproutsocial/seeds-react-partner-logo");
|
|
220
|
+
var import_seeds_react_avatar2 = require("@sproutsocial/seeds-react-avatar");
|
|
221
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
222
|
+
var InlineProfileContainer = import_styled_components2.default.span`
|
|
223
|
+
display: inline-flex;
|
|
46
224
|
flex-direction: row;
|
|
47
225
|
align-items: center;
|
|
226
|
+
gap: ${(props) => props.theme.space[200]};
|
|
48
227
|
max-width: 100%;
|
|
228
|
+
${(props) => props.theme.typography[200]}
|
|
229
|
+
color: ${(props) => props.theme.colors.text.subtext};
|
|
230
|
+
text-align: inherit;
|
|
49
231
|
`;
|
|
50
|
-
var
|
|
51
|
-
display: flex;
|
|
232
|
+
var InlineProfileAvatar = import_styled_components2.default.span`
|
|
233
|
+
display: inline-flex;
|
|
234
|
+
flex-shrink: 0;
|
|
235
|
+
`;
|
|
236
|
+
var InlineProfileContent = import_styled_components2.default.span`
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
gap: ${(props) => props.theme.space[200]};
|
|
240
|
+
min-width: 0;
|
|
241
|
+
flex: 1;
|
|
242
|
+
`;
|
|
243
|
+
var InlineProfileNetwork = import_styled_components2.default.span`
|
|
244
|
+
display: inline-flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
flex-shrink: 0;
|
|
247
|
+
`;
|
|
248
|
+
var InlineProfileText = import_styled_components2.default.span`
|
|
249
|
+
display: inline-flex;
|
|
250
|
+
flex-direction: row;
|
|
52
251
|
align-items: center;
|
|
53
|
-
|
|
252
|
+
gap: ${(props) => props.theme.space[200]};
|
|
253
|
+
min-width: 0;
|
|
254
|
+
flex: 1;
|
|
255
|
+
`;
|
|
256
|
+
var InlineProfileName = import_styled_components2.default.span`
|
|
257
|
+
display: inline-block;
|
|
258
|
+
${(props) => props.theme.typography[200]}
|
|
259
|
+
font-family: ${(props) => props.theme.fontFamily};
|
|
260
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
261
|
+
text-transform: lowercase;
|
|
262
|
+
color: ${(props) => props.theme.colors.text.body};
|
|
263
|
+
max-width: 100%;
|
|
264
|
+
overflow: hidden;
|
|
265
|
+
text-overflow: ellipsis;
|
|
266
|
+
white-space: nowrap;
|
|
54
267
|
`;
|
|
268
|
+
var InlineProfileHandle = import_styled_components2.default.span`
|
|
269
|
+
display: inline-block;
|
|
270
|
+
${(props) => props.theme.typography[200]}
|
|
271
|
+
font-family: ${(props) => props.theme.fontFamily};
|
|
272
|
+
color: ${(props) => props.theme.colors.text.subtext};
|
|
273
|
+
max-width: 100%;
|
|
274
|
+
overflow: hidden;
|
|
275
|
+
text-overflow: ellipsis;
|
|
276
|
+
white-space: nowrap;
|
|
277
|
+
`;
|
|
278
|
+
var avatarSizeMap = {
|
|
279
|
+
small: "16px",
|
|
280
|
+
medium: "20px",
|
|
281
|
+
large: "24px"
|
|
282
|
+
};
|
|
55
283
|
var InlineProfile = ({
|
|
56
284
|
name,
|
|
57
285
|
secondaryName,
|
|
58
286
|
partnerName,
|
|
59
287
|
partnerLogoLabel,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
288
|
+
size = "medium",
|
|
289
|
+
avatarSize: avatarSizeOverride,
|
|
290
|
+
avatarUrl,
|
|
291
|
+
verificationType,
|
|
292
|
+
className
|
|
63
293
|
}) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
294
|
+
const displayName = name || secondaryName || "Unknown Profile";
|
|
295
|
+
const avatarSize = avatarSizeOverride || avatarSizeMap[size];
|
|
296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(InlineProfileContainer, { className, $size: size, children: [
|
|
297
|
+
avatarUrl && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InlineProfileAvatar, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_avatar2.Avatar, { src: avatarUrl, name: displayName, size: avatarSize }) }),
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(InlineProfileContent, { children: [
|
|
299
|
+
partnerName && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InlineProfileNetwork, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
300
|
+
import_seeds_react_partner_logo2.PartnerLogo,
|
|
301
|
+
{
|
|
302
|
+
partnerName,
|
|
303
|
+
"aria-label": partnerLogoLabel || `${partnerName} profile`,
|
|
304
|
+
size: "small"
|
|
305
|
+
}
|
|
306
|
+
) }),
|
|
307
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(InlineProfileText, { children: [
|
|
308
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InlineProfileName, { children: name }),
|
|
309
|
+
secondaryName && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InlineProfileHandle, { children: secondaryName })
|
|
310
|
+
] }),
|
|
311
|
+
verificationType && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
312
|
+
VerifiedProfileIcon,
|
|
313
|
+
{
|
|
314
|
+
partnerName,
|
|
315
|
+
verificationType
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
] })
|
|
78
319
|
] });
|
|
79
320
|
};
|
|
80
321
|
|
|
81
322
|
// src/ProfileToken.tsx
|
|
82
|
-
var
|
|
323
|
+
var import_styled_components3 = __toESM(require("styled-components"));
|
|
83
324
|
var import_seeds_react_token = require("@sproutsocial/seeds-react-token");
|
|
84
|
-
var
|
|
325
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
326
|
+
var StyledProfileToken = (0, import_styled_components3.default)(import_seeds_react_token.Token)`
|
|
327
|
+
box-sizing: border-box;
|
|
328
|
+
display: inline-flex;
|
|
329
|
+
max-width: 100%;
|
|
330
|
+
vertical-align: middle;
|
|
331
|
+
padding: ${(props) => props.theme.space[100]}
|
|
332
|
+
${(props) => props.theme.space[200]};
|
|
333
|
+
margin: ${(props) => props.theme.space[100]} 0;
|
|
334
|
+
`;
|
|
85
335
|
var ProfileToken = ({
|
|
86
|
-
tokenProps,
|
|
87
336
|
className,
|
|
337
|
+
onClick,
|
|
338
|
+
tokenProps,
|
|
88
339
|
...props
|
|
89
|
-
}) => /* @__PURE__ */ (0,
|
|
340
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
341
|
+
StyledProfileToken,
|
|
342
|
+
{
|
|
343
|
+
className,
|
|
344
|
+
closeable: false,
|
|
345
|
+
onClick,
|
|
346
|
+
...tokenProps,
|
|
347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InlineProfile, { size: "small", ...props })
|
|
348
|
+
}
|
|
349
|
+
);
|
|
90
350
|
// Annotate the CommonJS export names for ESM import in node:
|
|
91
351
|
0 && (module.exports = {
|
|
92
352
|
InlineProfile,
|
|
353
|
+
ProfileCard,
|
|
93
354
|
ProfileToken
|
|
94
355
|
});
|
|
95
356
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/InlineProfile.tsx","../src/ProfileToken.tsx"],"sourcesContent":["export * from \"./InlineProfile\";\nexport * from \"./ProfileToken\";\nexport * from \"./types\";\n","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;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,+BAAmB;AACnB,8BAAqB;AACrB,sCAA4B;AAC5B,gCAAuB;AAkDnB;AA/CJ,IAAM,yBAAyB,yBAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtC,IAAM,oBAAoB,yBAAAA,QAAO;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,6CAAC,0BACC;AAAA,gDAAC,oCAAO,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,4CAAC,gCAAK,UAAU,KAAK,YAAW,YAAW,IAAI,KAAK,WAAW,MAC5D,gBACH;AAAA,IACC,iBACC,4CAAC,gCAAK,UAAU,KAAK,IAAI,KAAK,YAAW,UAAS,WAAW,MAC1D,yBACH;AAAA,IAEF,4CAAC,qBAAmB,UAAS;AAAA,KAC/B;AAEJ;;;AC1EA,mBAAkB;AAClB,+BAAsB;AAclB,IAAAC,sBAAA;AANG,IAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE,6CAAC,kCAAM,WAAsB,WAAW,OAAQ,GAAG,YACjD,uDAAC,iBAAe,GAAG,OAAO,GAC5B;","names":["styled","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/ProfileCard.tsx","../src/VerifiedProfileIcon.tsx","../src/InlineProfile.tsx","../src/ProfileToken.tsx"],"sourcesContent":["export * from \"./ProfileCard\";\nexport * from \"./InlineProfile\";\nexport * from \"./ProfileToken\";\nexport * from \"./types\";\n","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 {avatarUrl && (\n <InlineProfileAvatar>\n <Avatar src={avatarUrl} name={displayName} size={avatarSize} />\n </InlineProfileAvatar>\n )}\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 vertical-align: middle;\n padding: ${(props) => props.theme.space[100]}\n ${(props) => props.theme.space[200]};\n margin: ${(props) => props.theme.space[100]} 0;\n`;\n\n/**\n * A ProfileToken component that wraps InlineProfile in a Seeds Token component.\n * This token is not closable and provides a compact way to display profile information inline.\n *\n * ProfileToken enforces design standards by only showing the profile name and network logo.\n * It does not support avatars, secondary names (handles), or custom avatar sizes.\n * Use InlineProfile directly if you need more flexibility.\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,+BAAmB;AACnB,sCAA4B;AAC5B,gCAAuB;AACvB,8BAKO;AACP,IAAAA,2BAAqB;AACrB,8BAAqB;AACrB,8BAAqB;;;ACXrB,8BAAqB;AAuDjB;AAnDJ,IAAM,sBAAsB;AAAA,EAC1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G;AAAA,IAEJ,uDAAC,iBAAc,MAAK,SAAS,GAAG,OAAO;AAAA;AACzC;","names":["import_seeds_react_icon","import_jsx_runtime","styled","import_styled_components","import_seeds_react_partner_logo","import_seeds_react_avatar","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/seeds-react-profile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Seeds React Profile",
|
|
5
5
|
"author": "Sprout Social, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,17 +20,19 @@
|
|
|
20
20
|
"lint:fix": "eslint --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@sproutsocial/seeds-react-
|
|
24
|
-
"@sproutsocial/seeds-react-
|
|
25
|
-
"@sproutsocial/seeds-react-
|
|
26
|
-
"@sproutsocial/seeds-react-
|
|
27
|
-
"@sproutsocial/seeds-react-
|
|
28
|
-
"@sproutsocial/seeds-react-
|
|
23
|
+
"@sproutsocial/seeds-react-avatar": "^1.0.1",
|
|
24
|
+
"@sproutsocial/seeds-react-card": "^1.1.14",
|
|
25
|
+
"@sproutsocial/seeds-react-icon": "^1.0.0",
|
|
26
|
+
"@sproutsocial/seeds-react-link": "^1.0.0",
|
|
27
|
+
"@sproutsocial/seeds-react-partner-logo": "^1.0.0",
|
|
28
|
+
"@sproutsocial/seeds-react-text": "^1.3.0",
|
|
29
|
+
"@sproutsocial/seeds-react-token": "^1.0.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@types/react": "^18.0.0",
|
|
32
33
|
"@types/styled-components": "^5.1.26",
|
|
33
34
|
"@sproutsocial/eslint-config-seeds": "*",
|
|
35
|
+
"@sproutsocial/seeds-react-box": "*",
|
|
34
36
|
"react": "^18.0.0",
|
|
35
37
|
"styled-components": "^5.2.3",
|
|
36
38
|
"tsup": "^8.3.4",
|
|
@@ -40,7 +42,8 @@
|
|
|
40
42
|
"@sproutsocial/seeds-react-testing-library": "*"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {
|
|
43
|
-
"react": "^18.0.0",
|
|
45
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
46
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
44
47
|
"styled-components": "^5.2.3"
|
|
45
48
|
},
|
|
46
49
|
"engines": {
|