@sproutsocial/racine 31.3.1 → 31.4.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,20 @@
1
1
  # Change Log
2
2
 
3
+ ## 31.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7ce52ce: Add narrative primitives to `seeds-react-narrative-kit`: `MetricHighlight` for
8
+ emphasizing key figures, `NarrativeHeadline` (with highlight and roll variants) for
9
+ section headers, and `PullQuote` for callout quotations. All are exported through
10
+ `@sproutsocial/racine`.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [7ce52ce]
15
+ - @sproutsocial/seeds-react-narrative-kit@0.2.0
16
+ - @sproutsocial/seeds-react-accordion@0.4.47
17
+
3
18
  ## 31.3.1
4
19
 
5
20
  ### Patch Changes
@@ -1078,6 +1078,225 @@
1078
1078
  }
1079
1079
  }
1080
1080
 
1081
+ /* --- seeds-react-narrative-kit --- */
1082
+ /**
1083
+ * Seeds EyebrowToken component classes.
1084
+ * Use these instead of writing out individual Tailwind utility classes.
1085
+ *
1086
+ * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
1087
+ * CSS variable definitions and dark mode support.
1088
+ *
1089
+ * Usage:
1090
+ * <span class="seeds-eyebrow-token">May 31, 2026</span>
1091
+ */
1092
+
1093
+ @layer components {
1094
+
1095
+ /* A solid gray pill matching the design: background and border are both the
1096
+ #dee1e1 container-border-base token, which also tracks dark mode. The two
1097
+ pixel literals below have no exact theme token — the --space scale skips 6px
1098
+ (4px→8px) and the --font-size scale skips 12px (11px→13px) — so the design's
1099
+ values are kept verbatim. All colors use tokens. */
1100
+ .seeds-eyebrow-token {
1101
+ box-sizing: border-box;
1102
+ display: inline-flex;
1103
+ align-items: center;
1104
+ justify-content: center;
1105
+ gap: var(--space-100); /* 2px */
1106
+ padding: var(--space-100) var(--space-300); /* 2px / 8px */
1107
+ border: 1px solid var(--color-container-border-base); /* #dee1e1 */
1108
+ border-radius: var(--radius-500); /* 6px */
1109
+ background-color: var(--color-container-border-base); /* #dee1e1 */
1110
+ font-family: var(--font-family);
1111
+ font-size: 12px; /* text-sm */
1112
+ line-height: 20px;
1113
+ font-weight: var(--font-weight-normal);
1114
+ color: var(--color-text-body);
1115
+ white-space: nowrap;
1116
+ }
1117
+
1118
+ }
1119
+
1120
+ /* --- seeds-react-narrative-kit --- */
1121
+ /**
1122
+ * Seeds MetricHighlight component classes.
1123
+ * Use these instead of writing out individual Tailwind utility classes.
1124
+ *
1125
+ * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
1126
+ * CSS variable definitions and dark mode support.
1127
+ *
1128
+ * Usage:
1129
+ * <div class="seeds-metric-highlight">…</div> // horizontal, default
1130
+ * <div class="seeds-metric-highlight seeds-metric-highlight-vertical">…</div>
1131
+ * <div class="seeds-metric-highlight seeds-metric-highlight-small">…</div>
1132
+ * <div class="seeds-metric-highlight seeds-metric-highlight-bare">…</div> // no surface
1133
+ */
1134
+
1135
+ @layer components {
1136
+
1137
+ .seeds-metric-highlight {
1138
+ box-sizing: border-box;
1139
+ display: flex;
1140
+ align-items: flex-start;
1141
+ gap: var(--space-350); /* 12px */
1142
+ border-radius: var(--radius-800); /* 12px */
1143
+ font-family: var(--font-family);
1144
+ /* Container (default): a padded gray app surface (matches the design's
1145
+ #f3f4f4 box). `-bare` strips it. */
1146
+ padding: var(--space-400) var(--space-450); /* 16px / 24px */
1147
+ background-color: var(--color-app-bg-base);
1148
+ }
1149
+
1150
+ .seeds-metric-highlight-bare {
1151
+ padding: 0;
1152
+ background-color: transparent;
1153
+ }
1154
+
1155
+ .seeds-metric-highlight-vertical {
1156
+ flex-direction: column;
1157
+ }
1158
+
1159
+ /* The metric block: label + value/trend. Grows to fill the row in horizontal. */
1160
+ .seeds-metric-highlight-metric {
1161
+ box-sizing: border-box;
1162
+ display: flex;
1163
+ flex-direction: column;
1164
+ align-items: flex-start;
1165
+ gap: var(--space-200); /* 4px */
1166
+ flex: 1 0 0;
1167
+ min-width: 0;
1168
+ }
1169
+
1170
+ .seeds-metric-highlight-vertical .seeds-metric-highlight-metric {
1171
+ width: 100%;
1172
+ flex: 0 0 auto;
1173
+ }
1174
+
1175
+ /* Small: label and value collapse onto a single centered row. */
1176
+ .seeds-metric-highlight-small .seeds-metric-highlight-metric {
1177
+ flex-direction: row;
1178
+ align-items: center;
1179
+ gap: var(--space-300); /* 8px */
1180
+ }
1181
+
1182
+ .seeds-metric-highlight-label {
1183
+ margin: 0;
1184
+ font-size: var(--font-size-300); /* 16px */
1185
+ line-height: var(--line-height-400); /* ~28px */
1186
+ font-weight: var(--font-weight-normal);
1187
+ color: var(--color-text-body);
1188
+ overflow-wrap: break-word;
1189
+ }
1190
+
1191
+ /* In small, the label takes the slack so the value/trend align to the end. */
1192
+ .seeds-metric-highlight-small .seeds-metric-highlight-label {
1193
+ flex: 1 0 0;
1194
+ min-width: 0;
1195
+ }
1196
+
1197
+ .seeds-metric-highlight-value-row {
1198
+ display: flex;
1199
+ align-items: center;
1200
+ gap: var(--space-300); /* 8px */
1201
+ }
1202
+
1203
+ .seeds-metric-highlight-small .seeds-metric-highlight-value-row {
1204
+ justify-content: flex-end;
1205
+ }
1206
+
1207
+ .seeds-metric-highlight-value {
1208
+ margin: 0;
1209
+ /* No mono token exists yet; fall back to a system monospace stack. Mirrors the
1210
+ font/font-mono treatment in the design. */
1211
+ font-family: var(--font-family-mono, ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace);
1212
+ font-size: var(--font-size-700); /* 32px */
1213
+ line-height: var(--line-height-700); /* 40px */
1214
+ font-weight: var(--font-weight-bold);
1215
+ color: var(--color-text-headline);
1216
+ white-space: nowrap;
1217
+ }
1218
+
1219
+ .seeds-metric-highlight-small .seeds-metric-highlight-value {
1220
+ font-size: var(--font-size-600); /* 24px */
1221
+ line-height: var(--line-height-600); /* 32px */
1222
+ }
1223
+
1224
+ /* Trend badge — a rounded pill. Up is the positive (green) treatment; down
1225
+ swaps to the negative (red) treatment. Color flows to the arrow + value via
1226
+ currentColor. */
1227
+ .seeds-metric-highlight-trend {
1228
+ display: inline-flex;
1229
+ align-items: center;
1230
+ gap: var(--space-200); /* 4px */
1231
+ padding: var(--space-100) var(--space-300); /* 2px / 8px */
1232
+ border-radius: 999px;
1233
+ font-size: var(--font-size-200); /* 13px */
1234
+ line-height: var(--line-height-200);
1235
+ font-weight: var(--font-weight-bold);
1236
+ white-space: nowrap;
1237
+ background-color: var(--color-container-bg-decorative-green);
1238
+ color: var(--color-text-decorative-green);
1239
+ }
1240
+
1241
+ .seeds-metric-highlight-trend-down {
1242
+ background-color: var(--color-container-bg-decorative-red);
1243
+ color: var(--color-text-decorative-red);
1244
+ }
1245
+
1246
+ .seeds-metric-highlight-trend-arrow {
1247
+ flex: 0 0 auto;
1248
+ width: 1em;
1249
+ height: 1em;
1250
+ stroke: currentColor;
1251
+ stroke-width: 1.5;
1252
+ }
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;
1258
+ 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;
1272
+ }
1273
+
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 {
1277
+ width: 104px;
1278
+ align-self: stretch;
1279
+ min-height: 40px;
1280
+ }
1281
+
1282
+ .seeds-metric-highlight-small:not(.seeds-metric-highlight-vertical) .seeds-metric-highlight-spark {
1283
+ width: 88px;
1284
+ height: 40px;
1285
+ align-self: center;
1286
+ }
1287
+
1288
+ /* Vertical: a full-width chart stacked beneath the metric. */
1289
+ .seeds-metric-highlight-vertical .seeds-metric-highlight-spark {
1290
+ width: 100%;
1291
+ height: 96px;
1292
+ }
1293
+
1294
+ .seeds-metric-highlight-vertical.seeds-metric-highlight-small .seeds-metric-highlight-spark {
1295
+ height: 56px;
1296
+ }
1297
+
1298
+ }
1299
+
1081
1300
  /* --- seeds-react-narrative-kit --- */
