@kopexa/grc 0.0.18 → 0.0.20
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-KNGEZZFI.mjs → chunk-AUICT2D3.mjs} +1 -1
- package/dist/{chunk-GF3WJZVI.mjs → chunk-AXBL7YBB.mjs} +4 -0
- package/dist/{chunk-AGASJJ7X.mjs → chunk-C2GUKNBG.mjs} +32 -23
- package/dist/common/impact/impact-card.d.mts +3 -1
- package/dist/common/impact/impact-card.d.ts +3 -1
- package/dist/common/impact/impact-card.js +34 -21
- package/dist/common/impact/impact-card.mjs +3 -3
- package/dist/common/impact/index.js +34 -21
- package/dist/common/impact/index.mjs +3 -3
- package/dist/common/impact/messages.d.mts +4 -0
- package/dist/common/impact/messages.d.ts +4 -0
- package/dist/common/impact/messages.js +4 -0
- package/dist/common/impact/messages.mjs +1 -1
- package/dist/common/impact/scales.js +4 -0
- package/dist/common/impact/scales.mjs +2 -2
- package/dist/common/index.js +34 -21
- package/dist/common/index.mjs +3 -3
- package/dist/index.js +34 -21
- package/dist/index.mjs +3 -3
- package/package.json +8 -8
- package/src/common/impact/impact-card.tsx +12 -1
- package/src/common/impact/messages.ts +4 -0
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getScale,
|
|
4
4
|
impactLevels
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AUICT2D3.mjs";
|
|
6
6
|
import {
|
|
7
7
|
messages
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AXBL7YBB.mjs";
|
|
9
9
|
|
|
10
10
|
// src/common/impact/impact-card.tsx
|
|
11
11
|
import { useSafeIntl } from "@kopexa/i18n";
|
|
@@ -83,7 +83,8 @@ function ImpactCard({
|
|
|
83
83
|
readOnly = false,
|
|
84
84
|
scale = "risk",
|
|
85
85
|
title,
|
|
86
|
-
variant = "card"
|
|
86
|
+
variant = "card",
|
|
87
|
+
needsAttention = false
|
|
87
88
|
}) {
|
|
88
89
|
var _a, _b;
|
|
89
90
|
const intl = useSafeIntl();
|
|
@@ -113,7 +114,8 @@ function ImpactCard({
|
|
|
113
114
|
noJustification: intl.formatMessage(messages.no_justification),
|
|
114
115
|
edit: intl.formatMessage(messages.edit),
|
|
115
116
|
cancel: intl.formatMessage(messages.cancel),
|
|
116
|
-
save: intl.formatMessage(messages.save)
|
|
117
|
+
save: intl.formatMessage(messages.save),
|
|
118
|
+
required: intl.formatMessage(messages.required)
|
|
117
119
|
};
|
|
118
120
|
const defaultTitle = showAuthenticity ? t.titleCiaa : t.titleCia;
|
|
119
121
|
const cardTitle = title != null ? title : defaultTitle;
|
|
@@ -244,25 +246,32 @@ function ImpactCard({
|
|
|
244
246
|
] });
|
|
245
247
|
}
|
|
246
248
|
return /* @__PURE__ */ jsxs(Card.Root, { className: styles.root(), children: [
|
|
247
|
-
/* @__PURE__ */ jsxs(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
249
|
+
/* @__PURE__ */ jsxs(
|
|
250
|
+
Card.Header,
|
|
251
|
+
{
|
|
252
|
+
className: `flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`,
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
255
|
+
/* @__PURE__ */ jsx(Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
256
|
+
isEditing && /* @__PURE__ */ jsx(Chip, { size: "sm", color: "primary", children: t.edit }),
|
|
257
|
+
needsAttention && !isEditing && /* @__PURE__ */ jsx(Chip, { size: "sm", color: "destructive", variant: "solid", children: t.required })
|
|
258
|
+
] }),
|
|
259
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ jsx(
|
|
260
|
+
"button",
|
|
261
|
+
{
|
|
262
|
+
type: "button",
|
|
263
|
+
onClick: handleStartEdit,
|
|
264
|
+
className: styles.editButton(),
|
|
265
|
+
"aria-label": t.edit,
|
|
266
|
+
children: /* @__PURE__ */ jsx(EditIcon, { className: "size-4" })
|
|
267
|
+
}
|
|
268
|
+
) : /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
269
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
270
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
271
|
+
] }))
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
),
|
|
266
275
|
/* @__PURE__ */ jsxs(Card.Body, { className: "space-y-3", children: [
|
|
267
276
|
impactRows,
|
|
268
277
|
justificationContent
|
|
@@ -35,7 +35,9 @@ interface ImpactCardProps {
|
|
|
35
35
|
* - `inline`: No card wrapper, always editable, changes propagate immediately
|
|
36
36
|
*/
|
|
37
37
|
variant?: "card" | "inline";
|
|
38
|
+
/** Show attention indicator when impact values need to be filled */
|
|
39
|
+
needsAttention?: boolean;
|
|
38
40
|
}
|
|
39
|
-
declare function ImpactCard({ value, onChange, showJustification, showAuthenticity, readOnly, scale, title, variant, }: ImpactCardProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
declare function ImpactCard({ value, onChange, showJustification, showAuthenticity, readOnly, scale, title, variant, needsAttention, }: ImpactCardProps): react_jsx_runtime.JSX.Element;
|
|
40
42
|
|
|
41
43
|
export { ImpactCard, type ImpactCardProps, type ImpactValue };
|
|
@@ -35,7 +35,9 @@ interface ImpactCardProps {
|
|
|
35
35
|
* - `inline`: No card wrapper, always editable, changes propagate immediately
|
|
36
36
|
*/
|
|
37
37
|
variant?: "card" | "inline";
|
|
38
|
+
/** Show attention indicator when impact values need to be filled */
|
|
39
|
+
needsAttention?: boolean;
|
|
38
40
|
}
|
|
39
|
-
declare function ImpactCard({ value, onChange, showJustification, showAuthenticity, readOnly, scale, title, variant, }: ImpactCardProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
declare function ImpactCard({ value, onChange, showJustification, showAuthenticity, readOnly, scale, title, variant, needsAttention, }: ImpactCardProps): react_jsx_runtime.JSX.Element;
|
|
40
42
|
|
|
41
43
|
export { ImpactCard, type ImpactCardProps, type ImpactValue };
|
|
@@ -90,6 +90,10 @@ var messages = (0, import_i18n.defineMessages)({
|
|
|
90
90
|
id: "grc.impact.save",
|
|
91
91
|
defaultMessage: "Save"
|
|
92
92
|
},
|
|
93
|
+
required: {
|
|
94
|
+
id: "grc.impact.required",
|
|
95
|
+
defaultMessage: "Required"
|
|
96
|
+
},
|
|
93
97
|
// Risk Scale (default)
|
|
94
98
|
risk_0: {
|
|
95
99
|
id: "grc.impact.scale.risk.0",
|
|
@@ -383,7 +387,8 @@ function ImpactCard({
|
|
|
383
387
|
readOnly = false,
|
|
384
388
|
scale = "risk",
|
|
385
389
|
title,
|
|
386
|
-
variant = "card"
|
|
390
|
+
variant = "card",
|
|
391
|
+
needsAttention = false
|
|
387
392
|
}) {
|
|
388
393
|
var _a, _b;
|
|
389
394
|
const intl = (0, import_i18n2.useSafeIntl)();
|
|
@@ -413,7 +418,8 @@ function ImpactCard({
|
|
|
413
418
|
noJustification: intl.formatMessage(messages.no_justification),
|
|
414
419
|
edit: intl.formatMessage(messages.edit),
|
|
415
420
|
cancel: intl.formatMessage(messages.cancel),
|
|
416
|
-
save: intl.formatMessage(messages.save)
|
|
421
|
+
save: intl.formatMessage(messages.save),
|
|
422
|
+
required: intl.formatMessage(messages.required)
|
|
417
423
|
};
|
|
418
424
|
const defaultTitle = showAuthenticity ? t.titleCiaa : t.titleCia;
|
|
419
425
|
const cardTitle = title != null ? title : defaultTitle;
|
|
@@ -544,25 +550,32 @@ function ImpactCard({
|
|
|
544
550
|
] });
|
|
545
551
|
}
|
|
546
552
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Root, { className: styles.root(), children: [
|
|
547
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
554
|
+
import_sight.Card.Header,
|
|
555
|
+
{
|
|
556
|
+
className: `flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`,
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
559
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
560
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Chip, { size: "sm", color: "primary", children: t.edit }),
|
|
561
|
+
needsAttention && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Chip, { size: "sm", color: "destructive", variant: "solid", children: t.required })
|
|
562
|
+
] }),
|
|
563
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
564
|
+
"button",
|
|
565
|
+
{
|
|
566
|
+
type: "button",
|
|
567
|
+
onClick: handleStartEdit,
|
|
568
|
+
className: styles.editButton(),
|
|
569
|
+
"aria-label": t.edit,
|
|
570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditIcon, { className: "size-4" })
|
|
571
|
+
}
|
|
572
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
573
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
575
|
+
] }))
|
|
576
|
+
]
|
|
577
|
+
}
|
|
578
|
+
),
|
|
566
579
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Body, { className: "space-y-3", children: [
|
|
567
580
|
impactRows,
|
|
568
581
|
justificationContent
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
ImpactCard
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-C2GUKNBG.mjs";
|
|
6
|
+
import "../../chunk-AUICT2D3.mjs";
|
|
7
|
+
import "../../chunk-AXBL7YBB.mjs";
|
|
8
8
|
export {
|
|
9
9
|
ImpactCard
|
|
10
10
|
};
|
|
@@ -97,6 +97,10 @@ var messages = (0, import_i18n.defineMessages)({
|
|
|
97
97
|
id: "grc.impact.save",
|
|
98
98
|
defaultMessage: "Save"
|
|
99
99
|
},
|
|
100
|
+
required: {
|
|
101
|
+
id: "grc.impact.required",
|
|
102
|
+
defaultMessage: "Required"
|
|
103
|
+
},
|
|
100
104
|
// Risk Scale (default)
|
|
101
105
|
risk_0: {
|
|
102
106
|
id: "grc.impact.scale.risk.0",
|
|
@@ -390,7 +394,8 @@ function ImpactCard({
|
|
|
390
394
|
readOnly = false,
|
|
391
395
|
scale = "risk",
|
|
392
396
|
title,
|
|
393
|
-
variant = "card"
|
|
397
|
+
variant = "card",
|
|
398
|
+
needsAttention = false
|
|
394
399
|
}) {
|
|
395
400
|
var _a, _b;
|
|
396
401
|
const intl = (0, import_i18n2.useSafeIntl)();
|
|
@@ -420,7 +425,8 @@ function ImpactCard({
|
|
|
420
425
|
noJustification: intl.formatMessage(messages.no_justification),
|
|
421
426
|
edit: intl.formatMessage(messages.edit),
|
|
422
427
|
cancel: intl.formatMessage(messages.cancel),
|
|
423
|
-
save: intl.formatMessage(messages.save)
|
|
428
|
+
save: intl.formatMessage(messages.save),
|
|
429
|
+
required: intl.formatMessage(messages.required)
|
|
424
430
|
};
|
|
425
431
|
const defaultTitle = showAuthenticity ? t.titleCiaa : t.titleCia;
|
|
426
432
|
const cardTitle = title != null ? title : defaultTitle;
|
|
@@ -551,25 +557,32 @@ function ImpactCard({
|
|
|
551
557
|
] });
|
|
552
558
|
}
|
|
553
559
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Root, { className: styles.root(), children: [
|
|
554
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
561
|
+
import_sight.Card.Header,
|
|
562
|
+
{
|
|
563
|
+
className: `flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`,
|
|
564
|
+
children: [
|
|
565
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
566
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
567
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Chip, { size: "sm", color: "primary", children: t.edit }),
|
|
568
|
+
needsAttention && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Chip, { size: "sm", color: "destructive", variant: "solid", children: t.required })
|
|
569
|
+
] }),
|
|
570
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
571
|
+
"button",
|
|
572
|
+
{
|
|
573
|
+
type: "button",
|
|
574
|
+
onClick: handleStartEdit,
|
|
575
|
+
className: styles.editButton(),
|
|
576
|
+
"aria-label": t.edit,
|
|
577
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.EditIcon, { className: "size-4" })
|
|
578
|
+
}
|
|
579
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
581
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sight.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
582
|
+
] }))
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
),
|
|
573
586
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_sight.Card.Body, { className: "space-y-3", children: [
|
|
574
587
|
impactRows,
|
|
575
588
|
justificationContent
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import "../../chunk-GFABGXAO.mjs";
|
|
3
3
|
import {
|
|
4
4
|
ImpactCard
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-C2GUKNBG.mjs";
|
|
6
6
|
import {
|
|
7
7
|
assetScale,
|
|
8
8
|
getScale,
|
|
9
9
|
impactLevels,
|
|
10
10
|
processScale,
|
|
11
11
|
riskScale
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-AUICT2D3.mjs";
|
|
13
13
|
import {
|
|
14
14
|
messages
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-AXBL7YBB.mjs";
|
|
16
16
|
export {
|
|
17
17
|
ImpactCard,
|
|
18
18
|
assetScale,
|
|
@@ -82,6 +82,10 @@ var messages = (0, import_i18n.defineMessages)({
|
|
|
82
82
|
id: "grc.impact.save",
|
|
83
83
|
defaultMessage: "Save"
|
|
84
84
|
},
|
|
85
|
+
required: {
|
|
86
|
+
id: "grc.impact.required",
|
|
87
|
+
defaultMessage: "Required"
|
|
88
|
+
},
|
|
85
89
|
// Risk Scale (default)
|
|
86
90
|
risk_0: {
|
|
87
91
|
id: "grc.impact.scale.risk.0",
|
|
@@ -88,6 +88,10 @@ var messages = (0, import_i18n.defineMessages)({
|
|
|
88
88
|
id: "grc.impact.save",
|
|
89
89
|
defaultMessage: "Save"
|
|
90
90
|
},
|
|
91
|
+
required: {
|
|
92
|
+
id: "grc.impact.required",
|
|
93
|
+
defaultMessage: "Required"
|
|
94
|
+
},
|
|
91
95
|
// Risk Scale (default)
|
|
92
96
|
risk_0: {
|
|
93
97
|
id: "grc.impact.scale.risk.0",
|
package/dist/common/index.js
CHANGED
|
@@ -427,6 +427,10 @@ var messages4 = (0, import_i18n6.defineMessages)({
|
|
|
427
427
|
id: "grc.impact.save",
|
|
428
428
|
defaultMessage: "Save"
|
|
429
429
|
},
|
|
430
|
+
required: {
|
|
431
|
+
id: "grc.impact.required",
|
|
432
|
+
defaultMessage: "Required"
|
|
433
|
+
},
|
|
430
434
|
// Risk Scale (default)
|
|
431
435
|
risk_0: {
|
|
432
436
|
id: "grc.impact.scale.risk.0",
|
|
@@ -720,7 +724,8 @@ function ImpactCard({
|
|
|
720
724
|
readOnly = false,
|
|
721
725
|
scale = "risk",
|
|
722
726
|
title,
|
|
723
|
-
variant = "card"
|
|
727
|
+
variant = "card",
|
|
728
|
+
needsAttention = false
|
|
724
729
|
}) {
|
|
725
730
|
var _a, _b;
|
|
726
731
|
const intl = (0, import_i18n7.useSafeIntl)();
|
|
@@ -750,7 +755,8 @@ function ImpactCard({
|
|
|
750
755
|
noJustification: intl.formatMessage(messages4.no_justification),
|
|
751
756
|
edit: intl.formatMessage(messages4.edit),
|
|
752
757
|
cancel: intl.formatMessage(messages4.cancel),
|
|
753
|
-
save: intl.formatMessage(messages4.save)
|
|
758
|
+
save: intl.formatMessage(messages4.save),
|
|
759
|
+
required: intl.formatMessage(messages4.required)
|
|
754
760
|
};
|
|
755
761
|
const defaultTitle = showAuthenticity ? t.titleCiaa : t.titleCia;
|
|
756
762
|
const cardTitle = title != null ? title : defaultTitle;
|
|
@@ -881,25 +887,32 @@ function ImpactCard({
|
|
|
881
887
|
] });
|
|
882
888
|
}
|
|
883
889
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Root, { className: styles.root(), children: [
|
|
884
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
890
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
891
|
+
import_sight4.Card.Header,
|
|
892
|
+
{
|
|
893
|
+
className: `flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`,
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
896
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
897
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Chip, { size: "sm", color: "primary", children: t.edit }),
|
|
898
|
+
needsAttention && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Chip, { size: "sm", color: "destructive", variant: "solid", children: t.required })
|
|
899
|
+
] }),
|
|
900
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
901
|
+
"button",
|
|
902
|
+
{
|
|
903
|
+
type: "button",
|
|
904
|
+
onClick: handleStartEdit,
|
|
905
|
+
className: styles.editButton(),
|
|
906
|
+
"aria-label": t.edit,
|
|
907
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.EditIcon, { className: "size-4" })
|
|
908
|
+
}
|
|
909
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
912
|
+
] }))
|
|
913
|
+
]
|
|
914
|
+
}
|
|
915
|
+
),
|
|
903
916
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Body, { className: "space-y-3", children: [
|
|
904
917
|
impactRows,
|
|
905
918
|
justificationContent
|
package/dist/common/index.mjs
CHANGED
|
@@ -8,17 +8,17 @@ import "../chunk-JHGWV2ID.mjs";
|
|
|
8
8
|
import "../chunk-GFABGXAO.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ImpactCard
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-C2GUKNBG.mjs";
|
|
12
12
|
import {
|
|
13
13
|
assetScale,
|
|
14
14
|
getScale,
|
|
15
15
|
impactLevels,
|
|
16
16
|
processScale,
|
|
17
17
|
riskScale
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-AUICT2D3.mjs";
|
|
19
19
|
import {
|
|
20
20
|
messages
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-AXBL7YBB.mjs";
|
|
22
22
|
import "../chunk-HI7F2CF4.mjs";
|
|
23
23
|
import {
|
|
24
24
|
RiskRatingDisplay
|
package/dist/index.js
CHANGED
|
@@ -429,6 +429,10 @@ var messages4 = (0, import_i18n6.defineMessages)({
|
|
|
429
429
|
id: "grc.impact.save",
|
|
430
430
|
defaultMessage: "Save"
|
|
431
431
|
},
|
|
432
|
+
required: {
|
|
433
|
+
id: "grc.impact.required",
|
|
434
|
+
defaultMessage: "Required"
|
|
435
|
+
},
|
|
432
436
|
// Risk Scale (default)
|
|
433
437
|
risk_0: {
|
|
434
438
|
id: "grc.impact.scale.risk.0",
|
|
@@ -722,7 +726,8 @@ function ImpactCard({
|
|
|
722
726
|
readOnly = false,
|
|
723
727
|
scale = "risk",
|
|
724
728
|
title,
|
|
725
|
-
variant = "card"
|
|
729
|
+
variant = "card",
|
|
730
|
+
needsAttention = false
|
|
726
731
|
}) {
|
|
727
732
|
var _a, _b;
|
|
728
733
|
const intl = (0, import_i18n7.useSafeIntl)();
|
|
@@ -752,7 +757,8 @@ function ImpactCard({
|
|
|
752
757
|
noJustification: intl.formatMessage(messages4.no_justification),
|
|
753
758
|
edit: intl.formatMessage(messages4.edit),
|
|
754
759
|
cancel: intl.formatMessage(messages4.cancel),
|
|
755
|
-
save: intl.formatMessage(messages4.save)
|
|
760
|
+
save: intl.formatMessage(messages4.save),
|
|
761
|
+
required: intl.formatMessage(messages4.required)
|
|
756
762
|
};
|
|
757
763
|
const defaultTitle = showAuthenticity ? t.titleCiaa : t.titleCia;
|
|
758
764
|
const cardTitle = title != null ? title : defaultTitle;
|
|
@@ -883,25 +889,32 @@ function ImpactCard({
|
|
|
883
889
|
] });
|
|
884
890
|
}
|
|
885
891
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Root, { className: styles.root(), children: [
|
|
886
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
892
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
893
|
+
import_sight4.Card.Header,
|
|
894
|
+
{
|
|
895
|
+
className: `flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`,
|
|
896
|
+
children: [
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
898
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Heading, { level: "h4", className: "text-sm font-medium", children: cardTitle }),
|
|
899
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Chip, { size: "sm", color: "primary", children: t.edit }),
|
|
900
|
+
needsAttention && !isEditing && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Chip, { size: "sm", color: "destructive", variant: "solid", children: t.required })
|
|
901
|
+
] }),
|
|
902
|
+
!readOnly && (!isEditing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
903
|
+
"button",
|
|
904
|
+
{
|
|
905
|
+
type: "button",
|
|
906
|
+
onClick: handleStartEdit,
|
|
907
|
+
className: styles.editButton(),
|
|
908
|
+
"aria-label": t.edit,
|
|
909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.EditIcon, { className: "size-4" })
|
|
910
|
+
}
|
|
911
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Button, { variant: "ghost", size: "sm", onClick: handleCancel, children: t.cancel }),
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_sight4.Button, { size: "sm", onClick: handleSave, children: t.save })
|
|
914
|
+
] }))
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
),
|
|
905
918
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_sight4.Card.Body, { className: "space-y-3", children: [
|
|
906
919
|
impactRows,
|
|
907
920
|
justificationContent
|
package/dist/index.mjs
CHANGED
|
@@ -8,17 +8,17 @@ import "./chunk-JHGWV2ID.mjs";
|
|
|
8
8
|
import "./chunk-GFABGXAO.mjs";
|
|
9
9
|
import {
|
|
10
10
|
ImpactCard
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-C2GUKNBG.mjs";
|
|
12
12
|
import {
|
|
13
13
|
assetScale,
|
|
14
14
|
getScale,
|
|
15
15
|
impactLevels,
|
|
16
16
|
processScale,
|
|
17
17
|
riskScale
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AUICT2D3.mjs";
|
|
19
19
|
import {
|
|
20
20
|
messages
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-AXBL7YBB.mjs";
|
|
22
22
|
import "./chunk-HI7F2CF4.mjs";
|
|
23
23
|
import {
|
|
24
24
|
RiskRatingDisplay
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/grc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "GRC (Governance, Risk, Compliance) components for Kopexa",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"react": ">=19.0.0-rc.0",
|
|
43
43
|
"react-dom": ">=19.0.0-rc.0",
|
|
44
44
|
"react-intl": "^7.1.14",
|
|
45
|
-
"@kopexa/theme": "17.
|
|
46
|
-
"@kopexa/sight": "17.
|
|
47
|
-
"@kopexa/tiptap": "17.6.
|
|
45
|
+
"@kopexa/theme": "17.17.0",
|
|
46
|
+
"@kopexa/sight": "17.6.1",
|
|
47
|
+
"@kopexa/tiptap": "17.6.3"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@kopexa/krn": "^1.0.1",
|
|
51
|
-
"@kopexa/
|
|
52
|
-
"@kopexa/
|
|
53
|
-
"@kopexa/
|
|
54
|
-
"@kopexa/
|
|
51
|
+
"@kopexa/shared-utils": "17.0.30",
|
|
52
|
+
"@kopexa/react-utils": "17.0.30",
|
|
53
|
+
"@kopexa/icons": "17.5.1",
|
|
54
|
+
"@kopexa/i18n": "17.5.11"
|
|
55
55
|
},
|
|
56
56
|
"clean-package": "../../clean-package.config.json",
|
|
57
57
|
"publishConfig": {
|
|
@@ -151,6 +151,8 @@ export interface ImpactCardProps {
|
|
|
151
151
|
* - `inline`: No card wrapper, always editable, changes propagate immediately
|
|
152
152
|
*/
|
|
153
153
|
variant?: "card" | "inline";
|
|
154
|
+
/** Show attention indicator when impact values need to be filled */
|
|
155
|
+
needsAttention?: boolean;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
const defaultImpact: ImpactValue = {
|
|
@@ -169,6 +171,7 @@ export function ImpactCard({
|
|
|
169
171
|
scale = "risk",
|
|
170
172
|
title,
|
|
171
173
|
variant = "card",
|
|
174
|
+
needsAttention = false,
|
|
172
175
|
}: ImpactCardProps) {
|
|
173
176
|
const intl = useSafeIntl();
|
|
174
177
|
const isInline = variant === "inline";
|
|
@@ -208,6 +211,7 @@ export function ImpactCard({
|
|
|
208
211
|
edit: intl.formatMessage(messages.edit),
|
|
209
212
|
cancel: intl.formatMessage(messages.cancel),
|
|
210
213
|
save: intl.formatMessage(messages.save),
|
|
214
|
+
required: intl.formatMessage(messages.required),
|
|
211
215
|
};
|
|
212
216
|
|
|
213
217
|
// Derive default title based on authenticity
|
|
@@ -379,7 +383,9 @@ export function ImpactCard({
|
|
|
379
383
|
// Card variant: wrapped in Card with edit/save/cancel
|
|
380
384
|
return (
|
|
381
385
|
<Card.Root className={styles.root()}>
|
|
382
|
-
<Card.Header
|
|
386
|
+
<Card.Header
|
|
387
|
+
className={`flex flex-row items-center justify-between ${needsAttention ? "bg-destructive/10 rounded-t-lg" : ""}`}
|
|
388
|
+
>
|
|
383
389
|
<div className="flex items-center gap-2">
|
|
384
390
|
<Heading level="h4" className="text-sm font-medium">
|
|
385
391
|
{cardTitle}
|
|
@@ -389,6 +395,11 @@ export function ImpactCard({
|
|
|
389
395
|
{t.edit}
|
|
390
396
|
</Chip>
|
|
391
397
|
)}
|
|
398
|
+
{needsAttention && !isEditing && (
|
|
399
|
+
<Chip size="sm" color="destructive" variant="solid">
|
|
400
|
+
{t.required}
|
|
401
|
+
</Chip>
|
|
402
|
+
)}
|
|
392
403
|
</div>
|
|
393
404
|
{!readOnly &&
|
|
394
405
|
(!isEditing ? (
|