@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.
- package/dist/chunk-5TBN3JQA.mjs +66 -0
- package/dist/{chunk-TW3S4OE2.mjs → chunk-AGASJJ7X.mjs} +106 -82
- package/dist/chunk-DC44K745.mjs +46 -0
- package/dist/chunk-HI7F2CF4.mjs +1 -0
- package/dist/chunk-HJUSN7FD.mjs +1 -0
- package/dist/chunk-QDYL5ABK.mjs +118 -0
- package/dist/chunk-QS5S6V26.mjs +22 -0
- package/dist/chunk-VFX3DASQ.mjs +57 -0
- package/dist/common/control/index.d.mts +3 -0
- package/dist/common/control/index.d.ts +3 -0
- package/dist/common/control/index.js +160 -0
- package/dist/common/control/index.mjs +11 -0
- package/dist/common/control/mapped-controls.d.mts +33 -0
- package/dist/common/control/mapped-controls.d.ts +33 -0
- package/dist/common/control/mapped-controls.js +159 -0
- package/dist/common/control/mapped-controls.mjs +11 -0
- package/dist/common/control/messages.d.mts +16 -0
- package/dist/common/control/messages.d.ts +16 -0
- package/dist/common/control/messages.js +45 -0
- package/dist/common/control/messages.mjs +7 -0
- package/dist/common/impact/impact-card.d.mts +7 -1
- package/dist/common/impact/impact-card.d.ts +7 -1
- package/dist/common/impact/impact-card.js +105 -81
- package/dist/common/impact/impact-card.mjs +1 -1
- package/dist/common/impact/index.js +105 -81
- package/dist/common/impact/index.mjs +1 -1
- package/dist/common/index.d.mts +5 -0
- package/dist/common/index.d.ts +5 -0
- package/dist/common/index.js +458 -145
- package/dist/common/index.mjs +27 -2
- package/dist/common/risk/index.d.mts +4 -0
- package/dist/common/risk/index.d.ts +4 -0
- package/dist/common/risk/index.js +185 -0
- package/dist/common/risk/index.mjs +20 -0
- package/dist/common/risk/messages.d.mts +40 -0
- package/dist/common/risk/messages.d.ts +40 -0
- package/dist/common/risk/messages.js +69 -0
- package/dist/common/risk/messages.mjs +7 -0
- package/dist/common/risk/risk-rating-display.d.mts +21 -0
- package/dist/common/risk/risk-rating-display.d.ts +21 -0
- package/dist/common/risk/risk-rating-display.js +139 -0
- package/dist/common/risk/risk-rating-display.mjs +10 -0
- package/dist/common/risk/types.d.mts +37 -0
- package/dist/common/risk/types.d.ts +37 -0
- package/dist/common/risk/types.js +82 -0
- package/dist/common/risk/types.mjs +11 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +458 -145
- package/dist/index.mjs +27 -2
- package/package.json +8 -7
- package/src/common/control/index.ts +6 -0
- package/src/common/control/mapped-controls.tsx +192 -0
- package/src/common/control/messages.ts +16 -0
- package/src/common/impact/impact-card.tsx +132 -79
- package/src/common/index.ts +2 -0
- package/src/common/risk/index.ts +12 -0
- package/src/common/risk/messages.ts +40 -0
- package/src/common/risk/risk-rating-display.tsx +86 -0
- package/src/common/risk/types.ts +91 -0
- /package/dist/{chunk-BFZPRJQT.mjs → chunk-CND77GVC.mjs} +0 -0
|
@@ -382,15 +382,18 @@ function ImpactCard({
|
|
|
382
382
|
showAuthenticity = false,
|
|
383
383
|
readOnly = false,
|
|
384
384
|
scale = "risk",
|
|
385
|
-
title
|
|
385
|
+
title,
|
|
386
|
+
variant = "card"
|
|
386
387
|
}) {
|
|
387
388
|
var _a, _b;
|
|
388
389
|
const intl = (0, import_i18n2.useSafeIntl)();
|
|
390
|
+
const isInline = variant === "inline";
|
|
389
391
|
const [isEditing, setIsEditing] = (0, import_react.useState)(false);
|
|
390
392
|
const [editValues, setEditValues] = (0, import_react.useState)(
|
|
391
393
|
value || defaultImpact
|
|
392
394
|
);
|
|
393
|
-
const
|
|
395
|
+
const effectiveIsEditing = isInline ? !readOnly : isEditing;
|
|
396
|
+
const styles = (0, import_theme.impactCard)({ editing: !isInline && isEditing });
|
|
394
397
|
const scaleConfig = typeof scale === "string" ? getScale(scale) : scale;
|
|
395
398
|
const formatLabel = (level) => {
|
|
396
399
|
const config = scaleConfig[level];
|
|
@@ -426,18 +429,28 @@ function ImpactCard({
|
|
|
426
429
|
setEditValues(value || defaultImpact);
|
|
427
430
|
setIsEditing(true);
|
|
428
431
|
};
|
|
429
|
-
const currentImpact = isEditing ? editValues : value || defaultImpact;
|
|
432
|
+
const currentImpact = isInline ? value || defaultImpact : isEditing ? editValues : value || defaultImpact;
|
|
430
433
|
const handleLevelChange = (key) => (level) => {
|
|
431
|
-
|
|
432
|
-
...
|
|
434
|
+
const newValues = {
|
|
435
|
+
...isInline ? value || defaultImpact : editValues,
|
|
433
436
|
[key]: level
|
|
434
|
-
}
|
|
437
|
+
};
|
|
438
|
+
if (isInline) {
|
|
439
|
+
onChange == null ? void 0 : onChange(newValues);
|
|
440
|
+
} else {
|
|
441
|
+
setEditValues(newValues);
|
|
442
|
+
}
|
|
435
443
|
};
|
|
436
444
|
const handleJustificationChange = (justification) => {
|
|
437
|
-
|
|
438
|
-
...
|
|
445
|
+
const newValues = {
|
|
446
|
+
...isInline ? value || defaultImpact : editValues,
|
|
439
447
|
impactJustification: justification || void 0
|
|
440
|
-
}
|
|
448
|
+
};
|
|
449
|
+
if (isInline) {
|
|
450
|
+
onChange == null ? void 0 : onChange(newValues);
|
|
451
|
+
} else {
|
|
452
|
+
setEditValues(newValues);
|
|
453
|
+
}
|
|
441
454
|
};
|
|
442
455
|
const highestImpact = Math.max(
|
|
443
456
|
currentImpact.impactConfidentiality,
|
|
@@ -449,6 +462,87 @@ function ImpactCard({
|
|
|
449
462
|
const justificationHint = intl.formatMessage(messages.justification_hint, {
|
|
450
463
|
level: highestLabel
|
|
451
464
|
});
|
|
465
|
+
const impactRows = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
466
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
467
|
+
ImpactItemRow,
|
|
468
|
+
{
|
|
469
|
+
label: t.confidentiality,
|
|
470
|
+
shortLabel: "C",
|
|
471
|
+
value: currentImpact.impactConfidentiality,
|
|
472
|
+
isEditing: effectiveIsEditing,
|
|
473
|
+
scale: scaleConfig,
|
|
474
|
+
formatLabel,
|
|
475
|
+
onLevelChange: handleLevelChange("impactConfidentiality")
|
|
476
|
+
}
|
|
477
|
+
),
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
479
|
+
ImpactItemRow,
|
|
480
|
+
{
|
|
481
|
+
label: t.integrity,
|
|
482
|
+
shortLabel: "I",
|
|
483
|
+
value: currentImpact.impactIntegrity,
|
|
484
|
+
isEditing: effectiveIsEditing,
|
|
485
|
+
scale: scaleConfig,
|
|
486
|
+
formatLabel,
|
|
487
|
+
onLevelChange: handleLevelChange("impactIntegrity")
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
491
|
+
ImpactItemRow,
|
|
492
|
+
{
|
|
493
|
+
label: t.availability,
|
|
494
|
+
shortLabel: "A",
|
|
495
|
+
value: currentImpact.impactAvailability,
|
|
496
|
+
isEditing: effectiveIsEditing,
|
|
497
|
+
scale: scaleConfig,
|
|
498
|
+
formatLabel,
|
|
499
|
+
onLevelChange: handleLevelChange("impactAvailability")
|
|
500
|
+
}
|
|
501
|
+
),
|
|
502
|
+
showAuthenticity && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
503
|
+
ImpactItemRow,
|
|
504
|
+
{
|
|
505
|
+
label: t.authenticity,
|
|
506
|
+
shortLabel: "Au",
|
|
507
|
+
value: (_b = currentImpact.impactAuthenticity) != null ? _b : 0,
|
|
508
|
+
isEditing: effectiveIsEditing,
|
|
509
|
+
scale: scaleConfig,
|
|
510
|
+
formatLabel,
|
|
511
|
+
onLevelChange: handleLevelChange("impactAuthenticity")
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
] });
|
|
515
|
+
const justificationContent = showJustification && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.justificationSection(), children: [
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
517
|
+
"label",
|
|
518
|
+
{
|
|
519
|
+
htmlFor: "impact-justification",
|
|
520
|
+
className: styles.justificationLabel(),
|
|
521
|
+
children: [
|
|
522
|
+
t.justification,
|
|
523
|
+
highestImpact > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.justificationHint(), children: justificationHint })
|
|
524
|
+
]
|
|
525
|
+
}
|
|
526
|
+
),
|
|
527
|
+
effectiveIsEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
528
|
+
import_sight.Textarea,
|
|
529
|
+
{
|
|
530
|
+
id: "impact-justification",
|
|
531
|
+
value: currentImpact.impactJustification || "",
|
|
532
|
+
onChange: (e) => handleJustificationChange(e.target.value),
|
|
533
|
+
placeholder: t.justificationPlaceholder,
|
|
534
|
+
rows: 3,
|
|
535
|
+
className: "text-sm"
|
|
536
|
+
}
|
|
537
|
+
) : currentImpact.impactJustification ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationText(), children: currentImpact.impactJustification }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationEmpty(), children: t.noJustification })
|
|
538
|
+
] });
|
|
539
|
+
if (isInline) {
|
|
540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.wrapper(), children: [
|
|
541
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.inlineHeader(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Heading, { level: "h4", className: "text-sm font-medium", children: title }) }),
|
|
542
|
+
impactRows,
|
|
543
|
+
justificationContent
|
|
544
|
+
] });
|
|
545
|
+
}
|
|
452
546
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Root, { className: styles.root(), children: [
|
|
453
547
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Header, { className: "flex flex-row items-center justify-between", children: [
|
|
454
548
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
@@ -470,78 +564,8 @@ function ImpactCard({
|
|
|
470
564
|
] }))
|
|
471
565
|
] }),
|
|
472
566
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Body, { className: "space-y-3", children: [
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
{
|
|
476
|
-
label: t.confidentiality,
|
|
477
|
-
shortLabel: "C",
|
|
478
|
-
value: currentImpact.impactConfidentiality,
|
|
479
|
-
isEditing,
|
|
480
|
-
scale: scaleConfig,
|
|
481
|
-
formatLabel,
|
|
482
|
-
onLevelChange: handleLevelChange("impactConfidentiality")
|
|
483
|
-
}
|
|
484
|
-
),
|
|
485
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
486
|
-
ImpactItemRow,
|
|
487
|
-
{
|
|
488
|
-
label: t.integrity,
|
|
489
|
-
shortLabel: "I",
|
|
490
|
-
value: currentImpact.impactIntegrity,
|
|
491
|
-
isEditing,
|
|
492
|
-
scale: scaleConfig,
|
|
493
|
-
formatLabel,
|
|
494
|
-
onLevelChange: handleLevelChange("impactIntegrity")
|
|
495
|
-
}
|
|
496
|
-
),
|
|
497
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
498
|
-
ImpactItemRow,
|
|
499
|
-
{
|
|
500
|
-
label: t.availability,
|
|
501
|
-
shortLabel: "A",
|
|
502
|
-
value: currentImpact.impactAvailability,
|
|
503
|
-
isEditing,
|
|
504
|
-
scale: scaleConfig,
|
|
505
|
-
formatLabel,
|
|
506
|
-
onLevelChange: handleLevelChange("impactAvailability")
|
|
507
|
-
}
|
|
508
|
-
),
|
|
509
|
-
showAuthenticity && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
510
|
-
ImpactItemRow,
|
|
511
|
-
{
|
|
512
|
-
label: t.authenticity,
|
|
513
|
-
shortLabel: "Au",
|
|
514
|
-
value: (_b = currentImpact.impactAuthenticity) != null ? _b : 0,
|
|
515
|
-
isEditing,
|
|
516
|
-
scale: scaleConfig,
|
|
517
|
-
formatLabel,
|
|
518
|
-
onLevelChange: handleLevelChange("impactAuthenticity")
|
|
519
|
-
}
|
|
520
|
-
),
|
|
521
|
-
showJustification && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.justificationSection(), children: [
|
|
522
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
523
|
-
"label",
|
|
524
|
-
{
|
|
525
|
-
htmlFor: "impact-justification",
|
|
526
|
-
className: styles.justificationLabel(),
|
|
527
|
-
children: [
|
|
528
|
-
t.justification,
|
|
529
|
-
highestImpact > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.justificationHint(), children: justificationHint })
|
|
530
|
-
]
|
|
531
|
-
}
|
|
532
|
-
),
|
|
533
|
-
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
534
|
-
import_sight.Textarea,
|
|
535
|
-
{
|
|
536
|
-
id: "impact-justification",
|
|
537
|
-
value: currentImpact.impactJustification || "",
|
|
538
|
-
onChange: (e) => handleJustificationChange(e.target.value),
|
|
539
|
-
placeholder: t.justificationPlaceholder,
|
|
540
|
-
rows: 3,
|
|
541
|
-
className: "text-sm"
|
|
542
|
-
}
|
|
543
|
-
) : currentImpact.impactJustification ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationText(), children: currentImpact.impactJustification }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationEmpty(), children: t.noJustification })
|
|
544
|
-
] })
|
|
567
|
+
impactRows,
|
|
568
|
+
justificationContent
|
|
545
569
|
] })
|
|
546
570
|
] });
|
|
547
571
|
}
|
|
@@ -389,15 +389,18 @@ function ImpactCard({
|
|
|
389
389
|
showAuthenticity = false,
|
|
390
390
|
readOnly = false,
|
|
391
391
|
scale = "risk",
|
|
392
|
-
title
|
|
392
|
+
title,
|
|
393
|
+
variant = "card"
|
|
393
394
|
}) {
|
|
394
395
|
var _a, _b;
|
|
395
396
|
const intl = (0, import_i18n2.useSafeIntl)();
|
|
397
|
+
const isInline = variant === "inline";
|
|
396
398
|
const [isEditing, setIsEditing] = (0, import_react.useState)(false);
|
|
397
399
|
const [editValues, setEditValues] = (0, import_react.useState)(
|
|
398
400
|
value || defaultImpact
|
|
399
401
|
);
|
|
400
|
-
const
|
|
402
|
+
const effectiveIsEditing = isInline ? !readOnly : isEditing;
|
|
403
|
+
const styles = (0, import_theme.impactCard)({ editing: !isInline && isEditing });
|
|
401
404
|
const scaleConfig = typeof scale === "string" ? getScale(scale) : scale;
|
|
402
405
|
const formatLabel = (level) => {
|
|
403
406
|
const config = scaleConfig[level];
|
|
@@ -433,18 +436,28 @@ function ImpactCard({
|
|
|
433
436
|
setEditValues(value || defaultImpact);
|
|
434
437
|
setIsEditing(true);
|
|
435
438
|
};
|
|
436
|
-
const currentImpact = isEditing ? editValues : value || defaultImpact;
|
|
439
|
+
const currentImpact = isInline ? value || defaultImpact : isEditing ? editValues : value || defaultImpact;
|
|
437
440
|
const handleLevelChange = (key) => (level) => {
|
|
438
|
-
|
|
439
|
-
...
|
|
441
|
+
const newValues = {
|
|
442
|
+
...isInline ? value || defaultImpact : editValues,
|
|
440
443
|
[key]: level
|
|
441
|
-
}
|
|
444
|
+
};
|
|
445
|
+
if (isInline) {
|
|
446
|
+
onChange == null ? void 0 : onChange(newValues);
|
|
447
|
+
} else {
|
|
448
|
+
setEditValues(newValues);
|
|
449
|
+
}
|
|
442
450
|
};
|
|
443
451
|
const handleJustificationChange = (justification) => {
|
|
444
|
-
|
|
445
|
-
...
|
|
452
|
+
const newValues = {
|
|
453
|
+
...isInline ? value || defaultImpact : editValues,
|
|
446
454
|
impactJustification: justification || void 0
|
|
447
|
-
}
|
|
455
|
+
};
|
|
456
|
+
if (isInline) {
|
|
457
|
+
onChange == null ? void 0 : onChange(newValues);
|
|
458
|
+
} else {
|
|
459
|
+
setEditValues(newValues);
|
|
460
|
+
}
|
|
448
461
|
};
|
|
449
462
|
const highestImpact = Math.max(
|
|
450
463
|
currentImpact.impactConfidentiality,
|
|
@@ -456,6 +469,87 @@ function ImpactCard({
|
|
|
456
469
|
const justificationHint = intl.formatMessage(messages.justification_hint, {
|
|
457
470
|
level: highestLabel
|
|
458
471
|
});
|
|
472
|
+
const impactRows = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
474
|
+
ImpactItemRow,
|
|
475
|
+
{
|
|
476
|
+
label: t.confidentiality,
|
|
477
|
+
shortLabel: "C",
|
|
478
|
+
value: currentImpact.impactConfidentiality,
|
|
479
|
+
isEditing: effectiveIsEditing,
|
|
480
|
+
scale: scaleConfig,
|
|
481
|
+
formatLabel,
|
|
482
|
+
onLevelChange: handleLevelChange("impactConfidentiality")
|
|
483
|
+
}
|
|
484
|
+
),
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
486
|
+
ImpactItemRow,
|
|
487
|
+
{
|
|
488
|
+
label: t.integrity,
|
|
489
|
+
shortLabel: "I",
|
|
490
|
+
value: currentImpact.impactIntegrity,
|
|
491
|
+
isEditing: effectiveIsEditing,
|
|
492
|
+
scale: scaleConfig,
|
|
493
|
+
formatLabel,
|
|
494
|
+
onLevelChange: handleLevelChange("impactIntegrity")
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
498
|
+
ImpactItemRow,
|
|
499
|
+
{
|
|
500
|
+
label: t.availability,
|
|
501
|
+
shortLabel: "A",
|
|
502
|
+
value: currentImpact.impactAvailability,
|
|
503
|
+
isEditing: effectiveIsEditing,
|
|
504
|
+
scale: scaleConfig,
|
|
505
|
+
formatLabel,
|
|
506
|
+
onLevelChange: handleLevelChange("impactAvailability")
|
|
507
|
+
}
|
|
508
|
+
),
|
|
509
|
+
showAuthenticity && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
510
|
+
ImpactItemRow,
|
|
511
|
+
{
|
|
512
|
+
label: t.authenticity,
|
|
513
|
+
shortLabel: "Au",
|
|
514
|
+
value: (_b = currentImpact.impactAuthenticity) != null ? _b : 0,
|
|
515
|
+
isEditing: effectiveIsEditing,
|
|
516
|
+
scale: scaleConfig,
|
|
517
|
+
formatLabel,
|
|
518
|
+
onLevelChange: handleLevelChange("impactAuthenticity")
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
] });
|
|
522
|
+
const justificationContent = showJustification && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.justificationSection(), children: [
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
524
|
+
"label",
|
|
525
|
+
{
|
|
526
|
+
htmlFor: "impact-justification",
|
|
527
|
+
className: styles.justificationLabel(),
|
|
528
|
+
children: [
|
|
529
|
+
t.justification,
|
|
530
|
+
highestImpact > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.justificationHint(), children: justificationHint })
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
),
|
|
534
|
+
effectiveIsEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
535
|
+
import_sight.Textarea,
|
|
536
|
+
{
|
|
537
|
+
id: "impact-justification",
|
|
538
|
+
value: currentImpact.impactJustification || "",
|
|
539
|
+
onChange: (e) => handleJustificationChange(e.target.value),
|
|
540
|
+
placeholder: t.justificationPlaceholder,
|
|
541
|
+
rows: 3,
|
|
542
|
+
className: "text-sm"
|
|
543
|
+
}
|
|
544
|
+
) : currentImpact.impactJustification ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationText(), children: currentImpact.impactJustification }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationEmpty(), children: t.noJustification })
|
|
545
|
+
] });
|
|
546
|
+
if (isInline) {
|
|
547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.wrapper(), children: [
|
|
548
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.inlineHeader(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Heading, { level: "h4", className: "text-sm font-medium", children: title }) }),
|
|
549
|
+
impactRows,
|
|
550
|
+
justificationContent
|
|
551
|
+
] });
|
|
552
|
+
}
|
|
459
553
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Root, { className: styles.root(), children: [
|
|
460
554
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Header, { className: "flex flex-row items-center justify-between", children: [
|
|
461
555
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
@@ -477,78 +571,8 @@ function ImpactCard({
|
|
|
477
571
|
] }))
|
|
478
572
|
] }),
|
|
479
573
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Body, { className: "space-y-3", children: [
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
{
|
|
483
|
-
label: t.confidentiality,
|
|
484
|
-
shortLabel: "C",
|
|
485
|
-
value: currentImpact.impactConfidentiality,
|
|
486
|
-
isEditing,
|
|
487
|
-
scale: scaleConfig,
|
|
488
|
-
formatLabel,
|
|
489
|
-
onLevelChange: handleLevelChange("impactConfidentiality")
|
|
490
|
-
}
|
|
491
|
-
),
|
|
492
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
493
|
-
ImpactItemRow,
|
|
494
|
-
{
|
|
495
|
-
label: t.integrity,
|
|
496
|
-
shortLabel: "I",
|
|
497
|
-
value: currentImpact.impactIntegrity,
|
|
498
|
-
isEditing,
|
|
499
|
-
scale: scaleConfig,
|
|
500
|
-
formatLabel,
|
|
501
|
-
onLevelChange: handleLevelChange("impactIntegrity")
|
|
502
|
-
}
|
|
503
|
-
),
|
|
504
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
505
|
-
ImpactItemRow,
|
|
506
|
-
{
|
|
507
|
-
label: t.availability,
|
|
508
|
-
shortLabel: "A",
|
|
509
|
-
value: currentImpact.impactAvailability,
|
|
510
|
-
isEditing,
|
|
511
|
-
scale: scaleConfig,
|
|
512
|
-
formatLabel,
|
|
513
|
-
onLevelChange: handleLevelChange("impactAvailability")
|
|
514
|
-
}
|
|
515
|
-
),
|
|
516
|
-
showAuthenticity && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
517
|
-
ImpactItemRow,
|
|
518
|
-
{
|
|
519
|
-
label: t.authenticity,
|
|
520
|
-
shortLabel: "Au",
|
|
521
|
-
value: (_b = currentImpact.impactAuthenticity) != null ? _b : 0,
|
|
522
|
-
isEditing,
|
|
523
|
-
scale: scaleConfig,
|
|
524
|
-
formatLabel,
|
|
525
|
-
onLevelChange: handleLevelChange("impactAuthenticity")
|
|
526
|
-
}
|
|
527
|
-
),
|
|
528
|
-
showJustification && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.justificationSection(), children: [
|
|
529
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
530
|
-
"label",
|
|
531
|
-
{
|
|
532
|
-
htmlFor: "impact-justification",
|
|
533
|
-
className: styles.justificationLabel(),
|
|
534
|
-
children: [
|
|
535
|
-
t.justification,
|
|
536
|
-
highestImpact > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.justificationHint(), children: justificationHint })
|
|
537
|
-
]
|
|
538
|
-
}
|
|
539
|
-
),
|
|
540
|
-
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
541
|
-
import_sight.Textarea,
|
|
542
|
-
{
|
|
543
|
-
id: "impact-justification",
|
|
544
|
-
value: currentImpact.impactJustification || "",
|
|
545
|
-
onChange: (e) => handleJustificationChange(e.target.value),
|
|
546
|
-
placeholder: t.justificationPlaceholder,
|
|
547
|
-
rows: 3,
|
|
548
|
-
className: "text-sm"
|
|
549
|
-
}
|
|
550
|
-
) : currentImpact.impactJustification ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationText(), children: currentImpact.impactJustification }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: styles.justificationEmpty(), children: t.noJustification })
|
|
551
|
-
] })
|
|
574
|
+
impactRows,
|
|
575
|
+
justificationContent
|
|
552
576
|
] })
|
|
553
577
|
] });
|
|
554
578
|
}
|
package/dist/common/index.d.mts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export { ComplianceBadges, ComplianceBadgesProps, DoraBadge, DoraBadgeProps, Nis2Badge, Nis2BadgeProps } from './compliance/compliance-badge.mjs';
|
|
2
|
+
export { ControlChip, ControlChipProps, MappedControls, MappedControlsProps } from './control/mapped-controls.mjs';
|
|
2
3
|
export { ImpactCard, ImpactCardProps, ImpactValue } from './impact/impact-card.mjs';
|
|
3
4
|
export { messages as impactMessages } from './impact/messages.mjs';
|
|
4
5
|
export { ImpactLevel, ImpactLevelConfig, ImpactScaleConfig, ImpactScalePreset, assetScale, getScale, impactLevels, processScale, riskScale } from './impact/scales.mjs';
|
|
6
|
+
export { messages as riskMessages } from './risk/messages.mjs';
|
|
7
|
+
export { RiskRatingDisplay, RiskRatingDisplayProps } from './risk/risk-rating-display.mjs';
|
|
8
|
+
export { RiskLevel, RiskRating, getRiskLevelFromRating, isRatingUnrated, riskLevelConfig } from './risk/types.mjs';
|
|
5
9
|
import 'react/jsx-runtime';
|
|
10
|
+
import 'react';
|
|
6
11
|
import 'react-intl';
|
package/dist/common/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export { ComplianceBadges, ComplianceBadgesProps, DoraBadge, DoraBadgeProps, Nis2Badge, Nis2BadgeProps } from './compliance/compliance-badge.js';
|
|
2
|
+
export { ControlChip, ControlChipProps, MappedControls, MappedControlsProps } from './control/mapped-controls.js';
|
|
2
3
|
export { ImpactCard, ImpactCardProps, ImpactValue } from './impact/impact-card.js';
|
|
3
4
|
export { messages as impactMessages } from './impact/messages.js';
|
|
4
5
|
export { ImpactLevel, ImpactLevelConfig, ImpactScaleConfig, ImpactScalePreset, assetScale, getScale, impactLevels, processScale, riskScale } from './impact/scales.js';
|
|
6
|
+
export { messages as riskMessages } from './risk/messages.js';
|
|
7
|
+
export { RiskRatingDisplay, RiskRatingDisplayProps } from './risk/risk-rating-display.js';
|
|
8
|
+
export { RiskLevel, RiskRating, getRiskLevelFromRating, isRatingUnrated, riskLevelConfig } from './risk/types.js';
|
|
5
9
|
import 'react/jsx-runtime';
|
|
10
|
+
import 'react';
|
|
6
11
|
import 'react-intl';
|