1082
1301
  /**
1083
1302
  * Seeds NarrativeContainer component classes.
@@ -1098,7 +1317,7 @@
1098
1317
  box-sizing: border-box;
1099
1318
  display: flex;
1100
1319
  flex-direction: column;
1101
- align-items: flex-start;
1320
+ align-items: stretch;
1102
1321
  padding: var(--space-500);
1103
1322
  border-radius: var(--radius-800);
1104
1323
  box-shadow: var(--shadow-low);
@@ -1136,6 +1355,224 @@
1136
1355
 
1137
1356
  }
1138
1357
 
1358
+ /* --- seeds-react-narrative-kit --- */
1359
+ /**
1360
+ * Seeds NarrativeHeadline component classes.
1361
+ * Use these instead of writing out individual Tailwind utility classes.
1362
+ *
1363
+ * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
1364
+ * CSS variable definitions and dark mode support.
1365
+ *
1366
+ * Usage:
1367
+ * <h2 class="seeds-narrative-headline">
1368
+ * Headline with a
1369
+ * <span class="seeds-narrative-headline-highlight">highlighted</span>
1370
+ * word
1371
+ * </h2>
1372
+ */
1373
+
1374
+ @layer components {
1375
+
1376
+ /* Headline text. Rendered as an h1–h6, so reset the UA heading margins. */
1377
+ .seeds-narrative-headline {
1378
+ box-sizing: border-box;
1379
+ margin: 0;
1380
+ font-family: var(--font-family);
1381
+ font-size: var(--font-size-700);
1382
+ line-height: var(--line-height-700);
1383
+ font-weight: var(--font-weight-bold);
1384
+ letter-spacing: -0.02em;
1385
+ color: var(--color-text-headline);
1386
+ }
1387
+
1388
+ /* Static gradient accent for a span of headline text ("highlighted word").
1389
+ Paints the AI brand gradient onto the glyphs via background-clip. */
1390
+ .seeds-narrative-headline-highlight {
1391
+ background: var(--color-gradient-ai);
1392
+ -webkit-background-clip: text;
1393
+ background-clip: text;
1394
+ color: transparent;
1395
+ }
1396
+
1397
+ /* -------------------------------------------------------------------------
1398
+ "Roll" variant — vertical word roll. The active word slides into view
1399
+ while the previous one rolls out.
1400
+ ------------------------------------------------------------------------- */
1401
+ .seeds-narrative-headline-roll {
1402
+ display: inline-block;
1403
+ position: relative;
1404
+ /* clip-path rather than overflow:hidden: overflow:hidden on an inline-block
1405
+ snaps its baseline to the bottom margin edge, dropping the rolling word
1406
+ below the surrounding text. clip-path keeps the natural baseline. */
1407
+ clip-path: inset(0);
1408
+ }
1409
+
1410
+ /* Invisible word that holds the box width to the active word. */
1411
+ .seeds-narrative-headline-roll-sizer {
1412
+ display: inline-block;
1413
+ visibility: hidden;
1414
+ white-space: nowrap;
1415
+ pointer-events: none;
1416
+ }
1417
+
1418
+ .seeds-narrative-headline-roll-word {
1419
+ display: inline-block;
1420
+ position: absolute;
1421
+ top: 0;
1422
+ left: 0;
1423
+ white-space: nowrap;
1424
+ transform: translateY(100%);
1425
+ opacity: 0;
1426
+ transition:
1427
+ transform var(--seeds-narrative-headline-roll-ms, 500ms) ease,
1428
+ opacity var(--seeds-narrative-headline-roll-ms, 500ms) ease;
1429
+ }
1430
+
1431
+ .seeds-narrative-headline-roll-word-active {
1432
+ transform: translateY(0);
1433
+ opacity: 1;
1434
+ }
1435
+
1436
+ .seeds-narrative-headline-roll-word-past {
1437
+ transform: translateY(-100%);
1438
+ opacity: 0;
1439
+ }
1440
+
1441
+ /* Reverse the roll direction. */
1442
+ .seeds-narrative-headline-roll-down .seeds-narrative-headline-roll-word {
1443
+ transform: translateY(-100%);
1444
+ }
1445
+ .seeds-narrative-headline-roll-down .seeds-narrative-headline-roll-word-active {
1446
+ transform: translateY(0);
1447
+ }
1448
+ .seeds-narrative-headline-roll-down .seeds-narrative-headline-roll-word-past {
1449
+ transform: translateY(100%);
1450
+ }
1451
+
1452
+ /* Gradient-painted rolling words with a slow shimmer. */
1453
+ .seeds-narrative-headline-roll-gradient .seeds-narrative-headline-roll-word {
1454
+ background: var(--color-gradient-ai);
1455
+ background-size: 200% 200%;
1456
+ -webkit-background-clip: text;
1457
+ background-clip: text;
1458
+ color: transparent;
1459
+ animation: seeds-narrative-headline-grad-shift 8s ease infinite;
1460
+ }
1461
+
1462
+ @keyframes seeds-narrative-headline-grad-shift {
1463
+ 0%,
1464
+ 100% {
1465
+ background-position: 0% 50%;
1466
+ }
1467
+ 50% {
1468
+ background-position: 100% 50%;
1469
+ }
1470
+ }
1471
+
1472
+ /* The JS cycle is already disabled under reduced-motion (the first word holds);
1473
+ also flatten the transition and shimmer so any in-flight motion settles. */
1474
+ @media (prefers-reduced-motion: reduce) {
1475
+ .seeds-narrative-headline-roll-word {
1476
+ transition: none;
1477
+ }
1478
+ .seeds-narrative-headline-roll-gradient .seeds-narrative-headline-roll-word {
1479
+ animation: none;
1480
+ }
1481
+ }
1482
+
1483
+ }
1484
+
1485
+ /* --- seeds-react-narrative-kit --- */
1486
+ /**
1487
+ * Seeds PullQuote component classes.
1488
+ * Use these instead of writing out individual Tailwind utility classes.
1489
+ *
1490
+ * Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
1491
+ * CSS variable definitions and dark mode support.
1492
+ *
1493
+ * Usage:
1494
+ * <figure class="seeds-pull-quote">…</figure> // subtle (default)
1495
+ * <figure class="seeds-pull-quote seeds-pull-quote-vivid">…</figure>
1496
+ */
1497
+
1498
+ @layer components {
1499
+
1500
+ .seeds-pull-quote {
1501
+ position: relative;
1502
+ overflow: hidden;
1503
+ box-sizing: border-box;
1504
+ width: 100%;
1505
+ display: flex;
1506
+ flex-direction: column;
1507
+ align-items: flex-start;
1508
+ margin: 0; /* reset the browser default <figure> margin */
1509
+ /* 40px block / 48px inline — 48px is off the space scale, so derive it from
1510
+ two tokens (40 + 8) rather than hardcoding an off-scale value. */
1511
+ padding: var(--space-600) calc(var(--space-600) + var(--space-300));
1512
+ border-radius: var(--radius-800);
1513
+ box-shadow: var(--shadow-low);
1514
+ font-family: var(--font-family);
1515
+ /* Subtle (default): the 20% AI gradient tint composited over the base
1516
+ surface. --color-gradient-ai-subtle is already translucent, so layering it
1517
+ over the opaque base color produces the soft wash. */
1518
+ background-color: var(--color-container-bg-base);
1519
+ background-image: var(--color-gradient-ai-subtle);
1520
+ color: var(--color-text-headline);
1521
+ }
1522
+
1523
+ /* Vivid: the full-saturation AI gradient with white content. White has no
1524
+ semantic Seeds token; it is part of the AI gradient treatment (mirrors the
1525
+ raw brand hex used in --color-gradient-ai). */
1526
+ .seeds-pull-quote-vivid {
1527
+ background-color: transparent;
1528
+ background-image: var(--color-gradient-ai);
1529
+ color: #fff;
1530
+ }
1531
+
1532
+ /* The accented bar holding the quote and attribution. */
1533
+ .seeds-pull-quote-bar {
1534
+ box-sizing: border-box;
1535
+ display: flex;
1536
+ flex-direction: column;
1537
+ align-items: flex-start;
1538
+ gap: var(--space-450); /* 24px */
1539
+ width: 100%;
1540
+ padding-left: var(--space-450); /* 24px */
1541
+ /* 4px is off the border-width scale (max token is 3px); the bar is a
1542
+ decorative accent, mirroring NarrativeContainer's hardcoded 4px ring. The
1543
+ subtle accent uses the AI gradient mid stop (#9747ff — no exact token). */
1544
+ border-left: 4px solid #9747ff;
1545
+ }
1546
+
1547
+ .seeds-pull-quote-vivid .seeds-pull-quote-bar {
1548
+ border-left-color: #fff;
1549
+ }
1550
+
1551
+ .seeds-pull-quote-text {
1552
+ margin: 0; /* reset the browser default <blockquote> margin */
1553
+ font-size: var(--font-size-600);
1554
+ line-height: var(--line-height-600);
1555
+ font-style: italic;
1556
+ font-weight: var(--font-weight-normal);
1557
+ color: inherit;
1558
+ overflow-wrap: break-word;
1559
+ }
1560
+
1561
+ /* Attribution row — a flex container for author name, avatar, network, etc.
1562
+ Direct text inherits a bold, small treatment to match the display-name style;
1563
+ richer content (e.g. an Avatar) composes freely. */
1564
+ .seeds-pull-quote-attribution {
1565
+ display: flex;
1566
+ align-items: center;
1567
+ gap: var(--space-300); /* 8px */
1568
+ font-size: var(--font-size-200);
1569
+ line-height: var(--line-height-200);
1570
+ font-weight: var(--font-weight-bold);
1571
+ color: inherit;
1572
+ }
1573
+
1574
+ }
1575
+
1139
1576
  /* --- seeds-react-text --- */
