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.
package/dist/ssr.cjs CHANGED
@@ -363,11 +363,11 @@ function formatValue(value) {
363
363
  return String(value);
364
364
  }
365
365
  }
366
- function DocKv({ entry }) {
367
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("dl", { className: "my-2 flex flex-wrap items-baseline gap-x-2 text-sm", children: [
366
+ function DocKv({ entries }) {
367
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dl", { className: "my-2 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-sm", children: entries.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "contents", children: [
368
368
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
369
369
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { className: "min-w-0 break-words font-mono text-foreground", children: formatValue(entry.value) })
370
- ] });
370
+ ] }, i)) });
371
371
  }
372
372
 
373
373
  // src/hooks/useRenderers.ts
@@ -454,7 +454,7 @@ function DocSection({ entry }) {
454
454
  if (renderers.section) {
455
455
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: renderers.section(entry) });
456
456
  }
457
- const html = safeMarkdownHtml(entry.markdown);
457
+ const html = safeMarkdownHtml(dedent(entry.markdown));
458
458
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "my-3 text-sm", "aria-label": entry.title, children: [
459
459
  entry.title ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "mb-1 font-semibold text-foreground", children: entry.title }) : null,
460
460
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -640,7 +640,7 @@ function DocEntry({ entry }) {
640
640
  case "tag":
641
641
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocTag, { entry });
642
642
  case "kv":
643
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocKv, { entry });
643
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocKv, { entries: [entry] });
644
644
  case "code":
645
645
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocCode, { entry });
646
646
  case "table":
@@ -668,7 +668,15 @@ function DocEntry({ entry }) {
668
668
  var import_jsx_runtime18 = require("react/jsx-runtime");
669
669
  function ReportDocEntries({ entries }) {
670
670
  if (entries.length === 0) return null;
671
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: entries.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DocEntry, { entry }, i)) });
671
+ const groups = [];
672
+ for (const entry of entries) {
673
+ const last = groups[groups.length - 1];
674
+ if (entry.kind === "kv" && Array.isArray(last)) last.push(entry);
675
+ else groups.push(entry.kind === "kv" ? [entry] : entry);
676
+ }
677
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: groups.map(
678
+ (g, i) => Array.isArray(g) ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DocKv, { entries: g }, i) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DocEntry, { entry: g }, i)
679
+ ) });
672
680
  }
673
681
 
674
682
  // src/components/ReportSteps.tsx
@@ -1449,10 +1457,17 @@ function ReportFeatureIntro({ feature }) {
1449
1457
  dangerouslySetInnerHTML: { __html: safeMarkdownHtml(dedent(feature.narrative)) }
1450
1458
  }
1451
1459
  ) : null,
1452
- hasGlossary ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dl", { className: "grid gap-1.5", "aria-label": "Glossary", children: feature.glossary.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-wrap gap-x-2 text-xs", children: [
1453
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "font-medium text-foreground", children: entry.term }),
1454
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "flex-1 text-muted-foreground", children: entry.definition })
1455
- ] }, entry.term)) }) : null
1460
+ hasGlossary ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1461
+ "dl",
1462
+ {
1463
+ className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs",
1464
+ "aria-label": "Glossary",
1465
+ children: feature.glossary.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "contents", children: [
1466
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "font-medium text-foreground", children: entry.term }),
1467
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "text-muted-foreground", children: entry.definition })
1468
+ ] }, entry.term))
1469
+ }
1470
+ ) : null
1456
1471
  ] });
1457
1472
  }
1458
1473
  function featureKindLabel(kind) {
@@ -1468,7 +1483,6 @@ function ReportFeature({ feature }) {
1468
1483
  const titleId = `${feature.id}-title`;
1469
1484
  const bodyId = `${feature.id}-body`;
1470
1485
  const s = feature.summary;
1471
- const skipped = s.skipped + s.pending;
1472
1486
  const collapse = useCollapse();
1473
1487
  const collapsed = collapse?.isCollapsed(feature.id) ?? false;
1474
1488
  const kindLabel = featureKindLabel(feature.kind);
@@ -1508,7 +1522,12 @@ function ReportFeature({ feature }) {
1508
1522
  "p",
1509
1523
  {
1510
1524
  className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",
1511
- "aria-label": `${s.passed} passed, ${s.failed} failed, ${skipped} skipped`,
1525
+ "aria-label": [
1526
+ `${s.passed} passed`,
1527
+ `${s.failed} failed`,
1528
+ s.skipped > 0 && `${s.skipped} skipped`,
1529
+ s.pending > 0 && `${s.pending} pending`
1530
+ ].filter(Boolean).join(", "),
1512
1531
  children: [
1513
1532
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1514
1533
  s.passed,
@@ -1519,12 +1538,19 @@ function ReportFeature({ feature }) {
1519
1538
  s.failed,
1520
1539
  " failed"
1521
1540
  ] }),
1522
- skipped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1541
+ s.skipped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1523
1542
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
1524
1543
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1525
- skipped,
1544
+ s.skipped,
1526
1545
  " skipped"
1527
1546
  ] })
1547
+ ] }) : null,
1548
+ s.pending > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1549
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
1550
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1551
+ s.pending,
1552
+ " pending"
1553
+ ] })
1528
1554
  ] }) : null
1529
1555
  ]
1530
1556
  }