@kopexa/grc 0.0.21 → 0.0.24
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/chunk-VQUPRJG7.mjs +41 -0
- package/dist/common/impact/impact-badge.d.mts +26 -0
- package/dist/common/impact/impact-badge.d.ts +26 -0
- package/dist/common/impact/impact-badge.js +348 -0
- package/dist/common/impact/impact-badge.mjs +10 -0
- package/dist/common/impact/index.d.mts +1 -0
- package/dist/common/impact/index.d.ts +1 -0
- package/dist/common/impact/index.js +79 -44
- package/dist/common/impact/index.mjs +5 -1
- package/dist/common/index.d.mts +1 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +95 -60
- package/dist/common/index.mjs +17 -13
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +139 -104
- package/dist/index.mjs +17 -13
- package/package.json +8 -8
- package/src/common/impact/impact-badge.tsx +72 -0
- package/src/common/impact/index.ts +2 -0
- /package/dist/{chunk-GFABGXAO.mjs → chunk-4DMM2HCE.mjs} +0 -0
package/dist/common/index.mjs
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-5JULTRFD.mjs";
|
|
3
|
+
import "../chunk-HI7F2CF4.mjs";
|
|
4
|
+
import {
|
|
5
|
+
RiskRatingDisplay
|
|
6
|
+
} from "../chunk-5TBN3JQA.mjs";
|
|
7
|
+
import {
|
|
8
|
+
messages as messages2
|
|
9
|
+
} from "../chunk-DC44K745.mjs";
|
|
10
|
+
import {
|
|
11
|
+
getRiskLevelFromRating,
|
|
12
|
+
isRatingUnrated,
|
|
13
|
+
riskLevelConfig
|
|
14
|
+
} from "../chunk-VFX3DASQ.mjs";
|
|
3
15
|
import "../chunk-C5OUE3C2.mjs";
|
|
4
16
|
import {
|
|
5
17
|
EditorCard
|
|
6
18
|
} from "../chunk-EGK6RMOC.mjs";
|
|
7
19
|
import "../chunk-JHGWV2ID.mjs";
|
|
8
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-4DMM2HCE.mjs";
|
|
21
|
+
import {
|
|
22
|
+
ImpactBadge
|
|
23
|
+
} from "../chunk-VQUPRJG7.mjs";
|
|
9
24
|
import {
|
|
10
25
|
ImpactCard
|
|
11
26
|
} from "../chunk-C2GUKNBG.mjs";
|
|
@@ -19,18 +34,6 @@ import {
|
|
|
19
34
|
import {
|
|
20
35
|
messages
|
|
21
36
|
} from "../chunk-AXBL7YBB.mjs";
|
|
22
|
-
import "../chunk-HI7F2CF4.mjs";
|
|
23
|
-
import {
|
|
24
|
-
RiskRatingDisplay
|
|
25
|
-
} from "../chunk-5TBN3JQA.mjs";
|
|
26
|
-
import {
|
|
27
|
-
messages as messages2
|
|
28
|
-
} from "../chunk-DC44K745.mjs";
|
|
29
|
-
import {
|
|
30
|
-
getRiskLevelFromRating,
|
|
31
|
-
isRatingUnrated,
|
|
32
|
-
riskLevelConfig
|
|
33
|
-
} from "../chunk-VFX3DASQ.mjs";
|
|
34
37
|
import "../chunk-TICWEZUI.mjs";
|
|
35
38
|
import {
|
|
36
39
|
ComplianceBadges,
|
|
@@ -49,6 +52,7 @@ export {
|
|
|
49
52
|
ControlChip,
|
|
50
53
|
DoraBadge,
|
|
51
54
|
EditorCard,
|
|
55
|
+
ImpactBadge,
|
|
52
56
|
ImpactCard,
|
|
53
57
|
MappedControls,
|
|
54
58
|
Nis2Badge,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ComplianceBadges, ComplianceBadgesProps, DoraBadge, DoraBadgeProps, Nis2Badge, Nis2BadgeProps } from './common/compliance/compliance-badge.mjs';
|
|
2
2
|
export { ControlChip, ControlChipProps, MappedControls, MappedControlsProps } from './common/control/mapped-controls.mjs';
|
|
3
3
|
export { EditorCard, EditorCardProps } from './common/editor/editor-card.mjs';
|
|
4
|
+
export { ImpactBadge, ImpactBadgeProps } from './common/impact/impact-badge.mjs';
|
|
4
5
|
export { ImpactCard, ImpactCardProps, ImpactValue } from './common/impact/impact-card.mjs';
|
|
5
6
|
export { messages as impactMessages } from './common/impact/messages.mjs';
|
|
6
7
|
export { ImpactLevel, ImpactLevelConfig, ImpactScaleConfig, ImpactScalePreset, assetScale, getScale, impactLevels, processScale, riskScale } from './common/impact/scales.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ComplianceBadges, ComplianceBadgesProps, DoraBadge, DoraBadgeProps, Nis2Badge, Nis2BadgeProps } from './common/compliance/compliance-badge.js';
|
|
2
2
|
export { ControlChip, ControlChipProps, MappedControls, MappedControlsProps } from './common/control/mapped-controls.js';
|
|
3
3
|
export { EditorCard, EditorCardProps } from './common/editor/editor-card.js';
|
|
4
|
+
export { ImpactBadge, ImpactBadgeProps } from './common/impact/impact-badge.js';
|
|
4
5
|
export { ImpactCard, ImpactCardProps, ImpactValue } from './common/impact/impact-card.js';
|
|
5
6
|
export { messages as impactMessages } from './common/impact/messages.js';
|
|
6
7
|
export { ImpactLevel, ImpactLevelConfig, ImpactScaleConfig, ImpactScalePreset, assetScale, getScale, impactLevels, processScale, riskScale } from './common/impact/scales.js';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
ControlChip: () => ControlChip,
|
|
26
26
|
DoraBadge: () => DoraBadge,
|
|
27
27
|
EditorCard: () => EditorCard,
|
|
28
|
+
ImpactBadge: () => ImpactBadge,
|
|
28
29
|
ImpactCard: () => ImpactCard,
|
|
29
30
|
MappedControls: () => MappedControls,
|
|
30
31
|
Nis2Badge: () => Nis2Badge,
|
|
@@ -363,12 +364,9 @@ function EditorCard({
|
|
|
363
364
|
);
|
|
364
365
|
}
|
|
365
366
|
|
|
366
|
-
// src/common/impact/impact-
|
|
367
|
+
// src/common/impact/impact-badge.tsx
|
|
367
368
|
var import_i18n7 = require("@kopexa/i18n");
|
|
368
|
-
var
|
|
369
|
-
var import_sight4 = require("@kopexa/sight");
|
|
370
|
-
var import_theme3 = require("@kopexa/theme");
|
|
371
|
-
var import_react2 = require("react");
|
|
369
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
372
370
|
|
|
373
371
|
// src/common/impact/messages.ts
|
|
374
372
|
var import_i18n6 = require("@kopexa/i18n");
|
|
@@ -655,8 +653,44 @@ function getScale(preset) {
|
|
|
655
653
|
}
|
|
656
654
|
}
|
|
657
655
|
|
|
658
|
-
// src/common/impact/impact-
|
|
656
|
+
// src/common/impact/impact-badge.tsx
|
|
659
657
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
658
|
+
function ImpactBadge({
|
|
659
|
+
level,
|
|
660
|
+
scale = "risk",
|
|
661
|
+
showValue = false,
|
|
662
|
+
className
|
|
663
|
+
}) {
|
|
664
|
+
var _a;
|
|
665
|
+
const intl = (0, import_i18n7.useSafeIntl)();
|
|
666
|
+
const normalizedLevel = level === null || level === void 0 ? 0 : (_a = Math.min(5, Math.max(0, Math.round(level)))) != null ? _a : 0;
|
|
667
|
+
const scaleConfig = typeof scale === "string" ? getScale(scale) : scale;
|
|
668
|
+
const config = scaleConfig[normalizedLevel];
|
|
669
|
+
const isUnrated = normalizedLevel === 0;
|
|
670
|
+
const label = intl.formatMessage(config.message);
|
|
671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
672
|
+
"span",
|
|
673
|
+
{
|
|
674
|
+
className: (0, import_shared_utils.cn)(
|
|
675
|
+
"inline-flex items-center gap-1.5 text-sm font-medium px-2 py-0.5 rounded",
|
|
676
|
+
isUnrated ? "text-muted-foreground bg-muted" : `${config.color} ${config.bgColor}`,
|
|
677
|
+
className
|
|
678
|
+
),
|
|
679
|
+
children: [
|
|
680
|
+
showValue && !isUnrated && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-xs font-mono opacity-70", children: normalizedLevel }),
|
|
681
|
+
label
|
|
682
|
+
]
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// src/common/impact/impact-card.tsx
|
|
688
|
+
var import_i18n8 = require("@kopexa/i18n");
|
|
689
|
+
var import_icons3 = require("@kopexa/icons");
|
|
690
|
+
var import_sight4 = require("@kopexa/sight");
|
|
691
|
+
var import_theme3 = require("@kopexa/theme");
|
|
692
|
+
var import_react2 = require("react");
|
|
693
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
660
694
|
function ImpactItemRow({
|
|
661
695
|
label,
|
|
662
696
|
shortLabel,
|
|
@@ -670,28 +704,28 @@ function ImpactItemRow({
|
|
|
670
704
|
const isUnrated = value === 0;
|
|
671
705
|
const percentage = isUnrated ? 0 : value / 5 * 100;
|
|
672
706
|
const styles = (0, import_theme3.impactCard)({ unrated: isUnrated });
|
|
673
|
-
return /* @__PURE__ */ (0,
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
675
|
-
/* @__PURE__ */ (0,
|
|
676
|
-
/* @__PURE__ */ (0,
|
|
677
|
-
/* @__PURE__ */ (0,
|
|
678
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: styles.row(), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.rowContent(), children: [
|
|
708
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.rowIcon(), children: shortLabel }),
|
|
709
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.rowBody(), children: [
|
|
710
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.rowHeader(), children: [
|
|
711
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.rowLabel(), children: label }),
|
|
712
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
679
713
|
import_sight4.Select,
|
|
680
714
|
{
|
|
681
715
|
value: String(value),
|
|
682
716
|
onValueChange: (val) => onLevelChange(Number(val)),
|
|
683
717
|
size: "sm",
|
|
684
718
|
children: [
|
|
685
|
-
/* @__PURE__ */ (0,
|
|
686
|
-
/* @__PURE__ */ (0,
|
|
687
|
-
/* @__PURE__ */ (0,
|
|
719
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Select.Trigger, { className: "w-36", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Select.Value, {}) }),
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Select.Content, { children: impactLevels.map((level) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Select.Item, { value: String(level), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-xs text-muted-foreground w-3", children: level }),
|
|
688
722
|
formatLabel(level)
|
|
689
723
|
] }) }, level)) })
|
|
690
724
|
]
|
|
691
725
|
}
|
|
692
|
-
) : /* @__PURE__ */ (0,
|
|
693
|
-
!isUnrated && /* @__PURE__ */ (0,
|
|
694
|
-
/* @__PURE__ */ (0,
|
|
726
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.rowValue(), children: [
|
|
727
|
+
!isUnrated && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.rowValueNumber(), children: value }),
|
|
728
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
695
729
|
"span",
|
|
696
730
|
{
|
|
697
731
|
className: styles.rowValueBadge({
|
|
@@ -702,7 +736,7 @@ function ImpactItemRow({
|
|
|
702
736
|
)
|
|
703
737
|
] })
|
|
704
738
|
] }),
|
|
705
|
-
!isUnrated && !isEditing && /* @__PURE__ */ (0,
|
|
739
|
+
!isUnrated && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: styles.progressContainer(), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
706
740
|
"div",
|
|
707
741
|
{
|
|
708
742
|
className: styles.progressBar({ className: config.barColor }),
|
|
@@ -730,7 +764,7 @@ function ImpactCard({
|
|
|
730
764
|
needsAttention = false
|
|
731
765
|
}) {
|
|
732
766
|
var _a, _b;
|
|
733
|
-
const intl = (0,
|
|
767
|
+
const intl = (0, import_i18n8.useSafeIntl)();
|
|
734
768
|
const isInline = variant === "inline";
|
|
735
769
|
const [isEditing, setIsEditing] = (0, import_react2.useState)(false);
|
|
736
770
|
const [editValues, setEditValues] = (0, import_react2.useState)(
|
|
@@ -807,8 +841,8 @@ function ImpactCard({
|
|
|
807
841
|
const justificationHint = intl.formatMessage(messages4.justification_hint, {
|
|
808
842
|
level: highestLabel
|
|
809
843
|
});
|
|
810
|
-
const impactRows = /* @__PURE__ */ (0,
|
|
811
|
-
/* @__PURE__ */ (0,
|
|
844
|
+
const impactRows = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
812
846
|
ImpactItemRow,
|
|
813
847
|
{
|
|
814
848
|
label: t.confidentiality,
|
|
@@ -820,7 +854,7 @@ function ImpactCard({
|
|
|
820
854
|
onLevelChange: handleLevelChange("impactConfidentiality")
|
|
821
855
|
}
|
|
822
856
|
),
|
|
823
|
-
/* @__PURE__ */ (0,
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
824
858
|
ImpactItemRow,
|
|
825
859
|
{
|
|
826
860
|
label: t.integrity,
|
|
@@ -832,7 +866,7 @@ function ImpactCard({
|
|
|
832
866
|
onLevelChange: handleLevelChange("impactIntegrity")
|
|
833
867
|
}
|
|
834
868
|
),
|
|
835
|
-
/* @__PURE__ */ (0,
|
|
869
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
836
870
|
ImpactItemRow,
|
|
837
871
|
{
|
|
838
872
|
label: t.availability,
|
|
@@ -844,7 +878,7 @@ function ImpactCard({
|
|
|
844
878
|
onLevelChange: handleLevelChange("impactAvailability")
|
|
845
879
|
}
|
|
846
880
|
),
|
|
847
|
-
showAuthenticity && /* @__PURE__ */ (0,
|
|
881
|
+
showAuthenticity && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
848
882
|
ImpactItemRow,
|
|
849
883
|
{
|
|
850
884
|
label: t.authenticity,
|
|
@@ -857,19 +891,19 @@ function ImpactCard({
|
|
|
857
891
|
}
|
|
858
892
|
)
|
|
859
893
|
] });
|
|
860
|
-
const justificationContent = showJustification && /* @__PURE__ */ (0,
|
|
861
|
-
/* @__PURE__ */ (0,
|
|
894
|
+
const justificationContent = showJustification && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.justificationSection(), children: [
|
|
895
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
862
896
|
"label",
|
|
863
897
|
{
|
|
864
898
|
htmlFor: "impact-justification",
|
|
865
899
|
className: styles.justificationLabel(),
|
|
866
900
|
children: [
|
|
867
901
|
t.justification,
|
|
868
|
-
highestImpact > 0 && /* @__PURE__ */ (0,
|
|
902
|
+
highestImpact > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.justificationHint(), children: justificationHint })
|
|
869
903
|
]
|
|
870
904
|
}
|
|
871
905
|
),
|
|
872
|
-
effectiveIsEditing ? /* @__PURE__ */ (0,
|
|
906
|
+
effectiveIsEditing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
873
907
|
import_sight4.Textarea,
|
|
874
908
|
{
|
|
875
909
|
id: "impact-justification",
|
|
@@ -879,43 +913,43 @@ function ImpactCard({
|
|
|
879
913
|
rows: 3,
|
|
880
914
|
className: "text-sm"
|
|
881
915
|
}
|
|
882
|
-
) : currentImpact.impactJustification ? /* @__PURE__ */ (0,
|
|
916
|
+
) : currentImpact.impactJustification ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: styles.justificationText(), children: currentImpact.impactJustification }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: styles.justificationEmpty(), children: t.noJustification })
|
|
883
917
|
] });
|
|
884
918
|
if (isInline) {
|
|
885
|
-
return /* @__PURE__ */ (0,
|
|
886
|
-
title && /* @__PURE__ */ (0,
|
|
919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.wrapper(), children: [
|
|
920
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: styles.inlineHeader(), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Heading, { level: "h4", className: "text-sm font-medium", children: title }) }),
|
|
887
921
|
impactRows,
|
|
888
922
|
justificationContent
|
|
889
923
|
] });
|
|
890
924
|
}
|
|
891
|
-
return /* @__PURE__ */ (0,
|
|
892
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_sight4.Card.Root, { className: styles.root(), children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
893
927
|
import_sight4.Card.Header,
|
|
894
928
|
{
|
|
895
929
|
className: `flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`,
|
|
896
930
|
children: [
|
|
897
|
-
/* @__PURE__ */ (0,
|
|
898
|
-
/* @__PURE__ */ (0,
|
|
899
|
-
isEditing && /* @__PURE__ */ (0,
|
|
900
|
-
needsAttention && !isEditing && /* @__PURE__ */ (0,
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
933
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Chip, { size: "sm", color: "primary", children: t.edit }),
|
|
934
|
+
needsAttention && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Chip, { size: "sm", color: "destructive", variant: "solid", children: t.required })
|
|
901
935
|
] }),
|
|
902
|
-
!readOnly && (!isEditing ? /* @__PURE__ */ (0,
|
|
936
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
903
937
|
"button",
|
|
904
938
|
{
|
|
905
939
|
type: "button",
|
|
906
940
|
onClick: handleStartEdit,
|
|
907
941
|
className: styles.editButton(),
|
|
908
942
|
"aria-label": t.edit,
|
|
909
|
-
children: /* @__PURE__ */ (0,
|
|
943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons3.EditIcon, { className: "size-4" })
|
|
910
944
|
}
|
|
911
|
-
) : /* @__PURE__ */ (0,
|
|
912
|
-
/* @__PURE__ */ (0,
|
|
913
|
-
/* @__PURE__ */ (0,
|
|
945
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight4.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
914
948
|
] }))
|
|
915
949
|
]
|
|
916
950
|
}
|
|
917
951
|
),
|
|
918
|
-
/* @__PURE__ */ (0,
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_sight4.Card.Body, { className: "space-y-3", children: [
|
|
919
953
|
impactRows,
|
|
920
954
|
justificationContent
|
|
921
955
|
] })
|
|
@@ -923,8 +957,8 @@ function ImpactCard({
|
|
|
923
957
|
}
|
|
924
958
|
|
|
925
959
|
// src/common/risk/messages.ts
|
|
926
|
-
var
|
|
927
|
-
var messages5 = (0,
|
|
960
|
+
var import_i18n9 = require("@kopexa/i18n");
|
|
961
|
+
var messages5 = (0, import_i18n9.defineMessages)({
|
|
928
962
|
level_unrated: {
|
|
929
963
|
id: "grc.risk.level.unrated",
|
|
930
964
|
defaultMessage: "Not rated"
|
|
@@ -964,7 +998,7 @@ var messages5 = (0, import_i18n8.defineMessages)({
|
|
|
964
998
|
});
|
|
965
999
|
|
|
966
1000
|
// src/common/risk/risk-rating-display.tsx
|
|
967
|
-
var
|
|
1001
|
+
var import_i18n10 = require("@kopexa/i18n");
|
|
968
1002
|
var import_sight5 = require("@kopexa/sight");
|
|
969
1003
|
var import_theme4 = require("@kopexa/theme");
|
|
970
1004
|
|
|
@@ -1019,20 +1053,20 @@ var riskLevelConfig = {
|
|
|
1019
1053
|
};
|
|
1020
1054
|
|
|
1021
1055
|
// src/common/risk/risk-rating-display.tsx
|
|
1022
|
-
var
|
|
1056
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1023
1057
|
function RiskRatingDisplay({
|
|
1024
1058
|
rating,
|
|
1025
1059
|
showBadge = true,
|
|
1026
1060
|
showLabel = true,
|
|
1027
1061
|
size = "md"
|
|
1028
1062
|
}) {
|
|
1029
|
-
const intl = (0,
|
|
1063
|
+
const intl = (0, import_i18n10.useSafeIntl)();
|
|
1030
1064
|
if (isRatingUnrated(rating)) {
|
|
1031
1065
|
const styles2 = (0, import_theme4.riskRating)({ size, level: "unrated" });
|
|
1032
1066
|
const levelLabel2 = intl.formatMessage(messages5.level_unrated);
|
|
1033
|
-
return /* @__PURE__ */ (0,
|
|
1034
|
-
showBadge && /* @__PURE__ */ (0,
|
|
1035
|
-
showLabel && /* @__PURE__ */ (0,
|
|
1067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_sight5.Tooltip, { content: intl.formatMessage(messages5.not_rated_hint), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: styles2.base(), children: [
|
|
1068
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: styles2.badge(), children: "\u2014" }),
|
|
1069
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: styles2.label(), children: levelLabel2 })
|
|
1036
1070
|
] }) });
|
|
1037
1071
|
}
|
|
1038
1072
|
const ratedValue = rating;
|
|
@@ -1043,35 +1077,35 @@ function RiskRatingDisplay({
|
|
|
1043
1077
|
});
|
|
1044
1078
|
const levelLabelKey = `level_${level}`;
|
|
1045
1079
|
const levelLabel = intl.formatMessage(messages5[levelLabelKey]);
|
|
1046
|
-
return /* @__PURE__ */ (0,
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1047
1081
|
import_sight5.Tooltip,
|
|
1048
1082
|
{
|
|
1049
|
-
content: /* @__PURE__ */ (0,
|
|
1050
|
-
/* @__PURE__ */ (0,
|
|
1083
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-xs space-y-1", children: [
|
|
1084
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
1051
1085
|
intl.formatMessage(messages5.likelihood),
|
|
1052
1086
|
": ",
|
|
1053
1087
|
ratedValue.likelihood,
|
|
1054
1088
|
"/5"
|
|
1055
1089
|
] }),
|
|
1056
|
-
/* @__PURE__ */ (0,
|
|
1090
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
1057
1091
|
intl.formatMessage(messages5.consequence),
|
|
1058
1092
|
": ",
|
|
1059
1093
|
ratedValue.consequence,
|
|
1060
1094
|
"/5"
|
|
1061
1095
|
] }),
|
|
1062
|
-
ratedValue.comment && /* @__PURE__ */ (0,
|
|
1096
|
+
ratedValue.comment && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "text-muted-foreground", children: ratedValue.comment })
|
|
1063
1097
|
] }),
|
|
1064
|
-
children: /* @__PURE__ */ (0,
|
|
1065
|
-
showBadge && /* @__PURE__ */ (0,
|
|
1066
|
-
showLabel && /* @__PURE__ */ (0,
|
|
1098
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: styles.base(), children: [
|
|
1099
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: styles.badge(), children: ratedValue.rating }),
|
|
1100
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: styles.label(), children: levelLabel })
|
|
1067
1101
|
] })
|
|
1068
1102
|
}
|
|
1069
1103
|
);
|
|
1070
1104
|
}
|
|
1071
1105
|
|
|
1072
1106
|
// src/risk/messages.ts
|
|
1073
|
-
var
|
|
1074
|
-
var messages6 = (0,
|
|
1107
|
+
var import_i18n11 = require("@kopexa/i18n");
|
|
1108
|
+
var messages6 = (0, import_i18n11.defineMessages)({
|
|
1075
1109
|
// Card title
|
|
1076
1110
|
title: {
|
|
1077
1111
|
id: "grc.risk_treatment.title",
|
|
@@ -1175,11 +1209,11 @@ var messages6 = (0, import_i18n10.defineMessages)({
|
|
|
1175
1209
|
});
|
|
1176
1210
|
|
|
1177
1211
|
// src/risk/risk-treatment-card.tsx
|
|
1178
|
-
var
|
|
1212
|
+
var import_i18n12 = require("@kopexa/i18n");
|
|
1179
1213
|
var import_icons4 = require("@kopexa/icons");
|
|
1180
1214
|
var import_sight6 = require("@kopexa/sight");
|
|
1181
1215
|
var import_react3 = require("react");
|
|
1182
|
-
var
|
|
1216
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1183
1217
|
function TreatmentOption({
|
|
1184
1218
|
id,
|
|
1185
1219
|
label,
|
|
@@ -1190,7 +1224,7 @@ function TreatmentOption({
|
|
|
1190
1224
|
recommendedLabel,
|
|
1191
1225
|
onSelect
|
|
1192
1226
|
}) {
|
|
1193
|
-
return /* @__PURE__ */ (0,
|
|
1227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1194
1228
|
"button",
|
|
1195
1229
|
{
|
|
1196
1230
|
type: "button",
|
|
@@ -1199,25 +1233,25 @@ function TreatmentOption({
|
|
|
1199
1233
|
w-full text-left p-4 rounded-lg border-2 transition-all
|
|
1200
1234
|
${isSelected ? "border-primary bg-primary/5" : "border-border hover:border-primary/50 hover:bg-muted/50"}
|
|
1201
1235
|
`,
|
|
1202
|
-
children: /* @__PURE__ */ (0,
|
|
1203
|
-
/* @__PURE__ */ (0,
|
|
1236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
1237
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1204
1238
|
"div",
|
|
1205
1239
|
{
|
|
1206
1240
|
className: `
|
|
1207
1241
|
mt-0.5 size-5 rounded-full border-2 flex items-center justify-center flex-shrink-0
|
|
1208
1242
|
${isSelected ? "border-primary bg-primary" : "border-muted-foreground"}
|
|
1209
1243
|
`,
|
|
1210
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
1244
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "size-2 rounded-full bg-primary-foreground" })
|
|
1211
1245
|
}
|
|
1212
1246
|
),
|
|
1213
|
-
/* @__PURE__ */ (0,
|
|
1214
|
-
/* @__PURE__ */ (0,
|
|
1215
|
-
/* @__PURE__ */ (0,
|
|
1216
|
-
isRecommended && /* @__PURE__ */ (0,
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
1248
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-medium", children: label }),
|
|
1250
|
+
isRecommended && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Chip, { size: "sm", color: "success", variant: "flat", children: recommendedLabel })
|
|
1217
1251
|
] }),
|
|
1218
|
-
/* @__PURE__ */ (0,
|
|
1219
|
-
hint && /* @__PURE__ */ (0,
|
|
1220
|
-
/* @__PURE__ */ (0,
|
|
1252
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm text-muted-foreground mt-1", children: description }),
|
|
1253
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { className: "text-xs text-muted-foreground mt-2 flex items-center gap-1", children: [
|
|
1254
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-primary", children: "\u2192" }),
|
|
1221
1255
|
hint
|
|
1222
1256
|
] })
|
|
1223
1257
|
] })
|
|
@@ -1236,7 +1270,7 @@ function RiskTreatmentCard({
|
|
|
1236
1270
|
title,
|
|
1237
1271
|
recommended
|
|
1238
1272
|
}) {
|
|
1239
|
-
const intl = (0,
|
|
1273
|
+
const intl = (0, import_i18n12.useSafeIntl)();
|
|
1240
1274
|
const [isEditing, setIsEditing] = (0, import_react3.useState)(false);
|
|
1241
1275
|
const [editValues, setEditValues] = (0, import_react3.useState)(
|
|
1242
1276
|
value || defaultValue
|
|
@@ -1323,13 +1357,13 @@ function RiskTreatmentCard({
|
|
|
1323
1357
|
const handleRationaleChange = (rationale) => {
|
|
1324
1358
|
setEditValues((prev) => ({ ...prev, rationale: rationale || void 0 }));
|
|
1325
1359
|
};
|
|
1326
|
-
return /* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
1330
|
-
isEditing && /* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_sight6.Card.Root, { variant: "accent", children: [
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_sight6.Card.Header, { className: "flex flex-row items-center justify-between", children: [
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1363
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Heading, { level: "h3", className: "text-base", children: cardTitle }),
|
|
1364
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Chip, { size: "sm", color: "primary", children: t.edit })
|
|
1331
1365
|
] }),
|
|
1332
|
-
!readOnly && (!isEditing ? /* @__PURE__ */ (0,
|
|
1366
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1333
1367
|
import_sight6.Button,
|
|
1334
1368
|
{
|
|
1335
1369
|
variant: "ghost",
|
|
@@ -1337,17 +1371,17 @@ function RiskTreatmentCard({
|
|
|
1337
1371
|
isIconOnly: true,
|
|
1338
1372
|
onClick: handleStartEdit,
|
|
1339
1373
|
"aria-label": t.edit,
|
|
1340
|
-
children: /* @__PURE__ */ (0,
|
|
1374
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.EditIcon, { className: "size-4" })
|
|
1341
1375
|
}
|
|
1342
|
-
) : /* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
1376
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
1345
1379
|
] }))
|
|
1346
1380
|
] }),
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Card.Body, { className: "space-y-4", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-3", children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm text-muted-foreground", children: t.strategyPrompt }),
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "grid gap-3", children: treatmentOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1351
1385
|
TreatmentOption,
|
|
1352
1386
|
{
|
|
1353
1387
|
id: option.id,
|
|
@@ -1362,9 +1396,9 @@ function RiskTreatmentCard({
|
|
|
1362
1396
|
option.id
|
|
1363
1397
|
)) })
|
|
1364
1398
|
] }),
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Separator, {}),
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2", children: [
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1368
1402
|
"label",
|
|
1369
1403
|
{
|
|
1370
1404
|
htmlFor: "treatment-rationale",
|
|
@@ -1372,7 +1406,7 @@ function RiskTreatmentCard({
|
|
|
1372
1406
|
children: t.rationaleLabel
|
|
1373
1407
|
}
|
|
1374
1408
|
),
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1409
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1376
1410
|
import_sight6.Textarea,
|
|
1377
1411
|
{
|
|
1378
1412
|
id: "treatment-rationale",
|
|
@@ -1384,12 +1418,12 @@ function RiskTreatmentCard({
|
|
|
1384
1418
|
}
|
|
1385
1419
|
)
|
|
1386
1420
|
] })
|
|
1387
|
-
] }) : /* @__PURE__ */ (0,
|
|
1388
|
-
/* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1391
|
-
!isNotDefined && /* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1421
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1422
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm font-medium mb-1", children: t.strategyLabel }),
|
|
1424
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1425
|
+
!isNotDefined && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons4.CheckCirleIcon, { className: "size-4 text-success" }),
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1393
1427
|
"p",
|
|
1394
1428
|
{
|
|
1395
1429
|
className: `text-sm ${isNotDefined ? "text-muted-foreground" : ""}`,
|
|
@@ -1398,10 +1432,10 @@ function RiskTreatmentCard({
|
|
|
1398
1432
|
)
|
|
1399
1433
|
] })
|
|
1400
1434
|
] }),
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1402
|
-
/* @__PURE__ */ (0,
|
|
1403
|
-
/* @__PURE__ */ (0,
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_sight6.Separator, {}),
|
|
1436
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm font-medium mb-1", children: t.rationaleLabel }),
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm text-muted-foreground", children: currentValue.rationale || t.noRationale })
|
|
1405
1439
|
] })
|
|
1406
1440
|
] }) })
|
|
1407
1441
|
] });
|
|
@@ -1412,6 +1446,7 @@ function RiskTreatmentCard({
|
|
|
1412
1446
|
ControlChip,
|
|
1413
1447
|
DoraBadge,
|
|
1414
1448
|
EditorCard,
|
|
1449
|
+
ImpactBadge,
|
|
1415
1450
|
ImpactCard,
|
|
1416
1451
|
MappedControls,
|
|
1417
1452
|
Nis2Badge,
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./chunk-5JULTRFD.mjs";
|
|
3
|
+
import "./chunk-HI7F2CF4.mjs";
|
|
4
|
+
import {
|
|
5
|
+
RiskRatingDisplay
|
|
6
|
+
} from "./chunk-5TBN3JQA.mjs";
|
|
7
|
+
import {
|
|
8
|
+
messages as messages2
|
|
9
|
+
} from "./chunk-DC44K745.mjs";
|
|
10
|
+
import {
|
|
11
|
+
getRiskLevelFromRating,
|
|
12
|
+
isRatingUnrated,
|
|
13
|
+
riskLevelConfig
|
|
14
|
+
} from "./chunk-VFX3DASQ.mjs";
|
|
3
15
|
import "./chunk-C5OUE3C2.mjs";
|
|
4
16
|
import {
|
|
5
17
|
EditorCard
|
|
6
18
|
} from "./chunk-EGK6RMOC.mjs";
|
|
7
19
|
import "./chunk-JHGWV2ID.mjs";
|
|
8
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-4DMM2HCE.mjs";
|
|
21
|
+
import {
|
|
22
|
+
ImpactBadge
|
|
23
|
+
} from "./chunk-VQUPRJG7.mjs";
|
|
9
24
|
import {
|
|
10
25
|
ImpactCard
|
|
11
26
|
} from "./chunk-C2GUKNBG.mjs";
|
|
@@ -19,18 +34,6 @@ import {
|
|
|
19
34
|
import {
|
|
20
35
|
messages
|
|
21
36
|
} from "./chunk-AXBL7YBB.mjs";
|
|
22
|
-
import "./chunk-HI7F2CF4.mjs";
|
|
23
|
-
import {
|
|
24
|
-
RiskRatingDisplay
|
|
25
|
-
} from "./chunk-5TBN3JQA.mjs";
|
|
26
|
-
import {
|
|
27
|
-
messages as messages2
|
|
28
|
-
} from "./chunk-DC44K745.mjs";
|
|
29
|
-
import {
|
|
30
|
-
getRiskLevelFromRating,
|
|
31
|
-
isRatingUnrated,
|
|
32
|
-
riskLevelConfig
|
|
33
|
-
} from "./chunk-VFX3DASQ.mjs";
|
|
34
37
|
import "./chunk-TICWEZUI.mjs";
|
|
35
38
|
import {
|
|
36
39
|
ComplianceBadges,
|
|
@@ -56,6 +59,7 @@ export {
|
|
|
56
59
|
ControlChip,
|
|
57
60
|
DoraBadge,
|
|
58
61
|
EditorCard,
|
|
62
|
+
ImpactBadge,
|
|
59
63
|
ImpactCard,
|
|
60
64
|
MappedControls,
|
|
61
65
|
Nis2Badge,
|