@validation-os/dashboard 0.15.5 → 0.15.6

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.js CHANGED
@@ -1917,7 +1917,7 @@ function EvidenceCompositionView({
1917
1917
  }
1918
1918
 
1919
1919
  // src/assumptions-surface.tsx
1920
- import { useMemo as useMemo2 } from "react";
1920
+ import { useMemo as useMemo2, useState as useState3 } from "react";
1921
1921
 
1922
1922
  // src/next-move.ts
1923
1923
  import {
@@ -2808,6 +2808,7 @@ function NextMovesSection({
2808
2808
  recs,
2809
2809
  onOpenAssumption
2810
2810
  }) {
2811
+ const [openRec, setOpenRec] = useState3(null);
2811
2812
  return /* @__PURE__ */ jsxs5("div", { className: "vos-next-moves", children: [
2812
2813
  /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-head", children: "Next moves" }),
2813
2814
  /* @__PURE__ */ jsxs5("div", { className: "vos-next-moves-cols", children: [
@@ -2847,38 +2848,118 @@ function NextMovesSection({
2847
2848
  ] }),
2848
2849
  /* @__PURE__ */ jsxs5("div", { className: "vos-card vos-next-moves-col", children: [
2849
2850
  /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-col-label", children: "Proposed experiments \xB7 one per lens" }),
2850
- recs.length === 0 ? /* @__PURE__ */ jsx5("div", { className: "vos-muted vos-next-moves-empty", children: "Every risk has a live test." }) : recs.map((rec) => /* @__PURE__ */ jsxs5("div", { className: "vos-next-moves-rec", children: [
2851
- /* @__PURE__ */ jsxs5("div", { className: "vos-next-moves-rec-head", children: [
2852
- /* @__PURE__ */ jsx5(
2853
- "span",
2854
- {
2855
- className: "vos-next-moves-lens",
2856
- style: { background: `${rec.lensColour}20`, color: rec.lensColour, borderColor: `${rec.lensColour}40` },
2857
- children: rec.lens
2858
- }
2859
- ),
2860
- /* @__PURE__ */ jsx5("span", { className: "vos-next-moves-rec-type", children: rec.type }),
2861
- /* @__PURE__ */ jsxs5("span", { className: "vos-next-moves-rec-risk vos-num", children: [
2862
- Math.round(rec.maxRisk),
2863
- " risk"
2851
+ recs.length === 0 ? /* @__PURE__ */ jsx5("div", { className: "vos-muted vos-next-moves-empty", children: "Every risk has a live test." }) : recs.map((rec) => /* @__PURE__ */ jsxs5(
2852
+ "button",
2853
+ {
2854
+ type: "button",
2855
+ className: "vos-next-moves-rec vos-next-moves-rec-compact",
2856
+ onClick: () => setOpenRec(rec),
2857
+ children: [
2858
+ /* @__PURE__ */ jsxs5("div", { className: "vos-next-moves-rec-head", children: [
2859
+ /* @__PURE__ */ jsx5(
2860
+ "span",
2861
+ {
2862
+ className: "vos-next-moves-lens",
2863
+ style: { background: `${rec.lensColour}20`, color: rec.lensColour, borderColor: `${rec.lensColour}40` },
2864
+ children: rec.lens
2865
+ }
2866
+ ),
2867
+ /* @__PURE__ */ jsx5("span", { className: "vos-next-moves-rec-type", children: rec.type }),
2868
+ /* @__PURE__ */ jsxs5("span", { className: "vos-next-moves-rec-risk vos-num", children: [
2869
+ Math.round(rec.maxRisk),
2870
+ " risk"
2871
+ ] })
2872
+ ] }),
2873
+ /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-rec-title", children: rec.title }),
2874
+ /* @__PURE__ */ jsx5("span", { className: "vos-next-moves-rec-open", "aria-hidden": "true", children: "\u2192" })
2875
+ ]
2876
+ },
2877
+ rec.id
2878
+ ))
2879
+ ] })
2880
+ ] }),
2881
+ openRec ? /* @__PURE__ */ jsx5(
2882
+ RecommendedExperimentDrawer,
2883
+ {
2884
+ rec: openRec,
2885
+ onOpenAssumption,
2886
+ onClose: () => setOpenRec(null)
2887
+ }
2888
+ ) : null
2889
+ ] });
2890
+ }
2891
+ function RecommendedExperimentDrawer({
2892
+ rec,
2893
+ onOpenAssumption,
2894
+ onClose
2895
+ }) {
2896
+ return /* @__PURE__ */ jsxs5(Fragment4, { children: [
2897
+ /* @__PURE__ */ jsx5("div", { className: "vos-scrim", onClick: onClose, "aria-hidden": "true" }),
2898
+ /* @__PURE__ */ jsxs5(
2899
+ "aside",
2900
+ {
2901
+ className: "vos-drawer vos-rec-drawer",
2902
+ role: "dialog",
2903
+ "aria-modal": "true",
2904
+ "aria-label": `Proposed experiment: ${rec.title}`,
2905
+ children: [
2906
+ /* @__PURE__ */ jsxs5("div", { className: "vos-drawer-header", children: [
2907
+ /* @__PURE__ */ jsxs5("div", { children: [
2908
+ /* @__PURE__ */ jsx5("div", { className: "vos-drawer-eyebrow", children: "Proposed experiment" }),
2909
+ /* @__PURE__ */ jsx5("h2", { className: "vos-drawer-title", children: rec.title })
2910
+ ] }),
2911
+ /* @__PURE__ */ jsxs5("div", { style: { marginLeft: "auto", display: "flex", gap: 8, alignItems: "center" }, children: [
2912
+ /* @__PURE__ */ jsx5(
2913
+ "span",
2914
+ {
2915
+ className: "vos-next-moves-lens",
2916
+ style: { background: `${rec.lensColour}20`, color: rec.lensColour, borderColor: `${rec.lensColour}40` },
2917
+ children: rec.lens
2918
+ }
2919
+ ),
2920
+ /* @__PURE__ */ jsx5("span", { className: "vos-next-moves-rec-type", children: rec.type }),
2921
+ /* @__PURE__ */ jsxs5("span", { className: "vos-next-moves-rec-risk vos-num", children: [
2922
+ Math.round(rec.maxRisk),
2923
+ " risk"
2924
+ ] }),
2925
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "vos-btn vos-btn-sm", onClick: onClose, "aria-label": "Close", children: "\u2715" })
2864
2926
  ] })
2865
2927
  ] }),
2866
- /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-rec-title", children: rec.title }),
2867
- /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-rec-rationale", children: rec.rationale }),
2868
- /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-rec-chips", children: rec.assumptionIds.map((id) => /* @__PURE__ */ jsx5(
2869
- "button",
2870
- {
2871
- type: "button",
2872
- className: "vos-next-moves-rec-chip",
2873
- onClick: () => onOpenAssumption(id),
2874
- children: id
2875
- },
2876
- id
2877
- )) }),
2878
- /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-rec-actions", children: /* @__PURE__ */ jsx5("button", { type: "button", className: "vos-btn vos-btn-sm", children: "Accept & create experiment" }) })
2879
- ] }, rec.id))
2880
- ] })
2881
- ] })
2928
+ /* @__PURE__ */ jsxs5("div", { className: "vos-drawer-body", children: [
2929
+ /* @__PURE__ */ jsxs5("div", { className: "vos-rec-drawer-section", children: [
2930
+ /* @__PURE__ */ jsx5("div", { className: "vos-drawer-eyebrow", children: "Why this test" }),
2931
+ /* @__PURE__ */ jsx5("p", { className: "vos-rec-drawer-rationale", children: rec.rationale })
2932
+ ] }),
2933
+ /* @__PURE__ */ jsxs5("div", { className: "vos-rec-drawer-section", children: [
2934
+ /* @__PURE__ */ jsx5("div", { className: "vos-drawer-eyebrow", children: "Bar" }),
2935
+ /* @__PURE__ */ jsxs5("div", { className: "vos-rec-drawer-bar", children: [
2936
+ /* @__PURE__ */ jsx5("strong", { children: "Right if:" }),
2937
+ " ",
2938
+ rec.barPreview
2939
+ ] })
2940
+ ] }),
2941
+ /* @__PURE__ */ jsxs5("div", { className: "vos-rec-drawer-section", children: [
2942
+ /* @__PURE__ */ jsx5("div", { className: "vos-drawer-eyebrow", children: "Assumptions" }),
2943
+ /* @__PURE__ */ jsx5("div", { className: "vos-next-moves-rec-chips", children: rec.assumptionIds.map((id) => /* @__PURE__ */ jsx5(
2944
+ "button",
2945
+ {
2946
+ type: "button",
2947
+ className: "vos-next-moves-rec-chip",
2948
+ onClick: () => onOpenAssumption(id),
2949
+ children: id
2950
+ },
2951
+ id
2952
+ )) })
2953
+ ] }),
2954
+ /* @__PURE__ */ jsxs5("div", { className: "vos-rec-drawer-section", children: [
2955
+ /* @__PURE__ */ jsx5("div", { className: "vos-drawer-eyebrow", children: "Protocol" }),
2956
+ /* @__PURE__ */ jsx5("div", { className: "vos-rec-drawer-body", children: /* @__PURE__ */ jsx5(EvidenceBody, { text: rec.body }) })
2957
+ ] })
2958
+ ] }),
2959
+ /* @__PURE__ */ jsx5("div", { className: "vos-drawer-footer", children: /* @__PURE__ */ jsx5("button", { type: "button", className: "vos-btn vos-btn-sm vos-btn-accent", children: "Accept & create experiment" }) })
2960
+ ]
2961
+ }
2962
+ )
2882
2963
  ] });
2883
2964
  }
2884
2965
  function riskToneClass(risk) {