1140
1577
  /**
1141
1578
  * Seeds Text component classes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "31.3.1",
3
+ "version": "31.4.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@size-limit/file": "^11.1.6",
76
- "@sproutsocial/seeds-react-accordion": "^0.4.46",
76
+ "@sproutsocial/seeds-react-accordion": "^0.4.47",
77
77
  "@sproutsocial/seeds-react-avatar": "^1.1.16",
78
78
  "@sproutsocial/seeds-react-badge": "^2.0.34",
79
79
  "@sproutsocial/seeds-react-banner": "^1.1.22",
@@ -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.1.0",
114
+ "@sproutsocial/seeds-react-narrative-kit": "^0.2.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",
@@ -163,7 +163,7 @@
163
163
  "@sproutsocial/seeds-motion": "^1.8.2",
164
164
  "@sproutsocial/seeds-networkcolor": "^2.22.0",
165
165
  "@sproutsocial/seeds-partner-logos": "^2.4.1",
166
- "@sproutsocial/seeds-react-menu": "^1.15.10",
166
+ "@sproutsocial/seeds-react-menu": "^1.16.0",
167
167
  "@sproutsocial/seeds-react-testing-library": "*",
168
168
  "@sproutsocial/seeds-space": "^0.8.1",
169
169
  "@sproutsocial/seeds-testing": "*",