executable-stories-react 0.17.1 → 0.18.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.
@@ -203,11 +203,11 @@ function formatValue(value) {
203
203
  return String(value);
204
204
  }
205
205
  }
206
- function DocKv({ entry }) {
207
- return /* @__PURE__ */ jsxs("dl", { className: "my-2 flex flex-wrap items-baseline gap-x-2 text-sm", children: [
206
+ function DocKv({ entries }) {
207
+ return /* @__PURE__ */ jsx6("dl", { className: "my-2 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-sm", children: entries.map((entry, i) => /* @__PURE__ */ jsxs("div", { className: "contents", children: [
208
208
  /* @__PURE__ */ jsx6("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
209
209
  /* @__PURE__ */ jsx6("dd", { className: "min-w-0 break-words font-mono text-foreground", children: formatValue(entry.value) })
210
- ] });
210
+ ] }, i)) });
211
211
  }
212
212
 
213
213
  // src/hooks/useRenderers.ts
@@ -294,7 +294,7 @@ function DocSection({ entry }) {
294
294
  if (renderers.section) {
295
295
  return /* @__PURE__ */ jsx10(Fragment2, { children: renderers.section(entry) });
296
296
  }
297
- const html = safeMarkdownHtml(entry.markdown);
297
+ const html = safeMarkdownHtml(dedent(entry.markdown));
298
298
  return /* @__PURE__ */ jsxs4("section", { className: "my-3 text-sm", "aria-label": entry.title, children: [
299
299
  entry.title ? /* @__PURE__ */ jsx10("h4", { className: "mb-1 font-semibold text-foreground", children: entry.title }) : null,
300
300
  /* @__PURE__ */ jsx10(
@@ -480,7 +480,7 @@ function DocEntry({ entry }) {
480
480
  case "tag":
481
481
  return /* @__PURE__ */ jsx17(DocTag, { entry });
482
482
  case "kv":
483
- return /* @__PURE__ */ jsx17(DocKv, { entry });
483
+ return /* @__PURE__ */ jsx17(DocKv, { entries: [entry] });
484
484
  case "code":
485
485
  return /* @__PURE__ */ jsx17(DocCode, { entry });
486
486
  case "table":
@@ -508,7 +508,15 @@ function DocEntry({ entry }) {
508
508
  import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
509
509
  function ReportDocEntries({ entries }) {
510
510
  if (entries.length === 0) return null;
511
- return /* @__PURE__ */ jsx18(Fragment5, { children: entries.map((entry, i) => /* @__PURE__ */ jsx18(DocEntry, { entry }, i)) });
511
+ const groups = [];
512
+ for (const entry of entries) {
513
+ const last = groups[groups.length - 1];
514
+ if (entry.kind === "kv" && Array.isArray(last)) last.push(entry);
515
+ else groups.push(entry.kind === "kv" ? [entry] : entry);
516
+ }
517
+ return /* @__PURE__ */ jsx18(Fragment5, { children: groups.map(
518
+ (g, i) => Array.isArray(g) ? /* @__PURE__ */ jsx18(DocKv, { entries: g }, i) : /* @__PURE__ */ jsx18(DocEntry, { entry: g }, i)
519
+ ) });
512
520
  }
513
521
 
514
522
  // src/components/ReportSteps.tsx
@@ -1403,10 +1411,17 @@ function ReportFeatureIntro({ feature }) {
1403
1411
  dangerouslySetInnerHTML: { __html: safeMarkdownHtml(dedent(feature.narrative)) }
1404
1412
  }
1405
1413
  ) : null,
1406
- hasGlossary ? /* @__PURE__ */ jsx28("dl", { className: "grid gap-1.5", "aria-label": "Glossary", children: feature.glossary.map((entry) => /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-x-2 text-xs", children: [
1407
- /* @__PURE__ */ jsx28("dt", { className: "font-medium text-foreground", children: entry.term }),
1408
- /* @__PURE__ */ jsx28("dd", { className: "flex-1 text-muted-foreground", children: entry.definition })
1409
- ] }, entry.term)) }) : null
1414
+ hasGlossary ? /* @__PURE__ */ jsx28(
1415
+ "dl",
1416
+ {
1417
+ className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs",
1418
+ "aria-label": "Glossary",
1419
+ children: feature.glossary.map((entry) => /* @__PURE__ */ jsxs18("div", { className: "contents", children: [
1420
+ /* @__PURE__ */ jsx28("dt", { className: "font-medium text-foreground", children: entry.term }),
1421
+ /* @__PURE__ */ jsx28("dd", { className: "text-muted-foreground", children: entry.definition })
1422
+ ] }, entry.term))
1423
+ }
1424
+ ) : null
1410
1425
  ] });
1411
1426
  }
1412
1427
  function featureKindLabel(kind) {
@@ -1422,7 +1437,6 @@ function ReportFeature({ feature }) {
1422
1437
  const titleId = `${feature.id}-title`;
1423
1438
  const bodyId = `${feature.id}-body`;
1424
1439
  const s = feature.summary;
1425
- const skipped = s.skipped + s.pending;
1426
1440
  const collapse = useCollapse();
1427
1441
  const collapsed = collapse?.isCollapsed(feature.id) ?? false;
1428
1442
  const kindLabel = featureKindLabel(feature.kind);
@@ -1462,7 +1476,12 @@ function ReportFeature({ feature }) {
1462
1476
  "p",
1463
1477
  {
1464
1478
  className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",
1465
- "aria-label": `${s.passed} passed, ${s.failed} failed, ${skipped} skipped`,
1479
+ "aria-label": [
1480
+ `${s.passed} passed`,
1481
+ `${s.failed} failed`,
1482
+ s.skipped > 0 && `${s.skipped} skipped`,
1483
+ s.pending > 0 && `${s.pending} pending`
1484
+ ].filter(Boolean).join(", "),
1466
1485
  children: [
1467
1486
  /* @__PURE__ */ jsxs19("span", { children: [
1468
1487
  s.passed,
@@ -1473,12 +1492,19 @@ function ReportFeature({ feature }) {
1473
1492
  s.failed,
1474
1493
  " failed"
1475
1494
  ] }),
1476
- skipped > 0 ? /* @__PURE__ */ jsxs19(Fragment9, { children: [
1495
+ s.skipped > 0 ? /* @__PURE__ */ jsxs19(Fragment9, { children: [
1477
1496
  /* @__PURE__ */ jsx29("span", { "aria-hidden": true, children: "\xB7" }),
1478
1497
  /* @__PURE__ */ jsxs19("span", { children: [
1479
- skipped,
1498
+ s.skipped,
1480
1499
  " skipped"
1481
1500
  ] })
1501
+ ] }) : null,
1502
+ s.pending > 0 ? /* @__PURE__ */ jsxs19(Fragment9, { children: [
1503
+ /* @__PURE__ */ jsx29("span", { "aria-hidden": true, children: "\xB7" }),
1504
+ /* @__PURE__ */ jsxs19("span", { children: [
1505
+ s.pending,
1506
+ " pending"
1507
+ ] })
1482
1508
  ] }) : null
1483
1509
  ]
1484
1510
  }