@sproutsocial/racine 31.4.0 → 31.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Change Log
2
2
 
3
+ ## 31.5.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
+ ### Patch Changes
23
+
24
+ - Updated dependencies [1aca1d1]
25
+ - Updated dependencies [0b37765]
26
+ - Updated dependencies [0b37765]
27
+ - @sproutsocial/seeds-react-narrative-kit@0.3.0
28
+
3
29
  ## 31.4.0
4
30
 
5
31
  ### Minor Changes
@@ -1251,47 +1251,37 @@
1251
1251
  stroke-width: 1.5;
1252
1252
  }
1253
1253
 
1254
- /* Sparkline a single normalized polyline stretched to fit. The non-scaling
1255
- stroke keeps a crisp 2px line at any aspect ratio. */
1256
- .seeds-metric-highlight-spark {
1257
- display: block;
1254
+ /* Slot for an injected chart (e.g. a data-viz SparklineChart). Layout only — no
1255
+ stroke/background styling, so the injected chart controls its own look. Heights
1256
+ are explicit (never percentage/stretch) so a Highcharts chart always measures a
1257
+ concrete container instead of falling back to its 400px default. */
1258
+ .seeds-metric-highlight-chart {
1259
+ box-sizing: border-box;
1258
1260
  flex: 0 0 auto;
1259
- /* Matches the design's Data Viz / Categorical 01 line color (#0b968f). */
1260
- stroke: var(--color-teal-700);
1261
- }
1262
-
1263
- /* Downward trend: the red analog at the same scale step (#db3e3e). */
1264
- .seeds-metric-highlight-spark-negative {
1265
- stroke: var(--color-red-700);
1266
- }
1267
-
1268
- .seeds-metric-highlight-spark path {
1269
- stroke: inherit;
1270
- stroke-width: 2;
1271
- vector-effect: non-scaling-stroke;
1261
+ align-self: center;
1262
+ /* Center the injected chart as a flex item — an inline/inline-block child
1263
+ (e.g. the data-viz SparklineChart) otherwise sits on the text baseline with
1264
+ descender space below it, reading as vertically off-center in the slot. */
1265
+ display: flex;
1266
+ align-items: center;
1272
1267
  }
1273
1268
 
1274
- /* Horizontal: a compact fixed-width chart beside the metric, matched to the
1275
- metric block's height. */
1276
- .seeds-metric-highlight:not(.seeds-metric-highlight-vertical) .seeds-metric-highlight-spark {
1269
+ .seeds-metric-highlight:not(.seeds-metric-highlight-vertical) .seeds-metric-highlight-chart {
1277
1270
  width: 104px;
1278
- align-self: stretch;
1279
- min-height: 40px;
1271
+ height: 48px;
1280
1272
  }
1281
1273
 
1282
- .seeds-metric-highlight-small:not(.seeds-metric-highlight-vertical) .seeds-metric-highlight-spark {
1274
+ .seeds-metric-highlight-small:not(.seeds-metric-highlight-vertical) .seeds-metric-highlight-chart {
1283
1275
  width: 88px;
1284
1276
  height: 40px;
1285
- align-self: center;
1286
1277
  }
1287
1278
 
1288
- /* Vertical: a full-width chart stacked beneath the metric. */
1289
- .seeds-metric-highlight-vertical .seeds-metric-highlight-spark {
1279
+ .seeds-metric-highlight-vertical .seeds-metric-highlight-chart {
1290
1280
  width: 100%;
1291
1281
  height: 96px;
1292
1282
  }
1293
1283
 
1294
- .seeds-metric-highlight-vertical.seeds-metric-highlight-small .seeds-metric-highlight-spark {
1284
+ .seeds-metric-highlight-vertical.seeds-metric-highlight-small .seeds-metric-highlight-chart {
1295
1285
  height: 56px;
1296
1286
  }
1297
1287
 
@@ -1355,6 +1345,35 @@
1355
1345
 
1356
1346
  }
1357
1347
 
1348
+ /* --- seeds-react-narrative-kit --- */
1349
+ /**
1350
+ * Seeds NarrativeDivider component classes.
1351
+ * Use these instead of writing out individual Tailwind utility classes.
1352
+ *
1353
+ * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
1354
+ * CSS variable definitions and dark mode support.
1355
+ *
1356
+ * Usage:
1357
+ * <hr class="seeds-narrative-divider" />
1358
+ */
1359
+
1360
+ @layer components {
1361
+
1362
+ /* A full-width, 1px horizontal rule. The <hr> ships with user-agent margins
1363
+ and a beveled border, so reset those and draw the line with a single
1364
+ border-top using the container-border-base token (#dee1e1), which also
1365
+ tracks dark mode. */
1366
+ .seeds-narrative-divider {
1367
+ box-sizing: border-box;
1368
+ width: 100%;
1369
+ height: 0;
1370
+ margin: 0;
1371
+ border: 0;
1372
+ border-top: 1px solid var(--color-container-border-base); /* #dee1e1 */
1373
+ }
1374
+
1375
+ }
1376
+
1358
1377
  /* --- seeds-react-narrative-kit --- */
1359
1378
  /**
1360
1379
  * Seeds NarrativeHeadline component classes.
@@ -1385,6 +1404,13 @@
1385
1404
  color: var(--color-text-headline);
1386
1405
  }
1387
1406
 
1407
+ /* Compact size for denser layouts (e.g. NarrativeSummary). Weight, letter
1408
+ spacing, and color are inherited from the base class. */
1409
+ .seeds-narrative-headline-small {
1410
+ font-size: var(--font-size-600); /* 24px */
1411
+ line-height: var(--line-height-600); /* 32px */
1412
+ }
1413
+
1388
1414
  /* Static gradient accent for a span of headline text ("highlighted word").
1389
1415
  Paints the AI brand gradient onto the glyphs via background-clip. */
1390
1416
  .seeds-narrative-headline-highlight {
@@ -1482,6 +1508,134 @@
1482
1508
 
1483
1509
  }
1484
1510
 
1511
+ /* --- seeds-react-narrative-kit --- */
1512
+ /**
1513
+ * Seeds NarrativeSummary component classes.
1514
+ * Use these instead of writing out individual Tailwind utility classes.
1515
+ *
1516
+ * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
1517
+ * CSS variable definitions and dark mode support. Also relies on
1518
+ * narrative-headline.css (headline) and eyebrow-token.css (eyebrow).
1519
+ *
1520
+ * The layout is a CSS grid driven by a container query on the root, so the
1521
+ * columns collapse based on the width the component is given, not the viewport.
1522
+ *
1523
+ * Usage:
1524
+ * <div class="seeds-narrative-summary">
1525
+ * <div class="seeds-narrative-summary-grid">…</div>
1526
+ * </div>
1527
+ */
1528
+
1529
+ @layer components {
1530
+
1531
+ /* Establishes the query container. The grid inside reacts to this element's
1532
+ inline size. */
1533
+ .seeds-narrative-summary {
1534
+ container-type: inline-size;
1535
+ box-sizing: border-box;
1536
+ font-family: var(--font-family);
1537
+ }
1538
+
1539
+ /* Stacked single column by default (narrow). The container query below expands
1540
+ it once there is room. */
1541
+ .seeds-narrative-summary-grid {
1542
+ display: grid;
1543
+ grid-template-columns: 1fr;
1544
+ gap: var(--space-450); /* 24px */
1545
+ }
1546
+
1547
+ /* The lead column: eyebrow, headline, optional action. align-items:flex-start
1548
+ keeps the eyebrow pill and the action sized to their content — without it the
1549
+ column's default stretch would blow the eyebrow out to full width. The
1550
+ headline still fills and wraps because its text is wider than the track. */
1551
+ .seeds-narrative-summary-lead {
1552
+ display: flex;
1553
+ flex-direction: column;
1554
+ align-items: flex-start;
1555
+ gap: var(--space-300); /* 8px */
1556
+ min-width: 0;
1557
+ }
1558
+
1559
+ /* The headline area grows so the action anchors toward the bottom of the lead
1560
+ column when the neighboring columns are taller. align-self:stretch fills the
1561
+ track width (the lead column pins other items to flex-start) so the headline
1562
+ wraps at the column edge regardless of its length. */
1563
+ .seeds-narrative-summary-headline {
1564
+ flex: 1 1 auto;
1565
+ align-self: stretch;
1566
+ }
1567
+
1568
+ /* In three-column mode the content wrapper is transparent to the grid, so its
1569
+ two sections become grid items in their own columns. In two-column mode the
1570
+ container query below turns it into a real, stacking grid item. */
1571
+ .seeds-narrative-summary-content {
1572
+ display: contents;
1573
+ }
1574
+
1575
+ .seeds-narrative-summary-section {
1576
+ display: flex;
1577
+ flex-direction: column;
1578
+ gap: var(--space-300); /* 8px */
1579
+ min-width: 0;
1580
+ }
1581
+
1582
+ /* Section label. 14px / 24px has no exact type token (the scale skips from
1583
+ 13px to 16px), so the design value is kept verbatim — same rationale as
1584
+ eyebrow-token.css. All other values use tokens. */
1585
+ .seeds-narrative-summary-label {
1586
+ margin: 0;
1587
+ font-size: 14px;
1588
+ line-height: 24px;
1589
+ font-weight: var(--font-weight-bold);
1590
+ color: var(--color-text-headline);
1591
+ }
1592
+
1593
+ .seeds-narrative-summary-text {
1594
+ margin: 0;
1595
+ font-size: 14px; /* off-scale, see label above */
1596
+ line-height: 24px;
1597
+ font-weight: var(--font-weight-normal);
1598
+ color: var(--color-text-body);
1599
+ }
1600
+
1601
+ .seeds-narrative-summary-list {
1602
+ margin: 0;
1603
+ padding-inline-start: 21px;
1604
+ list-style: disc;
1605
+ font-size: 14px; /* off-scale, see label above */
1606
+ line-height: 24px;
1607
+ font-weight: var(--font-weight-normal);
1608
+ color: var(--color-text-body);
1609
+ }
1610
+
1611
+ .seeds-narrative-summary-list li {
1612
+ margin: 0;
1613
+ }
1614
+
1615
+ /* Expand to the multi-column layout once the component is wide enough. The
1616
+ threshold is on the component's own width (container query), so a narrow card
1617
+ on a wide screen still stacks. 640px = Tailwind/Seeds sm breakpoint. */
1618
+ @container (min-width: 640px) {
1619
+ .seeds-narrative-summary-grid {
1620
+ grid-template-columns: repeat(3, 1fr);
1621
+ }
1622
+
1623
+ /* 1/3 lead + 2/3 content. */
1624
+ .seeds-narrative-summary-two-column {
1625
+ grid-template-columns: 1fr 2fr;
1626
+ }
1627
+
1628
+ /* The content wrapper becomes a real grid item that stacks its two sections. */
1629
+ .seeds-narrative-summary-two-column .seeds-narrative-summary-content {
1630
+ display: flex;
1631
+ flex-direction: column;
1632
+ gap: var(--space-450); /* 24px */
1633
+ min-width: 0;
1634
+ }
1635
+ }
1636
+
1637
+ }
1638
+
1485
1639
  /* --- seeds-react-narrative-kit --- */
1486
1640
  /**
1487
1641
  * Seeds PullQuote component classes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "31.4.0",
3
+ "version": "31.5.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -111,7 +111,7 @@
111
111
  "@sproutsocial/seeds-react-message": "^1.0.48",
112
112
  "@sproutsocial/seeds-react-mixins": "^4.3.7",
113
113
  "@sproutsocial/seeds-react-modal": "^2.5.22",
114
- "@sproutsocial/seeds-react-narrative-kit": "^0.2.0",
114
+ "@sproutsocial/seeds-react-narrative-kit": "^0.3.0",
115
115
  "@sproutsocial/seeds-react-numeral": "^1.0.47",
116
116
  "@sproutsocial/seeds-react-pagination": "^0.1.20",
117
117
  "@sproutsocial/seeds-react-panel": "^1.0.0",