@elaraai/e3-ui-components 1.0.21 → 1.0.23
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/experiment/derive.d.ts +4 -2
- package/dist/experiment/derive.d.ts.map +1 -1
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/index.cjs +142 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +143 -81
- package/dist/index.js.map +1 -1
- package/package.json +13 -14
|
@@ -5,8 +5,8 @@ import { HelpId } from './help.js';
|
|
|
5
5
|
export type ResultValue = ValueTypeOf<typeof Experiment.Types.Result>;
|
|
6
6
|
/** The staged experiment config. */
|
|
7
7
|
export type ConfigValue = ValueTypeOf<typeof Experiment.Types.Config>;
|
|
8
|
-
/** A
|
|
9
|
-
export type
|
|
8
|
+
/** A named configuration — a vetted question + scope + optional precomputed answer. */
|
|
9
|
+
export type ConfigurationValue = ValueTypeOf<typeof Experiment.Types.Configuration>;
|
|
10
10
|
/** A confidence interval. */
|
|
11
11
|
export type Ci = ValueTypeOf<typeof Experiment.Types.Ci>;
|
|
12
12
|
/** The adjusted (like-for-like) effect + CI. */
|
|
@@ -180,6 +180,8 @@ export interface ExperimentView {
|
|
|
180
180
|
* and the (possibly absent) single experiment result.
|
|
181
181
|
*
|
|
182
182
|
* @param config - The staged {@link ConfigValue}.
|
|
183
|
+
* @param ranConfig - The config that produced `result` (the result deck reads this so its
|
|
184
|
+
* strings never drift ahead of the numbers on a live edit before the next Run).
|
|
183
185
|
* @param cols - The bound dataset's columns (name + type family).
|
|
184
186
|
* @param result - The experiment result, or `null` until the first Run settles.
|
|
185
187
|
* @param journal - Committed rows, or `null`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/experiment/derive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;A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F;IACxF,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAChE,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,WAAW,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,KAAK,EAAE,OAAO,CAAC;CAClB;AAqBD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAoEpI;AAGD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/experiment/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,OAAO,EAAuF,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACtI,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAyCrD,KAAK,iBAAiB,GAAG,WAAW,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/experiment/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,OAAO,EAAuF,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACtI,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAyCrD,KAAK,iBAAiB,GAAG,WAAW,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AA+KzE,MAAM,WAAW,yBAAyB;IACtC,KAAK,EAAE,iBAAiB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,QAAA,MAAM,oBAAoB,iEAgkB6E,CAAC;AAwWxG,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -60727,9 +60727,28 @@ function DeckSkeleton({ tab }) {
|
|
|
60727
60727
|
] })
|
|
60728
60728
|
] });
|
|
60729
60729
|
}
|
|
60730
|
+
function LoadingSkeleton() {
|
|
60731
|
+
const sk = react.useRecipe({ key: "skeleton" });
|
|
60732
|
+
const line2 = (w2, h2) => /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: sk({ variant: "line" }), width: w2, height: h2 });
|
|
60733
|
+
const block = (h2) => /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: sk({ variant: "block" }), width: "100%", minHeight: h2 });
|
|
60734
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { layerStyle: "frame", overflow: "visible", children: [
|
|
60735
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { layerStyle: "header.bar", display: "flex", alignItems: "center", gap: "3.5", children: [
|
|
60736
|
+
line2("260px", "20px"),
|
|
60737
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: "1" }),
|
|
60738
|
+
line2("72px", "16px")
|
|
60739
|
+
] }),
|
|
60740
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", alignItems: "start", children: [
|
|
60741
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { borderRightWidth: "1px", borderColor: "border.subtle", p: "4.5", display: "flex", flexDirection: "column", gap: "5", children: [0, 1, 2, 3].map((n2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "flex", flexDirection: "column", gap: "2", children: [
|
|
60742
|
+
line2("150px", "12px"),
|
|
60743
|
+
block("40px")
|
|
60744
|
+
] }, n2)) }),
|
|
60745
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeckSkeleton, { tab: "answer" })
|
|
60746
|
+
] })
|
|
60747
|
+
] });
|
|
60748
|
+
}
|
|
60730
60749
|
const experimentValueEqual = east.equalFor(internal.Experiment.Component.schema);
|
|
60731
60750
|
const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }) {
|
|
60732
|
-
var _a2, _b2, _c2
|
|
60751
|
+
var _a2, _b2, _c2;
|
|
60733
60752
|
const v3 = value;
|
|
60734
60753
|
const button = react.useRecipe({ key: "button" });
|
|
60735
60754
|
const chip = react.useRecipe({ key: "chip" });
|
|
@@ -60739,27 +60758,48 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60739
60758
|
const es = react.useSlotRecipe({ key: "eyebrowRow" })({});
|
|
60740
60759
|
const workspace = getReactiveDatasetCache().getConfig().workspace ?? "";
|
|
60741
60760
|
const data4 = useBindingValue(v3.data);
|
|
60742
|
-
const configBind = useBindingValue(v3.config);
|
|
60743
60761
|
const journalBind = useBindingValue(v3.journal.type === "some" ? v3.journal.value : null);
|
|
60744
|
-
const populationBind = useBindingValue(v3.population.type === "some" ? v3.population.value : null);
|
|
60745
60762
|
const meta3 = eastUiComponents.getSomeorUndefined(v3.columnMeta);
|
|
60746
60763
|
const readonly = eastUiComponents.getSomeorUndefined(v3.readonly) ?? false;
|
|
60747
|
-
const
|
|
60748
|
-
const
|
|
60749
|
-
const
|
|
60764
|
+
const configsBind = useBindingValue(v3.configs);
|
|
60765
|
+
const configs = React.useMemo(() => configsBind.value ?? [], [configsBind.value]);
|
|
60766
|
+
const [currentConfigId, setCurrentConfigId] = React.useState(void 0);
|
|
60767
|
+
const selectedEntry = React.useMemo(
|
|
60768
|
+
() => configs.find((c2) => c2.id === currentConfigId) ?? configs[0],
|
|
60769
|
+
[configs, currentConfigId]
|
|
60770
|
+
);
|
|
60771
|
+
React.useEffect(() => {
|
|
60772
|
+
const first2 = configs[0];
|
|
60773
|
+
if (currentConfigId === void 0 && first2 !== void 0) setCurrentConfigId(first2.id);
|
|
60774
|
+
}, [configs, currentConfigId]);
|
|
60775
|
+
const configGroups = React.useMemo(() => {
|
|
60750
60776
|
const buckets = /* @__PURE__ */ new Map();
|
|
60751
|
-
for (const
|
|
60752
|
-
const label = eastUiComponents.getSomeorUndefined(
|
|
60777
|
+
for (const c2 of configs) {
|
|
60778
|
+
const label = eastUiComponents.getSomeorUndefined(c2.group) ?? "Questions";
|
|
60753
60779
|
const bucket = buckets.get(label);
|
|
60754
|
-
if (bucket) bucket.push(
|
|
60755
|
-
else buckets.set(label, [
|
|
60780
|
+
if (bucket) bucket.push(c2);
|
|
60781
|
+
else buckets.set(label, [c2]);
|
|
60756
60782
|
}
|
|
60757
60783
|
return [...buckets].map(([label, items]) => ({ label, items }));
|
|
60758
|
-
}, [
|
|
60784
|
+
}, [configs]);
|
|
60759
60785
|
const { columns, rowArrayType } = useColumns(workspace, v3.data.source);
|
|
60760
|
-
const
|
|
60786
|
+
const [workingConfig, setWorkingConfig] = React.useState(void 0);
|
|
60761
60787
|
const [localPop, setLocalPop] = React.useState([]);
|
|
60762
|
-
const
|
|
60788
|
+
const [stale, setStale] = React.useState(false);
|
|
60789
|
+
const seededIdRef = React.useRef(void 0);
|
|
60790
|
+
React.useEffect(() => {
|
|
60791
|
+
const id3 = selectedEntry == null ? void 0 : selectedEntry.id;
|
|
60792
|
+
if (id3 === seededIdRef.current) return;
|
|
60793
|
+
const switching = seededIdRef.current !== void 0;
|
|
60794
|
+
seededIdRef.current = id3;
|
|
60795
|
+
setWorkingConfig(selectedEntry == null ? void 0 : selectedEntry.spec);
|
|
60796
|
+
setLocalPop(eastUiComponents.getSomeorUndefined(selectedEntry == null ? void 0 : selectedEntry.population) ?? []);
|
|
60797
|
+
const precomputed = (selectedEntry == null ? void 0 : selectedEntry.result.type) === "some";
|
|
60798
|
+
const hasEstimator = v3.experiment.type === "some";
|
|
60799
|
+
setStale(switching && hasEstimator && !precomputed);
|
|
60800
|
+
}, [selectedEntry, v3.experiment.type]);
|
|
60801
|
+
const config2 = workingConfig;
|
|
60802
|
+
const population = localPop;
|
|
60763
60803
|
const filteredRows = React.useMemo(() => {
|
|
60764
60804
|
if (!data4.value) return null;
|
|
60765
60805
|
return population.length ? data4.value.filter((r2) => rowMatchesAll(r2, population)) : data4.value;
|
|
@@ -60776,7 +60816,9 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60776
60816
|
[columns, meta3]
|
|
60777
60817
|
);
|
|
60778
60818
|
const estInputs = React.useMemo(() => rowArrayType ? [rowArrayType, internal.Experiment.Types.Config] : null, [rowArrayType]);
|
|
60779
|
-
const experiment = useFuncCall(v3.experiment.name, estInputs, internal.Experiment.Types.Result);
|
|
60819
|
+
const experiment = useFuncCall(v3.experiment.type === "some" ? v3.experiment.value.name : null, estInputs, internal.Experiment.Types.Result);
|
|
60820
|
+
const hasExperiment = v3.experiment.type === "some";
|
|
60821
|
+
const shownResult = experiment.result ?? eastUiComponents.getSomeorUndefined(selectedEntry == null ? void 0 : selectedEntry.result) ?? null;
|
|
60780
60822
|
const hasDesign = v3.design.type === "some";
|
|
60781
60823
|
const designInputs = React.useMemo(
|
|
60782
60824
|
() => rowArrayType ? [rowArrayType, internal.Experiment.Types.Config, internal.Experiment.Types.Result, internal.Experiment.Types.DesignConfig] : null,
|
|
@@ -60791,8 +60833,13 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60791
60833
|
experiment.call(filteredRows, config2);
|
|
60792
60834
|
}, [filteredRows, config2, experiment]);
|
|
60793
60835
|
const autoRan = React.useRef(false);
|
|
60836
|
+
const hasPrecomputed = selectedEntry !== void 0 && selectedEntry.result.type === "some";
|
|
60794
60837
|
React.useEffect(() => {
|
|
60795
60838
|
if (autoRan.current) return;
|
|
60839
|
+
if (hasPrecomputed || !hasExperiment) {
|
|
60840
|
+
autoRan.current = true;
|
|
60841
|
+
return;
|
|
60842
|
+
}
|
|
60796
60843
|
if (!filteredRows || !config2 || !rowArrayType) return;
|
|
60797
60844
|
if (experiment.result !== null || experiment.status === "running") {
|
|
60798
60845
|
autoRan.current = true;
|
|
@@ -60802,29 +60849,23 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60802
60849
|
autoRan.current = true;
|
|
60803
60850
|
if (filteredRows.length > AUTORUN_MAX_ROWS) return;
|
|
60804
60851
|
runAll();
|
|
60805
|
-
}, [filteredRows, config2, rowArrayType, experiment.result, experiment.status, runAll]);
|
|
60852
|
+
}, [hasPrecomputed, hasExperiment, filteredRows, config2, rowArrayType, experiment.result, experiment.status, runAll]);
|
|
60806
60853
|
React.useEffect(() => {
|
|
60807
60854
|
if (experiment.result !== null) setRanConfig(pendingConfigRef.current);
|
|
60808
60855
|
}, [experiment.result]);
|
|
60809
|
-
const
|
|
60810
|
-
const editConfig = React.useCallback((next2, fromPreset) => {
|
|
60811
|
-
if (readonly) return;
|
|
60812
|
-
setStale(true);
|
|
60813
|
-
setCurrentPreset(fromPreset);
|
|
60814
|
-
queueMicrotask(() => configBind.mutate(next2));
|
|
60815
|
-
}, [readonly, configBind]);
|
|
60816
|
-
const editPopulation = React.useCallback((next2, fromPreset) => {
|
|
60856
|
+
const editConfig = React.useCallback((next2) => {
|
|
60817
60857
|
if (readonly) return;
|
|
60818
|
-
setStale(true);
|
|
60819
|
-
|
|
60820
|
-
|
|
60821
|
-
|
|
60822
|
-
}, [readonly, v3.population.type, populationBind]);
|
|
60823
|
-
const selectPreset = React.useCallback((p2) => {
|
|
60858
|
+
if (v3.experiment.type === "some") setStale(true);
|
|
60859
|
+
setWorkingConfig(next2);
|
|
60860
|
+
}, [readonly, v3.experiment.type]);
|
|
60861
|
+
const editPopulation = React.useCallback((next2) => {
|
|
60824
60862
|
if (readonly) return;
|
|
60825
|
-
|
|
60826
|
-
|
|
60827
|
-
}, [readonly,
|
|
60863
|
+
if (v3.experiment.type === "some") setStale(true);
|
|
60864
|
+
setLocalPop(next2);
|
|
60865
|
+
}, [readonly, v3.experiment.type]);
|
|
60866
|
+
const selectEntry = React.useCallback((c2) => {
|
|
60867
|
+
setCurrentConfigId(c2.id);
|
|
60868
|
+
}, []);
|
|
60828
60869
|
const onRun = React.useCallback(() => {
|
|
60829
60870
|
runAll();
|
|
60830
60871
|
setStale(false);
|
|
@@ -60839,18 +60880,16 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60839
60880
|
adjusted: r2.adjusted.type === "some" ? east.some(r2.adjusted.value.effect) : east.none,
|
|
60840
60881
|
committed_at: /* @__PURE__ */ new Date(),
|
|
60841
60882
|
committed_by: "you",
|
|
60842
|
-
// Record which
|
|
60843
|
-
preset:
|
|
60883
|
+
// Record which question framed this experiment.
|
|
60884
|
+
preset: currentConfigId !== void 0 ? east.some(currentConfigId) : east.none
|
|
60844
60885
|
};
|
|
60845
60886
|
journalBind.mutate([row, ...journalBind.value ?? []]);
|
|
60846
60887
|
try {
|
|
60847
60888
|
await journalBind.commit();
|
|
60848
|
-
await configBind.commit();
|
|
60849
|
-
if (v3.population.type === "some") await populationBind.commit();
|
|
60850
60889
|
setStale(false);
|
|
60851
60890
|
} catch {
|
|
60852
60891
|
}
|
|
60853
|
-
}, [config2, experiment.result, journalBind,
|
|
60892
|
+
}, [config2, experiment.result, journalBind, currentConfigId]);
|
|
60854
60893
|
const [tab, setTab] = React.useState(((_a2 = eastUiComponents.getSomeorUndefined(v3.defaultTab)) == null ? void 0 : _a2.type) ?? "answer");
|
|
60855
60894
|
const [guidance, setGuidance] = React.useState(true);
|
|
60856
60895
|
const now2 = React.useMemo(() => /* @__PURE__ */ new Date(), []);
|
|
@@ -60865,39 +60904,44 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60865
60904
|
}, [ranConfig, config2, meta3]);
|
|
60866
60905
|
const view = React.useMemo(() => {
|
|
60867
60906
|
if (!config2) return null;
|
|
60868
|
-
return deriveView(config2, ranConfig ?? config2, columns,
|
|
60869
|
-
}, [config2, ranConfig, columns,
|
|
60907
|
+
return deriveView(config2, ranConfig ?? config2, columns, shownResult, journalBind.value, meta3, nRows, now2);
|
|
60908
|
+
}, [config2, ranConfig, columns, shownResult, journalBind.value, meta3, nRows, now2]);
|
|
60870
60909
|
const designConfigValue = React.useMemo(() => ({
|
|
60871
60910
|
alpha: east.none,
|
|
60872
60911
|
target_power: east.none,
|
|
60873
60912
|
materiality: east.none,
|
|
60874
60913
|
treated_shares: east.some([0.5, 0.3])
|
|
60875
60914
|
}), []);
|
|
60915
|
+
const precomputedDesign = eastUiComponents.getSomeorUndefined(selectedEntry == null ? void 0 : selectedEntry.design) ?? null;
|
|
60876
60916
|
const designSnapRef = React.useRef(null);
|
|
60877
60917
|
React.useEffect(() => {
|
|
60878
60918
|
var _a3;
|
|
60879
|
-
if (tab !== "validate" || !hasDesign || design.pending) return;
|
|
60880
|
-
if (!filteredRows || !config2 || !
|
|
60881
|
-
if (((_a3 = designSnapRef.current) == null ? void 0 : _a3.result) ===
|
|
60882
|
-
designSnapRef.current = { result:
|
|
60883
|
-
design.call(filteredRows, ranConfig ?? config2,
|
|
60884
|
-
}, [tab, hasDesign, filteredRows, config2, ranConfig,
|
|
60885
|
-
const vmDesign = React.useMemo(
|
|
60886
|
-
(
|
|
60887
|
-
|
|
60888
|
-
);
|
|
60889
|
-
const designFresh = design.result !== null && ((_b2 = designSnapRef.current) == null ? void 0 : _b2.result) ===
|
|
60919
|
+
if (tab !== "validate" || !hasDesign || design.pending || precomputedDesign !== null) return;
|
|
60920
|
+
if (!filteredRows || !config2 || !shownResult) return;
|
|
60921
|
+
if (((_a3 = designSnapRef.current) == null ? void 0 : _a3.result) === shownResult) return;
|
|
60922
|
+
designSnapRef.current = { result: shownResult, config: ranConfig ?? config2 };
|
|
60923
|
+
design.call(filteredRows, ranConfig ?? config2, shownResult, designConfigValue);
|
|
60924
|
+
}, [tab, hasDesign, precomputedDesign, filteredRows, config2, ranConfig, shownResult, design, designConfigValue]);
|
|
60925
|
+
const vmDesign = React.useMemo(() => {
|
|
60926
|
+
if (precomputedDesign !== null && shownResult !== null && config2) return deriveDesign(precomputedDesign, shownResult, ranConfig ?? config2, meta3);
|
|
60927
|
+
return design.result && designSnapRef.current ? deriveDesign(design.result, designSnapRef.current.result, designSnapRef.current.config, meta3) : null;
|
|
60928
|
+
}, [precomputedDesign, shownResult, config2, ranConfig, design.result, meta3]);
|
|
60929
|
+
const designFresh = precomputedDesign !== null && shownResult !== null || design.result !== null && ((_b2 = designSnapRef.current) == null ? void 0 : _b2.result) === shownResult && !design.pending;
|
|
60890
60930
|
if (!config2 || !view) {
|
|
60891
60931
|
const failed2 = experiment.status === "failed";
|
|
60892
|
-
const
|
|
60893
|
-
const
|
|
60932
|
+
const noConfigs = !configsBind.error && configs.length === 0;
|
|
60933
|
+
const which = data4.error ? "dataset" : configsBind.error ? "configs" : journalBind.error ? "journal" : null;
|
|
60934
|
+
const bindError = data4.error ?? configsBind.error ?? journalBind.error;
|
|
60894
60935
|
const bindMsg = bindError instanceof Error ? bindError.message : bindError != null ? String(bindError) : null;
|
|
60895
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { layerStyle: "frame", p: "6", children:
|
|
60936
|
+
if (bindMsg) return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { layerStyle: "frame", p: "6", children: /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { textStyle: "body.sm", color: "fg.danger", children: [
|
|
60896
60937
|
"Couldn’t load the experiment ",
|
|
60897
60938
|
which,
|
|
60898
60939
|
": ",
|
|
60899
60940
|
bindMsg
|
|
60900
|
-
] })
|
|
60941
|
+
] }) });
|
|
60942
|
+
if (noConfigs) return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { layerStyle: "frame", p: "6", children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "body.sm", color: "fg.muted", children: "No questions to show — bind a non-empty configs list." }) });
|
|
60943
|
+
if (failed2 && experiment.error) return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { layerStyle: "frame", p: "6", children: /* @__PURE__ */ jsxRuntime.jsx(RunError, { error: experiment.error }) });
|
|
60944
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LoadingSkeleton, {});
|
|
60901
60945
|
}
|
|
60902
60946
|
const { spec: vs, answer: a2, refusal: ref, overlap: ov, refute: vr, dose: vd, journal, verdict } = view;
|
|
60903
60947
|
const higherBetter = eastUiComponents.getSomeorUndefined((_c2 = meta3 == null ? void 0 : meta3.get(vs.outcome)) == null ? void 0 : _c2.higherIsBetter);
|
|
@@ -60907,18 +60951,19 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60907
60951
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: bs.track, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: bs.fill, width: `${Math.round(r2.frac * 100)}%`, bg: toneToken(r2.tone) }) }),
|
|
60908
60952
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { css: bs.value, children: r2.value })
|
|
60909
60953
|
] }, i)) });
|
|
60910
|
-
const specStaged = configBind.mode === "staged";
|
|
60911
60954
|
const hasJournal = v3.journal.type === "some";
|
|
60912
|
-
const canRun = !readonly;
|
|
60913
|
-
const canCommit = !readonly &&
|
|
60955
|
+
const canRun = !readonly && hasExperiment;
|
|
60956
|
+
const canCommit = !readonly && hasExperiment && hasJournal;
|
|
60914
60957
|
const runDisabled = !data4.value || experiment.pending;
|
|
60915
60958
|
const commitDisabled = experiment.status !== "succeeded" || experiment.pending || stale;
|
|
60916
60959
|
const failed = experiment.status === "failed" && experiment.error;
|
|
60917
|
-
const showResult =
|
|
60918
|
-
const
|
|
60960
|
+
const showResult = shownResult !== null && !experiment.pending && !failed;
|
|
60961
|
+
const anyPrecomputedDesign = configs.some((c2) => c2.design.type === "some");
|
|
60962
|
+
const showValidate = hasDesign || anyPrecomputedDesign;
|
|
60963
|
+
const tabKeys = [...["answer", "trust", "dose"], ...showValidate ? ["validate"] : []];
|
|
60919
60964
|
return /* @__PURE__ */ jsxRuntime.jsx(GuidanceProvider, { on: guidance, vars: helpVars, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { layerStyle: "frame", overflow: "visible", children: [
|
|
60920
60965
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { layerStyle: "header.bar", display: "flex", alignItems: "center", gap: "3.5", children: [
|
|
60921
|
-
|
|
60966
|
+
configs.length > 1 ? /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.Root, { children: [
|
|
60922
60967
|
/* @__PURE__ */ jsxRuntime.jsx(react.Menu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "button", bg: "transparent", border: "0", p: "0", cursor: "pointer", display: "inline-flex", alignItems: "center", gap: "2", textAlign: "start", children: [
|
|
60923
60968
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Text, { textStyle: "title.card", color: "fg.muted", children: [
|
|
60924
60969
|
"Does ",
|
|
@@ -60929,12 +60974,12 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60929
60974
|
] }),
|
|
60930
60975
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", color: "fg.subtle", fontSize: "11px", lineHeight: "1", children: /* @__PURE__ */ jsxRuntime.jsx(FontAwesomeIcon, { icon: faChevronDown }) })
|
|
60931
60976
|
] }) }),
|
|
60932
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Content, { minW: "280px", children:
|
|
60933
|
-
g2.label !== "
|
|
60934
|
-
g2.items.map((
|
|
60935
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", width: "14px", flexShrink: "0", color: "brand.fg", children:
|
|
60936
|
-
|
|
60937
|
-
] },
|
|
60977
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Content, { minW: "280px", children: configGroups.map((g2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.ItemGroup, { children: [
|
|
60978
|
+
g2.label !== "Questions" && /* @__PURE__ */ jsxRuntime.jsx(react.Menu.ItemGroupLabel, { textStyle: "caption.eyebrow", fontSize: "9px", children: g2.label }),
|
|
60979
|
+
g2.items.map((c2) => /* @__PURE__ */ jsxRuntime.jsxs(react.Menu.Item, { value: c2.id, onClick: () => selectEntry(c2), gap: "2", children: [
|
|
60980
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", width: "14px", flexShrink: "0", color: "brand.fg", children: c2.id === (selectedEntry == null ? void 0 : selectedEntry.id) && /* @__PURE__ */ jsxRuntime.jsx(FontAwesomeIcon, { icon: faCheck, style: { fontSize: "10px" } }) }),
|
|
60981
|
+
c2.label
|
|
60982
|
+
] }, c2.id))
|
|
60938
60983
|
] }, g2.label)) }) }) })
|
|
60939
60984
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "title.card", color: "fg.muted", children: /* @__PURE__ */ jsxRuntime.jsxs(Help, { id: "header", children: [
|
|
60940
60985
|
"Does ",
|
|
@@ -60944,6 +60989,7 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60944
60989
|
"?"
|
|
60945
60990
|
] }) }),
|
|
60946
60991
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: "1" }),
|
|
60992
|
+
readonly && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: badge({ variant: "plain", size: "sm" }), textTransform: "none", letterSpacing: "normal", children: "View only" }),
|
|
60947
60993
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "span", css: dataStatus.root, children: [
|
|
60948
60994
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: dataStatus.indicator }),
|
|
60949
60995
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: dataStatus.label, children: stale ? `${nRows} rows` : vs.dataLabel })
|
|
@@ -60955,15 +61001,15 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60955
61001
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "304px minmax(0,1fr)", alignItems: "start", children: [
|
|
60956
61002
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { borderRightWidth: "1px", borderColor: "border.subtle", children: [
|
|
60957
61003
|
/* @__PURE__ */ jsxRuntime.jsxs(Step, { n: 1, title: "What did you change?", help: "step_treatment", children: [
|
|
60958
|
-
/* @__PURE__ */ jsxRuntime.jsx(ColumnPick, { column: vs.treatment, kind: vs.treatmentKind, badge, button, choices: columns.filter((c2) => c2.kind === "boolean" || c2.kind === "integer").map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, treatment: c2 }) }),
|
|
61004
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColumnPick, { column: vs.treatment, kind: vs.treatmentKind, badge, button, readonly, choices: columns.filter((c2) => c2.kind === "boolean" || c2.kind === "integer").map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, treatment: c2 }) }),
|
|
60959
61005
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Text, { textStyle: "caption", mt: "1.5", children: [
|
|
60960
61006
|
"Treated = ",
|
|
60961
61007
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", color: "fg.default", fontWeight: "semibold", children: vs.comparison })
|
|
60962
61008
|
] })
|
|
60963
61009
|
] }),
|
|
60964
|
-
/* @__PURE__ */ jsxRuntime.jsx(Step, { n: 2, title: "What did you want it to improve?", help: "step_outcome", children: /* @__PURE__ */ jsxRuntime.jsx(ColumnPick, { column: vs.outcome, kind: vs.outcomeKind, badge, button, choices: columns.filter((c2) => c2.kind === "float" || c2.kind === "integer").map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, outcome: c2 }) }) }),
|
|
61010
|
+
/* @__PURE__ */ jsxRuntime.jsx(Step, { n: 2, title: "What did you want it to improve?", help: "step_outcome", children: /* @__PURE__ */ jsxRuntime.jsx(ColumnPick, { column: vs.outcome, kind: vs.outcomeKind, badge, button, readonly, choices: columns.filter((c2) => c2.kind === "float" || c2.kind === "integer").map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, outcome: c2 }) }) }),
|
|
60965
61011
|
/* @__PURE__ */ jsxRuntime.jsx(Step, { n: 3, title: "What else was different?", help: "step_confounders", children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { layerStyle: "frame.flat", children: [
|
|
60966
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { maxH: "216px", overflowY: "auto", children: vs.confounders.map((c2, i) => /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: "1fr 78px 16px", gap: "2.5", alignItems: "center", px: "2.5", py: "2.5", borderTopWidth: i ? "1px" : "0", borderColor: "border.subtle", children: [
|
|
61012
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { maxH: "216px", overflowY: "auto", children: vs.confounders.map((c2, i) => /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "grid", gridTemplateColumns: readonly ? "1fr 78px" : "1fr 78px 16px", gap: "2.5", alignItems: "center", px: "2.5", py: "2.5", borderTopWidth: i ? "1px" : "0", borderColor: "border.subtle", children: [
|
|
60967
61013
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
|
60968
61014
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "mono.sm", fontWeight: "semibold", color: "fg.default", children: c2.col }),
|
|
60969
61015
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "caption", lineHeight: "1.35", mt: "px", children: c2.reason })
|
|
@@ -60972,14 +61018,14 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
60972
61018
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: bs.track, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: bs.fill, width: `${Math.round(c2.imbalance * 100)}%`, bg: toneToken(c2.tone) }) }),
|
|
60973
61019
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "caption.eyebrow", fontSize: "9px", textAlign: "center", mt: "1.5", children: /* @__PURE__ */ jsxRuntime.jsx(Help, { id: "confounder_imbalance", children: c2.level }) })
|
|
60974
61020
|
] }),
|
|
60975
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "button", css: button({ variant: "ghost", size: "xs" }), px: "0", minW: "16px", display: "inline-flex", alignItems: "center", justifyContent: "center", "aria-label": `Remove ${c2.col}`, onClick: () => editConfig({ ...config2, common_causes: config2.common_causes.filter((x2) => x2 !== c2.col), categorical: config2.categorical.type === "some" ? east.some(config2.categorical.value.filter((x2) => x2 !== c2.col)) : east.none }), children: /* @__PURE__ */ jsxRuntime.jsx(FontAwesomeIcon, { icon: faXmark, style: { fontSize: "11px" } }) })
|
|
61021
|
+
!readonly && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "button", css: button({ variant: "ghost", size: "xs" }), px: "0", minW: "16px", display: "inline-flex", alignItems: "center", justifyContent: "center", "aria-label": `Remove ${c2.col}`, onClick: () => editConfig({ ...config2, common_causes: config2.common_causes.filter((x2) => x2 !== c2.col), categorical: config2.categorical.type === "some" ? east.some(config2.categorical.value.filter((x2) => x2 !== c2.col)) : east.none }), children: /* @__PURE__ */ jsxRuntime.jsx(FontAwesomeIcon, { icon: faXmark, style: { fontSize: "11px" } }) })
|
|
60976
61022
|
] }, i)) }),
|
|
60977
|
-
vs.suggestion && /* @__PURE__ */ jsxRuntime.jsx(ColumnMenu, { choices: columns.filter((c2) => !(/* @__PURE__ */ new Set([config2.treatment, config2.outcome, ...config2.common_causes])).has(c2.name)).map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, common_causes: [...config2.common_causes, c2] }), children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "button", css: button({ variant: "ghost", size: "sm" }), justifyContent: "flex-start", width: "100%", color: "brand.fg", fontFamily: "mono", display: "inline-flex", alignItems: "center", gap: "2", children: [
|
|
61023
|
+
!readonly && vs.suggestion && /* @__PURE__ */ jsxRuntime.jsx(ColumnMenu, { choices: columns.filter((c2) => !(/* @__PURE__ */ new Set([config2.treatment, config2.outcome, ...config2.common_causes])).has(c2.name)).map((c2) => c2.name), onPick: (c2) => editConfig({ ...config2, common_causes: [...config2.common_causes, c2] }), children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "button", css: button({ variant: "ghost", size: "sm" }), justifyContent: "flex-start", width: "100%", color: "brand.fg", fontFamily: "mono", display: "inline-flex", alignItems: "center", gap: "2", children: [
|
|
60978
61024
|
/* @__PURE__ */ jsxRuntime.jsx(FontAwesomeIcon, { icon: faPlus, style: { fontSize: "9px" } }),
|
|
60979
61025
|
"add another"
|
|
60980
61026
|
] }) })
|
|
60981
61027
|
] }) }),
|
|
60982
|
-
/* @__PURE__ */ jsxRuntime.jsx(Step, { n: 4, title: `Which ${SUBJECT_MANY}?`, help: "step_population", children: /* @__PURE__ */ jsxRuntime.jsx(FilterRail, { fields, population, onChange: editPopulation, chip, button }) }),
|
|
61028
|
+
/* @__PURE__ */ jsxRuntime.jsx(Step, { n: 4, title: `Which ${SUBJECT_MANY}?`, help: "step_population", children: /* @__PURE__ */ jsxRuntime.jsx(FilterRail, { fields, population, onChange: editPopulation, chip, button, readonly }) }),
|
|
60983
61029
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "details", borderTopWidth: "1px", borderColor: "border.subtle", children: [
|
|
60984
61030
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
60985
61031
|
react.Box,
|
|
@@ -61012,8 +61058,8 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
61012
61058
|
}
|
|
61013
61059
|
),
|
|
61014
61060
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { px: "4.5", pb: "3.5", pt: "0.5", children: [
|
|
61015
|
-
/* @__PURE__ */ jsxRuntime.jsx(Segmented, { label: "How to compare", help: "adv_method", left: "regression", right: "reweighting", active: vs.method === "reweighting" ? "right" : "left", onPick: (s2) => editConfig({ ...config2, method: east.some(s2 === "right" ? east.variant("propensity_score_weighting", { weighting_scheme: east.none }) : east.variant("linear_regression", null)) }) }),
|
|
61016
|
-
/* @__PURE__ */ jsxRuntime.jsx(Segmented, { label: "Answer for", help: "adv_estimand", left: "all", right: "only treated", active: vs.target === "treated" ? "right" : "left", onPick: (s2) => editConfig({ ...config2, estimand: east.some(east.variant(s2 === "right" ? "att" : "ate", null)) }), last: true })
|
|
61061
|
+
/* @__PURE__ */ jsxRuntime.jsx(Segmented, { label: "How to compare", help: "adv_method", left: "regression", right: "reweighting", active: vs.method === "reweighting" ? "right" : "left", readonly, onPick: (s2) => editConfig({ ...config2, method: east.some(s2 === "right" ? east.variant("propensity_score_weighting", { weighting_scheme: east.none }) : east.variant("linear_regression", null)) }) }),
|
|
61062
|
+
/* @__PURE__ */ jsxRuntime.jsx(Segmented, { label: "Answer for", help: "adv_estimand", left: "all", right: "only treated", active: vs.target === "treated" ? "right" : "left", readonly, onPick: (s2) => editConfig({ ...config2, estimand: east.some(east.variant(s2 === "right" ? "att" : "ate", null)) }), last: true })
|
|
61017
61063
|
] })
|
|
61018
61064
|
] })
|
|
61019
61065
|
] }),
|
|
@@ -61087,7 +61133,7 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
61087
61133
|
] })
|
|
61088
61134
|
] }),
|
|
61089
61135
|
tab === "answer" && a2 && /* @__PURE__ */ jsxRuntime.jsx(AnswerNumeric, { a: a2, verdict, higherBetter, badge, barList }),
|
|
61090
|
-
tab === "answer" && !a2 && ref && /* @__PURE__ */ jsxRuntime.jsx(RefusalZone, { refusal: ref, overlap: ov, naiveValue: (
|
|
61136
|
+
tab === "answer" && !a2 && ref && /* @__PURE__ */ jsxRuntime.jsx(RefusalZone, { refusal: ref, overlap: ov, naiveValue: (shownResult == null ? void 0 : shownResult.naive) ?? 0, outcome: vs.outcome }),
|
|
61091
61137
|
tab === "trust" && vr && /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { p: "4.5", children: [
|
|
61092
61138
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "body.sm", color: "fg.muted", mb: "3.5", children: /* @__PURE__ */ jsxRuntime.jsx(Help, { id: "trust_intro", children: "Before trusting the answer we tried to break it — colour shows pass / caution." }) }),
|
|
61093
61139
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { layerStyle: "frame.flat", children: vr.checks.map((c2, i) => {
|
|
@@ -61189,7 +61235,7 @@ const EastChakraExperiment = React.memo(function EastChakraExperiment2({ value }
|
|
|
61189
61235
|
var _a3;
|
|
61190
61236
|
const id3 = eastUiComponents.getSomeorUndefined(r2.preset);
|
|
61191
61237
|
if (id3 === void 0) return null;
|
|
61192
|
-
const label = ((_a3 =
|
|
61238
|
+
const label = ((_a3 = configs.find((c2) => c2.id === id3)) == null ? void 0 : _a3.label) ?? id3;
|
|
61193
61239
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
61194
61240
|
" ",
|
|
61195
61241
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "span", css: chip({ tone: "brand", size: "sm" }), children: [
|
|
@@ -61389,11 +61435,17 @@ function ValidatePanel({ vm, barList }) {
|
|
|
61389
61435
|
] }, i)) })
|
|
61390
61436
|
] });
|
|
61391
61437
|
}
|
|
61392
|
-
function FilterRail({ fields, population, onChange: onChange2, chip, button }) {
|
|
61438
|
+
function FilterRail({ fields, population, onChange: onChange2, chip, button, readonly }) {
|
|
61393
61439
|
const [open, setOpen] = React.useState(null);
|
|
61394
61440
|
const replaceAt = (i, p2) => onChange2(population.map((f2, j2) => j2 === i ? p2 : f2));
|
|
61395
61441
|
const removeAt = (i) => onChange2(population.filter((_2, j2) => j2 !== i));
|
|
61396
61442
|
const done = /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "button", css: button({ variant: "outline", size: "xs" }), onClick: () => setOpen(null), children: "Done" });
|
|
61443
|
+
if (readonly) {
|
|
61444
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { display: "flex", flexWrap: "wrap", gap: "1.5", alignItems: "center", children: population.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { css: chip({ tone: "plain", numeric: true, shape: "rounded" }), children: [
|
|
61445
|
+
"all ",
|
|
61446
|
+
SUBJECT_MANY
|
|
61447
|
+
] }) : population.map((pred, i) => /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: chip({ tone: "brand", numeric: true, shape: "rounded" }), flexShrink: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", whiteSpace: "nowrap", children: eastUiComponents.formatPredicate(pred) }) }, i)) });
|
|
61448
|
+
}
|
|
61397
61449
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "flex", flexWrap: "wrap", gap: "1.5", alignItems: "center", children: [
|
|
61398
61450
|
population.map((pred, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
61399
61451
|
eastUiComponents.SliceEditPopover,
|
|
@@ -61454,7 +61506,13 @@ function ColumnMenu({ choices, onPick, children: children2 }) {
|
|
|
61454
61506
|
/* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Content, { children: choices.map((c2) => /* @__PURE__ */ jsxRuntime.jsx(react.Menu.Item, { value: c2, onClick: () => onPick(c2), children: c2 }, c2)) }) }) })
|
|
61455
61507
|
] });
|
|
61456
61508
|
}
|
|
61457
|
-
function ColumnPick({ column: column2, kind, choices, onPick, badge, button }) {
|
|
61509
|
+
function ColumnPick({ column: column2, kind, choices, onPick, badge, button, readonly }) {
|
|
61510
|
+
if (readonly) {
|
|
61511
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { css: button({ variant: "outline", size: "sm" }), gap: "1.5", cursor: "default", children: [
|
|
61512
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", fontFamily: "mono", fontWeight: "semibold", children: column2 }),
|
|
61513
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: badge({ variant: "plain", size: "sm" }), textTransform: "none", letterSpacing: "normal", children: kind })
|
|
61514
|
+
] });
|
|
61515
|
+
}
|
|
61458
61516
|
return /* @__PURE__ */ jsxRuntime.jsx(ColumnMenu, { choices, onPick, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { as: "button", css: button({ variant: "outline", size: "sm" }), gap: "1.5", children: [
|
|
61459
61517
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { as: "span", fontFamily: "mono", fontWeight: "semibold", children: column2 }),
|
|
61460
61518
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: badge({ variant: "plain", size: "sm" }), textTransform: "none", letterSpacing: "normal", children: kind }),
|
|
@@ -61497,10 +61555,14 @@ function SegmentSelect({ options: options2, active, onPick, fill, size: size3 =
|
|
|
61497
61555
|
}
|
|
61498
61556
|
);
|
|
61499
61557
|
}
|
|
61500
|
-
function
|
|
61558
|
+
function SegmentStatic({ value, size: size3 = "xs" }) {
|
|
61559
|
+
const s2 = react.useSlotRecipe({ key: "segmentGroup" })({ size: size3 });
|
|
61560
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: s2.root, alignSelf: "flex-start", children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { css: s2.item, "data-state": "checked", children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: "span", css: s2.itemText, children: value }) }) });
|
|
61561
|
+
}
|
|
61562
|
+
function Segmented({ label, left, right, active, onPick, last: last2, help, readonly }) {
|
|
61501
61563
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { display: "flex", flexDirection: "column", alignItems: "stretch", gap: "1.5", py: "2", borderBottomWidth: last2 ? "0" : "1px", borderColor: "border.subtle", children: [
|
|
61502
61564
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { textStyle: "caption.eyebrow", textTransform: "none", letterSpacing: "normal", color: "fg.default", children: help ? /* @__PURE__ */ jsxRuntime.jsx(Help, { id: help, children: label }) : label }),
|
|
61503
|
-
/* @__PURE__ */ jsxRuntime.jsx(SegmentSelect, { options: [left, right], active: active === "left" ? 0 : 1, onPick: (i) => onPick(i === 0 ? "left" : "right"), fill: true, size: "xs" })
|
|
61565
|
+
readonly ? /* @__PURE__ */ jsxRuntime.jsx(SegmentStatic, { value: active === "left" ? left : right }) : /* @__PURE__ */ jsxRuntime.jsx(SegmentSelect, { options: [left, right], active: active === "left" ? 0 : 1, onPick: (i) => onPick(i === 0 ? "left" : "right"), fill: true, size: "xs" })
|
|
61504
61566
|
] });
|
|
61505
61567
|
}
|
|
61506
61568
|
eastUiComponents.implementUIComponent(internal.Experiment.Component, EastChakraExperiment);
|