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/index.cjs CHANGED
@@ -430,11 +430,11 @@ function formatValue(value) {
430
430
  return String(value);
431
431
  }
432
432
  }
433
- function DocKv({ entry }) {
434
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("dl", { className: "my-2 flex flex-wrap items-baseline gap-x-2 text-sm", children: [
433
+ function DocKv({ entries }) {
434
+ 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: [
435
435
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dt", { className: "font-semibold text-muted-foreground", children: entry.label }),
436
436
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("dd", { className: "min-w-0 break-words font-mono text-foreground", children: formatValue(entry.value) })
437
- ] });
437
+ ] }, i)) });
438
438
  }
439
439
 
440
440
  // src/hooks/useRenderers.ts
@@ -521,7 +521,7 @@ function DocSection({ entry }) {
521
521
  if (renderers.section) {
522
522
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: renderers.section(entry) });
523
523
  }
524
- const html = safeMarkdownHtml(entry.markdown);
524
+ const html = safeMarkdownHtml(dedent(entry.markdown));
525
525
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "my-3 text-sm", "aria-label": entry.title, children: [
526
526
  entry.title ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h4", { className: "mb-1 font-semibold text-foreground", children: entry.title }) : null,
527
527
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -707,7 +707,7 @@ function DocEntry({ entry }) {
707
707
  case "tag":
708
708
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocTag, { entry });
709
709
  case "kv":
710
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocKv, { entry });
710
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocKv, { entries: [entry] });
711
711
  case "code":
712
712
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DocCode, { entry });
713
713
  case "table":
@@ -735,7 +735,15 @@ function DocEntry({ entry }) {
735
735
  var import_jsx_runtime18 = require("react/jsx-runtime");
736
736
  function ReportDocEntries({ entries }) {
737
737
  if (entries.length === 0) return null;
738
- 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)) });
738
+ const groups = [];
739
+ for (const entry of entries) {
740
+ const last = groups[groups.length - 1];
741
+ if (entry.kind === "kv" && Array.isArray(last)) last.push(entry);
742
+ else groups.push(entry.kind === "kv" ? [entry] : entry);
743
+ }
744
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: groups.map(
745
+ (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)
746
+ ) });
739
747
  }
740
748
 
741
749
  // src/components/ReportSteps.tsx
@@ -1525,10 +1533,17 @@ function ReportFeatureIntro({ feature }) {
1525
1533
  dangerouslySetInnerHTML: { __html: safeMarkdownHtml(dedent(feature.narrative)) }
1526
1534
  }
1527
1535
  ) : null,
1528
- 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: [
1529
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "font-medium text-foreground", children: entry.term }),
1530
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "flex-1 text-muted-foreground", children: entry.definition })
1531
- ] }, entry.term)) }) : null
1536
+ hasGlossary ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1537
+ "dl",
1538
+ {
1539
+ className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1.5 text-xs",
1540
+ "aria-label": "Glossary",
1541
+ children: feature.glossary.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "contents", children: [
1542
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dt", { className: "font-medium text-foreground", children: entry.term }),
1543
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("dd", { className: "text-muted-foreground", children: entry.definition })
1544
+ ] }, entry.term))
1545
+ }
1546
+ ) : null
1532
1547
  ] });
1533
1548
  }
1534
1549
  function featureKindLabel(kind) {
@@ -1544,7 +1559,6 @@ function ReportFeature({ feature }) {
1544
1559
  const titleId = `${feature.id}-title`;
1545
1560
  const bodyId = `${feature.id}-body`;
1546
1561
  const s = feature.summary;
1547
- const skipped = s.skipped + s.pending;
1548
1562
  const collapse = useCollapse();
1549
1563
  const collapsed = collapse?.isCollapsed(feature.id) ?? false;
1550
1564
  const kindLabel = featureKindLabel(feature.kind);
@@ -1584,7 +1598,12 @@ function ReportFeature({ feature }) {
1584
1598
  "p",
1585
1599
  {
1586
1600
  className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",
1587
- "aria-label": `${s.passed} passed, ${s.failed} failed, ${skipped} skipped`,
1601
+ "aria-label": [
1602
+ `${s.passed} passed`,
1603
+ `${s.failed} failed`,
1604
+ s.skipped > 0 && `${s.skipped} skipped`,
1605
+ s.pending > 0 && `${s.pending} pending`
1606
+ ].filter(Boolean).join(", "),
1588
1607
  children: [
1589
1608
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1590
1609
  s.passed,
@@ -1595,12 +1614,19 @@ function ReportFeature({ feature }) {
1595
1614
  s.failed,
1596
1615
  " failed"
1597
1616
  ] }),
1598
- skipped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1617
+ s.skipped > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1599
1618
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
1600
1619
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1601
- skipped,
1620
+ s.skipped,
1602
1621
  " skipped"
1603
1622
  ] })
1623
+ ] }) : null,
1624
+ s.pending > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": true, children: "\xB7" }),
1626
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
1627
+ s.pending,
1628
+ " pending"
1629
+ ] })
1604
1630
  ] }) : null
1605
1631
  ]
1606
1632
  }