@tantainnovative/ndpr-toolkit 2.1.2 → 2.2.0
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/README.md +56 -0
- package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
- package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
- package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
- package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
- package/dist/breach.d.mts +81 -5
- package/dist/breach.d.ts +81 -5
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-4RGDNVR5.mjs +72 -0
- package/dist/chunk-6LM3RAFO.js +7 -0
- package/dist/chunk-7DNQSOER.js +2 -0
- package/dist/chunk-A7DRHSDQ.mjs +2 -0
- package/dist/chunk-FC6EG34C.js +72 -0
- package/dist/chunk-FDB6KZUD.mjs +2 -0
- package/dist/chunk-FZUCKGIM.mjs +7 -0
- package/dist/chunk-G3JNFZPT.js +2 -0
- package/dist/chunk-HXCRMA4J.mjs +2 -0
- package/dist/chunk-IC7VOOKJ.mjs +2 -0
- package/dist/chunk-ICUZG6CD.mjs +2 -0
- package/dist/chunk-IW5PHOG7.mjs +7 -0
- package/dist/chunk-JKEAPTYP.js +7 -0
- package/dist/chunk-N52S64SU.js +2 -0
- package/dist/chunk-SKAMVXBI.mjs +94 -0
- package/dist/chunk-VURIXCGY.js +2 -0
- package/dist/chunk-VXRY3V42.js +94 -0
- package/dist/chunk-YBPHGEL2.js +2 -0
- package/dist/consent.d.mts +68 -2
- package/dist/consent.d.ts +68 -2
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +10 -10
- package/dist/core.d.ts +10 -10
- package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
- package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
- package/dist/cross-border-entry-BfF7jw5o.d.mts +84 -0
- package/dist/cross-border-entry-CtX8_o-_.d.ts +84 -0
- package/dist/cross-border.d.mts +4 -58
- package/dist/cross-border.d.ts +4 -58
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
- package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
- package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
- package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
- package/dist/dpia.d.mts +105 -5
- package/dist/dpia.d.ts +105 -5
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
- package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
- package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
- package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
- package/dist/dsr.d.mts +66 -5
- package/dist/dsr.d.ts +66 -5
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +13 -13
- package/dist/hooks.d.ts +13 -13
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
- package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
- package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
- package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
- package/dist/lawful-basis-entry-BeSX7u0U.d.ts +81 -0
- package/dist/lawful-basis-entry-CMPPM9Rh.d.mts +81 -0
- package/dist/lawful-basis.d.mts +5 -55
- package/dist/lawful-basis.d.ts +5 -55
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-dmsRlqgM.d.ts +283 -0
- package/dist/policy-kZN23hrR.d.mts +283 -0
- package/dist/policy.d.mts +3 -193
- package/dist/policy.d.ts +3 -193
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
- package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
- package/dist/ropa-entry-CZJ91ymk.d.mts +71 -0
- package/dist/ropa-entry-DIEQ9WFs.d.ts +71 -0
- package/dist/ropa.d.mts +5 -45
- package/dist/ropa.d.ts +5 -45
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
- package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
- package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
- package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
- package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
- package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
- package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
- package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
- package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
- package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
- package/package.json +22 -15
- package/dist/chunk-2XHD22J7.mjs +0 -7
- package/dist/chunk-4DKT6IB6.js +0 -94
- package/dist/chunk-6JFTAYXV.mjs +0 -2
- package/dist/chunk-6JVYYLS7.js +0 -2
- package/dist/chunk-6SGG6WPA.mjs +0 -2
- package/dist/chunk-AQEGDEQM.js +0 -7
- package/dist/chunk-C2IJWCZQ.mjs +0 -2
- package/dist/chunk-FFW7RUAG.mjs +0 -94
- package/dist/chunk-FK3CSFLJ.js +0 -2
- package/dist/chunk-JUN6YPLL.mjs +0 -72
- package/dist/chunk-L3FKTBGV.js +0 -72
- package/dist/chunk-RB26MIRI.js +0 -2
- package/dist/chunk-RHWW5FDP.js +0 -16
- package/dist/chunk-SLNMKGQ2.mjs +0 -2
- package/dist/chunk-UUWVBENC.js +0 -2
- package/dist/chunk-XMKA6GVK.mjs +0 -16
package/README.md
CHANGED
|
@@ -97,6 +97,62 @@ function App() {
|
|
|
97
97
|
|
|
98
98
|
---
|
|
99
99
|
|
|
100
|
+
## Styling & Customization
|
|
101
|
+
|
|
102
|
+
Every component supports three styling modes:
|
|
103
|
+
|
|
104
|
+
**Default (Tailwind CSS built-in):**
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<ConsentBanner options={options} onSave={handleSave} />
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Override specific sections:**
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import { ConsentBanner } from '@tantainnovative/ndpr-toolkit/consent';
|
|
114
|
+
|
|
115
|
+
<ConsentBanner
|
|
116
|
+
options={options}
|
|
117
|
+
onSave={handleSave}
|
|
118
|
+
classNames={{
|
|
119
|
+
root: "fixed bottom-0 inset-x-0 bg-white shadow-xl p-6 z-50",
|
|
120
|
+
title: "text-xl font-serif text-gray-900",
|
|
121
|
+
acceptButton: "bg-green-600 text-white px-6 py-2 rounded-full",
|
|
122
|
+
rejectButton: "border border-gray-300 px-6 py-2 rounded-full",
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Fully unstyled (BYO CSS -- works with Bootstrap, CSS Modules, vanilla CSS):**
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<ConsentBanner
|
|
131
|
+
options={options}
|
|
132
|
+
onSave={handleSave}
|
|
133
|
+
unstyled
|
|
134
|
+
classNames={{
|
|
135
|
+
root: "my-consent-banner",
|
|
136
|
+
acceptButton: "btn btn-primary",
|
|
137
|
+
rejectButton: "btn btn-outline-secondary",
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### classNames Reference
|
|
143
|
+
|
|
144
|
+
| Component | Key classNames | Total keys |
|
|
145
|
+
|-----------|---------------|------------|
|
|
146
|
+
| ConsentBanner | root, title, acceptButton, rejectButton, optionsList | 14 |
|
|
147
|
+
| DSRRequestForm | root, form, input, select, submitButton | 11 |
|
|
148
|
+
| BreachReportForm | root, form, input, submitButton, notice | 10 |
|
|
149
|
+
| LawfulBasisTracker | root, table, form, statusBadge, complianceScore | 15 |
|
|
150
|
+
| All 19 components | -- | 194 total |
|
|
151
|
+
|
|
152
|
+
Every component follows the same pattern. Pass `classNames` to override specific sections, or set `unstyled` to strip all default styles.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
100
156
|
## Modules
|
|
101
157
|
|
|
102
158
|
### 1. Consent Management
|
|
@@ -182,4 +182,4 @@ interface RegulatoryNotification {
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
export type {
|
|
185
|
+
export type { BreachCategory as B, NotificationRequirement as N, RegulatoryNotification as R, BreachReport as a, RiskAssessment as b };
|
|
@@ -182,4 +182,4 @@ interface RegulatoryNotification {
|
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
export type {
|
|
185
|
+
export type { BreachCategory as B, NotificationRequirement as N, RegulatoryNotification as R, BreachReport as a, RiskAssessment as b };
|
package/dist/breach.d.mts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { N as NotificationRequirement } from './breach-
|
|
4
|
-
export { u as useBreach } from './useBreach-
|
|
5
|
-
export { c as calculateBreachSeverity } from './breach-
|
|
2
|
+
import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification } from './breach-Eu9byel8.mjs';
|
|
3
|
+
export { N as NotificationRequirement } from './breach-Eu9byel8.mjs';
|
|
4
|
+
export { u as useBreach } from './useBreach-BBSoIcZO.mjs';
|
|
5
|
+
export { c as calculateBreachSeverity } from './breach-B_-6lDqS.mjs';
|
|
6
6
|
|
|
7
|
+
interface BreachReportFormClassNames {
|
|
8
|
+
root?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
form?: string;
|
|
11
|
+
fieldGroup?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
input?: string;
|
|
14
|
+
select?: string;
|
|
15
|
+
textarea?: string;
|
|
16
|
+
submitButton?: string;
|
|
17
|
+
notice?: string;
|
|
18
|
+
}
|
|
7
19
|
interface BreachReportFormProps {
|
|
8
20
|
/**
|
|
9
21
|
* Available breach categories
|
|
@@ -36,6 +48,14 @@ interface BreachReportFormProps {
|
|
|
36
48
|
* Custom CSS class for the submit button
|
|
37
49
|
*/
|
|
38
50
|
buttonClassName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Override class names for individual elements
|
|
53
|
+
*/
|
|
54
|
+
classNames?: BreachReportFormClassNames;
|
|
55
|
+
/**
|
|
56
|
+
* Remove all default styles, only applying classNames overrides
|
|
57
|
+
*/
|
|
58
|
+
unstyled?: boolean;
|
|
39
59
|
/**
|
|
40
60
|
* Whether to show a confirmation message after submission
|
|
41
61
|
* @default true
|
|
@@ -69,6 +89,16 @@ interface BreachReportFormProps {
|
|
|
69
89
|
}
|
|
70
90
|
declare const BreachReportForm: React.FC<BreachReportFormProps>;
|
|
71
91
|
|
|
92
|
+
interface BreachRiskAssessmentClassNames {
|
|
93
|
+
root?: string;
|
|
94
|
+
header?: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
slider?: string;
|
|
97
|
+
riskBadge?: string;
|
|
98
|
+
riskScore?: string;
|
|
99
|
+
notificationStatus?: string;
|
|
100
|
+
submitButton?: string;
|
|
101
|
+
}
|
|
72
102
|
interface BreachRiskAssessmentProps {
|
|
73
103
|
/**
|
|
74
104
|
* The breach data to assess
|
|
@@ -105,6 +135,14 @@ interface BreachRiskAssessmentProps {
|
|
|
105
135
|
* Custom CSS class for the submit button
|
|
106
136
|
*/
|
|
107
137
|
buttonClassName?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Override class names for individual elements
|
|
140
|
+
*/
|
|
141
|
+
classNames?: BreachRiskAssessmentClassNames;
|
|
142
|
+
/**
|
|
143
|
+
* Remove all default styles, only applying classNames overrides
|
|
144
|
+
*/
|
|
145
|
+
unstyled?: boolean;
|
|
108
146
|
/**
|
|
109
147
|
* Whether to show the breach summary
|
|
110
148
|
* @default true
|
|
@@ -118,6 +156,17 @@ interface BreachRiskAssessmentProps {
|
|
|
118
156
|
}
|
|
119
157
|
declare const BreachRiskAssessment: React.FC<BreachRiskAssessmentProps>;
|
|
120
158
|
|
|
159
|
+
interface BreachNotificationManagerClassNames {
|
|
160
|
+
root?: string;
|
|
161
|
+
header?: string;
|
|
162
|
+
title?: string;
|
|
163
|
+
breachList?: string;
|
|
164
|
+
breachItem?: string;
|
|
165
|
+
statusBadge?: string;
|
|
166
|
+
timeline?: string;
|
|
167
|
+
timelineStep?: string;
|
|
168
|
+
detailPanel?: string;
|
|
169
|
+
}
|
|
121
170
|
interface BreachNotificationManagerProps {
|
|
122
171
|
/**
|
|
123
172
|
* List of breach reports to manage
|
|
@@ -161,6 +210,14 @@ interface BreachNotificationManagerProps {
|
|
|
161
210
|
* Custom CSS class for the buttons
|
|
162
211
|
*/
|
|
163
212
|
buttonClassName?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Override class names for individual elements
|
|
215
|
+
*/
|
|
216
|
+
classNames?: BreachNotificationManagerClassNames;
|
|
217
|
+
/**
|
|
218
|
+
* Remove all default styles, only applying classNames overrides
|
|
219
|
+
*/
|
|
220
|
+
unstyled?: boolean;
|
|
164
221
|
/**
|
|
165
222
|
* Whether to show the breach details
|
|
166
223
|
* @default true
|
|
@@ -179,6 +236,17 @@ interface BreachNotificationManagerProps {
|
|
|
179
236
|
}
|
|
180
237
|
declare const BreachNotificationManager: React.FC<BreachNotificationManagerProps>;
|
|
181
238
|
|
|
239
|
+
interface RegulatoryReportGeneratorClassNames {
|
|
240
|
+
root?: string;
|
|
241
|
+
header?: string;
|
|
242
|
+
title?: string;
|
|
243
|
+
reportPreview?: string;
|
|
244
|
+
field?: string;
|
|
245
|
+
fieldLabel?: string;
|
|
246
|
+
fieldValue?: string;
|
|
247
|
+
generateButton?: string;
|
|
248
|
+
downloadButton?: string;
|
|
249
|
+
}
|
|
182
250
|
interface OrganizationInfo {
|
|
183
251
|
/**
|
|
184
252
|
* Name of the organization
|
|
@@ -249,6 +317,14 @@ interface RegulatoryReportGeneratorProps {
|
|
|
249
317
|
* Custom CSS class for the buttons
|
|
250
318
|
*/
|
|
251
319
|
buttonClassName?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Override class names for individual elements
|
|
322
|
+
*/
|
|
323
|
+
classNames?: RegulatoryReportGeneratorClassNames;
|
|
324
|
+
/**
|
|
325
|
+
* Remove all default styles, only applying classNames overrides
|
|
326
|
+
*/
|
|
327
|
+
unstyled?: boolean;
|
|
252
328
|
/**
|
|
253
329
|
* Whether to show a preview of the generated report
|
|
254
330
|
* @default true
|
|
@@ -272,4 +348,4 @@ interface RegulatoryReportGeneratorProps {
|
|
|
272
348
|
}
|
|
273
349
|
declare const RegulatoryReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
|
|
274
350
|
|
|
275
|
-
export { BreachCategory, BreachNotificationManager, BreachReport, BreachReportForm, BreachRiskAssessment, RegulatoryNotification, RegulatoryReportGenerator, RiskAssessment };
|
|
351
|
+
export { BreachCategory, BreachNotificationManager, type BreachNotificationManagerClassNames, BreachReport, BreachReportForm, type BreachReportFormClassNames, BreachRiskAssessment, type BreachRiskAssessmentClassNames, RegulatoryNotification, RegulatoryReportGenerator, type RegulatoryReportGeneratorClassNames, RiskAssessment };
|
package/dist/breach.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { N as NotificationRequirement } from './breach-
|
|
4
|
-
export { u as useBreach } from './useBreach-
|
|
5
|
-
export { c as calculateBreachSeverity } from './breach-
|
|
2
|
+
import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification } from './breach-Eu9byel8.js';
|
|
3
|
+
export { N as NotificationRequirement } from './breach-Eu9byel8.js';
|
|
4
|
+
export { u as useBreach } from './useBreach-lFLbSyAN.js';
|
|
5
|
+
export { c as calculateBreachSeverity } from './breach-CzXqSsaY.js';
|
|
6
6
|
|
|
7
|
+
interface BreachReportFormClassNames {
|
|
8
|
+
root?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
form?: string;
|
|
11
|
+
fieldGroup?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
input?: string;
|
|
14
|
+
select?: string;
|
|
15
|
+
textarea?: string;
|
|
16
|
+
submitButton?: string;
|
|
17
|
+
notice?: string;
|
|
18
|
+
}
|
|
7
19
|
interface BreachReportFormProps {
|
|
8
20
|
/**
|
|
9
21
|
* Available breach categories
|
|
@@ -36,6 +48,14 @@ interface BreachReportFormProps {
|
|
|
36
48
|
* Custom CSS class for the submit button
|
|
37
49
|
*/
|
|
38
50
|
buttonClassName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Override class names for individual elements
|
|
53
|
+
*/
|
|
54
|
+
classNames?: BreachReportFormClassNames;
|
|
55
|
+
/**
|
|
56
|
+
* Remove all default styles, only applying classNames overrides
|
|
57
|
+
*/
|
|
58
|
+
unstyled?: boolean;
|
|
39
59
|
/**
|
|
40
60
|
* Whether to show a confirmation message after submission
|
|
41
61
|
* @default true
|
|
@@ -69,6 +89,16 @@ interface BreachReportFormProps {
|
|
|
69
89
|
}
|
|
70
90
|
declare const BreachReportForm: React.FC<BreachReportFormProps>;
|
|
71
91
|
|
|
92
|
+
interface BreachRiskAssessmentClassNames {
|
|
93
|
+
root?: string;
|
|
94
|
+
header?: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
slider?: string;
|
|
97
|
+
riskBadge?: string;
|
|
98
|
+
riskScore?: string;
|
|
99
|
+
notificationStatus?: string;
|
|
100
|
+
submitButton?: string;
|
|
101
|
+
}
|
|
72
102
|
interface BreachRiskAssessmentProps {
|
|
73
103
|
/**
|
|
74
104
|
* The breach data to assess
|
|
@@ -105,6 +135,14 @@ interface BreachRiskAssessmentProps {
|
|
|
105
135
|
* Custom CSS class for the submit button
|
|
106
136
|
*/
|
|
107
137
|
buttonClassName?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Override class names for individual elements
|
|
140
|
+
*/
|
|
141
|
+
classNames?: BreachRiskAssessmentClassNames;
|
|
142
|
+
/**
|
|
143
|
+
* Remove all default styles, only applying classNames overrides
|
|
144
|
+
*/
|
|
145
|
+
unstyled?: boolean;
|
|
108
146
|
/**
|
|
109
147
|
* Whether to show the breach summary
|
|
110
148
|
* @default true
|
|
@@ -118,6 +156,17 @@ interface BreachRiskAssessmentProps {
|
|
|
118
156
|
}
|
|
119
157
|
declare const BreachRiskAssessment: React.FC<BreachRiskAssessmentProps>;
|
|
120
158
|
|
|
159
|
+
interface BreachNotificationManagerClassNames {
|
|
160
|
+
root?: string;
|
|
161
|
+
header?: string;
|
|
162
|
+
title?: string;
|
|
163
|
+
breachList?: string;
|
|
164
|
+
breachItem?: string;
|
|
165
|
+
statusBadge?: string;
|
|
166
|
+
timeline?: string;
|
|
167
|
+
timelineStep?: string;
|
|
168
|
+
detailPanel?: string;
|
|
169
|
+
}
|
|
121
170
|
interface BreachNotificationManagerProps {
|
|
122
171
|
/**
|
|
123
172
|
* List of breach reports to manage
|
|
@@ -161,6 +210,14 @@ interface BreachNotificationManagerProps {
|
|
|
161
210
|
* Custom CSS class for the buttons
|
|
162
211
|
*/
|
|
163
212
|
buttonClassName?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Override class names for individual elements
|
|
215
|
+
*/
|
|
216
|
+
classNames?: BreachNotificationManagerClassNames;
|
|
217
|
+
/**
|
|
218
|
+
* Remove all default styles, only applying classNames overrides
|
|
219
|
+
*/
|
|
220
|
+
unstyled?: boolean;
|
|
164
221
|
/**
|
|
165
222
|
* Whether to show the breach details
|
|
166
223
|
* @default true
|
|
@@ -179,6 +236,17 @@ interface BreachNotificationManagerProps {
|
|
|
179
236
|
}
|
|
180
237
|
declare const BreachNotificationManager: React.FC<BreachNotificationManagerProps>;
|
|
181
238
|
|
|
239
|
+
interface RegulatoryReportGeneratorClassNames {
|
|
240
|
+
root?: string;
|
|
241
|
+
header?: string;
|
|
242
|
+
title?: string;
|
|
243
|
+
reportPreview?: string;
|
|
244
|
+
field?: string;
|
|
245
|
+
fieldLabel?: string;
|
|
246
|
+
fieldValue?: string;
|
|
247
|
+
generateButton?: string;
|
|
248
|
+
downloadButton?: string;
|
|
249
|
+
}
|
|
182
250
|
interface OrganizationInfo {
|
|
183
251
|
/**
|
|
184
252
|
* Name of the organization
|
|
@@ -249,6 +317,14 @@ interface RegulatoryReportGeneratorProps {
|
|
|
249
317
|
* Custom CSS class for the buttons
|
|
250
318
|
*/
|
|
251
319
|
buttonClassName?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Override class names for individual elements
|
|
322
|
+
*/
|
|
323
|
+
classNames?: RegulatoryReportGeneratorClassNames;
|
|
324
|
+
/**
|
|
325
|
+
* Remove all default styles, only applying classNames overrides
|
|
326
|
+
*/
|
|
327
|
+
unstyled?: boolean;
|
|
252
328
|
/**
|
|
253
329
|
* Whether to show a preview of the generated report
|
|
254
330
|
* @default true
|
|
@@ -272,4 +348,4 @@ interface RegulatoryReportGeneratorProps {
|
|
|
272
348
|
}
|
|
273
349
|
declare const RegulatoryReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
|
|
274
350
|
|
|
275
|
-
export { BreachCategory, BreachNotificationManager, BreachReport, BreachReportForm, BreachRiskAssessment, RegulatoryNotification, RegulatoryReportGenerator, RiskAssessment };
|
|
351
|
+
export { BreachCategory, BreachNotificationManager, type BreachNotificationManagerClassNames, BreachReport, BreachReportForm, type BreachReportFormClassNames, BreachRiskAssessment, type BreachRiskAssessmentClassNames, RegulatoryNotification, RegulatoryReportGenerator, type RegulatoryReportGeneratorClassNames, RiskAssessment };
|
package/dist/breach.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkFC6EG34C_js=require('./chunk-FC6EG34C.js'),chunkLI6WJ3LZ_js=require('./chunk-LI6WJ3LZ.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-VURIXCGY.js'),require('./chunk-MQFZHA2D.js');Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunkFC6EG34C_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkFC6EG34C_js.a}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunkFC6EG34C_js.b}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunkFC6EG34C_js.d}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkLI6WJ3LZ_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});//# sourceMappingURL=breach.js.map
|
|
2
2
|
//# sourceMappingURL=breach.js.map
|
package/dist/breach.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{c as BreachNotificationManager,a as BreachReportForm,b as BreachRiskAssessment,d as RegulatoryReportGenerator}from'./chunk-
|
|
1
|
+
export{c as BreachNotificationManager,a as BreachReportForm,b as BreachRiskAssessment,d as RegulatoryReportGenerator}from'./chunk-4RGDNVR5.mjs';export{a as useBreach}from'./chunk-OITITR6K.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-FDB6KZUD.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=breach.mjs.map
|
|
2
2
|
//# sourceMappingURL=breach.mjs.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {a}from'./chunk-FDB6KZUD.mjs';import {a as a$2,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var $e=({categories:h,onSubmit:v,title:D="Report a Data Breach",formDescription:oe="Use this form to report a suspected or confirmed data breach. All fields marked with * are required.",submitButtonText:ne="Submit Report",className:te="",buttonClassName:de="",classNames:A={},unstyled:f=false,showConfirmation:m=true,confirmationMessage:u="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:I=true,maxAttachments:q=5,maxFileSize:ae=5*1024*1024,allowedFileTypes:E=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"]})=>{let[w,O]=useState(""),[T,Y]=useState(""),[$,W]=useState(""),[j,K]=useState(""),[U,Z]=useState(""),[G,le]=useState(""),[Q,se]=useState(""),[re,B]=useState(""),[k,R]=useState(""),[x,C]=useState([]),[me,_]=useState(""),[X,b$1]=useState([]),[S,ce]=useState(""),[ue,i]=useState("ongoing"),[p,d]=useState(""),[y,M]=useState([]),[V,be]=useState(false),[N,L]=useState({}),xe=o=>{let F=o.target.value;_(F);let J=F.split(",").map(ee=>ee.trim()).filter(Boolean);C(J);},fe=o=>{b$1(F=>F.includes(o)?F.filter(J=>J!==o):[...F,o]);},Ne=o=>{var ye;let F=o.target.files;if(!F)return;let J=[],ee={};if(y.length+F.length>q){ee.attachments=`Maximum of ${q} files allowed`,L(z=>a$2(a$2({},z),ee));return}for(let z=0;z<F.length;z++){let he=F[z];if(he.size>ae){ee.attachments=`File ${he.name} exceeds the maximum size of ${ae/(1024*1024)}MB`;continue}let ke="."+((ye=he.name.split(".").pop())==null?void 0:ye.toLowerCase());if(!E.includes(ke)){ee.attachments=`File type ${ke} is not allowed`;continue}J.push(he);}Object.keys(ee).length>0?L(z=>a$2(a$2({},z),ee)):(M(z=>[...z,...J]),L(z=>b(a$2({},z),{attachments:""})));},ve=o=>{M(F=>F.filter((J,ee)=>ee!==o));},Se=()=>{let o={};return w.trim()||(o.breachTitle="Breach title is required"),T.trim()||(o.description="Description is required"),$||(o.category="Category is required"),j||(o.discoveredAt="Discovery date is required"),G.trim()||(o.reporterName="Reporter name is required"),Q.trim()?/\S+@\S+\.\S+/.test(Q)||(o.reporterEmail="Reporter email is invalid"):o.reporterEmail="Reporter email is required",re.trim()||(o.reporterDepartment="Reporter department is required"),x.length===0&&(o.affectedSystems="At least one affected system is required"),X.length===0&&(o.dataTypes="At least one data type is required"),S&&isNaN(Number(S))&&(o.estimatedAffectedSubjects="Estimated affected subjects must be a number"),L(o),Object.keys(o).length===0},De=o=>{if(o.preventDefault(),!Se())return;let F={title:w,description:T,category:$,discoveredAt:new Date(j).getTime(),occurredAt:U?new Date(U).getTime():void 0,reportedAt:Date.now(),reporter:{name:G,email:Q,department:re,phone:k||void 0},affectedSystems:x,dataTypes:X,estimatedAffectedSubjects:S?Number(S):void 0,status:ue,initialActions:p||void 0,attachments:y.map(J=>({name:J.name,type:J.type,size:J.size,file:J}))};v(F),m&&be(true);};if(V)return jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${te}`,children:[jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:u}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>be(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${de}`,children:"Report Another Breach"})]});let Be=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,A.root,f),children:[jsx("h2",{className:a("text-xl font-bold mb-2",A.title,f),children:D}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:oe}),jsx("form",{onSubmit:De,className:a("",A.form,f),children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:a("",A.fieldGroup,f),children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("block text-sm font-medium mb-1",A.label,f),children:["Breach Title/Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:w,onChange:o=>O(o.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.input,f),required:true}),N.breachTitle&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("block text-sm font-medium mb-1",A.label,f),children:["Breach Category ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"category",value:$,onChange:o=>W(o.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.select,f),required:true,children:[jsx("option",{value:"",children:"Select a category"}),h.map(o=>jsx("option",{value:o.id,children:o.name},o.id))]}),N.category&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("block text-sm font-medium mb-1",A.label,f),children:["Detailed Description ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"description",value:T,onChange:o=>Y(o.target.value),rows:4,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.textarea,f),required:true}),N.description&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:j,onChange:o=>K(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true}),N.discoveredAt&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:U,onChange:o=>Z(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:G,onChange:o=>le(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true}),N.reporterName&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:Q,onChange:o=>se(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true}),N.reporterEmail&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:re,onChange:o=>B(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true}),N.reporterDepartment&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:k,onChange:o=>R(o.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:me,onChange:xe,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true}),N.affectedSystems&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:S,onChange:o=>ce(o.target.value),placeholder:"e.g. 100",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),N.estimatedAffectedSubjects&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.estimatedAffectedSubjects})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Be.map(o=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${o.id}`,checked:X.includes(o.id),onChange:()=>fe(o.id),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),jsx("label",{htmlFor:`dataType_${o.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:o.label})]},o.id))}),N.dataTypes&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"status",value:ue,onChange:o=>i(o.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.select,f),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:p,onChange:o=>d(o.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.textarea,f)})]})]})]}),I&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxs("div",{className:"mb-4",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:["Max ",q," files, ",ae/(1024*1024),"MB each. Allowed types: ",E.join(", ")]}),jsx("input",{type:"file",onChange:Ne,multiple:true,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",accept:E.join(",")}),N.attachments&&jsx("p",{className:"mt-1 text-sm text-red-500",children:N.attachments})]}),y.length>0&&jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsx("ul",{className:"space-y-2",children:y.map((o,F)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:o.name}),jsxs("span",{className:"ml-2 text-xs text-gray-500 dark:text-gray-400",children:["(",(o.size/1024).toFixed(1)," KB)"]})]}),jsx("button",{type:"button",onClick:()=>ve(F),className:"text-red-500 hover:text-red-700",children:jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},F))})]})]}),jsxs("div",{className:a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",A.notice,f),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${de}`,A.submitButton,f),children:ne})})]})})]})};var He=({breachData:h,initialAssessment:v={},onComplete:D,title:oe="Breach Risk Assessment",description:ne="Assess the risk level of this data breach to determine notification requirements.",submitButtonText:te="Complete Assessment",className:de="",buttonClassName:A="",classNames:f={},unstyled:m=false,showBreachSummary:u=true,showNotificationRequirements:I=true})=>{let[q,ae]=useState(v.confidentialityImpact||3),[E,w]=useState(v.integrityImpact||3),[O,T]=useState(v.availabilityImpact||3),[Y,$]=useState(v.harmLikelihood||3),[W,j]=useState(v.harmSeverity||3),[K,U]=useState(v.risksToRightsAndFreedoms!==void 0?v.risksToRightsAndFreedoms:false),[Z,G]=useState(v.highRisksToRightsAndFreedoms!==void 0?v.highRisksToRightsAndFreedoms:false),[le,Q]=useState(v.justification||""),[se,re]=useState(0),[B,k]=useState("low"),[R,x]=useState(false),[C,me]=useState(0),[_,X]=useState(0),[b,S]=useState(false);useEffect(()=>{let N=q*.2+E*.1+O*.1+Y*.3+W*.3;re(Number(N.toFixed(1)));let L;N<2?L="low":N<3?L="medium":N<4?L="high":L="critical",k(L),x(K||L==="high"||L==="critical");let fe=h.discoveredAt+4320*60*1e3;me(fe);let Ne=Date.now(),ve=(fe-Ne)/(3600*1e3);X(Number(ve.toFixed(1)));},[q,E,O,Y,W,K,h.discoveredAt]);let ce=d=>new Date(d).toLocaleString(),ue=d=>{d.preventDefault();let y={id:v.id||`assessment_${Date.now()}`,breachId:h.id,assessedAt:Date.now(),assessor:v.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:q,integrityImpact:E,availabilityImpact:O,harmLikelihood:Y,harmSeverity:W,overallRiskScore:se,riskLevel:B,risksToRightsAndFreedoms:K,highRisksToRightsAndFreedoms:Z,justification:le};D(y),S(true);},i=d=>{switch(d){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},p=d=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[d]}`,f.riskBadge,m),children:d.charAt(0).toUpperCase()+d.slice(1)});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${de}`,f.root,m),children:[jsx("h2",{className:a("text-xl font-bold mb-2",f.title,m),children:oe}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ne}),u&&jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",h.title]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",ce(h.discoveredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",h.status.charAt(0).toUpperCase()+h.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]})]}),b?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",p(B)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",se," / 5"]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ce(Date.now())]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",K?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",Z?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:le})]})]}),I&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${R?_>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,f.notificationStatus,m),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),R?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${_>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",ce(C)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:_<24?"text-red-600 dark:text-red-400 font-bold":"",children:_>0?`${_} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",Z?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:R?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),Z&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>S(false),className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,f.submitButton,m),children:"Edit Assessment"})]}):jsx("form",{onSubmit:ue,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:q,onChange:d=>ae(parseInt(d.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(q)," (",q,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:E,onChange:d=>w(parseInt(d.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(E)," (",E,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:O,onChange:d=>T(parseInt(d.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(O)," (",O,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:Y,onChange:d=>$(parseInt(d.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(Y)," (",Y,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:W,onChange:d=>j(parseInt(d.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(W)," (",W,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:K,onChange:d=>U(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:Z,onChange:d=>G(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",f.riskScore,m),children:[se," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),p(B)]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"justification",value:le,onChange:d=>Q(d.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${A}`,f.submitButton,m),children:te})})]})})]})};var Ke=({breachReports:h,riskAssessments:v,regulatoryNotifications:D,onSelectBreach:oe,onRequestAssessment:ne,onRequestNotification:te,title:de="Breach Notification Manager",description:A="Manage data breach notifications and track compliance with NDPA requirements.",className:f="",buttonClassName:m="",classNames:u={},unstyled:I=false,showBreachDetails:q=true,showNotificationTimeline:ae=true,showDeadlineAlerts:E=true})=>{var ue;let[w,O]=useState(null),[T,Y]=useState(h),[$,W]=useState("all"),[j,K]=useState(""),[U,Z]=useState("discoveredAt"),[G,le]=useState("desc");useEffect(()=>{let i=[...h];if($!=="all"&&(i=i.filter(p=>p.status===$)),j){let p=j.toLowerCase();i=i.filter(d=>d.title.toLowerCase().includes(p)||d.description.toLowerCase().includes(p)||d.affectedSystems.some(y=>y.toLowerCase().includes(p))||d.dataTypes.some(y=>y.toLowerCase().includes(p)));}i.sort((p,d)=>{let y=0;switch(U){case "title":y=p.title.localeCompare(d.title);break;case "discoveredAt":y=p.discoveredAt-d.discoveredAt;break;case "status":y=p.status.localeCompare(d.status);break;case "riskLevel":let M=v.find(L=>L.breachId===p.id),V=v.find(L=>L.breachId===d.id),be=(M==null?void 0:M.riskLevel)||"unknown",N=(V==null?void 0:V.riskLevel)||"unknown";y=be.localeCompare(N);break;default:y=p.discoveredAt-d.discoveredAt;}return G==="asc"?y:-y}),Y(i);},[h,$,j,U,G,v]),useEffect(()=>{T.length>0&&!w&&O(T[0].id);},[T,w]);let Q=i=>{O(i),oe&&oe(i);},se=()=>{w&&ne&&ne(w);},re=()=>{w&&te&&te(w);},B=i=>new Date(i).toLocaleString(),k=w?h.find(i=>i.id===w):null,R=w?v.find(i=>i.breachId===w):null,x=w?D.find(i=>i.breachId===w):null,C=k?me(k,R):null;function me(i,p){let d=a$1(i,p||void 0),y=i.discoveredAt+d.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:d.notificationRequired,ndpcNotificationDeadline:y,dataSubjectNotificationRequired:(p==null?void 0:p.highRisksToRightsAndFreedoms)||false,justification:d.justification}}function _(i){let p=Date.now(),d=(i-p)/(3600*1e3);return Number(d.toFixed(1))}let X=i=>i?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[i]}`,u.statusBadge,I),children:i.charAt(0).toUpperCase()+i.slice(1)}):null,b=i=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[i]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,u.statusBadge,I),children:i.charAt(0).toUpperCase()+i.slice(1)}),S=()=>{if(!k||!C)return null;if(!C.ndpcNotificationRequired)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(x)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",B(x.sentAt),"."]})]});let i=_(C.ndpcNotificationDeadline);return i<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):i<=24?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",i," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",B(C.ndpcNotificationDeadline)," (",i," hours remaining)."]})]})},ce=()=>{if(!k)return null;let i=[{title:"Breach Discovered",date:k.discoveredAt,completed:true,description:`Breach was discovered on ${B(k.discoveredAt)}.`},{title:"Risk Assessment",date:R==null?void 0:R.assessedAt,completed:!!R,description:R?`Risk assessment completed on ${B(R.assessedAt)}.`:"Risk assessment has not been completed yet."}];return C!=null&&C.ndpcNotificationRequired&&i.push({title:"NDPC Notification",date:x==null?void 0:x.sentAt,completed:!!x,description:x?`Notification sent to the NDPC on ${B(x.sentAt)}.`:`Notification must be sent to the NDPC by ${B(C.ndpcNotificationDeadline)}.`}),C!=null&&C.dataSubjectNotificationRequired&&i.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",u.timeline,I),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:i.map((p,d)=>jsxs("li",{className:a("mb-6 ml-4",u.timelineStep,I),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${p.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",children:p.date?B(p.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:p.description})]},d))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${f}`,u.root,I),children:[jsxs("div",{className:a("",u.header,I),children:[jsx("h2",{className:a("text-xl font-bold mb-2",u.title,I),children:de}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:A})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:$,onChange:i=>W(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:U,onChange:i=>Z(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:j,onChange:i=>K(i.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),T.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",u.breachList,I),children:T.map(i=>{let p=v.find(V=>V.breachId===i.id),d=D.find(V=>V.breachId===i.id),y=me(i,p),M=null;if(y!=null&&y.ndpcNotificationRequired)if(d)M=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let V=_(y.ndpcNotificationDeadline);V<=0?M=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):V<=24?M=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):M=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else M=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${w===i.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,u.breachItem,I),onClick:()=>Q(i.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:i.title}),b(i.status)]}),jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(i.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:p&&X(p.riskLevel)}),jsx("div",{children:M})]})]},i.id)})})]}),jsx("div",{className:a("md:col-span-2",u.detailPanel,I),children:k?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:k.title}),b(k.status)]}),E&&jsx("div",{className:"mb-4",children:S()}),q&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",B(k.discoveredAt)]}),k.occurredAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",B(k.occurredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",k.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",k.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",k.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",k.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:k.description})]}),k.initialActions&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:k.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),R?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),X(R.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",R.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",R.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",R.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:R.justification})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:se,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${m}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),x?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",B(x.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",x.method.charAt(0).toUpperCase()+x.method.slice(1)]}),x.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",x.referenceNumber]}),(x.ndpcContact||x.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(ue=x.ndpcContact||x.nitdaContact)==null?void 0:ue.name]})]}):jsx("div",{children:C!=null&&C.ndpcNotificationRequired?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${m}`,children:"Generate Notification"})]}):jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),ae&&ce()]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var tt=({breachData:h,assessmentData:v,organizationInfo:D,onGenerate:oe,title:ne="Generate NDPC Notification Report",description:te="Generate a report for submission to the NDPC in compliance with the NDPA breach notification requirements.",generateButtonText:de="Generate Report",className:A="",buttonClassName:f="",classNames:m={},unstyled:u=false,showPreview:I=true,allowEditing:q=true,allowDownload:ae=true,downloadFormat:E="pdf"})=>{let[w,O]=useState(""),[T,Y]=useState(""),[$,W]=useState(""),[j,K]=useState(""),[U,Z]=useState("email"),[G,le]=useState(""),[Q,se]=useState(""),[re,B]=useState(false),[k,R]=useState(false);useEffect(()=>{if(!re){let b=C();O(b),B(true);}},[h,v,D]);let x=b=>new Date(b).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),C=()=>`
|
|
2
|
+
NDPC DATA BREACH NOTIFICATION
|
|
3
|
+
|
|
4
|
+
Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
|
|
5
|
+
|
|
6
|
+
Reference: NDPA Section 40 - Breach Notification
|
|
7
|
+
|
|
8
|
+
ORGANIZATION DETAILS
|
|
9
|
+
-------------------
|
|
10
|
+
Organization Name: ${D.name}
|
|
11
|
+
${D.registrationNumber?`Registration Number: ${D.registrationNumber}`:""}
|
|
12
|
+
Address: ${D.address}
|
|
13
|
+
${D.website?`Website: ${D.website}`:""}
|
|
14
|
+
|
|
15
|
+
DATA PROTECTION OFFICER
|
|
16
|
+
----------------------
|
|
17
|
+
Name: ${D.dpoName}
|
|
18
|
+
Email: ${D.dpoEmail}
|
|
19
|
+
${D.dpoPhone?`Phone: ${D.dpoPhone}`:""}
|
|
20
|
+
|
|
21
|
+
BREACH DETAILS
|
|
22
|
+
-------------
|
|
23
|
+
Breach Title: ${h.title}
|
|
24
|
+
Date Discovered: ${x(h.discoveredAt)}
|
|
25
|
+
${h.occurredAt?`Date Occurred: ${x(h.occurredAt)}`:"Date Occurred: Unknown"}
|
|
26
|
+
Status: ${h.status.charAt(0).toUpperCase()+h.status.slice(1)}
|
|
27
|
+
|
|
28
|
+
Description of the Breach:
|
|
29
|
+
${h.description}
|
|
30
|
+
|
|
31
|
+
Affected Systems/Applications:
|
|
32
|
+
${h.affectedSystems.join(", ")}
|
|
33
|
+
|
|
34
|
+
Types of Personal Data Involved:
|
|
35
|
+
${h.dataTypes.join(", ")}
|
|
36
|
+
|
|
37
|
+
Estimated Number of Data Subjects Affected:
|
|
38
|
+
${h.estimatedAffectedSubjects||"Unknown"}
|
|
39
|
+
|
|
40
|
+
RISK ASSESSMENT
|
|
41
|
+
--------------
|
|
42
|
+
${v?`
|
|
43
|
+
Overall Risk Level: ${v.riskLevel.charAt(0).toUpperCase()+v.riskLevel.slice(1)}
|
|
44
|
+
Risk to Rights and Freedoms of Data Subjects: ${v.risksToRightsAndFreedoms?"Yes":"No"}
|
|
45
|
+
High Risk to Rights and Freedoms of Data Subjects: ${v.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
46
|
+
|
|
47
|
+
Justification for Risk Assessment:
|
|
48
|
+
${v.justification}
|
|
49
|
+
`:"Risk assessment has not been conducted yet."}
|
|
50
|
+
|
|
51
|
+
MEASURES TAKEN
|
|
52
|
+
-------------
|
|
53
|
+
Measures taken or proposed to address the breach:
|
|
54
|
+
${h.initialActions||"To be determined"}
|
|
55
|
+
|
|
56
|
+
Measures taken or proposed to mitigate possible adverse effects:
|
|
57
|
+
[Please specify measures taken to mitigate adverse effects]
|
|
58
|
+
|
|
59
|
+
NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
|
|
60
|
+
----------------------------
|
|
61
|
+
Have data subjects been notified: [Yes/No]
|
|
62
|
+
If yes, date of notification: [Date]
|
|
63
|
+
If no, planned date of notification: [Date]
|
|
64
|
+
Reason for delay (if applicable): [Reason]
|
|
65
|
+
|
|
66
|
+
ADDITIONAL INFORMATION
|
|
67
|
+
---------------------
|
|
68
|
+
[Any additional information relevant to the breach]
|
|
69
|
+
|
|
70
|
+
This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
|
|
71
|
+
`,me=b=>{b.preventDefault();let S={id:`notification_${Date.now()}`,breachId:h.id,sentAt:Date.now(),method:U,referenceNumber:G||void 0,ndpcContact:T?{name:T,email:$,phone:j||void 0}:void 0,content:w,attachments:[]};oe(S),R(true);},_=()=>{let b=document.createElement("a"),S=new Blob([w],{type:"text/plain"});b.href=URL.createObjectURL(S),b.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(b),b.click(),document.body.removeChild(b);},X=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(S=>jsx("option",{value:S.value,children:S.label},S.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,m.root,u),children:[jsxs("div",{className:a("",m.header,u),children:[jsx("h2",{className:a("text-xl font-bold mb-2",m.title,u),children:ne}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:te})]}),k?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Method:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:U.charAt(0).toUpperCase()+U.slice(1)})]}),T&&jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Contact Name:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:T})]}),$&&jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Contact Email:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:$})]}),j&&jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Contact Phone:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:j})]})]}),jsxs("div",{children:[jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Date Generated:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:x(Date.now())})]}),jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Breach ID:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:h.id})]}),G&&jsxs("p",{className:a("text-sm",m.field,u),children:[jsx("span",{className:a("font-medium",m.fieldLabel,u),children:"Reference Number:"})," ",jsx("span",{className:a("",m.fieldValue,u),children:G})]})]})]})]}),I&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",m.reportPreview,u),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:w})})]}),jsxs("div",{className:"flex flex-wrap gap-3",children:[ae&&jsxs("button",{onClick:_,className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,m.downloadButton,u),children:["Download Report (",E.toUpperCase(),")"]}),jsx("button",{onClick:()=>R(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${f}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:me,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"method",value:U,onChange:b=>Z(b.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true,children:X()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:G,onChange:b=>le(b.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:T,onChange:b=>Y(b.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:$,onChange:b=>W(b.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:j,onChange:b=>K(b.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:Q,onChange:b=>se(b.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),q&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"reportContent",value:w,onChange:b=>O(b.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${f}`,m.generateButton,u),children:de})})]})})]})};export{$e as a,He as b,Ke as c,tt as d};//# sourceMappingURL=chunk-4RGDNVR5.mjs.map
|
|
72
|
+
//# sourceMappingURL=chunk-4RGDNVR5.mjs.map
|