executable-stories-react 0.17.0 → 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.
package/dist/ssr.js CHANGED
@@ -342,11 +342,11 @@ function formatValue(value) {
342
342
  return String(value);
343
343
  }
344
344
  }
345
- function DocKv({ entry }) {
346
- return /* @__PURE__ */ jsxs2("dl", { className: "my-2 flex flex-wrap items-baseline gap-x-2 text-sm", children: [
345
+ function DocKv({ entries }) {
346
+ 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__ */ jsxs2("div", { className: "contents", children: [
347
347
  /* @__PURE__ */ jsx6("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
348
348
  /* @__PURE__ */ jsx6("dd", { className: "min-w-0 break-words font-mono text-foreground", children: formatValue(entry.value) })
349
- ] });
349
+ ] }, i)) });
350
350
  }
351
351
 
352
352
  // src/hooks/useRenderers.ts
@@ -433,7 +433,7 @@ function DocSection({ entry }) {
433
433
  if (renderers.section) {
434
434
  return /* @__PURE__ */ jsx10(Fragment2, { children: renderers.section(entry) });
435
435
  }
436
- const html = safeMarkdownHtml(entry.markdown);
436
+ const html = safeMarkdownHtml(dedent(entry.markdown));
437
437
  return /* @__PURE__ */ jsxs5("section", { className: "my-3 text-sm", "aria-label": entry.title, children: [
438
438
  entry.title ? /* @__PURE__ */ jsx10("h4", { className: "mb-1 font-semibold text-foreground", children: entry.title }) : null,
439
439
  /* @__PURE__ */ jsx10(
@@ -619,7 +619,7 @@ function DocEntry({ entry }) {
619
619
  case "tag":
620
620
  return /* @__PURE__ */ jsx17(DocTag, { entry });
621
621
  case "kv":
622
- return /* @__PURE__ */ jsx17(DocKv, { entry });
622
+ return /* @__PURE__ */ jsx17(DocKv, { entries: [entry] });
623
623
  case "code":
624
624
  return /* @__PURE__ */ jsx17(DocCode, { entry });
625
625
  case "table":
@@ -647,7 +647,15 @@ function DocEntry({ entry }) {
647
647
  import { Fragment as Fragment5, jsx as jsx18 } from "react/jsx-runtime";
648
648
  function ReportDocEntries({ entries }) {
649
649
  if (entries.length === 0) return null;
650
- return /* @__PURE__ */ jsx18(Fragment5, { children: entries.map((entry, i) => /* @__PURE__ */ jsx18(DocEntry, { entry }, i)) });
650
+ const groups = [];
651
+ for (const entry of entries) {
652
+ const last = groups[groups.length - 1];
653
+ if (entry.kind === "kv" && Array.isArray(last)) last.push(entry);
654
+ else groups.push(entry.kind === "kv" ? [entry] : entry);
655
+ }
656
+ return /* @__PURE__ */ jsx18(Fragment5, { children: groups.map(
657
+ (g, i) => Array.isArray(g) ? /* @__PURE__ */ jsx18(DocKv, { entries: g }, i) : /* @__PURE__ */ jsx18(DocEntry, { entry: g }, i)
658
+ ) });
651
659
  }
652
660
 
653
661
  // src/components/ReportSteps.tsx
@@ -1428,10 +1436,17 @@ function ReportFeatureIntro({ feature }) {
1428
1436
  dangerouslySetInnerHTML: { __html: safeMarkdownHtml(dedent(feature.narrative)) }
1429
1437
  }
1430
1438
  ) : null,
1431
- hasGlossary ? /* @__PURE__ */ jsx28("dl", { className: "grid gap-1.5", "aria-label": "Glossary", children: feature.glossary.map((entry) => /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap gap-x-2 text-xs", children: [
1432
- /* @__PURE__ */ jsx28("dt", { className: "font-medium text-foreground", children: entry.term }),
1433
- /* @__PURE__ */ jsx28("dd", { className: "flex-1 text-muted-foreground", children: entry.definition })
1434
- ] }, entry.term)) }) : null
1439
+ hasGlossary ? /* @__PURE__ */ jsx28(
1440
+ "dl",
1441
+ {
1442
+ className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs",
1443
+ "aria-label": "Glossary",
1444
+ children: feature.glossary.map((entry) => /* @__PURE__ */ jsxs19("div", { className: "contents", children: [
1445
+ /* @__PURE__ */ jsx28("dt", { className: "font-medium text-foreground", children: entry.term }),
1446
+ /* @__PURE__ */ jsx28("dd", { className: "text-muted-foreground", children: entry.definition })
1447
+ ] }, entry.term))
1448
+ }
1449
+ ) : null
1435
1450
  ] });
1436
1451
  }
1437
1452
  function featureKindLabel(kind) {
@@ -1447,7 +1462,6 @@ function ReportFeature({ feature }) {
1447
1462
  const titleId = `${feature.id}-title`;
1448
1463
  const bodyId = `${feature.id}-body`;
1449
1464
  const s = feature.summary;
1450
- const skipped = s.skipped + s.pending;
1451
1465
  const collapse = useCollapse();
1452
1466
  const collapsed = collapse?.isCollapsed(feature.id) ?? false;
1453
1467
  const kindLabel = featureKindLabel(feature.kind);
@@ -1487,7 +1501,12 @@ function ReportFeature({ feature }) {
1487
1501
  "p",
1488
1502
  {
1489
1503
  className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",
1490
- "aria-label": `${s.passed} passed, ${s.failed} failed, ${skipped} skipped`,
1504
+ "aria-label": [
1505
+ `${s.passed} passed`,
1506
+ `${s.failed} failed`,
1507
+ s.skipped > 0 && `${s.skipped} skipped`,
1508
+ s.pending > 0 && `${s.pending} pending`
1509
+ ].filter(Boolean).join(", "),
1491
1510
  children: [
1492
1511
  /* @__PURE__ */ jsxs20("span", { children: [
1493
1512
  s.passed,
@@ -1498,12 +1517,19 @@ function ReportFeature({ feature }) {
1498
1517
  s.failed,
1499
1518
  " failed"
1500
1519
  ] }),
1501
- skipped > 0 ? /* @__PURE__ */ jsxs20(Fragment9, { children: [
1520
+ s.skipped > 0 ? /* @__PURE__ */ jsxs20(Fragment9, { children: [
1502
1521
  /* @__PURE__ */ jsx29("span", { "aria-hidden": true, children: "\xB7" }),
1503
1522
  /* @__PURE__ */ jsxs20("span", { children: [
1504
- skipped,
1523
+ s.skipped,
1505
1524
  " skipped"
1506
1525
  ] })
1526
+ ] }) : null,
1527
+ s.pending > 0 ? /* @__PURE__ */ jsxs20(Fragment9, { children: [
1528
+ /* @__PURE__ */ jsx29("span", { "aria-hidden": true, children: "\xB7" }),
1529
+ /* @__PURE__ */ jsxs20("span", { children: [
1530
+ s.pending,
1531
+ " pending"
1532
+ ] })
1507
1533
  ] }) : null
1508
1534
  ]
1509
1535
  }