@kopexa/grc 0.0.2 → 0.0.4

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.
Files changed (61) hide show
  1. package/dist/chunk-5TBN3JQA.mjs +66 -0
  2. package/dist/{chunk-TW3S4OE2.mjs → chunk-AGASJJ7X.mjs} +106 -82
  3. package/dist/chunk-DC44K745.mjs +46 -0
  4. package/dist/chunk-HI7F2CF4.mjs +1 -0
  5. package/dist/chunk-HJUSN7FD.mjs +1 -0
  6. package/dist/chunk-QDYL5ABK.mjs +118 -0
  7. package/dist/chunk-QS5S6V26.mjs +22 -0
  8. package/dist/chunk-VFX3DASQ.mjs +57 -0
  9. package/dist/common/control/index.d.mts +3 -0
  10. package/dist/common/control/index.d.ts +3 -0
  11. package/dist/common/control/index.js +160 -0
  12. package/dist/common/control/index.mjs +11 -0
  13. package/dist/common/control/mapped-controls.d.mts +33 -0
  14. package/dist/common/control/mapped-controls.d.ts +33 -0
  15. package/dist/common/control/mapped-controls.js +159 -0
  16. package/dist/common/control/mapped-controls.mjs +11 -0
  17. package/dist/common/control/messages.d.mts +16 -0
  18. package/dist/common/control/messages.d.ts +16 -0
  19. package/dist/common/control/messages.js +45 -0
  20. package/dist/common/control/messages.mjs +7 -0
  21. package/dist/common/impact/impact-card.d.mts +7 -1
  22. package/dist/common/impact/impact-card.d.ts +7 -1
  23. package/dist/common/impact/impact-card.js +105 -81
  24. package/dist/common/impact/impact-card.mjs +1 -1
  25. package/dist/common/impact/index.js +105 -81
  26. package/dist/common/impact/index.mjs +1 -1
  27. package/dist/common/index.d.mts +5 -0
  28. package/dist/common/index.d.ts +5 -0
  29. package/dist/common/index.js +458 -145
  30. package/dist/common/index.mjs +27 -2
  31. package/dist/common/risk/index.d.mts +4 -0
  32. package/dist/common/risk/index.d.ts +4 -0
  33. package/dist/common/risk/index.js +185 -0
  34. package/dist/common/risk/index.mjs +20 -0
  35. package/dist/common/risk/messages.d.mts +40 -0
  36. package/dist/common/risk/messages.d.ts +40 -0
  37. package/dist/common/risk/messages.js +69 -0
  38. package/dist/common/risk/messages.mjs +7 -0
  39. package/dist/common/risk/risk-rating-display.d.mts +21 -0
  40. package/dist/common/risk/risk-rating-display.d.ts +21 -0
  41. package/dist/common/risk/risk-rating-display.js +139 -0
  42. package/dist/common/risk/risk-rating-display.mjs +10 -0
  43. package/dist/common/risk/types.d.mts +37 -0
  44. package/dist/common/risk/types.d.ts +37 -0
  45. package/dist/common/risk/types.js +82 -0
  46. package/dist/common/risk/types.mjs +11 -0
  47. package/dist/index.d.mts +5 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +458 -145
  50. package/dist/index.mjs +27 -2
  51. package/package.json +8 -7
  52. package/src/common/control/index.ts +6 -0
  53. package/src/common/control/mapped-controls.tsx +192 -0
  54. package/src/common/control/messages.ts +16 -0
  55. package/src/common/impact/impact-card.tsx +132 -79
  56. package/src/common/index.ts +2 -0
  57. package/src/common/risk/index.ts +12 -0
  58. package/src/common/risk/messages.ts +40 -0
  59. package/src/common/risk/risk-rating-display.tsx +86 -0
  60. package/src/common/risk/types.ts +91 -0
  61. /package/dist/{chunk-BFZPRJQT.mjs → chunk-CND77GVC.mjs} +0 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * RiskRating represents the risk assessment details.
