@sproutsocial/seeds-react-narrative-kit 0.5.1 → 0.6.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 +11 -11
- package/CHANGELOG.md +15 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +38 -3
- package/dist/index.d.ts +38 -3
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/metric-highlight.css +11 -2
- package/dist/narrative-container.css +18 -0
- package/dist/narrative-section.css +46 -0
- package/dist/narrative-social-media-card.css +6 -3
- package/package.json +6 -5
- package/src/MetricHighlight/MetricHighlight.stories.tsx +0 -1
- package/src/NarrativeSection/NarrativeSection.stories.tsx +63 -0
- package/src/NarrativeSection/NarrativeSection.tsx +45 -0
- package/src/NarrativeSection/NarrativeSectionTypes.ts +17 -0
- package/src/NarrativeSection/__tests__/NarrativeSection.test.tsx +86 -0
- package/src/NarrativeSection/index.ts +5 -0
- package/src/NarrativeSocialMediaCard/NarrativeSocialMediaCard.tsx +5 -2
- package/src/Playground/Playground.stories.tsx +207 -188
- package/src/index.ts +6 -0
- package/src/metric-highlight.css +11 -2
- package/src/narrative-container.css +18 -0
- package/src/narrative-section.css +46 -0
- package/src/narrative-social-media-card.css +6 -3
|
@@ -9,6 +9,7 @@ import PullQuote from "../PullQuote/PullQuote";
|
|
|
9
9
|
import MetricHighlight from "../MetricHighlight/MetricHighlight";
|
|
10
10
|
import EyebrowToken from "../EyebrowToken/EyebrowToken";
|
|
11
11
|
import NarrativeDivider from "../NarrativeDivider/NarrativeDivider";
|
|
12
|
+
import NarrativeSection from "../NarrativeSection/NarrativeSection";
|
|
12
13
|
import NarrativeSummary from "../NarrativeSummary/NarrativeSummary";
|
|
13
14
|
import NarrativeOrderedList from "../NarrativeOrderedList/NarrativeOrderedList";
|
|
14
15
|
import NarrativeDataCallout from "../NarrativeDataCallout/NarrativeDataCallout";
|
|
@@ -25,12 +26,13 @@ import "../pull-quote.css";
|
|
|
25
26
|
import "../metric-highlight.css";
|
|
26
27
|
import "../eyebrow-token.css";
|
|
27
28
|
import "../narrative-divider.css";
|
|
29
|
+
import "../narrative-section.css";
|
|
28
30
|
import "../narrative-summary.css";
|
|
29
31
|
import "../narrative-ordered-list.css";
|
|
30
32
|
import "../narrative-data-callout.css";
|
|
33
|
+
import "../narrative-attribution.css";
|
|
31
34
|
import "../narrative-social-media-card.css";
|
|
32
35
|
import "@sproutsocial/seeds-react-button/dist/button.css";
|
|
33
|
-
import "@sproutsocial/seeds-react-data-viz/sparkline.css";
|
|
34
36
|
|
|
35
37
|
const spark = (data: number[], variant: "line" | "bar" = "line") => (
|
|
36
38
|
<SparklineChart
|
|
@@ -65,7 +67,7 @@ const Attribution = ({ name }: { name: string }) => (
|
|
|
65
67
|
|
|
66
68
|
const Brief = () => (
|
|
67
69
|
<div className="box-border min-h-screen p-600 bg-app-bg-base">
|
|
68
|
-
<div className="
|
|
70
|
+
<div className="mx-auto grid gap-500">
|
|
69
71
|
<span>
|
|
70
72
|
<EyebrowToken className="mb-300 inline-flex">May 31, 2026</EyebrowToken>
|
|
71
73
|
<NarrativeHeadline headingLevel={1}>
|
|
@@ -74,218 +76,235 @@ const Brief = () => (
|
|
|
74
76
|
words={["marketers", "agencies", "enterprise teams", "founders"]}
|
|
75
77
|
/>
|
|
76
78
|
</NarrativeHeadline>
|
|
77
|
-
<Text.BodyCopy mt={400} display="block"
|
|
79
|
+
<Text.BodyCopy mt={400} display="block" maxWidth="50ch">
|
|
78
80
|
Empowering cross-functional stakeholders to drive engagement at scale
|
|
79
81
|
and accelerate time-to-value through data-driven content strategies
|
|
80
82
|
aligned with your brand's north-star KPIs.
|
|
81
83
|
</Text.BodyCopy>
|
|
82
84
|
</span>
|
|
83
85
|
|
|
84
|
-
{/*
|
|
86
|
+
{/* Sectioned brief body — each block is grouped under a titled
|
|
87
|
+
NarrativeSection instead of being separated by dividers. */}
|
|
85
88
|
<NarrativeContainer className="w-full">
|
|
86
89
|
<Grid columns={{ sm: 1, md: 1 }} gap={500}>
|
|
87
90
|
{/* Metric highlights — a row of 3 -------------------------------- */}
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
layout="two-column"
|
|
123
|
-
eyebrow="June 10th"
|
|
124
|
-
headline="Engagement climbed across every owned channel this month"
|
|
125
|
-
summary="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec odio leo, gravida vitae sodales vitae, tempor eget ligula. Vestibulum nec enim eget mi placerat finibus. Donec tempor tincidunt elit."
|
|
126
|
-
keyThemes={[
|
|
127
|
-
"Reply threads outperformed paid pushes for the week.",
|
|
128
|
-
"Average response time dropped nearly in half.",
|
|
129
|
-
"Enterprise segment drove the largest share of new engagement.",
|
|
130
|
-
]}
|
|
131
|
-
/>
|
|
132
|
-
|
|
133
|
-
<PullQuote
|
|
134
|
-
quote="The reply thread on the 18th outperformed our entire paid push for the week."
|
|
135
|
-
attribution={<Attribution name="Jordan Lee" />}
|
|
136
|
-
/>
|
|
137
|
-
|
|
138
|
-
<NarrativeDivider />
|
|
139
|
-
|
|
140
|
-
<NarrativeOrderedList
|
|
141
|
-
items={[
|
|
142
|
-
{
|
|
143
|
-
title: "Double down on reply threads",
|
|
144
|
-
description:
|
|
145
|
-
"Shift a slice of paid budget toward the organic reply threads that outperformed this week.",
|
|
146
|
-
action: (
|
|
147
|
-
<Button appearance="ai-secondary">Suggested Action</Button>
|
|
148
|
-
),
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
title: "Protect response time at peak",
|
|
152
|
-
description:
|
|
153
|
-
"Add coverage during the two peak windows to hold response time under two hours.",
|
|
154
|
-
action: (
|
|
155
|
-
<Button appearance="ai-secondary">Suggested Action</Button>
|
|
156
|
-
),
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
title: "Lean into the enterprise segment",
|
|
160
|
-
description:
|
|
161
|
-
"Build a follow-up sequence for the enterprise cohort that drove the most new engagement.",
|
|
162
|
-
action: (
|
|
163
|
-
<Button appearance="ai-secondary">Suggested Action</Button>
|
|
164
|
-
),
|
|
165
|
-
},
|
|
166
|
-
]}
|
|
167
|
-
/>
|
|
168
|
-
|
|
169
|
-
<NarrativeDivider />
|
|
170
|
-
|
|
171
|
-
{/* Narrative summary (3-column) — below the pull quotes --------- */}
|
|
172
|
-
<NarrativeSummary
|
|
173
|
-
eyebrow="Quarterly review"
|
|
174
|
-
headline="Three themes defined the quarter for the brand"
|
|
175
|
-
action={<Button appearance="primary">View report</Button>}
|
|
176
|
-
summary="Praesent pretium libero vitae arcu blandit pellentesque. Aenean fermentum, nisi eu blandit placerat, ligula ligula euismod ante, id semper nibh diam ac ipsum."
|
|
177
|
-
keyThemes={[
|
|
178
|
-
"Owned channels outpaced paid across every region.",
|
|
179
|
-
"Response time held under two hours through peak weeks.",
|
|
180
|
-
"Sentiment trended positive after the product launch.",
|
|
181
|
-
]}
|
|
182
|
-
/>
|
|
183
|
-
|
|
184
|
-
<PullQuote
|
|
185
|
-
appearance="vivid"
|
|
186
|
-
quote="This rollout cut our average response time nearly in half."
|
|
187
|
-
attribution={<Attribution name="Priya Nair" />}
|
|
188
|
-
/>
|
|
91
|
+
<NarrativeSection sectionTitle="Performance at a glance">
|
|
92
|
+
<Grid columns={{ sm: 1, md: 2, lg: 3 }} gap={400}>
|
|
93
|
+
<MetricHighlight
|
|
94
|
+
label="Impressions"
|
|
95
|
+
value="1.2M"
|
|
96
|
+
trend={{
|
|
97
|
+
direction: "up",
|
|
98
|
+
value: "18%",
|
|
99
|
+
"aria-label": "up 18%",
|
|
100
|
+
}}
|
|
101
|
+
sparkline={spark([8, 12, 9, 15, 13, 19])}
|
|
102
|
+
/>
|
|
103
|
+
<MetricHighlight
|
|
104
|
+
label="Engagement rate"
|
|
105
|
+
value="6.4%"
|
|
106
|
+
trend={{
|
|
107
|
+
direction: "up",
|
|
108
|
+
value: "240%",
|
|
109
|
+
"aria-label": "up 240%",
|
|
110
|
+
}}
|
|
111
|
+
sparkline={spark([3, 5, 4, 7, 6, 9])}
|
|
112
|
+
/>
|
|
113
|
+
<MetricHighlight
|
|
114
|
+
label="Response time"
|
|
115
|
+
value="2h"
|
|
116
|
+
trend={{
|
|
117
|
+
direction: "down",
|
|
118
|
+
value: "12%",
|
|
119
|
+
"aria-label": "down 12%",
|
|
120
|
+
}}
|
|
121
|
+
sparkline={spark([18, 16, 17, 13, 14, 10], "bar")}
|
|
122
|
+
/>
|
|
123
|
+
</Grid>
|
|
124
|
+
</NarrativeSection>
|
|
189
125
|
|
|
190
126
|
<NarrativeDivider />
|
|
191
127
|
|
|
192
|
-
{/*
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</NarrativeDataCallout>
|
|
128
|
+
{/* Narrative summary (2-column) + supporting pull quote ---------- */}
|
|
129
|
+
<NarrativeSection sectionTitle="What's happening">
|
|
130
|
+
<NarrativeSummary
|
|
131
|
+
layout="two-column"
|
|
132
|
+
eyebrow="June 10th"
|
|
133
|
+
headline="Engagement climbed across every owned channel this month"
|
|
134
|
+
summary="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec odio leo, gravida vitae sodales vitae, tempor eget ligula. Vestibulum nec enim eget mi placerat finibus. Donec tempor tincidunt elit."
|
|
135
|
+
keyThemes={[
|
|
136
|
+
"Reply threads outperformed paid pushes for the week.",
|
|
137
|
+
"Average response time dropped nearly in half.",
|
|
138
|
+
"Enterprise segment drove the largest share of new engagement.",
|
|
139
|
+
]}
|
|
140
|
+
/>
|
|
141
|
+
<PullQuote
|
|
142
|
+
quote="The reply thread on the 18th outperformed our entire paid push for the week."
|
|
143
|
+
attribution={<Attribution name="Jordan Lee" />}
|
|
144
|
+
/>
|
|
145
|
+
</NarrativeSection>
|
|
211
146
|
|
|
212
147
|
<NarrativeDivider />
|
|
213
148
|
|
|
214
|
-
{/*
|
|
215
|
-
<
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
avatarAlt="Sprout Social avatar"
|
|
219
|
-
displayName="Sprout Social"
|
|
220
|
-
socialIcon={<PartnerLogo partnerName="twitter" size="small" />}
|
|
221
|
-
text="Just launched our new product! Check it out and let us know what you think."
|
|
222
|
-
meta={[
|
|
149
|
+
{/* Recommended actions ------------------------------------------- */}
|
|
150
|
+
<NarrativeSection sectionTitle="Recommended actions">
|
|
151
|
+
<NarrativeOrderedList
|
|
152
|
+
items={[
|
|
223
153
|
{
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
154
|
+
title: "Double down on reply threads",
|
|
155
|
+
description:
|
|
156
|
+
"Shift a slice of paid budget toward the organic reply threads that outperformed this week.",
|
|
157
|
+
action: (
|
|
158
|
+
<Button appearance="ai-secondary">Suggested Action</Button>
|
|
159
|
+
),
|
|
227
160
|
},
|
|
228
161
|
{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
162
|
+
title: "Protect response time at peak",
|
|
163
|
+
description:
|
|
164
|
+
"Add coverage during the two peak windows to hold response time under two hours.",
|
|
165
|
+
action: (
|
|
166
|
+
<Button appearance="ai-secondary">Suggested Action</Button>
|
|
167
|
+
),
|
|
232
168
|
},
|
|
233
169
|
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
170
|
+
title: "Lean into the enterprise segment",
|
|
171
|
+
description:
|
|
172
|
+
"Build a follow-up sequence for the enterprise cohort that drove the most new engagement.",
|
|
173
|
+
action: (
|
|
174
|
+
<Button appearance="ai-secondary">Suggested Action</Button>
|
|
175
|
+
),
|
|
237
176
|
},
|
|
238
177
|
]}
|
|
239
178
|
/>
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
label: "Likes",
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
icon: <Icon name="repost-outline" />,
|
|
259
|
-
value: 156,
|
|
260
|
-
label: "Shares",
|
|
261
|
-
},
|
|
179
|
+
</NarrativeSection>
|
|
180
|
+
|
|
181
|
+
<NarrativeDivider />
|
|
182
|
+
|
|
183
|
+
{/* Narrative summary (3-column) + supporting pull quote ---------- */}
|
|
184
|
+
<NarrativeSection sectionTitle="The quarter in review">
|
|
185
|
+
<NarrativeSummary
|
|
186
|
+
eyebrow="Quarterly review"
|
|
187
|
+
headline="Three themes defined the quarter for the brand"
|
|
188
|
+
action={<Button appearance="primary">View report</Button>}
|
|
189
|
+
summary="Praesent pretium libero vitae arcu blandit pellentesque. Aenean fermentum, nisi eu blandit placerat, ligula ligula euismod ante, id semper nibh diam ac ipsum."
|
|
190
|
+
keyThemes={[
|
|
191
|
+
"Owned channels outpaced paid across every region.",
|
|
192
|
+
"Response time held under two hours through peak weeks.",
|
|
193
|
+
"Sentiment trended positive after the product launch.",
|
|
262
194
|
]}
|
|
263
195
|
/>
|
|
264
|
-
<
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
socialIcon={<PartnerLogo partnerName="instagram" size="small" />}
|
|
269
|
-
text="Behind the scenes of today's campaign launch. Swipe to see the creative process!"
|
|
270
|
-
meta={[
|
|
271
|
-
{
|
|
272
|
-
icon: <Icon name="reply-outline" />,
|
|
273
|
-
value: 89,
|
|
274
|
-
label: "Comments",
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
icon: <Icon name="heart-outline" />,
|
|
278
|
-
value: 1240,
|
|
279
|
-
label: "Likes",
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
icon: <Icon name="repost-outline" />,
|
|
283
|
-
value: 203,
|
|
284
|
-
label: "Shares",
|
|
285
|
-
},
|
|
286
|
-
]}
|
|
196
|
+
<PullQuote
|
|
197
|
+
appearance="vivid"
|
|
198
|
+
quote="This rollout cut our average response time nearly in half."
|
|
199
|
+
attribution={<Attribution name="Priya Nair" />}
|
|
287
200
|
/>
|
|
288
|
-
</
|
|
201
|
+
</NarrativeSection>
|
|
202
|
+
|
|
203
|
+
<NarrativeDivider />
|
|
204
|
+
|
|
205
|
+
{/* Data callout — a data-viz visual paired with narrative copy ---- */}
|
|
206
|
+
<NarrativeSection sectionTitle="Goal progress">
|
|
207
|
+
<NarrativeDataCallout
|
|
208
|
+
visual={
|
|
209
|
+
<DonutChart
|
|
210
|
+
description="Goal completion: 80% complete"
|
|
211
|
+
data={[
|
|
212
|
+
{ name: "Complete", value: 80 },
|
|
213
|
+
{ name: "Remaining", value: 20 },
|
|
214
|
+
]}
|
|
215
|
+
/>
|
|
216
|
+
}
|
|
217
|
+
>
|
|
218
|
+
We're 80% of the way to closing out this quarter's goal — a clear
|
|
219
|
+
signal that the cross-functional alignment we drove upstream is
|
|
220
|
+
now compounding into measurable downstream velocity. With the
|
|
221
|
+
remaining 20% squarely in view, we're doubling down on the
|
|
222
|
+
workstreams that move the needle and sunsetting the low-leverage
|
|
223
|
+
noise to land this initiative ahead of the curve.
|
|
224
|
+
</NarrativeDataCallout>
|
|
225
|
+
</NarrativeSection>
|
|
226
|
+
|
|
227
|
+
<NarrativeDivider />
|
|
228
|
+
|
|
229
|
+
{/* Social media cards — a row of 3 sample posts -------------------- */}
|
|
230
|
+
<NarrativeSection sectionTitle="From the community">
|
|
231
|
+
<Grid columns={{ sm: 1, md: 2, lg: 3 }} gap={400}>
|
|
232
|
+
<NarrativeSocialMediaCard
|
|
233
|
+
avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=Felix"
|
|
234
|
+
avatarAlt="Sprout Social avatar"
|
|
235
|
+
displayName="Sprout Social"
|
|
236
|
+
socialIcon={<PartnerLogo partnerName="twitter" size="small" />}
|
|
237
|
+
text="Just launched our new product! Check it out and let us know what you think."
|
|
238
|
+
meta={[
|
|
239
|
+
{
|
|
240
|
+
icon: <Icon name="reply-outline" />,
|
|
241
|
+
value: 12,
|
|
242
|
+
label: "Replies",
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
icon: <Icon name="heart-outline" />,
|
|
246
|
+
value: 128,
|
|
247
|
+
label: "Likes",
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
icon: <Icon name="repost-outline" />,
|
|
251
|
+
value: 42,
|
|
252
|
+
label: "Reposts",
|
|
253
|
+
},
|
|
254
|
+
]}
|
|
255
|
+
/>
|
|
256
|
+
<NarrativeSocialMediaCard
|
|
257
|
+
avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=Jordan"
|
|
258
|
+
avatarAlt="Marketing Team avatar"
|
|
259
|
+
displayName="Marketing Team"
|
|
260
|
+
socialIcon={<PartnerLogo partnerName="linkedin" size="small" />}
|
|
261
|
+
text="Our most viral post ever! Thanks for all the engagement. The community response has been incredible and we're excited to keep the momentum going."
|
|
262
|
+
meta={[
|
|
263
|
+
{
|
|
264
|
+
icon: <Icon name="reply-outline" />,
|
|
265
|
+
value: 45,
|
|
266
|
+
label: "Comments",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
icon: <Icon name="heart-outline" />,
|
|
270
|
+
value: 892,
|
|
271
|
+
label: "Likes",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
icon: <Icon name="repost-outline" />,
|
|
275
|
+
value: 156,
|
|
276
|
+
label: "Shares",
|
|
277
|
+
},
|
|
278
|
+
]}
|
|
279
|
+
/>
|
|
280
|
+
<NarrativeSocialMediaCard
|
|
281
|
+
avatar="https://api.dicebear.com/7.x/avataaars/svg?seed=Alex"
|
|
282
|
+
avatarAlt="Brand Studio avatar"
|
|
283
|
+
displayName="Brand Studio"
|
|
284
|
+
socialIcon={
|
|
285
|
+
<PartnerLogo partnerName="instagram" size="small" />
|
|
286
|
+
}
|
|
287
|
+
text="Behind the scenes of today's campaign launch. Swipe to see the creative process!"
|
|
288
|
+
meta={[
|
|
289
|
+
{
|
|
290
|
+
icon: <Icon name="reply-outline" />,
|
|
291
|
+
value: 89,
|
|
292
|
+
label: "Comments",
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
icon: <Icon name="heart-outline" />,
|
|
296
|
+
value: 1240,
|
|
297
|
+
label: "Likes",
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
icon: <Icon name="repost-outline" />,
|
|
301
|
+
value: 203,
|
|
302
|
+
label: "Shares",
|
|
303
|
+
},
|
|
304
|
+
]}
|
|
305
|
+
/>
|
|
306
|
+
</Grid>
|
|
307
|
+
</NarrativeSection>
|
|
289
308
|
</Grid>
|
|
290
309
|
</NarrativeContainer>
|
|
291
310
|
|
package/src/index.ts
CHANGED
|
@@ -61,4 +61,10 @@ export {
|
|
|
61
61
|
type TypeNarrativeAttributionProps,
|
|
62
62
|
} from "./NarrativeAttribution";
|
|
63
63
|
|
|
64
|
+
export {
|
|
65
|
+
NarrativeSection,
|
|
66
|
+
type TypeNarrativeSectionProps,
|
|
67
|
+
type TypeNarrativeSectionHeadingLevel,
|
|
68
|
+
} from "./NarrativeSection";
|
|
69
|
+
|
|
64
70
|
export type { TypeNarrativeTone } from "./_internal/types";
|
package/src/metric-highlight.css
CHANGED
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
.seeds-metric-highlight {
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
display: flex;
|
|
20
|
+
/* Wrap the fixed-width chart onto its own line when the metric block + chart
|
|
21
|
+
can't sit side by side (narrow cards / mobile). The metric block claims its
|
|
22
|
+
min-content width below, so a cramped row drops the chart down rather than
|
|
23
|
+
overflowing the card and getting clipped by the container. */
|
|
24
|
+
flex-wrap: wrap;
|
|
20
25
|
align-items: flex-start;
|
|
21
26
|
gap: var(--space-350); /* 12px */
|
|
22
27
|
border-radius: var(--radius-800); /* 12px */
|
|
@@ -43,8 +48,11 @@
|
|
|
43
48
|
flex-direction: column;
|
|
44
49
|
align-items: flex-start;
|
|
45
50
|
gap: var(--space-200); /* 4px */
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
/* Grow to fill the row, but never shrink below the metric's own content
|
|
52
|
+
(the nowrap value + trend pill). That min-content floor is what forces the
|
|
53
|
+
chart to wrap below on narrow cards instead of the row overflowing. */
|
|
54
|
+
flex: 1 1 auto;
|
|
55
|
+
min-width: min-content;
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
.seeds-metric-highlight-vertical .seeds-metric-highlight-metric {
|
|
@@ -76,6 +84,7 @@
|
|
|
76
84
|
|
|
77
85
|
.seeds-metric-highlight-value-row {
|
|
78
86
|
display: flex;
|
|
87
|
+
flex-wrap: wrap; /* trend pill drops under the value on very narrow cards */
|
|
79
88
|
align-items: center;
|
|
80
89
|
gap: var(--space-300); /* 8px */
|
|
81
90
|
}
|
|
@@ -25,6 +25,24 @@
|
|
|
25
25
|
font-family: var(--font-family);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/* Grid and flex items default to `min-width: auto`, so they never shrink below
|
|
29
|
+
their own min-content. A wide row of widgets (a metric grid, a card grid) then
|
|
30
|
+
forces its column wider than the padded surface — and since the container clips
|
|
31
|
+
with overflow:hidden, the excess is cut off at the edge, eating the right-hand
|
|
32
|
+
padding, and the whole layout can't reflow down to mobile widths. Letting the
|
|
33
|
+
container and its layout descendants shrink to zero lets the grids collapse to
|
|
34
|
+
their fair 1fr share and reflow within the padding, so the padding stays
|
|
35
|
+
consistent at every size.
|
|
36
|
+
|
|
37
|
+
Wrapped in :where() so the whole rule carries ZERO specificity — it is only a
|
|
38
|
+
default. Any component that needs a real floor (e.g. the data callout's 270px
|
|
39
|
+
donut slot) sets its own min-width via a plain class and always wins, instead
|
|
40
|
+
of racing this rule on source order. */
|
|
41
|
+
:where(.seeds-narrative-container),
|
|
42
|
+
:where(.seeds-narrative-container *) {
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
28
46
|
/* Decorative inner gradient border anchored to the top-left corner.
|
|
29
47
|
A masked ::before so the gradient renders as a uniform-width ring that follows
|
|
30
48
|
border-radius and never tints the content. The radial ellipse fades to
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seeds NarrativeSection component classes.
|
|
3
|
+
* Use these instead of writing out individual Tailwind utility classes.
|
|
4
|
+
*
|
|
5
|
+
* Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
|
|
6
|
+
* CSS variable definitions and dark mode support.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <section class="seeds-narrative-section">
|
|
10
|
+
* <h2 class="seeds-narrative-section-title">What's Happening</h2>
|
|
11
|
+
* <div class="seeds-narrative-section-content">...</div>
|
|
12
|
+
* </section>
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
@layer components {
|
|
16
|
+
|
|
17
|
+
/* The wrapper stacks the title above the content with a small gap. It carries
|
|
18
|
+
no surface of its own — it's meant to sit inside a NarrativeContainer. */
|
|
19
|
+
.seeds-narrative-section {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: var(--space-400); /* 16px — title to content */
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* The content slot stacks the section's widgets with the same 32px rhythm a
|
|
26
|
+
single-column grid (gap={500}) would give them, so multiple primitives inside
|
|
27
|
+
one section are spaced exactly as they are between sections. */
|
|
28
|
+
.seeds-narrative-section-content {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: var(--space-500); /* 32px — between widgets */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* The section title: bold 14px/24px in the headline color token (#273333,
|
|
35
|
+
which also tracks dark mode). Matches the summary-label recipe used across
|
|
36
|
+
the kit. The heading element ships with user-agent margins, so reset them. */
|
|
37
|
+
.seeds-narrative-section-title {
|
|
38
|
+
margin: 0;
|
|
39
|
+
font-family: var(--font-family);
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
line-height: 24px;
|
|
42
|
+
font-weight: var(--font-weight-bold);
|
|
43
|
+
color: var(--color-text-headline); /* #273333 */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
@layer components {
|
|
17
17
|
|
|
18
18
|
/* Main card container — gray background with rounded corners and padding.
|
|
19
|
-
Uses Seeds tokens for spacing, colors, and radius to match the design system.
|
|
19
|
+
Uses Seeds tokens for spacing, colors, and radius to match the design system.
|
|
20
|
+
Fills the width it is given (e.g. a grid column) and stretches its content to
|
|
21
|
+
match, mirroring the horizontal NarrativeOrderedList — so a row of cards grows
|
|
22
|
+
and resizes together instead of being pinned to a fixed 320px. */
|
|
20
23
|
.seeds-narrative-social-media-card {
|
|
21
24
|
box-sizing: border-box;
|
|
22
25
|
display: flex;
|
|
23
26
|
flex-direction: column;
|
|
24
|
-
align-items:
|
|
25
|
-
|
|
27
|
+
align-items: stretch;
|
|
28
|
+
width: 100%;
|
|
26
29
|
padding: var(--space-450); /* 24px */
|
|
27
30
|
border-radius: var(--radius-500); /* 6px */
|
|
28
31
|
background-color: var(--color-app-bg-base);
|