@kopexa/grc 0.0.13 → 0.0.15
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-C5OUE3C2.mjs +1 -0
- package/dist/chunk-EGK6RMOC.mjs +102 -0
- package/dist/chunk-JHGWV2ID.mjs +30 -0
- package/dist/common/editor/editor-card.d.mts +22 -0
- package/dist/common/editor/editor-card.d.ts +22 -0
- package/dist/common/editor/editor-card.js +150 -0
- package/dist/common/editor/editor-card.mjs +9 -0
- package/dist/common/editor/index.d.mts +3 -0
- package/dist/common/editor/index.d.ts +3 -0
- package/dist/common/editor/index.js +151 -0
- package/dist/common/editor/index.mjs +9 -0
- package/dist/common/editor/messages.d.mts +24 -0
- package/dist/common/editor/messages.d.ts +24 -0
- package/dist/common/editor/messages.js +53 -0
- package/dist/common/editor/messages.mjs +7 -0
- package/dist/common/index.d.mts +2 -0
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.js +225 -102
- package/dist/common/index.mjs +7 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +300 -177
- package/dist/index.mjs +7 -1
- package/package.json +8 -7
- package/src/common/editor/editor-card.tsx +129 -0
- package/src/common/editor/index.ts +1 -0
- package/src/common/editor/messages.ts +24 -0
- package/src/common/index.ts +1 -0
- /package/dist/{chunk-HJUSN7FD.mjs → chunk-5JULTRFD.mjs} +0 -0
package/dist/common/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(common_exports, {
|
|
|
24
24
|
ComplianceBadges: () => ComplianceBadges,
|
|
25
25
|
ControlChip: () => ControlChip,
|
|
26
26
|
DoraBadge: () => DoraBadge,
|
|
27
|
+
EditorCard: () => EditorCard,
|
|
27
28
|
ImpactCard: () => ImpactCard,
|
|
28
29
|
MappedControls: () => MappedControls,
|
|
29
30
|
Nis2Badge: () => Nis2Badge,
|
|
@@ -32,11 +33,11 @@ __export(common_exports, {
|
|
|
32
33
|
getRiskLevelFromRating: () => getRiskLevelFromRating,
|
|
33
34
|
getScale: () => getScale,
|
|
34
35
|
impactLevels: () => impactLevels,
|
|
35
|
-
impactMessages: () =>
|
|
36
|
+
impactMessages: () => messages4,
|
|
36
37
|
isRatingUnrated: () => isRatingUnrated,
|
|
37
38
|
processScale: () => processScale,
|
|
38
39
|
riskLevelConfig: () => riskLevelConfig,
|
|
39
|
-
riskMessages: () =>
|
|
40
|
+
riskMessages: () => messages5,
|
|
40
41
|
riskScale: () => riskScale
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(common_exports);
|
|
@@ -239,16 +240,137 @@ function MappedControls({
|
|
|
239
240
|
] });
|
|
240
241
|
}
|
|
241
242
|
|
|
242
|
-
// src/common/
|
|
243
|
-
var
|
|
243
|
+
// src/common/editor/editor-card.tsx
|
|
244
|
+
var import_i18n5 = require("@kopexa/i18n");
|
|
244
245
|
var import_icons2 = require("@kopexa/icons");
|
|
245
246
|
var import_sight3 = require("@kopexa/sight");
|
|
246
|
-
var
|
|
247
|
+
var import_tiptap = require("@kopexa/tiptap");
|
|
247
248
|
var import_react = require("react");
|
|
248
249
|
|
|
250
|
+
// src/common/editor/messages.ts
|
|
251
|
+
var import_react_intl = require("react-intl");
|
|
252
|
+
var messages3 = (0, import_react_intl.defineMessages)({
|
|
253
|
+
edit: {
|
|
254
|
+
id: "grc.editor_card.edit",
|
|
255
|
+
defaultMessage: "Edit"
|
|
256
|
+
},
|
|
257
|
+
cancel: {
|
|
258
|
+
id: "grc.editor_card.cancel",
|
|
259
|
+
defaultMessage: "Cancel"
|
|
260
|
+
},
|
|
261
|
+
save: {
|
|
262
|
+
id: "grc.editor_card.save",
|
|
263
|
+
defaultMessage: "Save"
|
|
264
|
+
},
|
|
265
|
+
placeholder: {
|
|
266
|
+
id: "grc.editor_card.placeholder",
|
|
267
|
+
defaultMessage: "Start typing or press '/' for commands..."
|
|
268
|
+
},
|
|
269
|
+
empty: {
|
|
270
|
+
id: "grc.editor_card.empty",
|
|
271
|
+
defaultMessage: "No content yet. Click edit to add content."
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// src/common/editor/editor-card.tsx
|
|
276
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
277
|
+
function EditorCard({
|
|
278
|
+
value,
|
|
279
|
+
onChange,
|
|
280
|
+
title,
|
|
281
|
+
placeholder,
|
|
282
|
+
emptyText,
|
|
283
|
+
readOnly = false,
|
|
284
|
+
cardVariant = "accent"
|
|
285
|
+
}) {
|
|
286
|
+
const intl = (0, import_i18n5.useSafeIntl)();
|
|
287
|
+
const [isEditing, setIsEditing] = (0, import_react.useState)(false);
|
|
288
|
+
const [draftContent, setDraftContent] = (0, import_react.useState)(
|
|
289
|
+
value
|
|
290
|
+
);
|
|
291
|
+
const t = {
|
|
292
|
+
edit: intl.formatMessage(messages3.edit),
|
|
293
|
+
cancel: intl.formatMessage(messages3.cancel),
|
|
294
|
+
save: intl.formatMessage(messages3.save),
|
|
295
|
+
placeholder: placeholder != null ? placeholder : intl.formatMessage(messages3.placeholder),
|
|
296
|
+
empty: emptyText != null ? emptyText : intl.formatMessage(messages3.empty)
|
|
297
|
+
};
|
|
298
|
+
const handleStartEdit = () => {
|
|
299
|
+
setDraftContent(value);
|
|
300
|
+
setIsEditing(true);
|
|
301
|
+
};
|
|
302
|
+
const handleSave = () => {
|
|
303
|
+
onChange == null ? void 0 : onChange(draftContent);
|
|
304
|
+
setIsEditing(false);
|
|
305
|
+
};
|
|
306
|
+
const handleCancel = () => {
|
|
307
|
+
setDraftContent(value);
|
|
308
|
+
setIsEditing(false);
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
311
|
+
import_sight3.Card.Root,
|
|
312
|
+
{
|
|
313
|
+
variant: cardVariant,
|
|
314
|
+
className: isEditing ? "ring-2 ring-primary overflow-visible" : void 0,
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_sight3.Card.Header, { className: "flex flex-row items-center justify-between", children: [
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sight3.Heading, { level: "h3", className: "text-base", children: title }),
|
|
318
|
+
!readOnly && (isEditing ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sight3.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
320
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
321
|
+
import_sight3.Button,
|
|
322
|
+
{
|
|
323
|
+
variant: "solid",
|
|
324
|
+
color: "primary",
|
|
325
|
+
size: "sm",
|
|
326
|
+
onClick: handleSave,
|
|
327
|
+
children: t.save
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
331
|
+
import_sight3.Button,
|
|
332
|
+
{
|
|
333
|
+
variant: "ghost",
|
|
334
|
+
size: "sm",
|
|
335
|
+
isIconOnly: true,
|
|
336
|
+
onClick: handleStartEdit,
|
|
337
|
+
"aria-label": t.edit,
|
|
338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons2.EditIcon, { className: "size-4" })
|
|
339
|
+
}
|
|
340
|
+
))
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_sight3.Card.Body, { className: "p-0", children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
343
|
+
import_tiptap.Editor,
|
|
344
|
+
{
|
|
345
|
+
variant: "field",
|
|
346
|
+
placeholder: t.placeholder,
|
|
347
|
+
content: draftContent,
|
|
348
|
+
onChange: setDraftContent
|
|
349
|
+
}
|
|
350
|
+
) : value ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
351
|
+
import_tiptap.Editor,
|
|
352
|
+
{
|
|
353
|
+
variant: "default",
|
|
354
|
+
bordered: false,
|
|
355
|
+
content: value,
|
|
356
|
+
editable: false
|
|
357
|
+
}
|
|
358
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed px-4 py-4", children: t.empty }) })
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// src/common/impact/impact-card.tsx
|
|
365
|
+
var import_i18n7 = require("@kopexa/i18n");
|
|
366
|
+
var import_icons3 = require("@kopexa/icons");
|
|
367
|
+
var import_sight4 = require("@kopexa/sight");
|
|
368
|
+
var import_theme3 = require("@kopexa/theme");
|
|
369
|
+
var import_react2 = require("react");
|
|
370
|
+
|
|
249
371
|
// src/common/impact/messages.ts
|
|
250
|
-
var
|
|
251
|
-
var
|
|
372
|
+
var import_i18n6 = require("@kopexa/i18n");
|
|
373
|
+
var messages4 = (0, import_i18n6.defineMessages)({
|
|
252
374
|
// Card titles
|
|
253
375
|
title_cia: {
|
|
254
376
|
id: "grc.impact.title_cia",
|
|
@@ -385,42 +507,42 @@ var messages3 = (0, import_i18n5.defineMessages)({
|
|
|
385
507
|
// src/common/impact/scales.ts
|
|
386
508
|
var riskScale = {
|
|
387
509
|
0: {
|
|
388
|
-
message:
|
|
510
|
+
message: messages4.risk_0,
|
|
389
511
|
fallbackLabel: "Not rated",
|
|
390
512
|
color: "text-muted-foreground",
|
|
391
513
|
bgColor: "bg-muted",
|
|
392
514
|
barColor: "bg-muted"
|
|
393
515
|
},
|
|
394
516
|
1: {
|
|
395
|
-
message:
|
|
517
|
+
message: messages4.risk_1,
|
|
396
518
|
fallbackLabel: "Negligible",
|
|
397
519
|
color: "text-green-700",
|
|
398
520
|
bgColor: "bg-green-100",
|
|
399
521
|
barColor: "bg-green-500"
|
|
400
522
|
},
|
|
401
523
|
2: {
|
|
402
|
-
message:
|
|
524
|
+
message: messages4.risk_2,
|
|
403
525
|
fallbackLabel: "Low",
|
|
404
526
|
color: "text-lime-700",
|
|
405
527
|
bgColor: "bg-lime-100",
|
|
406
528
|
barColor: "bg-lime-500"
|
|
407
529
|
},
|
|
408
530
|
3: {
|
|
409
|
-
message:
|
|
531
|
+
message: messages4.risk_3,
|
|
410
532
|
fallbackLabel: "Medium",
|
|
411
533
|
color: "text-yellow-700",
|
|
412
534
|
bgColor: "bg-yellow-100",
|
|
413
535
|
barColor: "bg-yellow-500"
|
|
414
536
|
},
|
|
415
537
|
4: {
|
|
416
|
-
message:
|
|
538
|
+
message: messages4.risk_4,
|
|
417
539
|
fallbackLabel: "High",
|
|
418
540
|
color: "text-orange-700",
|
|
419
541
|
bgColor: "bg-orange-100",
|
|
420
542
|
barColor: "bg-orange-500"
|
|
421
543
|
},
|
|
422
544
|
5: {
|
|
423
|
-
message:
|
|
545
|
+
message: messages4.risk_5,
|
|
424
546
|
fallbackLabel: "Critical",
|
|
425
547
|
color: "text-red-700",
|
|
426
548
|
bgColor: "bg-red-100",
|
|
@@ -429,42 +551,42 @@ var riskScale = {
|
|
|
429
551
|
};
|
|
430
552
|
var processScale = {
|
|
431
553
|
0: {
|
|
432
|
-
message:
|
|
554
|
+
message: messages4.process_0,
|
|
433
555
|
fallbackLabel: "Not rated",
|
|
434
556
|
color: "text-muted-foreground",
|
|
435
557
|
bgColor: "bg-muted",
|
|
436
558
|
barColor: "bg-muted"
|
|
437
559
|
},
|
|
438
560
|
1: {
|
|
439
|
-
message:
|
|
561
|
+
message: messages4.process_1,
|
|
440
562
|
fallbackLabel: "Insignificant",
|
|
441
563
|
color: "text-green-700",
|
|
442
564
|
bgColor: "bg-green-100",
|
|
443
565
|
barColor: "bg-green-500"
|
|
444
566
|
},
|
|
445
567
|
2: {
|
|
446
|
-
message:
|
|
568
|
+
message: messages4.process_2,
|
|
447
569
|
fallbackLabel: "Low",
|
|
448
570
|
color: "text-lime-700",
|
|
449
571
|
bgColor: "bg-lime-100",
|
|
450
572
|
barColor: "bg-lime-500"
|
|
451
573
|
},
|
|
452
574
|
3: {
|
|
453
|
-
message:
|
|
575
|
+
message: messages4.process_3,
|
|
454
576
|
fallbackLabel: "Relevant",
|
|
455
577
|
color: "text-yellow-700",
|
|
456
578
|
bgColor: "bg-yellow-100",
|
|
457
579
|
barColor: "bg-yellow-500"
|
|
458
580
|
},
|
|
459
581
|
4: {
|
|
460
|
-
message:
|
|
582
|
+
message: messages4.process_4,
|
|
461
583
|
fallbackLabel: "Important",
|
|
462
584
|
color: "text-orange-700",
|
|
463
585
|
bgColor: "bg-orange-100",
|
|
464
586
|
barColor: "bg-orange-500"
|
|
465
587
|
},
|
|
466
588
|
5: {
|
|
467
|
-
message:
|
|
589
|
+
message: messages4.process_5,
|
|
468
590
|
fallbackLabel: "Vital",
|
|
469
591
|
color: "text-red-700",
|
|
470
592
|
bgColor: "bg-red-100",
|
|
@@ -473,42 +595,42 @@ var processScale = {
|
|
|
473
595
|
};
|
|
474
596
|
var assetScale = {
|
|
475
597
|
0: {
|
|
476
|
-
message:
|
|
598
|
+
message: messages4.asset_0,
|
|
477
599
|
fallbackLabel: "Not classified",
|
|
478
600
|
color: "text-muted-foreground",
|
|
479
601
|
bgColor: "bg-muted",
|
|
480
602
|
barColor: "bg-muted"
|
|
481
603
|
},
|
|
482
604
|
1: {
|
|
483
|
-
message:
|
|
605
|
+
message: messages4.asset_1,
|
|
484
606
|
fallbackLabel: "Insignificant",
|
|
485
607
|
color: "text-green-700",
|
|
486
608
|
bgColor: "bg-green-100",
|
|
487
609
|
barColor: "bg-green-500"
|
|
488
610
|
},
|
|
489
611
|
2: {
|
|
490
|
-
message:
|
|
612
|
+
message: messages4.asset_2,
|
|
491
613
|
fallbackLabel: "Low",
|
|
492
614
|
color: "text-lime-700",
|
|
493
615
|
bgColor: "bg-lime-100",
|
|
494
616
|
barColor: "bg-lime-500"
|
|
495
617
|
},
|
|
496
618
|
3: {
|
|
497
|
-
message:
|
|
619
|
+
message: messages4.asset_3,
|
|
498
620
|
fallbackLabel: "Medium",
|
|
499
621
|
color: "text-yellow-700",
|
|
500
622
|
bgColor: "bg-yellow-100",
|
|
501
623
|
barColor: "bg-yellow-500"
|
|
502
624
|
},
|
|
503
625
|
4: {
|
|
504
|
-
message:
|
|
626
|
+
message: messages4.asset_4,
|
|
505
627
|
fallbackLabel: "High",
|
|
506
628
|
color: "text-orange-700",
|
|
507
629
|
bgColor: "bg-orange-100",
|
|
508
630
|
barColor: "bg-orange-500"
|
|
509
631
|
},
|
|
510
632
|
5: {
|
|
511
|
-
message:
|
|
633
|
+
message: messages4.asset_5,
|
|
512
634
|
fallbackLabel: "Business Critical",
|
|
513
635
|
color: "text-red-700",
|
|
514
636
|
bgColor: "bg-red-100",
|
|
@@ -528,7 +650,7 @@ function getScale(preset) {
|
|
|
528
650
|
}
|
|
529
651
|
|
|
530
652
|
// src/common/impact/impact-card.tsx
|
|
531
|
-
var
|
|
653
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
532
654
|
function ImpactItemRow({
|
|
533
655
|
label,
|
|
534
656
|
shortLabel,
|
|
@@ -542,28 +664,28 @@ function ImpactItemRow({
|
|
|
542
664
|
const isUnrated = value === 0;
|
|
543
665
|
const percentage = isUnrated ? 0 : value / 5 * 100;
|
|
544
666
|
const styles = (0, import_theme3.impactCard)({ unrated: isUnrated });
|
|
545
|
-
return /* @__PURE__ */ (0,
|
|
546
|
-
/* @__PURE__ */ (0,
|
|
547
|
-
/* @__PURE__ */ (0,
|
|
548
|
-
/* @__PURE__ */ (0,
|
|
549
|
-
/* @__PURE__ */ (0,
|
|
550
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
551
|
-
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: styles.row(), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.rowContent(), children: [
|
|
668
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: styles.rowIcon(), children: shortLabel }),
|
|
669
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.rowBody(), children: [
|
|
670
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.rowHeader(), children: [
|
|
671
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: styles.rowLabel(), children: label }),
|
|
672
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
673
|
+
import_sight4.Select,
|
|
552
674
|
{
|
|
553
675
|
value: String(value),
|
|
554
676
|
onValueChange: (val) => onLevelChange(Number(val)),
|
|
555
677
|
size: "sm",
|
|
556
678
|
children: [
|
|
557
|
-
/* @__PURE__ */ (0,
|
|
558
|
-
/* @__PURE__ */ (0,
|
|
559
|
-
/* @__PURE__ */ (0,
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Select.Trigger, { className: "w-36", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Select.Value, {}) }),
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Select.Content, { children: impactLevels.map((level) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Select.Item, { value: String(level), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex items-center gap-2", children: [
|
|
681
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-xs text-muted-foreground w-3", children: level }),
|
|
560
682
|
formatLabel(level)
|
|
561
683
|
] }) }, level)) })
|
|
562
684
|
]
|
|
563
685
|
}
|
|
564
|
-
) : /* @__PURE__ */ (0,
|
|
565
|
-
!isUnrated && /* @__PURE__ */ (0,
|
|
566
|
-
/* @__PURE__ */ (0,
|
|
686
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.rowValue(), children: [
|
|
687
|
+
!isUnrated && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: styles.rowValueNumber(), children: value }),
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
567
689
|
"span",
|
|
568
690
|
{
|
|
569
691
|
className: styles.rowValueBadge({
|
|
@@ -574,7 +696,7 @@ function ImpactItemRow({
|
|
|
574
696
|
)
|
|
575
697
|
] })
|
|
576
698
|
] }),
|
|
577
|
-
!isUnrated && !isEditing && /* @__PURE__ */ (0,
|
|
699
|
+
!isUnrated && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: styles.progressContainer(), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
578
700
|
"div",
|
|
579
701
|
{
|
|
580
702
|
className: styles.progressBar({ className: config.barColor }),
|
|
@@ -601,10 +723,10 @@ function ImpactCard({
|
|
|
601
723
|
variant = "card"
|
|
602
724
|
}) {
|
|
603
725
|
var _a, _b;
|
|
604
|
-
const intl = (0,
|
|
726
|
+
const intl = (0, import_i18n7.useSafeIntl)();
|
|
605
727
|
const isInline = variant === "inline";
|
|
606
|
-
const [isEditing, setIsEditing] = (0,
|
|
607
|
-
const [editValues, setEditValues] = (0,
|
|
728
|
+
const [isEditing, setIsEditing] = (0, import_react2.useState)(false);
|
|
729
|
+
const [editValues, setEditValues] = (0, import_react2.useState)(
|
|
608
730
|
value || defaultImpact
|
|
609
731
|
);
|
|
610
732
|
const effectiveIsEditing = isInline ? !readOnly : isEditing;
|
|
@@ -615,20 +737,20 @@ function ImpactCard({
|
|
|
615
737
|
return intl.formatMessage(config.message);
|
|
616
738
|
};
|
|
617
739
|
const t = {
|
|
618
|
-
titleCia: intl.formatMessage(
|
|
619
|
-
titleCiaa: intl.formatMessage(
|
|
620
|
-
confidentiality: intl.formatMessage(
|
|
621
|
-
integrity: intl.formatMessage(
|
|
622
|
-
availability: intl.formatMessage(
|
|
623
|
-
authenticity: intl.formatMessage(
|
|
624
|
-
justification: intl.formatMessage(
|
|
740
|
+
titleCia: intl.formatMessage(messages4.title_cia),
|
|
741
|
+
titleCiaa: intl.formatMessage(messages4.title_ciaa),
|
|
742
|
+
confidentiality: intl.formatMessage(messages4.confidentiality),
|
|
743
|
+
integrity: intl.formatMessage(messages4.integrity),
|
|
744
|
+
availability: intl.formatMessage(messages4.availability),
|
|
745
|
+
authenticity: intl.formatMessage(messages4.authenticity),
|
|
746
|
+
justification: intl.formatMessage(messages4.justification),
|
|
625
747
|
justificationPlaceholder: intl.formatMessage(
|
|
626
|
-
|
|
748
|
+
messages4.justification_placeholder
|
|
627
749
|
),
|
|
628
|
-
noJustification: intl.formatMessage(
|
|
629
|
-
edit: intl.formatMessage(
|
|
630
|
-
cancel: intl.formatMessage(
|
|
631
|
-
save: intl.formatMessage(
|
|
750
|
+
noJustification: intl.formatMessage(messages4.no_justification),
|
|
751
|
+
edit: intl.formatMessage(messages4.edit),
|
|
752
|
+
cancel: intl.formatMessage(messages4.cancel),
|
|
753
|
+
save: intl.formatMessage(messages4.save)
|
|
632
754
|
};
|
|
633
755
|
const defaultTitle = showAuthenticity ? t.titleCiaa : t.titleCia;
|
|
634
756
|
const cardTitle = title != null ? title : defaultTitle;
|
|
@@ -674,11 +796,11 @@ function ImpactCard({
|
|
|
674
796
|
(_a = currentImpact.impactAuthenticity) != null ? _a : 0
|
|
675
797
|
);
|
|
676
798
|
const highestLabel = formatLabel(highestImpact);
|
|
677
|
-
const justificationHint = intl.formatMessage(
|
|
799
|
+
const justificationHint = intl.formatMessage(messages4.justification_hint, {
|
|
678
800
|
level: highestLabel
|
|
679
801
|
});
|
|
680
|
-
const impactRows = /* @__PURE__ */ (0,
|
|
681
|
-
/* @__PURE__ */ (0,
|
|
802
|
+
const impactRows = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
682
804
|
ImpactItemRow,
|
|
683
805
|
{
|
|
684
806
|
label: t.confidentiality,
|
|
@@ -690,7 +812,7 @@ function ImpactCard({
|
|
|
690
812
|
onLevelChange: handleLevelChange("impactConfidentiality")
|
|
691
813
|
}
|
|
692
814
|
),
|
|
693
|
-
/* @__PURE__ */ (0,
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
694
816
|
ImpactItemRow,
|
|
695
817
|
{
|
|
696
818
|
label: t.integrity,
|
|
@@ -702,7 +824,7 @@ function ImpactCard({
|
|
|
702
824
|
onLevelChange: handleLevelChange("impactIntegrity")
|
|
703
825
|
}
|
|
704
826
|
),
|
|
705
|
-
/* @__PURE__ */ (0,
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
706
828
|
ImpactItemRow,
|
|
707
829
|
{
|
|
708
830
|
label: t.availability,
|
|
@@ -714,7 +836,7 @@ function ImpactCard({
|
|
|
714
836
|
onLevelChange: handleLevelChange("impactAvailability")
|
|
715
837
|
}
|
|
716
838
|
),
|
|
717
|
-
showAuthenticity && /* @__PURE__ */ (0,
|
|
839
|
+
showAuthenticity && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
718
840
|
ImpactItemRow,
|
|
719
841
|
{
|
|
720
842
|
label: t.authenticity,
|
|
@@ -727,20 +849,20 @@ function ImpactCard({
|
|
|
727
849
|
}
|
|
728
850
|
)
|
|
729
851
|
] });
|
|
730
|
-
const justificationContent = showJustification && /* @__PURE__ */ (0,
|
|
731
|
-
/* @__PURE__ */ (0,
|
|
852
|
+
const justificationContent = showJustification && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.justificationSection(), children: [
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
732
854
|
"label",
|
|
733
855
|
{
|
|
734
856
|
htmlFor: "impact-justification",
|
|
735
857
|
className: styles.justificationLabel(),
|
|
736
858
|
children: [
|
|
737
859
|
t.justification,
|
|
738
|
-
highestImpact > 0 && /* @__PURE__ */ (0,
|
|
860
|
+
highestImpact > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: styles.justificationHint(), children: justificationHint })
|
|
739
861
|
]
|
|
740
862
|
}
|
|
741
863
|
),
|
|
742
|
-
effectiveIsEditing ? /* @__PURE__ */ (0,
|
|
743
|
-
|
|
864
|
+
effectiveIsEditing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
865
|
+
import_sight4.Textarea,
|
|
744
866
|
{
|
|
745
867
|
id: "impact-justification",
|
|
746
868
|
value: currentImpact.impactJustification || "",
|
|
@@ -749,36 +871,36 @@ function ImpactCard({
|
|
|
749
871
|
rows: 3,
|
|
750
872
|
className: "text-sm"
|
|
751
873
|
}
|
|
752
|
-
) : currentImpact.impactJustification ? /* @__PURE__ */ (0,
|
|
874
|
+
) : currentImpact.impactJustification ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: styles.justificationText(), children: currentImpact.impactJustification }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: styles.justificationEmpty(), children: t.noJustification })
|
|
753
875
|
] });
|
|
754
876
|
if (isInline) {
|
|
755
|
-
return /* @__PURE__ */ (0,
|
|
756
|
-
title && /* @__PURE__ */ (0,
|
|
877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.wrapper(), children: [
|
|
878
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: styles.inlineHeader(), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Heading, { level: "h4", className: "text-sm font-medium", children: title }) }),
|
|
757
879
|
impactRows,
|
|
758
880
|
justificationContent
|
|
759
881
|
] });
|
|
760
882
|
}
|
|
761
|
-
return /* @__PURE__ */ (0,
|
|
762
|
-
/* @__PURE__ */ (0,
|
|
763
|
-
/* @__PURE__ */ (0,
|
|
764
|
-
/* @__PURE__ */ (0,
|
|
765
|
-
isEditing && /* @__PURE__ */ (0,
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Root, { className: styles.root(), children: [
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Header, { className: "flex flex-row items-center justify-between", children: [
|
|
885
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
886
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
887
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Chip, { size: "sm", color: "primary", children: t.edit })
|
|
766
888
|
] }),
|
|
767
|
-
!readOnly && (!isEditing ? /* @__PURE__ */ (0,
|
|
889
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
768
890
|
"button",
|
|
769
891
|
{
|
|
770
892
|
type: "button",
|
|
771
893
|
onClick: handleStartEdit,
|
|
772
894
|
className: styles.editButton(),
|
|
773
895
|
"aria-label": t.edit,
|
|
774
|
-
children: /* @__PURE__ */ (0,
|
|
896
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.EditIcon, { className: "size-4" })
|
|
775
897
|
}
|
|
776
|
-
) : /* @__PURE__ */ (0,
|
|
777
|
-
/* @__PURE__ */ (0,
|
|
778
|
-
/* @__PURE__ */ (0,
|
|
898
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
899
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
900
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
779
901
|
] }))
|
|
780
902
|
] }),
|
|
781
|
-
/* @__PURE__ */ (0,
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Body, { className: "space-y-3", children: [
|
|
782
904
|
impactRows,
|
|
783
905
|
justificationContent
|
|
784
906
|
] })
|
|
@@ -786,8 +908,8 @@ function ImpactCard({
|
|
|
786
908
|
}
|
|
787
909
|
|
|
788
910
|
// src/common/risk/messages.ts
|
|
789
|
-
var
|
|
790
|
-
var
|
|
911
|
+
var import_i18n8 = require("@kopexa/i18n");
|
|
912
|
+
var messages5 = (0, import_i18n8.defineMessages)({
|
|
791
913
|
level_unrated: {
|
|
792
914
|
id: "grc.risk.level.unrated",
|
|
793
915
|
defaultMessage: "Not rated"
|
|
@@ -827,8 +949,8 @@ var messages4 = (0, import_i18n7.defineMessages)({
|
|
|
827
949
|
});
|
|
828
950
|
|
|
829
951
|
// src/common/risk/risk-rating-display.tsx
|
|
830
|
-
var
|
|
831
|
-
var
|
|
952
|
+
var import_i18n9 = require("@kopexa/i18n");
|
|
953
|
+
var import_sight5 = require("@kopexa/sight");
|
|
832
954
|
var import_theme4 = require("@kopexa/theme");
|
|
833
955
|
|
|
834
956
|
// src/common/risk/types.ts
|
|
@@ -882,20 +1004,20 @@ var riskLevelConfig = {
|
|
|
882
1004
|
};
|
|
883
1005
|
|
|
884
1006
|
// src/common/risk/risk-rating-display.tsx
|
|
885
|
-
var
|
|
1007
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
886
1008
|
function RiskRatingDisplay({
|
|
887
1009
|
rating,
|
|
888
1010
|
showBadge = true,
|
|
889
1011
|
showLabel = true,
|
|
890
1012
|
size = "md"
|
|
891
1013
|
}) {
|
|
892
|
-
const intl = (0,
|
|
1014
|
+
const intl = (0, import_i18n9.useSafeIntl)();
|
|
893
1015
|
if (isRatingUnrated(rating)) {
|
|
894
1016
|
const styles2 = (0, import_theme4.riskRating)({ size, level: "unrated" });
|
|
895
|
-
const levelLabel2 = intl.formatMessage(
|
|
896
|
-
return /* @__PURE__ */ (0,
|
|
897
|
-
showBadge && /* @__PURE__ */ (0,
|
|
898
|
-
showLabel && /* @__PURE__ */ (0,
|
|
1017
|
+
const levelLabel2 = intl.formatMessage(messages5.level_unrated);
|
|
1018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_sight5.Tooltip, { content: intl.formatMessage(messages5.not_rated_hint), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles2.base(), children: [
|
|
1019
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: styles2.badge(), children: "\u2014" }),
|
|
1020
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles2.label(), children: levelLabel2 })
|
|
899
1021
|
] }) });
|
|
900
1022
|
}
|
|
901
1023
|
const ratedValue = rating;
|
|
@@ -905,28 +1027,28 @@ function RiskRatingDisplay({
|
|
|
905
1027
|
level
|
|
906
1028
|
});
|
|
907
1029
|
const levelLabelKey = `level_${level}`;
|
|
908
|
-
const levelLabel = intl.formatMessage(
|
|
909
|
-
return /* @__PURE__ */ (0,
|
|
910
|
-
|
|
1030
|
+
const levelLabel = intl.formatMessage(messages5[levelLabelKey]);
|
|
1031
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1032
|
+
import_sight5.Tooltip,
|
|
911
1033
|
{
|
|
912
|
-
content: /* @__PURE__ */ (0,
|
|
913
|
-
/* @__PURE__ */ (0,
|
|
914
|
-
intl.formatMessage(
|
|
1034
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "text-xs space-y-1", children: [
|
|
1035
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
1036
|
+
intl.formatMessage(messages5.likelihood),
|
|
915
1037
|
": ",
|
|
916
1038
|
ratedValue.likelihood,
|
|
917
1039
|
"/5"
|
|
918
1040
|
] }),
|
|
919
|
-
/* @__PURE__ */ (0,
|
|
920
|
-
intl.formatMessage(
|
|
1041
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
1042
|
+
intl.formatMessage(messages5.consequence),
|
|
921
1043
|
": ",
|
|
922
1044
|
ratedValue.consequence,
|
|
923
1045
|
"/5"
|
|
924
1046
|
] }),
|
|
925
|
-
ratedValue.comment && /* @__PURE__ */ (0,
|
|
1047
|
+
ratedValue.comment && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "text-muted-foreground", children: ratedValue.comment })
|
|
926
1048
|
] }),
|
|
927
|
-
children: /* @__PURE__ */ (0,
|
|
928
|
-
showBadge && /* @__PURE__ */ (0,
|
|
929
|
-
showLabel && /* @__PURE__ */ (0,
|
|
1049
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: styles.base(), children: [
|
|
1050
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: styles.badge(), children: ratedValue.rating }),
|
|
1051
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: styles.label(), children: levelLabel })
|
|
930
1052
|
] })
|
|
931
1053
|
}
|
|
932
1054
|
);
|
|
@@ -936,6 +1058,7 @@ function RiskRatingDisplay({
|
|
|
936
1058
|
ComplianceBadges,
|
|
937
1059
|
ControlChip,
|
|
938
1060
|
DoraBadge,
|
|
1061
|
+
EditorCard,
|
|
939
1062
|
ImpactCard,
|
|
940
1063
|
MappedControls,
|
|
941
1064
|
Nis2Badge,
|
package/dist/common/index.mjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "../chunk-
|
|
2
|
+
import "../chunk-5JULTRFD.mjs";
|
|
3
|
+
import "../chunk-C5OUE3C2.mjs";
|
|
4
|
+
import {
|
|
5
|
+
EditorCard
|
|
6
|
+
} from "../chunk-EGK6RMOC.mjs";
|
|
7
|
+
import "../chunk-JHGWV2ID.mjs";
|
|
3
8
|
import "../chunk-GFABGXAO.mjs";
|
|
4
9
|
import {
|
|
5
10
|
ImpactCard
|
|
@@ -43,6 +48,7 @@ export {
|
|
|
43
48
|
ComplianceBadges,
|
|
44
49
|
ControlChip,
|
|
45
50
|
DoraBadge,
|
|
51
|
+
EditorCard,
|
|
46
52
|
ImpactCard,
|
|
47
53
|
MappedControls,
|
|
48
54
|
Nis2Badge,
|