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.
@@ -239,11 +239,11 @@ function formatValue(value) {
239
239
  return String(value);
240
240
  }
241
241
  }
242
- function DocKv({ entry }) {
243
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("dl", { className: "my-2 flex flex-wrap items-baseline gap-x-2 text-sm", children: [
242
+ function DocKv({ entries }) {
243
+ 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: [
244
244
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
245
245
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { className: "min-w-0 break-words font-mono text-foreground", children: formatValue(entry.value) })
246
- ] });
246
+ ] }, i)) });
247
247
  }
248
248
 
249
249
  // src/hooks/useRenderers.ts
@@ -330,7 +330,7 @@ function DocSection({ entry }) {
330
330
  if (renderers.section) {
331
331
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: renderers.section(entry) });
332
332
  }
333
- const html = safeMarkdownHtml(entry.markdown);
333
+ const html = safeMarkdownHtml(dedent(entry.markdown));
334
334
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "my-3 text-sm", "aria-label": entry.title, children: [
335
335
  entry.title ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "mb-1 font-semibold text-foreground", children: entry.title }) : null,
336
336
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -516,7 +516,7 @@ function DocEntry({ entry }) {
516
516
  case "tag":
517
517
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocTag, { entry });
518
518
  case "kv":
519
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocKv, { entry });
519
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocKv, { entries: [entry] });
520
520
  case "code":
521
521
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocCode, { entry });
522
522
  case "table":
@@ -544,7 +544,15 @@ function DocEntry({ entry }) {
544
544
  var import_jsx_runtime18 = require("react/jsx-runtime");
545
545
  function ReportDocEntries({ entries }) {
546
546
  if (entries.length === 0) return null;
547
- 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)) });
547
+ const groups = [];
548
+ for (const entry of entries) {
549
+ const last = groups[groups.length - 1];
550
+ if (entry.kind === "kv" && Array.isArray(last)) last.push(entry);
551
+ else groups.push(entry.kind === "kv" ? [entry] : entry);
552
+ }
553
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: groups.map(
554
+ (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)
555
+ ) });
548
556
  }
549
557
 
550
558
  // src/components/ReportSteps.tsx
@@ -1439,10 +1447,17 @@ function ReportFeatureIntro({ feature }) {
1439
1447
  dangerouslySetInnerHTML: { __html: safeMarkdownHtml(dedent(feature.narrative)) }
1440
1448
  }
1441
1449
  ) : null,
1442
- 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: [
1443
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "font-medium text-foreground", children: entry.term }),
1444
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "flex-1 text-muted-foreground", children: entry.definition })
1445
- ] }, entry.term)) }) : null
1450
+ hasGlossary ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1451
+ "dl",
1452
+ {
1453
+ className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs",
1454
+ "aria-label": "Glossary",
1455
+ children: feature.glossary.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "contents", children: [
1456
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "font-medium text-foreground", children: entry.term }),
1457
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "text-muted-foreground", children: entry.definition })
1458
+ ] }, entry.term))
1459
+ }
1460
+ ) : null
1446
1461
  ] });
1447
1462
  }
1448
1463
  function featureKindLabel(kind) {
@@ -1458,7 +1473,6 @@ function ReportFeature({ feature }) {
1458
1473
  const titleId = `${feature.id}-title`;
1459
1474
  const bodyId = `${feature.id}-body`;
1460
1475
  const s = feature.summary;
1461
- const skipped = s.skipped + s.pending;
1462
1476
  const collapse = useCollapse();
1463
1477
  const collapsed = collapse?.isCollapsed(feature.id) ?? false;
1464
1478
  const kindLabel = featureKindLabel(feature.kind);
@@ -1498,7 +1512,12 @@ function ReportFeature({ feature }) {
1498
1512
  "p",
1499
1513
  {
1500
1514
  className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",
1501
- "aria-label": `${s.passed} passed, ${s.failed} failed, ${skipped} skipped`,
1515
+ "aria-label": [
1516
+ `${s.passed} passed`,
1517
+ `${s.failed} failed`,
1518
+ s.skipped > 0 && `${s.skipped} skipped`,
1519
+ s.pending > 0 && `${s.pending} pending`
1520
+ ].filter(Boolean).join(", "),
1502
1521
  children: [
1503
1522
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1504
1523
  s.passed,
@@ -1509,12 +1528,19 @@ function ReportFeature({ feature }) {
1509
1528
  s.failed,
1510
1529
  " failed"
1511
1530
  ] }),
1512
- skipped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1531
+ s.skipped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1513
1532
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
1514
1533
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1515
- skipped,
1534
+ s.skipped,
1516
1535
  " skipped"
1517
1536
  ] })
1537
+ ] }) : null,
1538
+ s.pending > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1539
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
1540
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1541
+ s.pending,
1542
+ " pending"
1543
+ ] })
1518
1544
  ] }) : null
1519
1545
  ]
1520
1546
  }