@burdenoff/microfe-vibecontrols 2026.610.8 → 2026.611.2
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/components/scorecard/ScorecardPanel.js +286 -264
- package/dist/components/scorecard/ScorecardPanel.js.map +1 -1
- package/dist/generated/wspace-operations.js +4 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js +15 -13
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { useAddScorecardMetricMutation as e, useApplyScorecardTemplateMutation as t, useGetScorecardQuery as n, useRemoveScorecardMetricMutation as r, useUpdateScorecardMetricMutation as i, useUpsertScorecardMutation as a } from "../../generated/wspace-operations.js";
|
|
2
2
|
import { LoadingState as o } from "../shared/LoadingState.js";
|
|
3
3
|
import { ErrorState as s } from "../shared/ErrorState.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ScorecardTier as c } from "../../generated/wspace-types.js";
|
|
5
|
+
import { Card as l } from "../shared/Card.js";
|
|
5
6
|
import "../shared/index.js";
|
|
6
7
|
import { EntityShareButton as ee } from "../sharing/EntityShareButton.js";
|
|
7
8
|
import "../sharing/index.js";
|
|
8
|
-
import { DIRECTION_OPTIONS as
|
|
9
|
-
import { ScorecardEmptyState as
|
|
10
|
-
import { ScorecardsOverviewPanel as
|
|
11
|
-
import { MetricTrend as
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { useI18n as
|
|
14
|
-
import { Info as
|
|
15
|
-
import { useActiveContext as
|
|
16
|
-
import { AnimatePresence as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { MotionItem as
|
|
9
|
+
import { DIRECTION_OPTIONS as u, METRIC_TYPE_OPTIONS as te, STATUS_OPTIONS as ne, deriveStatus as re, statusConfig as d } from "./scorecardConstants.js";
|
|
10
|
+
import { ScorecardEmptyState as ie } from "./ScorecardEmptyState.js";
|
|
11
|
+
import { ScorecardsOverviewPanel as f } from "./ScorecardsOverviewPanel.js";
|
|
12
|
+
import { MetricTrend as ae } from "./MetricTrend.js";
|
|
13
|
+
import { useCallback as p, useEffect as oe, useState as m } from "react";
|
|
14
|
+
import { useI18n as se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { Info as ce, Pencil as le, Plus as ue, RefreshCw as de, ShieldCheck as h, Trash2 as fe, TrendingUp as pe } from "lucide-react";
|
|
16
|
+
import { useActiveContext as me } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
17
|
+
import { AnimatePresence as g, motion as _ } from "framer-motion";
|
|
18
|
+
import { Fragment as he, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
19
|
+
import { MotionItem as ge, MotionList as _e } from "@burdenoff/fe-libs/shared/motion";
|
|
19
20
|
//#region src/components/scorecard/ScorecardPanel.tsx
|
|
20
|
-
var
|
|
21
|
+
var b = {
|
|
21
22
|
name: "",
|
|
22
23
|
description: "",
|
|
23
24
|
type: "CUSTOM",
|
|
@@ -30,27 +31,27 @@ var _ = {
|
|
|
30
31
|
remediation: "",
|
|
31
32
|
iframeUrl: "",
|
|
32
33
|
iframeHeight: ""
|
|
33
|
-
},
|
|
34
|
-
let { t:
|
|
35
|
-
let n =
|
|
34
|
+
}, x = "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary outline-none focus:border-action-primary-bg", S = ({ ownerType: c, ownerId: h, onAddMetric: S }) => {
|
|
35
|
+
let { t: C } = se(), w = p((e, t) => {
|
|
36
|
+
let n = C(e);
|
|
36
37
|
return n === e ? t : n;
|
|
37
|
-
}, [
|
|
38
|
+
}, [C]), { workspaceId: ye } = me(), [be, T] = m(null), [xe, E] = m(!1), [D, O] = m(null), [k, A] = m(null), [j, M] = m(null), [N, P] = m(b), [F, I] = m(null), [Se, L] = m(null), { data: Ce, loading: we, error: R, refetch: z } = n({
|
|
38
39
|
variables: {
|
|
39
|
-
ownerType:
|
|
40
|
-
ownerId:
|
|
40
|
+
ownerType: c,
|
|
41
|
+
ownerId: h
|
|
41
42
|
},
|
|
42
|
-
skip: !
|
|
43
|
+
skip: !h,
|
|
43
44
|
fetchPolicy: "cache-and-network"
|
|
44
|
-
}), [
|
|
45
|
-
|
|
45
|
+
}), [Te, { loading: Ee }] = a(), [De, { loading: Oe }] = e(), [ke, { loading: Ae }] = i(), [je, { loading: B }] = r(), [Me] = t(), V = Ce?.vibecontrolsScorecard ?? null, H = Ee || Oe || Ae, U = D !== null, W = () => {
|
|
46
|
+
P(b), I(null), O(null);
|
|
46
47
|
}, G = () => {
|
|
47
|
-
if (
|
|
48
|
-
|
|
48
|
+
if (S) {
|
|
49
|
+
S();
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
W(),
|
|
52
|
-
},
|
|
53
|
-
e.stopPropagation(),
|
|
52
|
+
W(), E(!0);
|
|
53
|
+
}, Ne = (e, t) => {
|
|
54
|
+
e.stopPropagation(), P({
|
|
54
55
|
name: t.name,
|
|
55
56
|
description: t.description ?? "",
|
|
56
57
|
type: t.type,
|
|
@@ -63,35 +64,35 @@ var _ = {
|
|
|
63
64
|
remediation: t.remediation ?? "",
|
|
64
65
|
iframeUrl: t.iframeUrl ?? "",
|
|
65
66
|
iframeHeight: t.iframeHeight !== null && t.iframeHeight !== void 0 ? String(t.iframeHeight) : ""
|
|
66
|
-
}),
|
|
67
|
-
},
|
|
68
|
-
e.stopPropagation(),
|
|
67
|
+
}), I(null), O(t.id), E(!0);
|
|
68
|
+
}, Pe = (e, t) => {
|
|
69
|
+
e.stopPropagation(), M(null), A({
|
|
69
70
|
id: t.id,
|
|
70
71
|
name: t.name
|
|
71
72
|
});
|
|
72
73
|
}, K = () => {
|
|
73
|
-
H || (
|
|
74
|
-
}, q =
|
|
75
|
-
B || (
|
|
74
|
+
H || (E(!1), W());
|
|
75
|
+
}, q = p(() => {
|
|
76
|
+
B || (A(null), M(null));
|
|
76
77
|
}, [B]);
|
|
77
|
-
|
|
78
|
-
if (!
|
|
78
|
+
oe(() => {
|
|
79
|
+
if (!k) return;
|
|
79
80
|
let e = (e) => {
|
|
80
81
|
e.key === "Escape" && q();
|
|
81
82
|
};
|
|
82
83
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
83
|
-
}, [
|
|
84
|
-
let
|
|
85
|
-
if (
|
|
86
|
-
|
|
84
|
+
}, [k, q]);
|
|
85
|
+
let Fe = async () => {
|
|
86
|
+
if (k) {
|
|
87
|
+
M(null);
|
|
87
88
|
try {
|
|
88
|
-
await
|
|
89
|
+
await je({ variables: { id: k.id } }), await z(), A(null);
|
|
89
90
|
} catch (e) {
|
|
90
|
-
|
|
91
|
+
M(e instanceof Error ? e.message : "Failed to remove metric");
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
}, J = (e, t) => {
|
|
94
|
-
|
|
95
|
+
P((n) => ({
|
|
95
96
|
...n,
|
|
96
97
|
[e]: t
|
|
97
98
|
}));
|
|
@@ -101,65 +102,65 @@ var _ = {
|
|
|
101
102
|
let r = Number(n);
|
|
102
103
|
if (!Number.isFinite(r)) throw Error(`${t} must be a valid number`);
|
|
103
104
|
return r;
|
|
104
|
-
},
|
|
105
|
+
}, Ie = async () => {
|
|
105
106
|
if (V?.id) return V.id;
|
|
106
|
-
let e = (await
|
|
107
|
-
ownerType:
|
|
108
|
-
ownerId:
|
|
107
|
+
let e = (await Te({ variables: { input: {
|
|
108
|
+
ownerType: c,
|
|
109
|
+
ownerId: h
|
|
109
110
|
} } })).data?.upsertVibecontrolsScorecard.id;
|
|
110
|
-
if (!e) throw Error(
|
|
111
|
+
if (!e) throw Error(w("scorecard.scorecardCreateFailed", "Unable to create scorecard"));
|
|
111
112
|
return e;
|
|
112
|
-
},
|
|
113
|
-
|
|
113
|
+
}, Le = async (e) => {
|
|
114
|
+
L(e);
|
|
114
115
|
try {
|
|
115
|
-
await
|
|
116
|
+
await Me({ variables: {
|
|
116
117
|
templateId: e,
|
|
117
|
-
ownerType:
|
|
118
|
-
ownerId:
|
|
118
|
+
ownerType: c,
|
|
119
|
+
ownerId: h
|
|
119
120
|
} }), await z();
|
|
120
121
|
} finally {
|
|
121
|
-
|
|
122
|
+
L(null);
|
|
122
123
|
}
|
|
123
|
-
},
|
|
124
|
-
e.preventDefault(),
|
|
125
|
-
let t =
|
|
124
|
+
}, Re = async (e) => {
|
|
125
|
+
e.preventDefault(), I(null);
|
|
126
|
+
let t = N.name.trim();
|
|
126
127
|
if (!t) {
|
|
127
|
-
|
|
128
|
+
I(w("scorecard.metricNameRequired", "Metric name is required"));
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
130
|
-
let n =
|
|
131
|
+
let n = N.statusMode === "AUTO" ? void 0 : N.statusMode;
|
|
131
132
|
try {
|
|
132
133
|
let e = {
|
|
133
134
|
name: t,
|
|
134
|
-
description:
|
|
135
|
-
type:
|
|
136
|
-
value: Y(
|
|
137
|
-
threshold: Y(
|
|
138
|
-
unit:
|
|
139
|
-
direction:
|
|
140
|
-
weight: Y(
|
|
135
|
+
description: N.description.trim() || null,
|
|
136
|
+
type: N.type,
|
|
137
|
+
value: Y(N.value, w("scorecard.value", "Value")) ?? null,
|
|
138
|
+
threshold: Y(N.threshold, w("scorecard.threshold", "Threshold")) ?? null,
|
|
139
|
+
unit: N.unit.trim() || null,
|
|
140
|
+
direction: N.direction,
|
|
141
|
+
weight: Y(N.weight, w("scorecard.weight", "Weight")) ?? 1,
|
|
141
142
|
status: n ?? null,
|
|
142
|
-
remediation:
|
|
143
|
-
iframeUrl:
|
|
144
|
-
iframeHeight: Y(
|
|
143
|
+
remediation: N.remediation.trim() || null,
|
|
144
|
+
iframeUrl: N.iframeUrl.trim() || null,
|
|
145
|
+
iframeHeight: Y(N.iframeHeight, w("scorecard.iframeHeight", "Iframe height")) ?? null
|
|
145
146
|
};
|
|
146
|
-
|
|
147
|
-
id:
|
|
147
|
+
D ? await ke({ variables: {
|
|
148
|
+
id: D,
|
|
148
149
|
input: e
|
|
149
|
-
} }) : await
|
|
150
|
-
scorecardId: await
|
|
150
|
+
} }) : await De({ variables: {
|
|
151
|
+
scorecardId: await Ie(),
|
|
151
152
|
input: e
|
|
152
|
-
} }), await z(),
|
|
153
|
+
} }), await z(), E(!1), W();
|
|
153
154
|
} catch (e) {
|
|
154
|
-
|
|
155
|
+
I(e instanceof Error ? e.message : D ? "Failed to update metric" : "Failed to add metric");
|
|
155
156
|
}
|
|
156
|
-
},
|
|
157
|
+
}, ze = N.statusMode === "AUTO" ? re(N.value.trim() ? Number(N.value) : null, N.threshold.trim() ? Number(N.threshold) : null, N.direction) : N.statusMode, X = () => /* @__PURE__ */ v(g, { children: k && /* @__PURE__ */ v(_.div, {
|
|
157
158
|
initial: { opacity: 0 },
|
|
158
159
|
animate: { opacity: 1 },
|
|
159
160
|
exit: { opacity: 0 },
|
|
160
161
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay p-4",
|
|
161
162
|
onClick: q,
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ y(_.div, {
|
|
163
164
|
initial: {
|
|
164
165
|
scale: .96,
|
|
165
166
|
y: 12
|
|
@@ -178,54 +179,54 @@ var _ = {
|
|
|
178
179
|
"aria-modal": "true",
|
|
179
180
|
"aria-labelledby": "scorecard-delete-title",
|
|
180
181
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ y("div", {
|
|
182
183
|
className: "border-b border-border-default px-5 py-4",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
184
185
|
id: "scorecard-delete-title",
|
|
185
186
|
className: "text-lg font-semibold text-text-primary",
|
|
186
|
-
children:
|
|
187
|
-
}), /* @__PURE__ */
|
|
187
|
+
children: w("scorecard.removeMetricTitle", "Remove metric")
|
|
188
|
+
}), /* @__PURE__ */ v("p", {
|
|
188
189
|
className: "mt-1 text-sm text-text-secondary",
|
|
189
|
-
children:
|
|
190
|
+
children: w("scorecard.removeMetricConfirm", "Are you sure you want to remove this metric? This cannot be undone.")
|
|
190
191
|
})]
|
|
191
192
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ y("div", {
|
|
193
194
|
className: "px-5 py-4 text-sm text-text-primary",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ v("p", {
|
|
195
196
|
className: "font-medium",
|
|
196
|
-
children:
|
|
197
|
-
}),
|
|
197
|
+
children: k.name
|
|
198
|
+
}), j && /* @__PURE__ */ v("p", {
|
|
198
199
|
className: "mt-3 rounded-md border border-status-error-border bg-status-error-bg px-3 py-2 text-sm text-status-error-text",
|
|
199
|
-
children:
|
|
200
|
+
children: j
|
|
200
201
|
})]
|
|
201
202
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ y("div", {
|
|
203
204
|
className: "flex items-center justify-end gap-3 border-t border-border-default px-5 py-4",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ v("button", {
|
|
205
206
|
type: "button",
|
|
206
207
|
onClick: q,
|
|
207
208
|
disabled: B,
|
|
208
209
|
className: "rounded-md border border-border-default px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60",
|
|
209
|
-
children:
|
|
210
|
-
}), /* @__PURE__ */
|
|
210
|
+
children: w("common.cancel", "Cancel")
|
|
211
|
+
}), /* @__PURE__ */ v("button", {
|
|
211
212
|
type: "button",
|
|
212
|
-
onClick:
|
|
213
|
+
onClick: Fe,
|
|
213
214
|
disabled: B,
|
|
214
215
|
className: "rounded-md bg-status-error-bg px-4 py-2 text-sm text-status-error-text hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
215
|
-
children: B ?
|
|
216
|
+
children: B ? w("scorecard.removingMetric", "Removing...") : w("scorecard.removeMetric", "Remove metric")
|
|
216
217
|
})]
|
|
217
218
|
})
|
|
218
219
|
]
|
|
219
220
|
})
|
|
220
221
|
}) }), Z = () => {
|
|
221
|
-
let e =
|
|
222
|
-
return /* @__PURE__ */
|
|
222
|
+
let e = d[ze] ?? d.UNKNOWN;
|
|
223
|
+
return /* @__PURE__ */ v(g, { children: xe && /* @__PURE__ */ v(_.div, {
|
|
223
224
|
initial: { opacity: 0 },
|
|
224
225
|
animate: { opacity: 1 },
|
|
225
226
|
exit: { opacity: 0 },
|
|
226
227
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay p-4",
|
|
227
228
|
onClick: K,
|
|
228
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ v(_.div, {
|
|
229
230
|
initial: {
|
|
230
231
|
scale: .96,
|
|
231
232
|
y: 12
|
|
@@ -240,226 +241,226 @@ var _ = {
|
|
|
240
241
|
},
|
|
241
242
|
className: "w-full max-w-2xl rounded-xl border border-border-default bg-bg-surface shadow-xl",
|
|
242
243
|
onClick: (e) => e.stopPropagation(),
|
|
243
|
-
children: /* @__PURE__ */
|
|
244
|
-
onSubmit:
|
|
244
|
+
children: /* @__PURE__ */ y("form", {
|
|
245
|
+
onSubmit: Re,
|
|
245
246
|
className: "flex max-h-[85vh] flex-col",
|
|
246
247
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ y("div", {
|
|
248
249
|
className: "border-b border-border-default px-5 py-4",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
250
251
|
className: "text-lg font-semibold text-text-primary",
|
|
251
|
-
children: U ?
|
|
252
|
-
}), /* @__PURE__ */
|
|
252
|
+
children: U ? w("scorecard.editMetricTitle", "Edit scorecard metric") : w("scorecard.addMetricTitle", "Add scorecard metric")
|
|
253
|
+
}), /* @__PURE__ */ v("p", {
|
|
253
254
|
className: "mt-1 text-sm text-text-secondary",
|
|
254
|
-
children:
|
|
255
|
+
children: w("scorecard.addMetricDescription", "Define a metric. Status is derived from value vs threshold unless you pin it.")
|
|
255
256
|
})]
|
|
256
257
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ y("div", {
|
|
258
259
|
className: "space-y-4 overflow-y-auto px-5 py-4",
|
|
259
260
|
children: [
|
|
260
|
-
|
|
261
|
+
F && /* @__PURE__ */ v("div", {
|
|
261
262
|
className: "rounded-md border border-status-error-border bg-status-error-bg px-3 py-2 text-sm text-status-error-text",
|
|
262
|
-
children:
|
|
263
|
+
children: F
|
|
263
264
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ y("label", {
|
|
265
266
|
className: "block space-y-1.5",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ v("span", {
|
|
267
268
|
className: "text-sm font-medium text-text-primary",
|
|
268
|
-
children:
|
|
269
|
-
}), /* @__PURE__ */
|
|
269
|
+
children: w("scorecard.metricName", "Metric name")
|
|
270
|
+
}), /* @__PURE__ */ v("input", {
|
|
270
271
|
"aria-label": "control",
|
|
271
|
-
value:
|
|
272
|
+
value: N.name,
|
|
272
273
|
onChange: (e) => J("name", e.target.value),
|
|
273
|
-
className:
|
|
274
|
-
placeholder:
|
|
274
|
+
className: x,
|
|
275
|
+
placeholder: w("scorecard.metricNamePlaceholder", "Test coverage")
|
|
275
276
|
})]
|
|
276
277
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ y("label", {
|
|
278
279
|
className: "block space-y-1.5",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ v("span", {
|
|
280
281
|
className: "text-sm font-medium text-text-primary",
|
|
281
|
-
children:
|
|
282
|
-
}), /* @__PURE__ */
|
|
282
|
+
children: w("scorecard.metricDescription", "Description")
|
|
283
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
283
284
|
"aria-label": "control",
|
|
284
|
-
value:
|
|
285
|
+
value: N.description,
|
|
285
286
|
onChange: (e) => J("description", e.target.value),
|
|
286
|
-
className: `min-h-16 ${
|
|
287
|
-
placeholder:
|
|
287
|
+
className: `min-h-16 ${x}`,
|
|
288
|
+
placeholder: w("scorecard.metricDescriptionPlaceholder", "Explain what this metric measures")
|
|
288
289
|
})]
|
|
289
290
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ y("div", {
|
|
291
292
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ y("label", {
|
|
293
294
|
className: "block space-y-1.5",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ v("span", {
|
|
295
296
|
className: "text-sm font-medium text-text-primary",
|
|
296
|
-
children:
|
|
297
|
-
}), /* @__PURE__ */
|
|
298
|
-
value:
|
|
297
|
+
children: w("scorecard.metricType", "Type")
|
|
298
|
+
}), /* @__PURE__ */ v("select", {
|
|
299
|
+
value: N.type,
|
|
299
300
|
onChange: (e) => J("type", e.target.value),
|
|
300
|
-
className:
|
|
301
|
-
children:
|
|
301
|
+
className: x,
|
|
302
|
+
children: te.map((e) => /* @__PURE__ */ v("option", {
|
|
302
303
|
value: e.value,
|
|
303
304
|
children: e.label
|
|
304
305
|
}, e.value))
|
|
305
306
|
})]
|
|
306
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ y("label", {
|
|
307
308
|
className: "block space-y-1.5",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ v("span", {
|
|
309
310
|
className: "text-sm font-medium text-text-primary",
|
|
310
|
-
children:
|
|
311
|
-
}), /* @__PURE__ */
|
|
312
|
-
value:
|
|
311
|
+
children: w("scorecard.metricDirection", "Direction")
|
|
312
|
+
}), /* @__PURE__ */ v("select", {
|
|
313
|
+
value: N.direction,
|
|
313
314
|
onChange: (e) => J("direction", e.target.value),
|
|
314
|
-
className:
|
|
315
|
-
children:
|
|
315
|
+
className: x,
|
|
316
|
+
children: u.map((e) => /* @__PURE__ */ v("option", {
|
|
316
317
|
value: e.value,
|
|
317
318
|
children: e.label
|
|
318
319
|
}, e.value))
|
|
319
320
|
})]
|
|
320
321
|
})]
|
|
321
322
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ y("div", {
|
|
323
324
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-4",
|
|
324
325
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ y("label", {
|
|
326
327
|
className: "block space-y-1.5",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ v("span", {
|
|
328
329
|
className: "text-sm font-medium text-text-primary",
|
|
329
|
-
children:
|
|
330
|
-
}), /* @__PURE__ */
|
|
330
|
+
children: w("scorecard.value", "Value")
|
|
331
|
+
}), /* @__PURE__ */ v("input", {
|
|
331
332
|
"aria-label": "value",
|
|
332
|
-
value:
|
|
333
|
+
value: N.value,
|
|
333
334
|
onChange: (e) => J("value", e.target.value),
|
|
334
335
|
inputMode: "decimal",
|
|
335
|
-
className:
|
|
336
|
+
className: x,
|
|
336
337
|
placeholder: "86"
|
|
337
338
|
})]
|
|
338
339
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ y("label", {
|
|
340
341
|
className: "block space-y-1.5",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ v("span", {
|
|
342
343
|
className: "text-sm font-medium text-text-primary",
|
|
343
|
-
children:
|
|
344
|
-
}), /* @__PURE__ */
|
|
344
|
+
children: w("scorecard.threshold", "Threshold")
|
|
345
|
+
}), /* @__PURE__ */ v("input", {
|
|
345
346
|
"aria-label": "threshold",
|
|
346
|
-
value:
|
|
347
|
+
value: N.threshold,
|
|
347
348
|
onChange: (e) => J("threshold", e.target.value),
|
|
348
349
|
inputMode: "decimal",
|
|
349
|
-
className:
|
|
350
|
+
className: x,
|
|
350
351
|
placeholder: "80"
|
|
351
352
|
})]
|
|
352
353
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ y("label", {
|
|
354
355
|
className: "block space-y-1.5",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ v("span", {
|
|
356
357
|
className: "text-sm font-medium text-text-primary",
|
|
357
|
-
children:
|
|
358
|
-
}), /* @__PURE__ */
|
|
358
|
+
children: w("scorecard.unit", "Unit")
|
|
359
|
+
}), /* @__PURE__ */ v("input", {
|
|
359
360
|
"aria-label": "unit",
|
|
360
|
-
value:
|
|
361
|
+
value: N.unit,
|
|
361
362
|
onChange: (e) => J("unit", e.target.value),
|
|
362
|
-
className:
|
|
363
|
+
className: x,
|
|
363
364
|
placeholder: "%"
|
|
364
365
|
})]
|
|
365
366
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ y("label", {
|
|
367
368
|
className: "block space-y-1.5",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ v("span", {
|
|
369
370
|
className: "text-sm font-medium text-text-primary",
|
|
370
|
-
children:
|
|
371
|
-
}), /* @__PURE__ */
|
|
371
|
+
children: w("scorecard.weight", "Weight")
|
|
372
|
+
}), /* @__PURE__ */ v("input", {
|
|
372
373
|
"aria-label": "weight",
|
|
373
|
-
value:
|
|
374
|
+
value: N.weight,
|
|
374
375
|
onChange: (e) => J("weight", e.target.value),
|
|
375
376
|
inputMode: "decimal",
|
|
376
|
-
className:
|
|
377
|
+
className: x,
|
|
377
378
|
placeholder: "1"
|
|
378
379
|
})]
|
|
379
380
|
})
|
|
380
381
|
]
|
|
381
382
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ y("div", {
|
|
383
384
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ y("label", {
|
|
385
386
|
className: "block space-y-1.5",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ v("span", {
|
|
387
388
|
className: "text-sm font-medium text-text-primary",
|
|
388
|
-
children:
|
|
389
|
-
}), /* @__PURE__ */
|
|
390
|
-
value:
|
|
389
|
+
children: w("scorecard.metricStatus", "Status")
|
|
390
|
+
}), /* @__PURE__ */ v("select", {
|
|
391
|
+
value: N.statusMode,
|
|
391
392
|
onChange: (e) => J("statusMode", e.target.value),
|
|
392
|
-
className:
|
|
393
|
-
children:
|
|
393
|
+
className: x,
|
|
394
|
+
children: ne.map((e) => /* @__PURE__ */ v("option", {
|
|
394
395
|
value: e.value,
|
|
395
396
|
children: e.label
|
|
396
397
|
}, e.value))
|
|
397
398
|
})]
|
|
398
|
-
}), /* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ v("div", {
|
|
399
400
|
className: "flex items-end",
|
|
400
|
-
children: /* @__PURE__ */
|
|
401
|
+
children: /* @__PURE__ */ y("div", {
|
|
401
402
|
className: `flex items-center gap-2 rounded-md px-3 py-2 text-sm ${e.bg} ${e.text}`,
|
|
402
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ v(e.icon, { className: "size-4" }), /* @__PURE__ */ y("span", { children: [N.statusMode === "AUTO" ? "Derived: " : "Pinned: ", e.label] })]
|
|
403
404
|
})
|
|
404
405
|
})]
|
|
405
406
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ y("label", {
|
|
407
408
|
className: "block space-y-1.5",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ v("span", {
|
|
409
410
|
className: "text-sm font-medium text-text-primary",
|
|
410
|
-
children:
|
|
411
|
-
}), /* @__PURE__ */
|
|
411
|
+
children: w("scorecard.remediation", "Remediation guidance")
|
|
412
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
412
413
|
"aria-label": "control",
|
|
413
|
-
value:
|
|
414
|
+
value: N.remediation,
|
|
414
415
|
onChange: (e) => J("remediation", e.target.value),
|
|
415
|
-
className: `min-h-16 ${
|
|
416
|
-
placeholder:
|
|
416
|
+
className: `min-h-16 ${x}`,
|
|
417
|
+
placeholder: w("scorecard.remediationPlaceholder", "What should someone do when this metric is failing?")
|
|
417
418
|
})]
|
|
418
419
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ y("div", {
|
|
420
421
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-[1fr_10rem]",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
422
|
+
children: [/* @__PURE__ */ y("label", {
|
|
422
423
|
className: "block space-y-1.5",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
424
|
+
children: [/* @__PURE__ */ v("span", {
|
|
424
425
|
className: "text-sm font-medium text-text-primary",
|
|
425
|
-
children:
|
|
426
|
-
}), /* @__PURE__ */
|
|
426
|
+
children: w("scorecard.iframeUrl", "Embed URL")
|
|
427
|
+
}), /* @__PURE__ */ v("input", {
|
|
427
428
|
"aria-label": "control",
|
|
428
|
-
value:
|
|
429
|
+
value: N.iframeUrl,
|
|
429
430
|
onChange: (e) => J("iframeUrl", e.target.value),
|
|
430
|
-
className:
|
|
431
|
-
placeholder:
|
|
431
|
+
className: x,
|
|
432
|
+
placeholder: w("scorecard.iframeUrlPlaceholder", "Optional dashboard URL")
|
|
432
433
|
})]
|
|
433
|
-
}), /* @__PURE__ */
|
|
434
|
+
}), /* @__PURE__ */ y("label", {
|
|
434
435
|
className: "block space-y-1.5",
|
|
435
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ v("span", {
|
|
436
437
|
className: "text-sm font-medium text-text-primary",
|
|
437
|
-
children:
|
|
438
|
-
}), /* @__PURE__ */
|
|
438
|
+
children: w("scorecard.iframeHeight", "Iframe height")
|
|
439
|
+
}), /* @__PURE__ */ v("input", {
|
|
439
440
|
"aria-label": "iframe height",
|
|
440
|
-
value:
|
|
441
|
+
value: N.iframeHeight,
|
|
441
442
|
onChange: (e) => J("iframeHeight", e.target.value),
|
|
442
443
|
inputMode: "numeric",
|
|
443
|
-
className:
|
|
444
|
+
className: x,
|
|
444
445
|
placeholder: "320"
|
|
445
446
|
})]
|
|
446
447
|
})]
|
|
447
448
|
})
|
|
448
449
|
]
|
|
449
450
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ y("div", {
|
|
451
452
|
className: "flex items-center justify-end gap-3 border-t border-border-default px-5 py-4",
|
|
452
|
-
children: [/* @__PURE__ */
|
|
453
|
+
children: [/* @__PURE__ */ v("button", {
|
|
453
454
|
type: "button",
|
|
454
455
|
onClick: K,
|
|
455
456
|
disabled: H,
|
|
456
457
|
className: "rounded-md border border-border-default px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60",
|
|
457
|
-
children:
|
|
458
|
-
}), /* @__PURE__ */
|
|
458
|
+
children: w("common.cancel", "Cancel")
|
|
459
|
+
}), /* @__PURE__ */ v("button", {
|
|
459
460
|
type: "submit",
|
|
460
461
|
disabled: H,
|
|
461
462
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm text-action-primary-text hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
462
|
-
children: H ?
|
|
463
|
+
children: H ? w("scorecard.savingMetric", "Saving...") : U ? w("scorecard.updateMetric", "Update Metric") : w("scorecard.saveMetric", "Save Metric")
|
|
463
464
|
})]
|
|
464
465
|
})
|
|
465
466
|
]
|
|
@@ -467,145 +468,146 @@ var _ = {
|
|
|
467
468
|
})
|
|
468
469
|
}) });
|
|
469
470
|
};
|
|
470
|
-
if (
|
|
471
|
-
if (R && !V) return /* @__PURE__ */
|
|
472
|
-
title:
|
|
471
|
+
if (we && !V) return /* @__PURE__ */ v(o, { message: w("scorecard.loading", "Loading scorecard...") });
|
|
472
|
+
if (R && !V) return /* @__PURE__ */ v(s, {
|
|
473
|
+
title: w("scorecard.failedLoad", "Failed to load scorecard"),
|
|
473
474
|
message: R.message,
|
|
474
475
|
onRetry: () => z()
|
|
475
476
|
});
|
|
476
|
-
if (!V || V.metrics.length === 0) return /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
ownerType:
|
|
479
|
-
ownerId:
|
|
477
|
+
if (!V || V.metrics.length === 0) return /* @__PURE__ */ y(he, { children: [
|
|
478
|
+
/* @__PURE__ */ v(ie, {
|
|
479
|
+
ownerType: c,
|
|
480
|
+
ownerId: h,
|
|
480
481
|
workspaceId: ye,
|
|
481
482
|
applyingTemplateId: Se,
|
|
482
|
-
onApplyTemplate:
|
|
483
|
+
onApplyTemplate: Le,
|
|
483
484
|
onAddManual: G
|
|
484
485
|
}),
|
|
485
486
|
Z(),
|
|
486
487
|
X()
|
|
487
488
|
] });
|
|
488
489
|
let Q = V.overallScore ?? 0, $ = Q >= 80 ? "text-status-success-text" : Q >= 50 ? "text-status-warning-text" : "text-status-error-text";
|
|
489
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ y("div", {
|
|
490
491
|
className: "space-y-6",
|
|
491
492
|
children: [
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ v(l, {
|
|
493
494
|
padding: "lg",
|
|
494
|
-
children: /* @__PURE__ */
|
|
495
|
+
children: /* @__PURE__ */ y("div", {
|
|
495
496
|
className: "flex items-center justify-between",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("p", {
|
|
497
498
|
className: "flex items-center gap-1.5 text-sm font-medium text-text-secondary",
|
|
498
|
-
children: [
|
|
499
|
+
children: [w("scorecard.overallScore", "Overall Score"), /* @__PURE__ */ v("span", {
|
|
499
500
|
title: "Weighted average of each metric's score (0–100). Status is derived from value vs threshold.",
|
|
500
|
-
children: /* @__PURE__ */
|
|
501
|
+
children: /* @__PURE__ */ v(ce, { className: "size-3.5 text-text-muted" })
|
|
501
502
|
})]
|
|
502
|
-
}), /* @__PURE__ */
|
|
503
|
+
}), /* @__PURE__ */ y("p", {
|
|
503
504
|
className: `text-4xl font-bold ${$}`,
|
|
504
|
-
children: [Q, /* @__PURE__ */
|
|
505
|
+
children: [Q, /* @__PURE__ */ v("span", {
|
|
505
506
|
className: "text-lg text-text-muted",
|
|
506
507
|
children: "/100"
|
|
507
508
|
})]
|
|
508
|
-
})] }), /* @__PURE__ */
|
|
509
|
+
})] }), /* @__PURE__ */ y("div", {
|
|
509
510
|
className: "flex items-center gap-2",
|
|
510
511
|
children: [
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
V.securityTier && /* @__PURE__ */ v(ve, { tier: V.securityTier }),
|
|
513
|
+
/* @__PURE__ */ v(pe, { className: `size-6 ${$}` }),
|
|
514
|
+
/* @__PURE__ */ v(ee, {
|
|
513
515
|
entity: "scorecard",
|
|
514
516
|
resource: {
|
|
515
517
|
id: V.id,
|
|
516
518
|
name: V.id,
|
|
517
519
|
owner: {
|
|
518
|
-
ownerId:
|
|
519
|
-
ownerType:
|
|
520
|
+
ownerId: h,
|
|
521
|
+
ownerType: c
|
|
520
522
|
}
|
|
521
523
|
},
|
|
522
|
-
label:
|
|
524
|
+
label: w("scorecard.share", "Share")
|
|
523
525
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ v("button", {
|
|
525
527
|
type: "button",
|
|
526
528
|
onClick: () => z(),
|
|
527
529
|
className: "rounded-md p-2 text-text-secondary transition-colors hover:bg-bg-sunken",
|
|
528
|
-
title:
|
|
529
|
-
children: /* @__PURE__ */
|
|
530
|
+
title: w("common.refresh", "Refresh"),
|
|
531
|
+
children: /* @__PURE__ */ v(de, { className: "size-4" })
|
|
530
532
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ y("button", {
|
|
532
534
|
type: "button",
|
|
533
535
|
onClick: G,
|
|
534
536
|
className: "flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-2 text-sm text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
535
|
-
children: [/* @__PURE__ */
|
|
537
|
+
children: [/* @__PURE__ */ v(ue, { className: "size-4" }), w("scorecard.addMetric", "Add Metric")]
|
|
536
538
|
})
|
|
537
539
|
]
|
|
538
540
|
})]
|
|
539
541
|
})
|
|
540
542
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ v(_e, {
|
|
542
544
|
stagger: .04,
|
|
543
545
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
544
546
|
children: V.metrics.map((e) => {
|
|
545
|
-
let t =
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
+
let t = d[e.status] || d.UNKNOWN, n = t.icon, r = e.value ?? 0, i = e.threshold ?? 100, a = i > 0 ? Math.min(100, Math.max(0, r / i * 100)) : 0, o = be === e.id, s = e.remediation && (e.status === "WARNING" || e.status === "FAILING");
|
|
548
|
+
return /* @__PURE__ */ v(ge, { children: /* @__PURE__ */ y(l, {
|
|
547
549
|
hoverable: !0,
|
|
548
550
|
padding: "none",
|
|
549
|
-
children: [/* @__PURE__ */
|
|
551
|
+
children: [/* @__PURE__ */ y("div", {
|
|
550
552
|
role: "button",
|
|
551
553
|
tabIndex: 0,
|
|
552
|
-
onClick: () =>
|
|
554
|
+
onClick: () => T(o ? null : e.id),
|
|
553
555
|
onKeyDown: (t) => {
|
|
554
|
-
t.target === t.currentTarget && (t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
556
|
+
t.target === t.currentTarget && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), T(o ? null : e.id));
|
|
555
557
|
},
|
|
556
558
|
className: "cursor-pointer rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
|
|
557
559
|
"aria-expanded": o,
|
|
558
560
|
"aria-label": `${e.name} metric details`,
|
|
559
561
|
children: [
|
|
560
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ y("div", {
|
|
561
563
|
className: "flex items-start justify-between gap-2",
|
|
562
|
-
children: [/* @__PURE__ */
|
|
564
|
+
children: [/* @__PURE__ */ y("div", {
|
|
563
565
|
className: "min-w-0 flex-1",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ v("p", {
|
|
565
567
|
className: "truncate text-sm font-medium text-text-primary",
|
|
566
568
|
children: e.name
|
|
567
|
-
}), /* @__PURE__ */
|
|
569
|
+
}), /* @__PURE__ */ y("p", {
|
|
568
570
|
className: "mt-0.5 flex items-center gap-1.5 text-xs text-text-muted",
|
|
569
571
|
children: [
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
e.weight && e.weight !== 1 ? /* @__PURE__ */
|
|
572
|
-
e.statusOverride ? /* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ v("span", { children: e.direction === "LOWER_IS_BETTER" ? "↓ lower better" : "↑ higher better" }),
|
|
573
|
+
e.weight && e.weight !== 1 ? /* @__PURE__ */ y("span", { children: ["· ×", e.weight] }) : null,
|
|
574
|
+
e.statusOverride ? /* @__PURE__ */ v("span", { children: "· pinned" }) : null
|
|
573
575
|
]
|
|
574
576
|
})]
|
|
575
|
-
}), /* @__PURE__ */
|
|
577
|
+
}), /* @__PURE__ */ y("div", {
|
|
576
578
|
className: "flex flex-shrink-0 items-center gap-1",
|
|
577
579
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ v("button", {
|
|
579
581
|
type: "button",
|
|
580
|
-
onClick: (t) =>
|
|
582
|
+
onClick: (t) => Ne(t, e),
|
|
581
583
|
className: "rounded-md p-1 text-text-secondary hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
|
|
582
|
-
"aria-label":
|
|
583
|
-
title:
|
|
584
|
-
children: /* @__PURE__ */
|
|
584
|
+
"aria-label": w("scorecard.editMetric", "Edit metric"),
|
|
585
|
+
title: w("scorecard.editMetric", "Edit metric"),
|
|
586
|
+
children: /* @__PURE__ */ v(le, { className: "size-4" })
|
|
585
587
|
}),
|
|
586
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ v("button", {
|
|
587
589
|
type: "button",
|
|
588
|
-
onClick: (t) =>
|
|
590
|
+
onClick: (t) => Pe(t, e),
|
|
589
591
|
className: "rounded-md p-1 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text focus:outline-none focus:ring-2 focus:ring-status-error-text",
|
|
590
|
-
"aria-label":
|
|
591
|
-
title:
|
|
592
|
-
children: /* @__PURE__ */
|
|
592
|
+
"aria-label": w("scorecard.removeMetric", "Remove metric"),
|
|
593
|
+
title: w("scorecard.removeMetric", "Remove metric"),
|
|
594
|
+
children: /* @__PURE__ */ v(fe, { className: "size-4" })
|
|
593
595
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ v("div", {
|
|
595
597
|
className: `flex size-7 items-center justify-center rounded-full ${t.bg}`,
|
|
596
|
-
children: /* @__PURE__ */
|
|
598
|
+
children: /* @__PURE__ */ v(n, { className: `size-4 ${t.text}` })
|
|
597
599
|
})
|
|
598
600
|
]
|
|
599
601
|
})]
|
|
600
602
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ y("div", {
|
|
602
604
|
className: "mt-3",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
605
|
+
children: [/* @__PURE__ */ y("div", {
|
|
604
606
|
className: "flex items-baseline justify-between",
|
|
605
|
-
children: [/* @__PURE__ */
|
|
607
|
+
children: [/* @__PURE__ */ y("span", {
|
|
606
608
|
className: "text-lg font-bold text-text-primary",
|
|
607
609
|
children: [r, e.unit ? ` ${e.unit}` : ""]
|
|
608
|
-
}), /* @__PURE__ */
|
|
610
|
+
}), /* @__PURE__ */ y("span", {
|
|
609
611
|
className: "text-xs text-text-muted",
|
|
610
612
|
children: [
|
|
611
613
|
"/ ",
|
|
@@ -613,9 +615,9 @@ var _ = {
|
|
|
613
615
|
e.unit ? ` ${e.unit}` : ""
|
|
614
616
|
]
|
|
615
617
|
})]
|
|
616
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ v("div", {
|
|
617
619
|
className: "mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
618
|
-
children: /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ v(_.div, {
|
|
619
621
|
initial: { width: 0 },
|
|
620
622
|
animate: { width: `${a}%` },
|
|
621
623
|
transition: {
|
|
@@ -626,12 +628,12 @@ var _ = {
|
|
|
626
628
|
})
|
|
627
629
|
})]
|
|
628
630
|
}),
|
|
629
|
-
s && /* @__PURE__ */
|
|
631
|
+
s && /* @__PURE__ */ v("p", {
|
|
630
632
|
className: "mt-2 rounded-md border border-status-warning-border bg-status-warning-bg px-2 py-1.5 text-xs text-status-warning-text",
|
|
631
633
|
children: e.remediation
|
|
632
634
|
})
|
|
633
635
|
]
|
|
634
|
-
}), /* @__PURE__ */
|
|
636
|
+
}), /* @__PURE__ */ v(g, { children: o && /* @__PURE__ */ y(_.div, {
|
|
635
637
|
initial: {
|
|
636
638
|
height: 0,
|
|
637
639
|
opacity: 0
|
|
@@ -646,13 +648,13 @@ var _ = {
|
|
|
646
648
|
},
|
|
647
649
|
transition: { duration: .2 },
|
|
648
650
|
className: "overflow-hidden border-t border-border-default",
|
|
649
|
-
children: [/* @__PURE__ */
|
|
651
|
+
children: [/* @__PURE__ */ v("div", {
|
|
650
652
|
className: "px-4 py-3",
|
|
651
|
-
children: /* @__PURE__ */
|
|
653
|
+
children: /* @__PURE__ */ v(ae, {
|
|
652
654
|
metricId: e.id,
|
|
653
655
|
colorClass: t.text
|
|
654
656
|
})
|
|
655
|
-
}), e.iframeUrl && /* @__PURE__ */
|
|
657
|
+
}), e.iframeUrl && /* @__PURE__ */ v("iframe", {
|
|
656
658
|
src: e.iframeUrl,
|
|
657
659
|
className: "w-full border-0",
|
|
658
660
|
style: { height: e.iframeHeight ? `${e.iframeHeight}px` : "200px" },
|
|
@@ -663,16 +665,36 @@ var _ = {
|
|
|
663
665
|
}) }, e.id);
|
|
664
666
|
})
|
|
665
667
|
}),
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
ownerType:
|
|
668
|
-
highlightOwnerId:
|
|
668
|
+
/* @__PURE__ */ v(f, {
|
|
669
|
+
ownerType: c,
|
|
670
|
+
highlightOwnerId: h
|
|
669
671
|
}),
|
|
670
672
|
Z(),
|
|
671
673
|
X()
|
|
672
674
|
]
|
|
673
675
|
});
|
|
676
|
+
}, C = {
|
|
677
|
+
[c.Bronze]: {
|
|
678
|
+
label: "Bronze",
|
|
679
|
+
cls: "bg-status-warning-bg-subtle text-status-warning-text border border-status-warning-border"
|
|
680
|
+
},
|
|
681
|
+
[c.Silver]: {
|
|
682
|
+
label: "Silver",
|
|
683
|
+
cls: "bg-bg-sunken text-text-secondary border border-border-strong"
|
|
684
|
+
},
|
|
685
|
+
[c.Gold]: {
|
|
686
|
+
label: "Gold",
|
|
687
|
+
cls: "bg-status-success-bg-subtle text-status-success-text border border-status-success-border"
|
|
688
|
+
}
|
|
689
|
+
}, ve = ({ tier: e }) => {
|
|
690
|
+
let t = C[e];
|
|
691
|
+
return /* @__PURE__ */ y("span", {
|
|
692
|
+
className: `inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-semibold ${t.cls}`,
|
|
693
|
+
title: `Security readiness tier: ${t.label}`,
|
|
694
|
+
children: [/* @__PURE__ */ v(h, { className: "size-3.5" }), t.label]
|
|
695
|
+
});
|
|
674
696
|
};
|
|
675
697
|
//#endregion
|
|
676
|
-
export {
|
|
698
|
+
export { S as ScorecardPanel };
|
|
677
699
|
|
|
678
700
|
//# sourceMappingURL=ScorecardPanel.js.map
|