3
+ * Aligned with backend Go struct.
4
+ */
5
+ interface RiskRating {
6
+ /** Likelihood of the risk occurring (1-5). 0 = not rated. */
7
+ likelihood: number;
8
+ /** Consequence/impact if the risk occurs (1-5). 0 = not rated. */
9
+ consequence: number;
10
+ /** Calculated rating: likelihood × consequence (0-25). 0 = not rated. */
11
+ rating: number;
12
+ /** Optional comment for context */
13
+ comment?: string;
14
+ }
15
+ type RiskLevel = "unrated" | "low" | "medium" | "high" | "critical";
16
+ /**
17
+ * Get risk level from rating (0-25).
18
+ * - 0: Unrated
19
+ * - 1-4: Low
20
+ * - 5-9: Medium
21
+ * - 10-16: High
22
+ * - 17-25: Critical
23
+ */
24
+ declare function getRiskLevelFromRating(rating: number): RiskLevel;
25
+ /**
26
+ * Check if a rating is considered "not rated"
27
+ */
28
+ declare function isRatingUnrated(rating: RiskRating | null | undefined): boolean;
29
+ declare const riskLevelConfig: Record<RiskLevel, {
30
+ label: string;
31
+ bgColor: string;
32
+ textColor: string;
33
+ iconBgColor: string;
34
+ iconTextColor: string;
35
+ }>;
36
+
37
+ export { type RiskLevel, type RiskRating, getRiskLevelFromRating, isRatingUnrated, riskLevelConfig };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/common/risk/types.ts
22
+ var types_exports = {};
23
+ __export(types_exports, {
24
+ getRiskLevelFromRating: () => getRiskLevelFromRating,
25
+ isRatingUnrated: () => isRatingUnrated,
26
+ riskLevelConfig: () => riskLevelConfig
27
+ });
28
+ module.exports = __toCommonJS(types_exports);
29
+ function getRiskLevelFromRating(rating) {
30
+ if (rating === 0) return "unrated";
31
+ if (rating <= 4) return "low";
32
+ if (rating <= 9) return "medium";
33
+ if (rating <= 16) return "high";
34
+ return "critical";
35
+ }
36
+ function isRatingUnrated(rating) {
37
+ if (!rating) return true;
38
+ return rating.rating === 0 || rating.likelihood === 0 || rating.consequence === 0;
39
+ }
40
+ var riskLevelConfig = {
41
+ unrated: {
42
+ label: "Nicht bewertet",
43
+ bgColor: "bg-muted",
44
+ textColor: "text-muted-foreground",
45
+ iconBgColor: "bg-muted/50",
46
+ iconTextColor: "text-muted-foreground"
47
+ },
48
+ low: {
49
+ label: "Niedrig",
50
+ bgColor: "bg-success",
51
+ textColor: "text-success",
52
+ iconBgColor: "bg-success/10",
53
+ iconTextColor: "text-success"
54
+ },
55
+ medium: {
56
+ label: "Mittel",
57
+ bgColor: "bg-warning",
58
+ textColor: "text-warning",
59
+ iconBgColor: "bg-warning/10",
60
+ iconTextColor: "text-warning"
61
+ },
62
+ high: {
63
+ label: "Hoch",
64
+ bgColor: "bg-orange-500",
65
+ textColor: "text-orange-500",
66
+ iconBgColor: "bg-orange-500/10",
67
+ iconTextColor: "text-orange-500"
68
+ },
69
+ critical: {
70
+ label: "Kritisch",
71
+ bgColor: "bg-destructive",
72
+ textColor: "text-destructive",
73
+ iconBgColor: "bg-destructive/10",
74
+ iconTextColor: "text-destructive"
75
+ }
76
+ };
77
+ // Annotate the CommonJS export names for ESM import in node:
78
+ 0 && (module.exports = {
79
+ getRiskLevelFromRating,
80
+ isRatingUnrated,
81
+ riskLevelConfig
82
+ });
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import {
3
+ getRiskLevelFromRating,
4
+ isRatingUnrated,
5
+ riskLevelConfig
6
+ } from "../../chunk-VFX3DASQ.mjs";
7
+ export {
8
+ getRiskLevelFromRating,
9
+ isRatingUnrated,
10
+ riskLevelConfig
11
+ };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,11 @@
1
1
  export { ComplianceBadges, ComplianceBadgesProps, DoraBadge, DoraBadgeProps, Nis2Badge, Nis2BadgeProps } from './common/compliance/compliance-badge.mjs';
2
+ export { ControlChip, ControlChipProps, MappedControls, MappedControlsProps } from './common/control/mapped-controls.mjs';
2
3
  export { ImpactCard, ImpactCardProps, ImpactValue } from './common/impact/impact-card.mjs';
3
4
  export { messages as impactMessages } from './common/impact/messages.mjs';
4
5
  export { ImpactLevel, ImpactLevelConfig, ImpactScaleConfig, ImpactScalePreset, assetScale, getScale, impactLevels, processScale, riskScale } from './common/impact/scales.mjs';
6
+ export { messages as riskMessages } from './common/risk/messages.mjs';
7
+ export { RiskRatingDisplay, RiskRatingDisplayProps } from './common/risk/risk-rating-display.mjs';
8
+ export { RiskLevel, RiskRating, getRiskLevelFromRating, isRatingUnrated, riskLevelConfig } from './common/risk/types.mjs';
5
9
  import 'react/jsx-runtime';
10
+ import 'react';
6
11
  import 'react-intl';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  export { ComplianceBadges, ComplianceBadgesProps, DoraBadge, DoraBadgeProps, Nis2Badge, Nis2BadgeProps } from './common/compliance/compliance-badge.js';
2
+ export { ControlChip, ControlChipProps, MappedControls, MappedControlsProps } from './common/control/mapped-controls.js';
2
3
  export { ImpactCard, ImpactCardProps, ImpactValue } from './common/impact/impact-card.js';
3
4
  export { messages as impactMessages } from './common/impact/messages.js';
4
5
  export { ImpactLevel, ImpactLevelConfig, ImpactScaleConfig, ImpactScalePreset, assetScale, getScale, impactLevels, processScale, riskScale } from './common/impact/scales.js';
6
+ export { messages as riskMessages } from './common/risk/messages.js';
7
+ export { RiskRatingDisplay, RiskRatingDisplayProps } from './common/risk/risk-rating-display.js';
8
+ export { RiskLevel, RiskRating, getRiskLevelFromRating, isRatingUnrated, riskLevelConfig } from './common/risk/types.js';
5
9
  import 'react/jsx-runtime';
10
+ import 'react';
6
11
  import 'react-intl';