@sproutsocial/seeds-react-narrative-kit 0.1.0 → 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 +11 -11
- package/CHANGELOG.md +28 -0
- package/dist/esm/index.js +324 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/eyebrow-token.css +37 -0
- package/dist/index.d.mts +304 -1
- package/dist/index.d.ts +304 -1
- package/dist/index.js +333 -3
- package/dist/index.js.map +1 -1
- package/dist/metric-highlight.css +168 -0
- package/dist/narrative-container.css +1 -1
- package/dist/narrative-divider.css +27 -0
- package/dist/narrative-headline.css +132 -0
- package/dist/narrative-summary.css +126 -0
- package/dist/pull-quote.css +89 -0
- package/package.json +13 -3
- package/src/EyebrowToken/EyebrowToken.stories.tsx +25 -0
- package/src/EyebrowToken/EyebrowToken.tsx +25 -0
- package/src/EyebrowToken/EyebrowTokenTypes.ts +7 -0
- package/src/EyebrowToken/__tests__/EyebrowToken.test.tsx +35 -0
- package/src/EyebrowToken/index.ts +2 -0
- package/src/MetricHighlight/MetricHighlight.stories.tsx +110 -0
- package/src/MetricHighlight/MetricHighlight.tsx +116 -0
- package/src/MetricHighlight/MetricHighlightTypes.ts +58 -0
- package/src/MetricHighlight/__tests__/MetricHighlight.test.tsx +116 -0
- package/src/MetricHighlight/index.ts +5 -0
- package/src/NarrativeContainer/NarrativeContainer.stories.tsx +3 -3
- package/src/NarrativeContainer/NarrativeContainer.tsx +1 -23
- package/src/NarrativeDivider/NarrativeDivider.stories.tsx +33 -0
- package/src/NarrativeDivider/NarrativeDivider.tsx +30 -0
- package/src/NarrativeDivider/NarrativeDividerTypes.ts +4 -0
- package/src/NarrativeDivider/__tests__/NarrativeDivider.test.tsx +35 -0
- package/src/NarrativeDivider/index.ts +2 -0
- package/src/NarrativeHeadline/NarrativeHeadline.stories.tsx +68 -0
- package/src/NarrativeHeadline/NarrativeHeadline.tsx +45 -0
- package/src/NarrativeHeadline/NarrativeHeadlineHighlight.tsx +31 -0
- package/src/NarrativeHeadline/NarrativeHeadlineRoll.tsx +103 -0
- package/src/NarrativeHeadline/NarrativeHeadlineTypes.ts +63 -0
- package/src/NarrativeHeadline/__tests__/NarrativeHeadline.test.tsx +133 -0
- package/src/NarrativeHeadline/index.ts +10 -0
- package/src/NarrativeSummary/NarrativeSummary.stories.tsx +79 -0
- package/src/NarrativeSummary/NarrativeSummary.tsx +98 -0
- package/src/NarrativeSummary/NarrativeSummaryTypes.ts +59 -0
- package/src/NarrativeSummary/__tests__/NarrativeSummary.test.tsx +99 -0
- package/src/NarrativeSummary/index.ts +5 -0
- package/src/Playground/Playground.stories.tsx +163 -0
- package/src/PullQuote/PullQuote.stories.tsx +45 -0
- package/src/PullQuote/PullQuote.tsx +42 -0
- package/src/PullQuote/PullQuoteTypes.ts +18 -0
- package/src/PullQuote/__tests__/PullQuote.test.tsx +48 -0
- package/src/PullQuote/index.ts +2 -0
- package/src/_internal/cn.ts +22 -0
- package/src/eyebrow-token.css +37 -0
- package/src/index.ts +31 -0
- package/src/metric-highlight.css +168 -0
- package/src/narrative-container.css +1 -1
- package/src/narrative-divider.css +27 -0
- package/src/narrative-headline.css +132 -0
- package/src/narrative-summary.css +126 -0
- package/src/pull-quote.css +89 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
yarn run v1.22.22
|
|
2
|
-
$ tsup --dts && cp src/narrative-container.css dist/narrative-container.css
|
|
2
|
+
$ tsup --dts && cp src/narrative-container.css dist/narrative-container.css && cp src/narrative-headline.css dist/narrative-headline.css && cp src/pull-quote.css dist/pull-quote.css && cp src/metric-highlight.css dist/metric-highlight.css && cp src/eyebrow-token.css dist/eyebrow-token.css && cp src/narrative-summary.css dist/narrative-summary.css && cp src/narrative-divider.css dist/narrative-divider.css
|
|
3
3
|
[34mCLI[39m Building entry: src/index.ts
|
|
4
4
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
5
5
|
[34mCLI[39m tsup v8.5.0
|
|
@@ -8,14 +8,14 @@ $ tsup --dts && cp src/narrative-container.css dist/narrative-container.css
|
|
|
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[32m14.66 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m25.00 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 17ms
|
|
14
|
+
[32mESM[39m [1mdist/esm/index.js [22m[32m11.87 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/esm/index.js.map [22m[32m24.02 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 17ms
|
|
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 1483ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m14.44 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m14.44 KB[39m
|
|
21
|
+
Done in 2.19s.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @sproutsocial/seeds-react-narrative-kit
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1aca1d1: `MetricHighlight` now takes a `sparkline` render slot instead of owning the
|
|
8
|
+
chart itself. Pass any node (e.g. a `<SparklineChart />` from
|
|
9
|
+
`@sproutsocial/seeds-react-data-viz/sparkline`) to render it beside/below the
|
|
10
|
+
metric; omit it to render the metric on its own. This replaces the previous
|
|
11
|
+
`data` and `chart` props.
|
|
12
|
+
- 0b37765: Add the `NarrativeDivider` primitive to `seeds-react-narrative-kit` — a full-width,
|
|
13
|
+
1px horizontal rule for separating sections within a narrative brief, using the
|
|
14
|
+
`container.border` token (dark-mode aware). Exported through `@sproutsocial/racine`.
|
|
15
|
+
- 0b37765: Add the `NarrativeSummary` primitive to `seeds-react-narrative-kit` — a composed
|
|
16
|
+
block pairing a lead column (eyebrow + headline + optional action) with a Summary
|
|
17
|
+
section and a Key themes list, laid out as a container-query-driven grid with
|
|
18
|
+
`three-column` and `two-column` (1/3 | 2/3) arrangements. Also adds a `size` prop
|
|
19
|
+
(`"default" | "small"`) to `NarrativeHeadline`. Exported through
|
|
20
|
+
`@sproutsocial/racine`.
|
|
21
|
+
|
|
22
|
+
## 0.2.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- 7ce52ce: Add narrative primitives to `seeds-react-narrative-kit`: `MetricHighlight` for
|
|
27
|
+
emphasizing key figures, `NarrativeHeadline` (with highlight and roll variants) for
|
|
28
|
+
section headers, and `PullQuote` for callout quotations. All are exported through
|
|
29
|
+
`@sproutsocial/racine`.
|
|
30
|
+
|
|
3
31
|
## 0.1.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/NarrativeContainer/NarrativeContainer.tsx
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
// src/_internal/cn.ts
|
|
4
5
|
function cn(...inputs) {
|
|
5
6
|
const classes = [];
|
|
6
7
|
for (const input of inputs) {
|
|
@@ -17,6 +18,9 @@ function cn(...inputs) {
|
|
|
17
18
|
}
|
|
18
19
|
return classes.join(" ");
|
|
19
20
|
}
|
|
21
|
+
|
|
22
|
+
// src/NarrativeContainer/NarrativeContainer.tsx
|
|
23
|
+
import { jsx } from "react/jsx-runtime";
|
|
20
24
|
var NarrativeContainer = React.forwardRef(({ children, accent = true, className, ...props }, ref) => {
|
|
21
25
|
return /* @__PURE__ */ jsx(
|
|
22
26
|
"div",
|
|
@@ -34,7 +38,325 @@ var NarrativeContainer = React.forwardRef(({ children, accent = true, className,
|
|
|
34
38
|
});
|
|
35
39
|
NarrativeContainer.displayName = "NarrativeContainer";
|
|
36
40
|
var NarrativeContainer_default = NarrativeContainer;
|
|
41
|
+
|
|
42
|
+
// src/NarrativeHeadline/NarrativeHeadline.tsx
|
|
43
|
+
import * as React2 from "react";
|
|
44
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
45
|
+
var NarrativeHeadline = React2.forwardRef(
|
|
46
|
+
({ children, headingLevel = 2, size = "default", className, ...props }, ref) => {
|
|
47
|
+
const Heading = `h${headingLevel}`;
|
|
48
|
+
return /* @__PURE__ */ jsx2(
|
|
49
|
+
Heading,
|
|
50
|
+
{
|
|
51
|
+
ref,
|
|
52
|
+
className: cn(
|
|
53
|
+
"seeds-narrative-headline",
|
|
54
|
+
{ "seeds-narrative-headline-small": size === "small" },
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
...props,
|
|
58
|
+
children
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
NarrativeHeadline.displayName = "NarrativeHeadline";
|
|
64
|
+
var NarrativeHeadline_default = NarrativeHeadline;
|
|
65
|
+
|
|
66
|
+
// src/NarrativeHeadline/NarrativeHeadlineHighlight.tsx
|
|
67
|
+
import * as React3 from "react";
|
|
68
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
69
|
+
var NarrativeHeadlineHighlight = React3.forwardRef(({ children, className, ...props }, ref) => {
|
|
70
|
+
return /* @__PURE__ */ jsx3(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
ref,
|
|
74
|
+
className: cn("seeds-narrative-headline-highlight", className),
|
|
75
|
+
...props,
|
|
76
|
+
children
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
NarrativeHeadlineHighlight.displayName = "NarrativeHeadlineHighlight";
|
|
81
|
+
var NarrativeHeadlineHighlight_default = NarrativeHeadlineHighlight;
|
|
82
|
+
|
|
83
|
+
// src/NarrativeHeadline/NarrativeHeadlineRoll.tsx
|
|
84
|
+
import * as React4 from "react";
|
|
85
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
86
|
+
var NarrativeHeadlineRoll = React4.forwardRef(
|
|
87
|
+
({
|
|
88
|
+
words,
|
|
89
|
+
intervalMs = 2200,
|
|
90
|
+
transitionMs = 500,
|
|
91
|
+
direction = "up",
|
|
92
|
+
gradient = true,
|
|
93
|
+
className,
|
|
94
|
+
style,
|
|
95
|
+
...rest
|
|
96
|
+
}, ref) => {
|
|
97
|
+
const [i, setI] = React4.useState(0);
|
|
98
|
+
React4.useEffect(() => {
|
|
99
|
+
if (words.length <= 1) return;
|
|
100
|
+
const reduced = typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
101
|
+
if (reduced) return;
|
|
102
|
+
const t = setInterval(
|
|
103
|
+
() => setI((j) => (j + 1) % words.length),
|
|
104
|
+
intervalMs
|
|
105
|
+
);
|
|
106
|
+
return () => clearInterval(t);
|
|
107
|
+
}, [intervalMs, words.length]);
|
|
108
|
+
const merged = {
|
|
109
|
+
...style,
|
|
110
|
+
// Consumed by the transition timing in narrative-headline.css.
|
|
111
|
+
["--seeds-narrative-headline-roll-ms"]: `${transitionMs}ms`
|
|
112
|
+
};
|
|
113
|
+
const prev = words.length ? (i - 1 + words.length) % words.length : 0;
|
|
114
|
+
return /* @__PURE__ */ jsxs(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
ref,
|
|
118
|
+
className: cn(
|
|
119
|
+
"seeds-narrative-headline-roll",
|
|
120
|
+
{ "seeds-narrative-headline-roll-down": direction === "down" },
|
|
121
|
+
{ "seeds-narrative-headline-roll-gradient": gradient },
|
|
122
|
+
className
|
|
123
|
+
),
|
|
124
|
+
style: merged,
|
|
125
|
+
...rest,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsx4(
|
|
128
|
+
"span",
|
|
129
|
+
{
|
|
130
|
+
className: "seeds-narrative-headline-roll-sizer",
|
|
131
|
+
"aria-hidden": "true",
|
|
132
|
+
children: words[i]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
words.map((w, idx) => /* @__PURE__ */ jsx4(
|
|
136
|
+
"span",
|
|
137
|
+
{
|
|
138
|
+
className: cn("seeds-narrative-headline-roll-word", {
|
|
139
|
+
"seeds-narrative-headline-roll-word-active": idx === i,
|
|
140
|
+
"seeds-narrative-headline-roll-word-past": idx === prev && i !== prev
|
|
141
|
+
}),
|
|
142
|
+
"aria-hidden": idx === i ? void 0 : "true",
|
|
143
|
+
children: w
|
|
144
|
+
},
|
|
145
|
+
idx
|
|
146
|
+
))
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
NarrativeHeadlineRoll.displayName = "NarrativeHeadlineRoll";
|
|
153
|
+
var NarrativeHeadlineRoll_default = NarrativeHeadlineRoll;
|
|
154
|
+
|
|
155
|
+
// src/PullQuote/PullQuote.tsx
|
|
156
|
+
import * as React5 from "react";
|
|
157
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
158
|
+
var PullQuote = React5.forwardRef(
|
|
159
|
+
({ quote, attribution, appearance = "subtle", className, ...props }, ref) => {
|
|
160
|
+
return /* @__PURE__ */ jsx5(
|
|
161
|
+
"figure",
|
|
162
|
+
{
|
|
163
|
+
ref,
|
|
164
|
+
className: cn(
|
|
165
|
+
"seeds-pull-quote",
|
|
166
|
+
{ "seeds-pull-quote-vivid": appearance === "vivid" },
|
|
167
|
+
className
|
|
168
|
+
),
|
|
169
|
+
...props,
|
|
170
|
+
children: /* @__PURE__ */ jsxs2("div", { className: "seeds-pull-quote-bar", children: [
|
|
171
|
+
/* @__PURE__ */ jsx5("blockquote", { className: "seeds-pull-quote-text", children: quote }),
|
|
172
|
+
attribution != null && /* @__PURE__ */ jsx5("figcaption", { className: "seeds-pull-quote-attribution", children: attribution })
|
|
173
|
+
] })
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
PullQuote.displayName = "PullQuote";
|
|
179
|
+
var PullQuote_default = PullQuote;
|
|
180
|
+
|
|
181
|
+
// src/EyebrowToken/EyebrowToken.tsx
|
|
182
|
+
import * as React6 from "react";
|
|
183
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
184
|
+
var EyebrowToken = React6.forwardRef(
|
|
185
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx6("span", { ref, className: cn("seeds-eyebrow-token", className), ...props, children })
|
|
186
|
+
);
|
|
187
|
+
EyebrowToken.displayName = "EyebrowToken";
|
|
188
|
+
var EyebrowToken_default = EyebrowToken;
|
|
189
|
+
|
|
190
|
+
// src/NarrativeDivider/NarrativeDivider.tsx
|
|
191
|
+
import * as React7 from "react";
|
|
192
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
193
|
+
var NarrativeDivider = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
194
|
+
"hr",
|
|
195
|
+
{
|
|
196
|
+
ref,
|
|
197
|
+
className: cn("seeds-narrative-divider", className),
|
|
198
|
+
...props
|
|
199
|
+
}
|
|
200
|
+
));
|
|
201
|
+
NarrativeDivider.displayName = "NarrativeDivider";
|
|
202
|
+
var NarrativeDivider_default = NarrativeDivider;
|
|
203
|
+
|
|
204
|
+
// src/MetricHighlight/MetricHighlight.tsx
|
|
205
|
+
import * as React8 from "react";
|
|
206
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
207
|
+
var TrendArrow = ({ direction }) => /* @__PURE__ */ jsx8(
|
|
208
|
+
"svg",
|
|
209
|
+
{
|
|
210
|
+
className: "seeds-metric-highlight-trend-arrow",
|
|
211
|
+
viewBox: "0 0 16 16",
|
|
212
|
+
"aria-hidden": true,
|
|
213
|
+
focusable: false,
|
|
214
|
+
children: direction === "up" ? /* @__PURE__ */ jsx8(
|
|
215
|
+
"path",
|
|
216
|
+
{
|
|
217
|
+
d: "M4.5 11.5 11.5 4.5M11.5 4.5H5.5M11.5 4.5V10.5",
|
|
218
|
+
fill: "none",
|
|
219
|
+
strokeLinecap: "round",
|
|
220
|
+
strokeLinejoin: "round"
|
|
221
|
+
}
|
|
222
|
+
) : /* @__PURE__ */ jsx8(
|
|
223
|
+
"path",
|
|
224
|
+
{
|
|
225
|
+
d: "M4.5 4.5 11.5 11.5M11.5 11.5H5.5M11.5 11.5V5.5",
|
|
226
|
+
fill: "none",
|
|
227
|
+
strokeLinecap: "round",
|
|
228
|
+
strokeLinejoin: "round"
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
var TrendBadge = ({
|
|
234
|
+
direction = "up",
|
|
235
|
+
value,
|
|
236
|
+
...rest
|
|
237
|
+
}) => /* @__PURE__ */ jsxs3(
|
|
238
|
+
"span",
|
|
239
|
+
{
|
|
240
|
+
className: cn("seeds-metric-highlight-trend", {
|
|
241
|
+
"seeds-metric-highlight-trend-down": direction === "down"
|
|
242
|
+
}),
|
|
243
|
+
...rest,
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ jsx8(TrendArrow, { direction }),
|
|
246
|
+
value != null && /* @__PURE__ */ jsx8("span", { className: "seeds-metric-highlight-trend-value", children: value })
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
var MetricHighlight = React8.forwardRef(
|
|
251
|
+
({
|
|
252
|
+
label,
|
|
253
|
+
value,
|
|
254
|
+
trend,
|
|
255
|
+
sparkline,
|
|
256
|
+
appearance = "horizontal",
|
|
257
|
+
size = "default",
|
|
258
|
+
container = true,
|
|
259
|
+
className,
|
|
260
|
+
...props
|
|
261
|
+
}, ref) => {
|
|
262
|
+
return /* @__PURE__ */ jsxs3(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
ref,
|
|
266
|
+
className: cn(
|
|
267
|
+
"seeds-metric-highlight",
|
|
268
|
+
{
|
|
269
|
+
"seeds-metric-highlight-vertical": appearance === "vertical",
|
|
270
|
+
"seeds-metric-highlight-small": size === "small",
|
|
271
|
+
"seeds-metric-highlight-bare": !container
|
|
272
|
+
},
|
|
273
|
+
className
|
|
274
|
+
),
|
|
275
|
+
...props,
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ jsxs3("div", { className: "seeds-metric-highlight-metric", children: [
|
|
278
|
+
/* @__PURE__ */ jsx8("p", { className: "seeds-metric-highlight-label", children: label }),
|
|
279
|
+
/* @__PURE__ */ jsxs3("div", { className: "seeds-metric-highlight-value-row", children: [
|
|
280
|
+
/* @__PURE__ */ jsx8("p", { className: "seeds-metric-highlight-value", children: value }),
|
|
281
|
+
trend != null && /* @__PURE__ */ jsx8(TrendBadge, { ...trend })
|
|
282
|
+
] })
|
|
283
|
+
] }),
|
|
284
|
+
sparkline != null && // Layout-only slot (bounded dimensions per horizontal/vertical/small)
|
|
285
|
+
// for a consumer-supplied chart. It controls its own look; the slot
|
|
286
|
+
// only sizes and centers it.
|
|
287
|
+
/* @__PURE__ */ jsx8("div", { className: "seeds-metric-highlight-chart", children: sparkline })
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
MetricHighlight.displayName = "MetricHighlight";
|
|
294
|
+
var MetricHighlight_default = MetricHighlight;
|
|
295
|
+
|
|
296
|
+
// src/NarrativeSummary/NarrativeSummary.tsx
|
|
297
|
+
import * as React9 from "react";
|
|
298
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
299
|
+
var NarrativeSummary = React9.forwardRef(
|
|
300
|
+
({
|
|
301
|
+
eyebrow,
|
|
302
|
+
headline,
|
|
303
|
+
headingLevel = 2,
|
|
304
|
+
action,
|
|
305
|
+
summary,
|
|
306
|
+
summaryLabel = "Summary",
|
|
307
|
+
keyThemes,
|
|
308
|
+
keyThemesLabel = "Key themes",
|
|
309
|
+
layout = "three-column",
|
|
310
|
+
className,
|
|
311
|
+
...props
|
|
312
|
+
}, ref) => {
|
|
313
|
+
const hasKeyThemes = keyThemes != null && keyThemes.length > 0;
|
|
314
|
+
return /* @__PURE__ */ jsx9(
|
|
315
|
+
"div",
|
|
316
|
+
{
|
|
317
|
+
ref,
|
|
318
|
+
className: cn("seeds-narrative-summary", className),
|
|
319
|
+
...props,
|
|
320
|
+
children: /* @__PURE__ */ jsxs4(
|
|
321
|
+
"div",
|
|
322
|
+
{
|
|
323
|
+
className: cn("seeds-narrative-summary-grid", {
|
|
324
|
+
"seeds-narrative-summary-two-column": layout === "two-column"
|
|
325
|
+
}),
|
|
326
|
+
children: [
|
|
327
|
+
/* @__PURE__ */ jsxs4("div", { className: "seeds-narrative-summary-lead", children: [
|
|
328
|
+
eyebrow != null && /* @__PURE__ */ jsx9(EyebrowToken_default, { children: eyebrow }),
|
|
329
|
+
/* @__PURE__ */ jsx9("div", { className: "seeds-narrative-summary-headline", children: /* @__PURE__ */ jsx9(NarrativeHeadline_default, { size: "small", headingLevel, children: headline }) }),
|
|
330
|
+
action != null && /* @__PURE__ */ jsx9("div", { className: "seeds-narrative-summary-action", children: action })
|
|
331
|
+
] }),
|
|
332
|
+
/* @__PURE__ */ jsxs4("div", { className: "seeds-narrative-summary-content", children: [
|
|
333
|
+
summary != null && /* @__PURE__ */ jsxs4("section", { className: "seeds-narrative-summary-section", children: [
|
|
334
|
+
/* @__PURE__ */ jsx9("p", { className: "seeds-narrative-summary-label", children: summaryLabel }),
|
|
335
|
+
/* @__PURE__ */ jsx9("p", { className: "seeds-narrative-summary-text", children: summary })
|
|
336
|
+
] }),
|
|
337
|
+
hasKeyThemes && /* @__PURE__ */ jsxs4("section", { className: "seeds-narrative-summary-section", children: [
|
|
338
|
+
/* @__PURE__ */ jsx9("p", { className: "seeds-narrative-summary-label", children: keyThemesLabel }),
|
|
339
|
+
/* @__PURE__ */ jsx9("ul", { className: "seeds-narrative-summary-list", children: keyThemes.map((theme, i) => /* @__PURE__ */ jsx9("li", { children: theme }, i)) })
|
|
340
|
+
] })
|
|
341
|
+
] })
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
NarrativeSummary.displayName = "NarrativeSummary";
|
|
350
|
+
var NarrativeSummary_default = NarrativeSummary;
|
|
37
351
|
export {
|
|
38
|
-
|
|
352
|
+
EyebrowToken_default as EyebrowToken,
|
|
353
|
+
MetricHighlight_default as MetricHighlight,
|
|
354
|
+
NarrativeContainer_default as NarrativeContainer,
|
|
355
|
+
NarrativeDivider_default as NarrativeDivider,
|
|
356
|
+
NarrativeHeadline_default as NarrativeHeadline,
|
|
357
|
+
NarrativeHeadlineHighlight_default as NarrativeHeadlineHighlight,
|
|
358
|
+
NarrativeHeadlineRoll_default as NarrativeHeadlineRoll,
|
|
359
|
+
NarrativeSummary_default as NarrativeSummary,
|
|
360
|
+
PullQuote_default as PullQuote
|
|
39
361
|
};
|
|
40
362
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/NarrativeContainer/NarrativeContainer.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { TypeNarrativeContainerProps } from \"./NarrativeContainerTypes\";\n\n/** Merge class names, supporting `{ \"class\": boolean }` toggles. */\nfunction cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n\n/**\n * NarrativeContainer — the foundational surface that narrative primitives are\n * composed inside. A padded, rounded, elevated card with a content slot and an\n * optional decorative gradient accent that wraps the top-left corner.\n *\n * Styled via `narrative-container.css` (Seeds CSS custom properties). Consumers\n * import the classes through `@sproutsocial/racine/css/components`. Surface\n * overrides are done with standard `className` / `style`.\n */\nconst NarrativeContainer = React.forwardRef<\n HTMLDivElement,\n TypeNarrativeContainerProps\n>(({ children, accent = true, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"seeds-narrative-container\",\n { \"seeds-narrative-container-accent\": accent },\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n});\n\nNarrativeContainer.displayName = \"NarrativeContainer\";\n\nexport default NarrativeContainer;\n"],"mappings":";AAAA,YAAY,WAAW;AAwCnB;AApCJ,SAAS,MACJ,QACK;AACR,QAAM,UAAoB,CAAC;AAE3B,aAAW,SAAS,QAAQ;AAC1B,QAAI,CAAC,MAAO;AAEZ,QAAI,OAAO,UAAU,UAAU;AAC7B,cAAQ,KAAK,KAAK;AAAA,IACpB,WAAW,OAAO,UAAU,UAAU;AACpC,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,YAAI,OAAO;AACT,kBAAQ,KAAK,GAAG;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,QAAQ,KAAK,GAAG;AACzB;AAWA,IAAM,qBAA2B,iBAG/B,CAAC,EAAE,UAAU,SAAS,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,EAAE,oCAAoC,OAAO;AAAA,QAC7C;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,mBAAmB,cAAc;AAEjC,IAAO,6BAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/NarrativeContainer/NarrativeContainer.tsx","../../src/_internal/cn.ts","../../src/NarrativeHeadline/NarrativeHeadline.tsx","../../src/NarrativeHeadline/NarrativeHeadlineHighlight.tsx","../../src/NarrativeHeadline/NarrativeHeadlineRoll.tsx","../../src/PullQuote/PullQuote.tsx","../../src/EyebrowToken/EyebrowToken.tsx","../../src/NarrativeDivider/NarrativeDivider.tsx","../../src/MetricHighlight/MetricHighlight.tsx","../../src/NarrativeSummary/NarrativeSummary.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypeNarrativeContainerProps } from \"./NarrativeContainerTypes\";\n\n/**\n * NarrativeContainer — the foundational surface that narrative primitives are\n * composed inside. A padded, rounded, elevated card with a content slot and an\n * optional decorative gradient accent that wraps the top-left corner.\n *\n * Styled via `narrative-container.css` (Seeds CSS custom properties). Consumers\n * import the classes through `@sproutsocial/racine/css/components`. Surface\n * overrides are done with standard `className` / `style`.\n */\nconst NarrativeContainer = React.forwardRef<\n HTMLDivElement,\n TypeNarrativeContainerProps\n>(({ children, accent = true, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"seeds-narrative-container\",\n { \"seeds-narrative-container-accent\": accent },\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n});\n\nNarrativeContainer.displayName = \"NarrativeContainer\";\n\nexport default NarrativeContainer;\n","/** Merge class names, supporting `{ \"class\": boolean }` toggles. */\nexport function cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypeNarrativeHeadlineProps } from \"./NarrativeHeadlineTypes\";\n\n/**\n * NarrativeHeadline — the titling primitive for a narrative block. A single\n * heading element, nothing more: supporting copy and tags/tokens belong to\n * sibling primitives that compose alongside it, not baked into the title.\n *\n * Wrap part of the headline in `<NarrativeHeadlineHighlight>` for a static\n * gradient accent, or `<NarrativeHeadlineRoll>` for the rolling \"roll\" variant.\n *\n * Styled via `narrative-headline.css` (Seeds CSS custom properties). Consumers\n * import the classes through `@sproutsocial/racine/css/components`. Overrides\n * are done with standard `className` / `style`.\n */\nconst NarrativeHeadline = React.forwardRef<\n HTMLHeadingElement,\n TypeNarrativeHeadlineProps\n>(\n (\n { children, headingLevel = 2, size = \"default\", className, ...props },\n ref\n ) => {\n const Heading = `h${headingLevel}` as const;\n\n return (\n <Heading\n ref={ref}\n className={cn(\n \"seeds-narrative-headline\",\n { \"seeds-narrative-headline-small\": size === \"small\" },\n className\n )}\n {...props}\n >\n {children}\n </Heading>\n );\n }\n);\n\nNarrativeHeadline.displayName = \"NarrativeHeadline\";\n\nexport default NarrativeHeadline;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypeNarrativeHeadlineHighlightProps } from \"./NarrativeHeadlineTypes\";\n\n/**\n * NarrativeHeadlineHighlight — paints a span of headline text with the AI\n * brand gradient (the \"highlighted word\" treatment). Drop it inline inside a\n * `<NarrativeHeadline>`:\n *\n * <NarrativeHeadline>\n * Headline with a <NarrativeHeadlineHighlight>highlighted</NarrativeHeadlineHighlight> word\n * </NarrativeHeadline>\n */\nconst NarrativeHeadlineHighlight = React.forwardRef<\n HTMLSpanElement,\n TypeNarrativeHeadlineHighlightProps\n>(({ children, className, ...props }, ref) => {\n return (\n <span\n ref={ref}\n className={cn(\"seeds-narrative-headline-highlight\", className)}\n {...props}\n >\n {children}\n </span>\n );\n});\n\nNarrativeHeadlineHighlight.displayName = \"NarrativeHeadlineHighlight\";\n\nexport default NarrativeHeadlineHighlight;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypeNarrativeHeadlineRollProps } from \"./NarrativeHeadlineTypes\";\n\n/**\n * NarrativeHeadlineRoll — the \"roll\" variant: a vertical word roll for the\n * highlighted slot of a headline. The active word slides into view while the\n * previous one rolls out (no typing). Inspired by the performative-ui WordRoll.\n *\n * <NarrativeHeadline>\n * Built for{\" \"}\n * <NarrativeHeadlineRoll words={[\"marketers\", \"agencies\", \"teams\"]} />\n * </NarrativeHeadline>\n *\n * The container width follows the active word so it sits naturally inline.\n * Gradient-painted by default; honors `prefers-reduced-motion` by holding the\n * first word static.\n */\nconst NarrativeHeadlineRoll = React.forwardRef<\n HTMLSpanElement,\n TypeNarrativeHeadlineRollProps\n>(\n (\n {\n words,\n intervalMs = 2200,\n transitionMs = 500,\n direction = \"up\",\n gradient = true,\n className,\n style,\n ...rest\n },\n ref\n ) => {\n const [i, setI] = React.useState(0);\n\n React.useEffect(() => {\n if (words.length <= 1) return;\n\n // Respect reduced-motion: hold the first word, skip the cycle entirely.\n const reduced =\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n if (reduced) return;\n\n const t = setInterval(\n () => setI((j) => (j + 1) % words.length),\n intervalMs\n );\n return () => clearInterval(t);\n }, [intervalMs, words.length]);\n\n const merged: React.CSSProperties = {\n ...style,\n // Consumed by the transition timing in narrative-headline.css.\n [\"--seeds-narrative-headline-roll-ms\" as string]: `${transitionMs}ms`,\n };\n\n const prev = words.length ? (i - 1 + words.length) % words.length : 0;\n\n return (\n <span\n ref={ref}\n className={cn(\n \"seeds-narrative-headline-roll\",\n { \"seeds-narrative-headline-roll-down\": direction === \"down\" },\n { \"seeds-narrative-headline-roll-gradient\": gradient },\n className\n )}\n style={merged}\n {...rest}\n >\n {/* Sizer keeps the container width matched to the active word — without\n it the absolutely-positioned words would collapse the box. */}\n <span\n className=\"seeds-narrative-headline-roll-sizer\"\n aria-hidden=\"true\"\n >\n {words[i]}\n </span>\n {words.map((w, idx) => (\n <span\n key={idx}\n className={cn(\"seeds-narrative-headline-roll-word\", {\n \"seeds-narrative-headline-roll-word-active\": idx === i,\n \"seeds-narrative-headline-roll-word-past\":\n idx === prev && i !== prev,\n })}\n aria-hidden={idx === i ? undefined : \"true\"}\n >\n {w}\n </span>\n ))}\n </span>\n );\n }\n);\n\nNarrativeHeadlineRoll.displayName = \"NarrativeHeadlineRoll\";\n\nexport default NarrativeHeadlineRoll;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypePullQuoteProps } from \"./PullQuoteTypes\";\n\n/**\n * PullQuote — a narrative primitive that spotlights a quotation on an AI\n * gradient surface. The quote sits behind an accented vertical bar with an\n * optional attribution row (author name, avatar, network).\n *\n * Rendered as semantic `<figure>` / `<blockquote>` / `<figcaption>` markup.\n * Styled via `pull-quote.css` (Seeds CSS custom properties); consumers import\n * the classes through `@sproutsocial/racine/css/components`. Surface overrides\n * are done with standard `className` / `style`.\n */\nconst PullQuote = React.forwardRef<HTMLElement, TypePullQuoteProps>(\n ({ quote, attribution, appearance = \"subtle\", className, ...props }, ref) => {\n return (\n <figure\n ref={ref}\n className={cn(\n \"seeds-pull-quote\",\n { \"seeds-pull-quote-vivid\": appearance === \"vivid\" },\n className\n )}\n {...props}\n >\n <div className=\"seeds-pull-quote-bar\">\n <blockquote className=\"seeds-pull-quote-text\">{quote}</blockquote>\n {attribution != null && (\n <figcaption className=\"seeds-pull-quote-attribution\">\n {attribution}\n </figcaption>\n )}\n </div>\n </figure>\n );\n }\n);\n\nPullQuote.displayName = \"PullQuote\";\n\nexport default PullQuote;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypeEyebrowTokenProps } from \"./EyebrowTokenTypes\";\n\n/**\n * EyebrowToken — a small gray pill that sits above a headline to carry a short\n * bit of context: a date (e.g. \"May 31, 2026\"), category, or kicker.\n *\n * A faithful match of the Figma \"Token / Non Clickable / Default\" design — a\n * solid `#dee1e1` fill with a matching border, 6px radius, and small body text.\n * Styled via `eyebrow-token.css` (Seeds CSS custom properties); consumers import\n * the classes through `@sproutsocial/racine/css/components`. Overrides come via\n * standard `className` / `style`.\n */\nconst EyebrowToken = React.forwardRef<HTMLSpanElement, TypeEyebrowTokenProps>(\n ({ children, className, ...props }, ref) => (\n <span ref={ref} className={cn(\"seeds-eyebrow-token\", className)} {...props}>\n {children}\n </span>\n )\n);\n\nEyebrowToken.displayName = \"EyebrowToken\";\n\nexport default EyebrowToken;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type { TypeNarrativeDividerProps } from \"./NarrativeDividerTypes\";\n\n/**\n * NarrativeDivider — a full-width, 1px horizontal rule that separates sections\n * within a narrative brief (e.g. a row of metrics from the headline/summary\n * block below it).\n *\n * Renders a semantic <hr> stripped of its user-agent margins and borders, then\n * draws a single 1px line with the container-border-base token (#dee1e1, which\n * also tracks dark mode). Styled via narrative-divider.css (Seeds CSS custom\n * properties); consumers import the classes through\n * @sproutsocial/racine/css/components. Overrides come via standard className /\n * style.\n */\nconst NarrativeDivider = React.forwardRef<\n HTMLHRElement,\n TypeNarrativeDividerProps\n>(({ className, ...props }, ref) => (\n <hr\n ref={ref}\n className={cn(\"seeds-narrative-divider\", className)}\n {...props}\n />\n));\n\nNarrativeDivider.displayName = \"NarrativeDivider\";\n\nexport default NarrativeDivider;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport type {\n TypeMetricHighlightProps,\n TypeMetricHighlightTrend,\n} from \"./MetricHighlightTypes\";\n\n/** Directional arrow glyph for the trend badge (decorative; `aria-hidden`). */\nconst TrendArrow = ({ direction }: { direction: \"up\" | \"down\" }) => (\n <svg\n className=\"seeds-metric-highlight-trend-arrow\"\n viewBox=\"0 0 16 16\"\n aria-hidden\n focusable={false}\n >\n {direction === \"up\" ? (\n <path\n d=\"M4.5 11.5 11.5 4.5M11.5 4.5H5.5M11.5 4.5V10.5\"\n fill=\"none\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n ) : (\n <path\n d=\"M4.5 4.5 11.5 11.5M11.5 11.5H5.5M11.5 11.5V5.5\"\n fill=\"none\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n )}\n </svg>\n);\n\nconst TrendBadge = ({\n direction = \"up\",\n value,\n ...rest\n}: TypeMetricHighlightTrend) => (\n <span\n className={cn(\"seeds-metric-highlight-trend\", {\n \"seeds-metric-highlight-trend-down\": direction === \"down\",\n })}\n {...rest}\n >\n <TrendArrow direction={direction} />\n {value != null && (\n <span className=\"seeds-metric-highlight-trend-value\">{value}</span>\n )}\n </span>\n);\n\n/**\n * MetricHighlight — a narrative primitive that spotlights a single metric: a\n * label, a large monospace value, an optional trend badge (a directional arrow\n * plus an optional number such as \"240%\"), and an optional chart supplied via\n * the `sparkline` slot (e.g. a `<SparklineChart />` from\n * `@sproutsocial/seeds-react-data-viz/sparkline`).\n *\n * Styled via `metric-highlight.css` (Seeds CSS custom properties); consumers\n * import the classes through `@sproutsocial/racine/css/components`. Layout flexes\n * across `appearance` (horizontal/vertical) and `size` (default/small); surface\n * overrides are done with standard `className` / `style`.\n */\nconst MetricHighlight = React.forwardRef<\n HTMLDivElement,\n TypeMetricHighlightProps\n>(\n (\n {\n label,\n value,\n trend,\n sparkline,\n appearance = \"horizontal\",\n size = \"default\",\n container = true,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"seeds-metric-highlight\",\n {\n \"seeds-metric-highlight-vertical\": appearance === \"vertical\",\n \"seeds-metric-highlight-small\": size === \"small\",\n \"seeds-metric-highlight-bare\": !container,\n },\n className\n )}\n {...props}\n >\n <div className=\"seeds-metric-highlight-metric\">\n <p className=\"seeds-metric-highlight-label\">{label}</p>\n <div className=\"seeds-metric-highlight-value-row\">\n <p className=\"seeds-metric-highlight-value\">{value}</p>\n {trend != null && <TrendBadge {...trend} />}\n </div>\n </div>\n {sparkline != null && (\n // Layout-only slot (bounded dimensions per horizontal/vertical/small)\n // for a consumer-supplied chart. It controls its own look; the slot\n // only sizes and centers it.\n <div className=\"seeds-metric-highlight-chart\">{sparkline}</div>\n )}\n </div>\n );\n }\n);\n\nMetricHighlight.displayName = \"MetricHighlight\";\n\nexport default MetricHighlight;\n","import * as React from \"react\";\nimport { cn } from \"../_internal/cn\";\nimport EyebrowToken from \"../EyebrowToken/EyebrowToken\";\nimport NarrativeHeadline from \"../NarrativeHeadline/NarrativeHeadline\";\nimport type { TypeNarrativeSummaryProps } from \"./NarrativeSummaryTypes\";\n\n/**\n * NarrativeSummary — a composed narrative block that pairs a lead column\n * (eyebrow + headline + optional action) with a Summary section and a Key\n * themes list.\n *\n * Renders inner content only — it carries no surface, shadow, or accent of its\n * own. Drop it into a `NarrativeContainer` (see the stories / playground).\n *\n * Layout is CSS Grid driven by container queries, so the columns collapse based\n * on the width the component is actually given, not the viewport:\n * - `\"three-column\"` → lead | Summary | Key themes.\n * - `\"two-column\"` → a 1/3 | 2/3 split with Summary and Key themes stacked in\n * the wider column.\n *\n * Styled via `narrative-summary.css` (Seeds CSS custom properties); consumers\n * import the classes through `@sproutsocial/racine/css/components`. Overrides\n * come via standard `className` / `style`.\n */\nconst NarrativeSummary = React.forwardRef<\n HTMLDivElement,\n TypeNarrativeSummaryProps\n>(\n (\n {\n eyebrow,\n headline,\n headingLevel = 2,\n action,\n summary,\n summaryLabel = \"Summary\",\n keyThemes,\n keyThemesLabel = \"Key themes\",\n layout = \"three-column\",\n className,\n ...props\n },\n ref\n ) => {\n const hasKeyThemes = keyThemes != null && keyThemes.length > 0;\n\n return (\n <div\n ref={ref}\n className={cn(\"seeds-narrative-summary\", className)}\n {...props}\n >\n <div\n className={cn(\"seeds-narrative-summary-grid\", {\n \"seeds-narrative-summary-two-column\": layout === \"two-column\",\n })}\n >\n <div className=\"seeds-narrative-summary-lead\">\n {eyebrow != null && <EyebrowToken>{eyebrow}</EyebrowToken>}\n <div className=\"seeds-narrative-summary-headline\">\n <NarrativeHeadline size=\"small\" headingLevel={headingLevel}>\n {headline}\n </NarrativeHeadline>\n </div>\n {action != null && (\n <div className=\"seeds-narrative-summary-action\">{action}</div>\n )}\n </div>\n\n <div className=\"seeds-narrative-summary-content\">\n {summary != null && (\n <section className=\"seeds-narrative-summary-section\">\n <p className=\"seeds-narrative-summary-label\">{summaryLabel}</p>\n <p className=\"seeds-narrative-summary-text\">{summary}</p>\n </section>\n )}\n {hasKeyThemes && (\n <section className=\"seeds-narrative-summary-section\">\n <p className=\"seeds-narrative-summary-label\">\n {keyThemesLabel}\n </p>\n <ul className=\"seeds-narrative-summary-list\">\n {keyThemes.map((theme, i) => (\n <li key={i}>{theme}</li>\n ))}\n </ul>\n </section>\n )}\n </div>\n </div>\n </div>\n );\n }\n);\n\nNarrativeSummary.displayName = \"NarrativeSummary\";\n\nexport default NarrativeSummary;\n"],"mappings":";AAAA,YAAY,WAAW;;;ACChB,SAAS,MACX,QACK;AACR,QAAM,UAAoB,CAAC;AAE3B,aAAW,SAAS,QAAQ;AAC1B,QAAI,CAAC,MAAO;AAEZ,QAAI,OAAO,UAAU,UAAU;AAC7B,cAAQ,KAAK,KAAK;AAAA,IACpB,WAAW,OAAO,UAAU,UAAU;AACpC,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,YAAI,OAAO;AACT,kBAAQ,KAAK,GAAG;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,QAAQ,KAAK,GAAG;AACzB;;;ADHI;AALJ,IAAM,qBAA2B,iBAG/B,CAAC,EAAE,UAAU,SAA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A,KAAC,OAAE,WAAU,gCAAgC,mBAAQ;AAAA,mBACvD;AAAA,gBAED,gBACC,gBAAAC,MAAC,aAAQ,WAAU,mCACjB;AAAA,kCAAAD,KAAC,OAAE,WAAU,iCACV,0BACH;AAAA,kBACA,gBAAAA,KAAC,QAAG,WAAU,gCACX,oBAAU,IAAI,CAAC,OAAO,MACrB,gBAAAA,KAAC,QAAY,mBAAJ,CAAU,CACpB,GACH;AAAA,mBACF;AAAA,iBAEJ;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,iBAAiB,cAAc;AAE/B,IAAO,2BAAQ;","names":["React","jsx","React","jsx","React","jsx","React","jsx","jsxs","React","jsx","React","jsx","React","jsx","jsxs","React","jsx","jsxs"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seeds EyebrowToken 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
|
+
* <span class="seeds-eyebrow-token">May 31, 2026</span>
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@layer components {
|
|
13
|
+
|
|
14
|
+
/* A solid gray pill matching the design: background and border are both the
|
|
15
|
+
#dee1e1 container-border-base token, which also tracks dark mode. The two
|
|
16
|
+
pixel literals below have no exact theme token — the --space scale skips 6px
|
|
17
|
+
(4px→8px) and the --font-size scale skips 12px (11px→13px) — so the design's
|
|
18
|
+
values are kept verbatim. All colors use tokens. */
|
|
19
|
+
.seeds-eyebrow-token {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
gap: var(--space-100); /* 2px */
|
|
25
|
+
padding: var(--space-100) var(--space-300); /* 2px / 8px */
|
|
26
|
+
border: 1px solid var(--color-container-border-base); /* #dee1e1 */
|
|
27
|
+
border-radius: var(--radius-500); /* 6px */
|
|
28
|
+
background-color: var(--color-container-border-base); /* #dee1e1 */
|
|
29
|
+
font-family: var(--font-family);
|
|
30
|
+
font-size: 12px; /* text-sm */
|
|
31
|
+
line-height: 20px;
|
|
32
|
+
font-weight: var(--font-weight-normal);
|
|
33
|
+
color: var(--color-text-body);
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|