@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/dist/index.d.mts
CHANGED
|
@@ -21,6 +21,309 @@ interface TypeNarrativeContainerProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
21
21
|
*/
|
|
22
22
|
declare const NarrativeContainer: React.ForwardRefExoticComponent<TypeNarrativeContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
|
|
24
|
+
/** Heading level the headline text renders as. */
|
|
25
|
+
type TypeNarrativeHeadlineLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
26
|
+
/** Visual size of the headline. Independent of the semantic heading level. */
|
|
27
|
+
type TypeNarrativeHeadlineSize = "default" | "small";
|
|
28
|
+
interface TypeNarrativeHeadlineProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
29
|
+
/**
|
|
30
|
+
* The headline text. Wrap part of it in `<NarrativeHeadlineHighlight>` for a
|
|
31
|
+
* static gradient accent, or `<NarrativeHeadlineRoll>` for the rolling "roll"
|
|
32
|
+
* variant.
|
|
33
|
+
*/
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Heading element the headline text renders as, for document outline /
|
|
37
|
+
* accessibility. Visual size is unaffected.
|
|
38
|
+
* @default 2
|
|
39
|
+
*/
|
|
40
|
+
headingLevel?: TypeNarrativeHeadlineLevel;
|
|
41
|
+
/**
|
|
42
|
+
* Visual size. `"default"` is the display size (32px / 40px); `"small"` is the
|
|
43
|
+
* compact size (24px / 32px) used inside denser layouts like NarrativeSummary.
|
|
44
|
+
* @default "default"
|
|
45
|
+
*/
|
|
46
|
+
size?: TypeNarrativeHeadlineSize;
|
|
47
|
+
}
|
|
48
|
+
interface TypeNarrativeHeadlineHighlightProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
49
|
+
/** Text painted with the AI gradient. */
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
interface TypeNarrativeHeadlineRollProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
53
|
+
/** Words to cycle through. The first word is shown initially. */
|
|
54
|
+
words: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Milliseconds each word holds before rolling out.
|
|
57
|
+
* @default 2200
|
|
58
|
+
*/
|
|
59
|
+
intervalMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Milliseconds of the slide animation.
|
|
62
|
+
* @default 500
|
|
63
|
+
*/
|
|
64
|
+
transitionMs?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Direction the active word rolls in from.
|
|
67
|
+
* @default "up"
|
|
68
|
+
*/
|
|
69
|
+
direction?: "up" | "down";
|
|
70
|
+
/**
|
|
71
|
+
* Paint each word with the AI gradient. Apply it here rather than nesting
|
|
72
|
+
* inside `<NarrativeHeadlineHighlight>` — `background-clip: text` does not
|
|
73
|
+
* apply across the absolutely-positioned rolling words.
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
gradient?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* NarrativeHeadline — the titling primitive for a narrative block. A single
|
|
81
|
+
* heading element, nothing more: supporting copy and tags/tokens belong to
|
|
82
|
+
* sibling primitives that compose alongside it, not baked into the title.
|
|
83
|
+
*
|
|
84
|
+
* Wrap part of the headline in `<NarrativeHeadlineHighlight>` for a static
|
|
85
|
+
* gradient accent, or `<NarrativeHeadlineRoll>` for the rolling "roll" variant.
|
|
86
|
+
*
|
|
87
|
+
* Styled via `narrative-headline.css` (Seeds CSS custom properties). Consumers
|
|
88
|
+
* import the classes through `@sproutsocial/racine/css/components`. Overrides
|
|
89
|
+
* are done with standard `className` / `style`.
|
|
90
|
+
*/
|
|
91
|
+
declare const NarrativeHeadline: React.ForwardRefExoticComponent<TypeNarrativeHeadlineProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* NarrativeHeadlineHighlight — paints a span of headline text with the AI
|
|
95
|
+
* brand gradient (the "highlighted word" treatment). Drop it inline inside a
|
|
96
|
+
* `<NarrativeHeadline>`:
|
|
97
|
+
*
|
|
98
|
+
* <NarrativeHeadline>
|
|
99
|
+
* Headline with a <NarrativeHeadlineHighlight>highlighted</NarrativeHeadlineHighlight> word
|
|
100
|
+
* </NarrativeHeadline>
|
|
101
|
+
*/
|
|
102
|
+
declare const NarrativeHeadlineHighlight: React.ForwardRefExoticComponent<TypeNarrativeHeadlineHighlightProps & React.RefAttributes<HTMLSpanElement>>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* NarrativeHeadlineRoll — the "roll" variant: a vertical word roll for the
|
|
106
|
+
* highlighted slot of a headline. The active word slides into view while the
|
|
107
|
+
* previous one rolls out (no typing). Inspired by the performative-ui WordRoll.
|
|
108
|
+
*
|
|
109
|
+
* <NarrativeHeadline>
|
|
110
|
+
* Built for{" "}
|
|
111
|
+
* <NarrativeHeadlineRoll words={["marketers", "agencies", "teams"]} />
|
|
112
|
+
* </NarrativeHeadline>
|
|
113
|
+
*
|
|
114
|
+
* The container width follows the active word so it sits naturally inline.
|
|
115
|
+
* Gradient-painted by default; honors `prefers-reduced-motion` by holding the
|
|
116
|
+
* first word static.
|
|
117
|
+
*/
|
|
118
|
+
declare const NarrativeHeadlineRoll: React.ForwardRefExoticComponent<TypeNarrativeHeadlineRollProps & React.RefAttributes<HTMLSpanElement>>;
|
|
119
|
+
|
|
120
|
+
interface TypePullQuoteProps extends React.HTMLAttributes<HTMLElement> {
|
|
121
|
+
/** The quotation text, rendered emphasized inside the accented bar. */
|
|
122
|
+
quote: React.ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* Optional attribution slot rendered beneath the quote (e.g. an author name,
|
|
125
|
+
* avatar, and network). Composed by the consumer; omitted entirely when absent.
|
|
126
|
+
*/
|
|
127
|
+
attribution?: React.ReactNode;
|
|
128
|
+
/**
|
|
129
|
+
* Visual treatment of the AI gradient surface.
|
|
130
|
+
* - `subtle` — a light 20% gradient tint over the base surface with dark text.
|
|
131
|
+
* - `vivid` — the full-saturation AI gradient with white text.
|
|
132
|
+
* @default "subtle"
|
|
133
|
+
*/
|
|
134
|
+
appearance?: "subtle" | "vivid";
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* PullQuote — a narrative primitive that spotlights a quotation on an AI
|
|
139
|
+
* gradient surface. The quote sits behind an accented vertical bar with an
|
|
140
|
+
* optional attribution row (author name, avatar, network).
|
|
141
|
+
*
|
|
142
|
+
* Rendered as semantic `<figure>` / `<blockquote>` / `<figcaption>` markup.
|
|
143
|
+
* Styled via `pull-quote.css` (Seeds CSS custom properties); consumers import
|
|
144
|
+
* the classes through `@sproutsocial/racine/css/components`. Surface overrides
|
|
145
|
+
* are done with standard `className` / `style`.
|
|
146
|
+
*/
|
|
147
|
+
declare const PullQuote: React.ForwardRefExoticComponent<TypePullQuoteProps & React.RefAttributes<HTMLElement>>;
|
|
148
|
+
|
|
149
|
+
interface TypeEyebrowTokenProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
150
|
+
/** The eyebrow text — a date, category, or short kicker. */
|
|
151
|
+
children: React.ReactNode;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* EyebrowToken — a small gray pill that sits above a headline to carry a short
|
|
156
|
+
* bit of context: a date (e.g. "May 31, 2026"), category, or kicker.
|
|
157
|
+
*
|
|
158
|
+
* A faithful match of the Figma "Token / Non Clickable / Default" design — a
|
|
159
|
+
* solid `#dee1e1` fill with a matching border, 6px radius, and small body text.
|
|
160
|
+
* Styled via `eyebrow-token.css` (Seeds CSS custom properties); consumers import
|
|
161
|
+
* the classes through `@sproutsocial/racine/css/components`. Overrides come via
|
|
162
|
+
* standard `className` / `style`.
|
|
163
|
+
*/
|
|
164
|
+
declare const EyebrowToken: React.ForwardRefExoticComponent<TypeEyebrowTokenProps & React.RefAttributes<HTMLSpanElement>>;
|
|
165
|
+
|
|
166
|
+
/** NarrativeDivider takes no extra props — just standard <hr> attributes. */
|
|
167
|
+
type TypeNarrativeDividerProps = React.HTMLAttributes<HTMLHRElement>;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* NarrativeDivider — a full-width, 1px horizontal rule that separates sections
|
|
171
|
+
* within a narrative brief (e.g. a row of metrics from the headline/summary
|
|
172
|
+
* block below it).
|
|
173
|
+
*
|
|
174
|
+
* Renders a semantic <hr> stripped of its user-agent margins and borders, then
|
|
175
|
+
* draws a single 1px line with the container-border-base token (#dee1e1, which
|
|
176
|
+
* also tracks dark mode). Styled via narrative-divider.css (Seeds CSS custom
|
|
177
|
+
* properties); consumers import the classes through
|
|
178
|
+
* @sproutsocial/racine/css/components. Overrides come via standard className /
|
|
179
|
+
* style.
|
|
180
|
+
*/
|
|
181
|
+
declare const NarrativeDivider: React.ForwardRefExoticComponent<TypeNarrativeDividerProps & React.RefAttributes<HTMLHRElement>>;
|
|
182
|
+
|
|
183
|
+
interface TypeMetricHighlightTrend {
|
|
184
|
+
/**
|
|
185
|
+
* Direction of movement. Selects the arrow glyph and the sentiment color of
|
|
186
|
+
* the badge (green for `up`, red for `down`).
|
|
187
|
+
* @default "up"
|
|
188
|
+
*/
|
|
189
|
+
direction?: "up" | "down";
|
|
190
|
+
/**
|
|
191
|
+
* Optional value rendered next to the arrow (e.g. `"240%"`, `12`). When
|
|
192
|
+
* omitted the badge is icon-only.
|
|
193
|
+
*/
|
|
194
|
+
value?: React.ReactNode;
|
|
195
|
+
/**
|
|
196
|
+
* Accessible label describing the trend (e.g. `"up 240%"`). The arrow glyph is
|
|
197
|
+
* decorative, so provide this whenever the trend conveys meaning on its own.
|
|
198
|
+
*/
|
|
199
|
+
"aria-label"?: string;
|
|
200
|
+
}
|
|
201
|
+
interface TypeMetricHighlightProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
202
|
+
/** Short metric label rendered above/beside the value (e.g. `"Insight metric"`). */
|
|
203
|
+
label: React.ReactNode;
|
|
204
|
+
/** The metric value, rendered as the emphasized monospace figure (e.g. `"123"`, `"1.2M"`). */
|
|
205
|
+
value: React.ReactNode;
|
|
206
|
+
/** Optional trend badge — a directional arrow plus an optional value. */
|
|
207
|
+
trend?: TypeMetricHighlightTrend;
|
|
208
|
+
/**
|
|
209
|
+
* Chart slot. When provided, this node renders in the chart area beside/below
|
|
210
|
+
* the metric — e.g. a `<SparklineChart />` from
|
|
211
|
+
* `@sproutsocial/seeds-react-data-viz/sparkline`. Omit it to render the metric
|
|
212
|
+
* on its own. The injected node controls its own look; the slot only sizes and
|
|
213
|
+
* centers it (pass `className="h-full w-full"` to fill).
|
|
214
|
+
*/
|
|
215
|
+
sparkline?: React.ReactNode;
|
|
216
|
+
/**
|
|
217
|
+
* Layout direction.
|
|
218
|
+
* - `horizontal` — metric block beside the sparkline.
|
|
219
|
+
* - `vertical` — metric block stacked above a full-width sparkline.
|
|
220
|
+
* @default "horizontal"
|
|
221
|
+
*/
|
|
222
|
+
appearance?: "horizontal" | "vertical";
|
|
223
|
+
/**
|
|
224
|
+
* Size of the value and overall density.
|
|
225
|
+
* - `default` — large value, label stacked above it.
|
|
226
|
+
* - `small` — condensed value, label and value on a single row.
|
|
227
|
+
* @default "default"
|
|
228
|
+
*/
|
|
229
|
+
size?: "default" | "small";
|
|
230
|
+
/**
|
|
231
|
+
* Render the padded surface background. Set `false` to drop the surface and
|
|
232
|
+
* compose the metric inside another container.
|
|
233
|
+
* @default true
|
|
234
|
+
*/
|
|
235
|
+
container?: boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* MetricHighlight — a narrative primitive that spotlights a single metric: a
|
|
240
|
+
* label, a large monospace value, an optional trend badge (a directional arrow
|
|
241
|
+
* plus an optional number such as "240%"), and an optional chart supplied via
|
|
242
|
+
* the `sparkline` slot (e.g. a `<SparklineChart />` from
|
|
243
|
+
* `@sproutsocial/seeds-react-data-viz/sparkline`).
|
|
244
|
+
*
|
|
245
|
+
* Styled via `metric-highlight.css` (Seeds CSS custom properties); consumers
|
|
246
|
+
* import the classes through `@sproutsocial/racine/css/components`. Layout flexes
|
|
247
|
+
* across `appearance` (horizontal/vertical) and `size` (default/small); surface
|
|
248
|
+
* overrides are done with standard `className` / `style`.
|
|
249
|
+
*/
|
|
250
|
+
declare const MetricHighlight: React.ForwardRefExoticComponent<TypeMetricHighlightProps & React.RefAttributes<HTMLDivElement>>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Column arrangement.
|
|
254
|
+
* - `"three-column"`: lead | Summary | Key themes, three side-by-side columns.
|
|
255
|
+
* - `"two-column"`: a 1/3 | 2/3 split — lead on the left, with Summary and Key
|
|
256
|
+
* themes stacked together in the wider right column.
|
|
257
|
+
*/
|
|
258
|
+
type TypeNarrativeSummaryLayout = "three-column" | "two-column";
|
|
259
|
+
interface TypeNarrativeSummaryProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
260
|
+
/**
|
|
261
|
+
* Kicker shown in an `EyebrowToken` above the headline (e.g. a date). Omit to
|
|
262
|
+
* hide the eyebrow entirely.
|
|
263
|
+
*/
|
|
264
|
+
eyebrow?: React.ReactNode;
|
|
265
|
+
/** Headline text — rendered via `NarrativeHeadline` at `size="small"`. */
|
|
266
|
+
headline: React.ReactNode;
|
|
267
|
+
/**
|
|
268
|
+
* Heading element the headline renders as, for document outline /
|
|
269
|
+
* accessibility.
|
|
270
|
+
* @default 2
|
|
271
|
+
*/
|
|
272
|
+
headingLevel?: TypeNarrativeHeadlineLevel;
|
|
273
|
+
/**
|
|
274
|
+
* Optional action, typically a `<Button>`. Rendered below the headline only
|
|
275
|
+
* when provided. Pass a Button without system props so it renders the Tailwind
|
|
276
|
+
* path (e.g. `<Button appearance="primary">Action</Button>`).
|
|
277
|
+
*
|
|
278
|
+
* Note: in the MVP this will most often be left unset (null) — the AC is
|
|
279
|
+
* poorly defined at this time and needs more definition before the data model
|
|
280
|
+
* will properly support it.
|
|
281
|
+
*/
|
|
282
|
+
action?: React.ReactNode;
|
|
283
|
+
/** Summary body content. The section is omitted when this is empty. */
|
|
284
|
+
summary?: React.ReactNode;
|
|
285
|
+
/**
|
|
286
|
+
* Label above the summary.
|
|
287
|
+
* @default "Summary"
|
|
288
|
+
*/
|
|
289
|
+
summaryLabel?: React.ReactNode;
|
|
290
|
+
/**
|
|
291
|
+
* Key themes, rendered as a bulleted list. The section is omitted when this
|
|
292
|
+
* is empty.
|
|
293
|
+
*/
|
|
294
|
+
keyThemes?: string[];
|
|
295
|
+
/**
|
|
296
|
+
* Label above the key themes.
|
|
297
|
+
* @default "Key themes"
|
|
298
|
+
*/
|
|
299
|
+
keyThemesLabel?: React.ReactNode;
|
|
300
|
+
/**
|
|
301
|
+
* Column arrangement. `"two-column"` is a 1/3 | 2/3 split.
|
|
302
|
+
* @default "three-column"
|
|
303
|
+
*/
|
|
304
|
+
layout?: TypeNarrativeSummaryLayout;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* NarrativeSummary — a composed narrative block that pairs a lead column
|
|
309
|
+
* (eyebrow + headline + optional action) with a Summary section and a Key
|
|
310
|
+
* themes list.
|
|
311
|
+
*
|
|
312
|
+
* Renders inner content only — it carries no surface, shadow, or accent of its
|
|
313
|
+
* own. Drop it into a `NarrativeContainer` (see the stories / playground).
|
|
314
|
+
*
|
|
315
|
+
* Layout is CSS Grid driven by container queries, so the columns collapse based
|
|
316
|
+
* on the width the component is actually given, not the viewport:
|
|
317
|
+
* - `"three-column"` → lead | Summary | Key themes.
|
|
318
|
+
* - `"two-column"` → a 1/3 | 2/3 split with Summary and Key themes stacked in
|
|
319
|
+
* the wider column.
|
|
320
|
+
*
|
|
321
|
+
* Styled via `narrative-summary.css` (Seeds CSS custom properties); consumers
|
|
322
|
+
* import the classes through `@sproutsocial/racine/css/components`. Overrides
|
|
323
|
+
* come via standard `className` / `style`.
|
|
324
|
+
*/
|
|
325
|
+
declare const NarrativeSummary: React.ForwardRefExoticComponent<TypeNarrativeSummaryProps & React.RefAttributes<HTMLDivElement>>;
|
|
326
|
+
|
|
24
327
|
/**
|
|
25
328
|
* Shared types for narrative primitives.
|
|
26
329
|
*
|
|
@@ -33,4 +336,4 @@ declare const NarrativeContainer: React.ForwardRefExoticComponent<TypeNarrativeC
|
|
|
33
336
|
*/
|
|
34
337
|
type TypeNarrativeTone = "neutral" | "positive" | "negative" | "opportunity";
|
|
35
338
|
|
|
36
|
-
export { NarrativeContainer, type TypeNarrativeContainerProps, type TypeNarrativeTone };
|
|
339
|
+
export { EyebrowToken, MetricHighlight, NarrativeContainer, NarrativeDivider, NarrativeHeadline, NarrativeHeadlineHighlight, NarrativeHeadlineRoll, NarrativeSummary, PullQuote, type TypeEyebrowTokenProps, type TypeMetricHighlightProps, type TypeMetricHighlightTrend, type TypeNarrativeContainerProps, type TypeNarrativeDividerProps, type TypeNarrativeHeadlineHighlightProps, type TypeNarrativeHeadlineLevel, type TypeNarrativeHeadlineProps, type TypeNarrativeHeadlineRollProps, type TypeNarrativeSummaryLayout, type TypeNarrativeSummaryProps, type TypeNarrativeTone, type TypePullQuoteProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,309 @@ interface TypeNarrativeContainerProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
21
21
|
*/
|
|
22
22
|
declare const NarrativeContainer: React.ForwardRefExoticComponent<TypeNarrativeContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
|
|
24
|
+
/** Heading level the headline text renders as. */
|
|
25
|
+
type TypeNarrativeHeadlineLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
26
|
+
/** Visual size of the headline. Independent of the semantic heading level. */
|
|
27
|
+
type TypeNarrativeHeadlineSize = "default" | "small";
|
|
28
|
+
interface TypeNarrativeHeadlineProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
29
|
+
/**
|
|
30
|
+
* The headline text. Wrap part of it in `<NarrativeHeadlineHighlight>` for a
|
|
31
|
+
* static gradient accent, or `<NarrativeHeadlineRoll>` for the rolling "roll"
|
|
32
|
+
* variant.
|
|
33
|
+
*/
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Heading element the headline text renders as, for document outline /
|
|
37
|
+
* accessibility. Visual size is unaffected.
|
|
38
|
+
* @default 2
|
|
39
|
+
*/
|
|
40
|
+
headingLevel?: TypeNarrativeHeadlineLevel;
|
|
41
|
+
/**
|
|
42
|
+
* Visual size. `"default"` is the display size (32px / 40px); `"small"` is the
|
|
43
|
+
* compact size (24px / 32px) used inside denser layouts like NarrativeSummary.
|
|
44
|
+
* @default "default"
|
|
45
|
+
*/
|
|
46
|
+
size?: TypeNarrativeHeadlineSize;
|
|
47
|
+
}
|
|
48
|
+
interface TypeNarrativeHeadlineHighlightProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
49
|
+
/** Text painted with the AI gradient. */
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
interface TypeNarrativeHeadlineRollProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
53
|
+
/** Words to cycle through. The first word is shown initially. */
|
|
54
|
+
words: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Milliseconds each word holds before rolling out.
|
|
57
|
+
* @default 2200
|
|
58
|
+
*/
|
|
59
|
+
intervalMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Milliseconds of the slide animation.
|
|
62
|
+
* @default 500
|
|
63
|
+
*/
|
|
64
|
+
transitionMs?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Direction the active word rolls in from.
|
|
67
|
+
* @default "up"
|
|
68
|
+
*/
|
|
69
|
+
direction?: "up" | "down";
|
|
70
|
+
/**
|
|
71
|
+
* Paint each word with the AI gradient. Apply it here rather than nesting
|
|
72
|
+
* inside `<NarrativeHeadlineHighlight>` — `background-clip: text` does not
|
|
73
|
+
* apply across the absolutely-positioned rolling words.
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
gradient?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* NarrativeHeadline — the titling primitive for a narrative block. A single
|
|
81
|
+
* heading element, nothing more: supporting copy and tags/tokens belong to
|
|
82
|
+
* sibling primitives that compose alongside it, not baked into the title.
|
|
83
|
+
*
|
|
84
|
+
* Wrap part of the headline in `<NarrativeHeadlineHighlight>` for a static
|
|
85
|
+
* gradient accent, or `<NarrativeHeadlineRoll>` for the rolling "roll" variant.
|
|
86
|
+
*
|
|
87
|
+
* Styled via `narrative-headline.css` (Seeds CSS custom properties). Consumers
|
|
88
|
+
* import the classes through `@sproutsocial/racine/css/components`. Overrides
|
|
89
|
+
* are done with standard `className` / `style`.
|
|
90
|
+
*/
|
|
91
|
+
declare const NarrativeHeadline: React.ForwardRefExoticComponent<TypeNarrativeHeadlineProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* NarrativeHeadlineHighlight — paints a span of headline text with the AI
|
|
95
|
+
* brand gradient (the "highlighted word" treatment). Drop it inline inside a
|
|
96
|
+
* `<NarrativeHeadline>`:
|
|
97
|
+
*
|
|
98
|
+
* <NarrativeHeadline>
|
|
99
|
+
* Headline with a <NarrativeHeadlineHighlight>highlighted</NarrativeHeadlineHighlight> word
|
|
100
|
+
* </NarrativeHeadline>
|
|
101
|
+
*/
|
|
102
|
+
declare const NarrativeHeadlineHighlight: React.ForwardRefExoticComponent<TypeNarrativeHeadlineHighlightProps & React.RefAttributes<HTMLSpanElement>>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* NarrativeHeadlineRoll — the "roll" variant: a vertical word roll for the
|
|
106
|
+
* highlighted slot of a headline. The active word slides into view while the
|
|
107
|
+
* previous one rolls out (no typing). Inspired by the performative-ui WordRoll.
|
|
108
|
+
*
|
|
109
|
+
* <NarrativeHeadline>
|
|
110
|
+
* Built for{" "}
|
|
111
|
+
* <NarrativeHeadlineRoll words={["marketers", "agencies", "teams"]} />
|
|
112
|
+
* </NarrativeHeadline>
|
|
113
|
+
*
|
|
114
|
+
* The container width follows the active word so it sits naturally inline.
|
|
115
|
+
* Gradient-painted by default; honors `prefers-reduced-motion` by holding the
|
|
116
|
+
* first word static.
|
|
117
|
+
*/
|
|
118
|
+
declare const NarrativeHeadlineRoll: React.ForwardRefExoticComponent<TypeNarrativeHeadlineRollProps & React.RefAttributes<HTMLSpanElement>>;
|
|
119
|
+
|
|
120
|
+
interface TypePullQuoteProps extends React.HTMLAttributes<HTMLElement> {
|
|
121
|
+
/** The quotation text, rendered emphasized inside the accented bar. */
|
|
122
|
+
quote: React.ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* Optional attribution slot rendered beneath the quote (e.g. an author name,
|
|
125
|
+
* avatar, and network). Composed by the consumer; omitted entirely when absent.
|
|
126
|
+
*/
|
|
127
|
+
attribution?: React.ReactNode;
|
|
128
|
+
/**
|
|
129
|
+
* Visual treatment of the AI gradient surface.
|
|
130
|
+
* - `subtle` — a light 20% gradient tint over the base surface with dark text.
|
|
131
|
+
* - `vivid` — the full-saturation AI gradient with white text.
|
|
132
|
+
* @default "subtle"
|
|
133
|
+
*/
|
|
134
|
+
appearance?: "subtle" | "vivid";
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* PullQuote — a narrative primitive that spotlights a quotation on an AI
|
|
139
|
+
* gradient surface. The quote sits behind an accented vertical bar with an
|
|
140
|
+
* optional attribution row (author name, avatar, network).
|
|
141
|
+
*
|
|
142
|
+
* Rendered as semantic `<figure>` / `<blockquote>` / `<figcaption>` markup.
|
|
143
|
+
* Styled via `pull-quote.css` (Seeds CSS custom properties); consumers import
|
|
144
|
+
* the classes through `@sproutsocial/racine/css/components`. Surface overrides
|
|
145
|
+
* are done with standard `className` / `style`.
|
|
146
|
+
*/
|
|
147
|
+
declare const PullQuote: React.ForwardRefExoticComponent<TypePullQuoteProps & React.RefAttributes<HTMLElement>>;
|
|
148
|
+
|
|
149
|
+
interface TypeEyebrowTokenProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
150
|
+
/** The eyebrow text — a date, category, or short kicker. */
|
|
151
|
+
children: React.ReactNode;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* EyebrowToken — a small gray pill that sits above a headline to carry a short
|
|
156
|
+
* bit of context: a date (e.g. "May 31, 2026"), category, or kicker.
|
|
157
|
+
*
|
|
158
|
+
* A faithful match of the Figma "Token / Non Clickable / Default" design — a
|
|
159
|
+
* solid `#dee1e1` fill with a matching border, 6px radius, and small body text.
|
|
160
|
+
* Styled via `eyebrow-token.css` (Seeds CSS custom properties); consumers import
|
|
161
|
+
* the classes through `@sproutsocial/racine/css/components`. Overrides come via
|
|
162
|
+
* standard `className` / `style`.
|
|
163
|
+
*/
|
|
164
|
+
declare const EyebrowToken: React.ForwardRefExoticComponent<TypeEyebrowTokenProps & React.RefAttributes<HTMLSpanElement>>;
|
|
165
|
+
|
|
166
|
+
/** NarrativeDivider takes no extra props — just standard <hr> attributes. */
|
|
167
|
+
type TypeNarrativeDividerProps = React.HTMLAttributes<HTMLHRElement>;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* NarrativeDivider — a full-width, 1px horizontal rule that separates sections
|
|
171
|
+
* within a narrative brief (e.g. a row of metrics from the headline/summary
|
|
172
|
+
* block below it).
|
|
173
|
+
*
|
|
174
|
+
* Renders a semantic <hr> stripped of its user-agent margins and borders, then
|
|
175
|
+
* draws a single 1px line with the container-border-base token (#dee1e1, which
|
|
176
|
+
* also tracks dark mode). Styled via narrative-divider.css (Seeds CSS custom
|
|
177
|
+
* properties); consumers import the classes through
|
|
178
|
+
* @sproutsocial/racine/css/components. Overrides come via standard className /
|
|
179
|
+
* style.
|
|
180
|
+
*/
|
|
181
|
+
declare const NarrativeDivider: React.ForwardRefExoticComponent<TypeNarrativeDividerProps & React.RefAttributes<HTMLHRElement>>;
|
|
182
|
+
|
|
183
|
+
interface TypeMetricHighlightTrend {
|
|
184
|
+
/**
|
|
185
|
+
* Direction of movement. Selects the arrow glyph and the sentiment color of
|
|
186
|
+
* the badge (green for `up`, red for `down`).
|
|
187
|
+
* @default "up"
|
|
188
|
+
*/
|
|
189
|
+
direction?: "up" | "down";
|
|
190
|
+
/**
|
|
191
|
+
* Optional value rendered next to the arrow (e.g. `"240%"`, `12`). When
|
|
192
|
+
* omitted the badge is icon-only.
|
|
193
|
+
*/
|
|
194
|
+
value?: React.ReactNode;
|
|
195
|
+
/**
|
|
196
|
+
* Accessible label describing the trend (e.g. `"up 240%"`). The arrow glyph is
|
|
197
|
+
* decorative, so provide this whenever the trend conveys meaning on its own.
|
|
198
|
+
*/
|
|
199
|
+
"aria-label"?: string;
|
|
200
|
+
}
|
|
201
|
+
interface TypeMetricHighlightProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
202
|
+
/** Short metric label rendered above/beside the value (e.g. `"Insight metric"`). */
|
|
203
|
+
label: React.ReactNode;
|
|
204
|
+
/** The metric value, rendered as the emphasized monospace figure (e.g. `"123"`, `"1.2M"`). */
|
|
205
|
+
value: React.ReactNode;
|
|
206
|
+
/** Optional trend badge — a directional arrow plus an optional value. */
|
|
207
|
+
trend?: TypeMetricHighlightTrend;
|
|
208
|
+
/**
|
|
209
|
+
* Chart slot. When provided, this node renders in the chart area beside/below
|
|
210
|
+
* the metric — e.g. a `<SparklineChart />` from
|
|
211
|
+
* `@sproutsocial/seeds-react-data-viz/sparkline`. Omit it to render the metric
|
|
212
|
+
* on its own. The injected node controls its own look; the slot only sizes and
|
|
213
|
+
* centers it (pass `className="h-full w-full"` to fill).
|
|
214
|
+
*/
|
|
215
|
+
sparkline?: React.ReactNode;
|
|
216
|
+
/**
|
|
217
|
+
* Layout direction.
|
|
218
|
+
* - `horizontal` — metric block beside the sparkline.
|
|
219
|
+
* - `vertical` — metric block stacked above a full-width sparkline.
|
|
220
|
+
* @default "horizontal"
|
|
221
|
+
*/
|
|
222
|
+
appearance?: "horizontal" | "vertical";
|
|
223
|
+
/**
|
|
224
|
+
* Size of the value and overall density.
|
|
225
|
+
* - `default` — large value, label stacked above it.
|
|
226
|
+
* - `small` — condensed value, label and value on a single row.
|
|
227
|
+
* @default "default"
|
|
228
|
+
*/
|
|
229
|
+
size?: "default" | "small";
|
|
230
|
+
/**
|
|
231
|
+
* Render the padded surface background. Set `false` to drop the surface and
|
|
232
|
+
* compose the metric inside another container.
|
|
233
|
+
* @default true
|
|
234
|
+
*/
|
|
235
|
+
container?: boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* MetricHighlight — a narrative primitive that spotlights a single metric: a
|
|
240
|
+
* label, a large monospace value, an optional trend badge (a directional arrow
|
|
241
|
+
* plus an optional number such as "240%"), and an optional chart supplied via
|
|
242
|
+
* the `sparkline` slot (e.g. a `<SparklineChart />` from
|
|
243
|
+
* `@sproutsocial/seeds-react-data-viz/sparkline`).
|
|
244
|
+
*
|
|
245
|
+
* Styled via `metric-highlight.css` (Seeds CSS custom properties); consumers
|
|
246
|
+
* import the classes through `@sproutsocial/racine/css/components`. Layout flexes
|
|
247
|
+
* across `appearance` (horizontal/vertical) and `size` (default/small); surface
|
|
248
|
+
* overrides are done with standard `className` / `style`.
|
|
249
|
+
*/
|
|
250
|
+
declare const MetricHighlight: React.ForwardRefExoticComponent<TypeMetricHighlightProps & React.RefAttributes<HTMLDivElement>>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Column arrangement.
|
|
254
|
+
* - `"three-column"`: lead | Summary | Key themes, three side-by-side columns.
|
|
255
|
+
* - `"two-column"`: a 1/3 | 2/3 split — lead on the left, with Summary and Key
|
|
256
|
+
* themes stacked together in the wider right column.
|
|
257
|
+
*/
|
|
258
|
+
type TypeNarrativeSummaryLayout = "three-column" | "two-column";
|
|
259
|
+
interface TypeNarrativeSummaryProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
260
|
+
/**
|
|
261
|
+
* Kicker shown in an `EyebrowToken` above the headline (e.g. a date). Omit to
|
|
262
|
+
* hide the eyebrow entirely.
|
|
263
|
+
*/
|
|
264
|
+
eyebrow?: React.ReactNode;
|
|
265
|
+
/** Headline text — rendered via `NarrativeHeadline` at `size="small"`. */
|
|
266
|
+
headline: React.ReactNode;
|
|
267
|
+
/**
|
|
268
|
+
* Heading element the headline renders as, for document outline /
|
|
269
|
+
* accessibility.
|
|
270
|
+
* @default 2
|
|
271
|
+
*/
|
|
272
|
+
headingLevel?: TypeNarrativeHeadlineLevel;
|
|
273
|
+
/**
|
|
274
|
+
* Optional action, typically a `<Button>`. Rendered below the headline only
|
|
275
|
+
* when provided. Pass a Button without system props so it renders the Tailwind
|
|
276
|
+
* path (e.g. `<Button appearance="primary">Action</Button>`).
|
|
277
|
+
*
|
|
278
|
+
* Note: in the MVP this will most often be left unset (null) — the AC is
|
|
279
|
+
* poorly defined at this time and needs more definition before the data model
|
|
280
|
+
* will properly support it.
|
|
281
|
+
*/
|
|
282
|
+
action?: React.ReactNode;
|
|
283
|
+
/** Summary body content. The section is omitted when this is empty. */
|
|
284
|
+
summary?: React.ReactNode;
|
|
285
|
+
/**
|
|
286
|
+
* Label above the summary.
|
|
287
|
+
* @default "Summary"
|
|
288
|
+
*/
|
|
289
|
+
summaryLabel?: React.ReactNode;
|
|
290
|
+
/**
|
|
291
|
+
* Key themes, rendered as a bulleted list. The section is omitted when this
|
|
292
|
+
* is empty.
|
|
293
|
+
*/
|
|
294
|
+
keyThemes?: string[];
|
|
295
|
+
/**
|
|
296
|
+
* Label above the key themes.
|
|
297
|
+
* @default "Key themes"
|
|
298
|
+
*/
|
|
299
|
+
keyThemesLabel?: React.ReactNode;
|
|
300
|
+
/**
|
|
301
|
+
* Column arrangement. `"two-column"` is a 1/3 | 2/3 split.
|
|
302
|
+
* @default "three-column"
|
|
303
|
+
*/
|
|
304
|
+
layout?: TypeNarrativeSummaryLayout;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* NarrativeSummary — a composed narrative block that pairs a lead column
|
|
309
|
+
* (eyebrow + headline + optional action) with a Summary section and a Key
|
|
310
|
+
* themes list.
|
|
311
|
+
*
|
|
312
|
+
* Renders inner content only — it carries no surface, shadow, or accent of its
|
|
313
|
+
* own. Drop it into a `NarrativeContainer` (see the stories / playground).
|
|
314
|
+
*
|
|
315
|
+
* Layout is CSS Grid driven by container queries, so the columns collapse based
|
|
316
|
+
* on the width the component is actually given, not the viewport:
|
|
317
|
+
* - `"three-column"` → lead | Summary | Key themes.
|
|
318
|
+
* - `"two-column"` → a 1/3 | 2/3 split with Summary and Key themes stacked in
|
|
319
|
+
* the wider column.
|
|
320
|
+
*
|
|
321
|
+
* Styled via `narrative-summary.css` (Seeds CSS custom properties); consumers
|
|
322
|
+
* import the classes through `@sproutsocial/racine/css/components`. Overrides
|
|
323
|
+
* come via standard `className` / `style`.
|
|
324
|
+
*/
|
|
325
|
+
declare const NarrativeSummary: React.ForwardRefExoticComponent<TypeNarrativeSummaryProps & React.RefAttributes<HTMLDivElement>>;
|
|
326
|
+
|
|
24
327
|
/**
|
|
25
328
|
* Shared types for narrative primitives.
|
|
26
329
|
*
|
|
@@ -33,4 +336,4 @@ declare const NarrativeContainer: React.ForwardRefExoticComponent<TypeNarrativeC
|
|
|
33
336
|
*/
|
|
34
337
|
type TypeNarrativeTone = "neutral" | "positive" | "negative" | "opportunity";
|
|
35
338
|
|
|
36
|
-
export { NarrativeContainer, type TypeNarrativeContainerProps, type TypeNarrativeTone };
|
|
339
|
+
export { EyebrowToken, MetricHighlight, NarrativeContainer, NarrativeDivider, NarrativeHeadline, NarrativeHeadlineHighlight, NarrativeHeadlineRoll, NarrativeSummary, PullQuote, type TypeEyebrowTokenProps, type TypeMetricHighlightProps, type TypeMetricHighlightTrend, type TypeNarrativeContainerProps, type TypeNarrativeDividerProps, type TypeNarrativeHeadlineHighlightProps, type TypeNarrativeHeadlineLevel, type TypeNarrativeHeadlineProps, type TypeNarrativeHeadlineRollProps, type TypeNarrativeSummaryLayout, type TypeNarrativeSummaryProps, type TypeNarrativeTone, type TypePullQuoteProps };
|