@tantainnovative/ndpr-toolkit 3.13.0 → 4.1.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/CHANGELOG.md +131 -0
- package/README.md +1 -1
- package/dist/breach.d.mts +2 -7
- package/dist/breach.d.ts +2 -7
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-3APT25XO.mjs +1 -0
- package/dist/chunk-45D7AMB3.js +1 -0
- package/dist/chunk-63WM5PHZ.js +1 -0
- package/dist/chunk-65J4P5ID.js +1 -0
- package/dist/chunk-6A6VI7ZP.mjs +1 -0
- package/dist/{chunk-NB6SKG76.mjs → chunk-6H6IXTHA.mjs} +1 -1
- package/dist/chunk-6OPGI27L.mjs +1 -0
- package/dist/{chunk-3XU6FL2I.js → chunk-6YFPDGNB.js} +1 -1
- package/dist/{chunk-IHNAFXDM.mjs → chunk-7Z7NURIA.mjs} +1 -1
- package/dist/chunk-D2UWB5OI.js +2 -0
- package/dist/chunk-D3HHDWBR.js +1 -0
- package/dist/chunk-DK7P5JEG.mjs +2 -0
- package/dist/chunk-DSIIEUAD.mjs +1 -0
- package/dist/chunk-H2FDWK4F.js +6 -0
- package/dist/chunk-HLFS3NXG.js +1 -0
- package/dist/chunk-JGY65SHX.mjs +1 -0
- package/dist/chunk-NI54X543.mjs +1 -0
- package/dist/chunk-O4ATGGVK.js +1 -0
- package/dist/chunk-P5MPUC5F.js +1 -0
- package/dist/{chunk-BGV2AKT7.mjs → chunk-PSPYIRIF.mjs} +1 -1
- package/dist/{chunk-HOAC5VUF.js → chunk-ROOUYQD4.js} +1 -1
- package/dist/{chunk-WMISQDSV.js → chunk-UJGNW6CH.js} +1 -1
- package/dist/chunk-UTXDZDYF.mjs +6 -0
- package/dist/chunk-W6VVLHRQ.mjs +1 -0
- package/dist/consent.d.mts +2 -0
- package/dist/consent.d.ts +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +13 -0
- package/dist/core.d.ts +13 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +24 -0
- package/dist/cross-border.d.ts +24 -0
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dsr.d.mts +15 -3
- package/dist/dsr.d.ts +15 -3
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +34 -4
- package/dist/headless.d.ts +34 -4
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +34 -4
- package/dist/hooks.d.ts +34 -4
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +229 -11
- package/dist/index.d.ts +229 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +21 -0
- package/dist/lawful-basis.d.ts +21 -0
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/presets-consent.d.mts +5 -1
- package/dist/presets-consent.d.ts +5 -1
- package/dist/presets-consent.js +1 -1
- package/dist/presets-consent.mjs +1 -1
- package/dist/presets.d.mts +103 -22
- package/dist/presets.d.ts +103 -22
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa-lite.d.mts +13 -1
- package/dist/ropa-lite.d.ts +13 -1
- package/dist/ropa-lite.js +1 -1
- package/dist/ropa-lite.mjs +1 -1
- package/dist/ropa.d.mts +43 -1
- package/dist/ropa.d.ts +43 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +135 -0
- package/dist/server.d.ts +135 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/styles.css +18 -16
- package/package.json +3 -3
- package/dist/chunk-42JPSNVV.mjs +0 -6
- package/dist/chunk-737EMUUC.mjs +0 -1
- package/dist/chunk-7FXNGGMO.js +0 -1
- package/dist/chunk-B46SJB5V.js +0 -1
- package/dist/chunk-BL5W472Q.js +0 -1
- package/dist/chunk-NUIRMJKQ.mjs +0 -2
- package/dist/chunk-O2WEABB3.js +0 -1
- package/dist/chunk-OZHUINWS.js +0 -1
- package/dist/chunk-PJNKQPQP.mjs +0 -1
- package/dist/chunk-PXDSPF5B.js +0 -2
- package/dist/chunk-QGUOFGVJ.js +0 -2
- package/dist/chunk-RBKFNCGO.mjs +0 -1
- package/dist/chunk-VPNK7OID.mjs +0 -1
- package/dist/chunk-WHQ4PEYS.mjs +0 -2
- package/dist/chunk-WKUC65HL.mjs +0 -1
- package/dist/chunk-XYGGUGTO.js +0 -6
- package/dist/chunk-Z2M5VJX2.mjs +0 -1
- package/dist/chunk-ZM5DLFCZ.js +0 -1
package/dist/presets.d.mts
CHANGED
|
@@ -444,6 +444,87 @@ declare interface DPIAQuestionnaireClassNames {
|
|
|
444
444
|
progressBar?: string;
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Represents the result of a completed DPIA
|
|
449
|
+
*/
|
|
450
|
+
declare interface DPIAResult {
|
|
451
|
+
/** Unique identifier for the DPIA */
|
|
452
|
+
id: string;
|
|
453
|
+
/** Title of the DPIA */
|
|
454
|
+
title: string;
|
|
455
|
+
/** Description of the processing activity being assessed */
|
|
456
|
+
processingDescription: string;
|
|
457
|
+
/** Timestamp when the DPIA was started */
|
|
458
|
+
startedAt: number;
|
|
459
|
+
/** Timestamp when the DPIA was completed */
|
|
460
|
+
completedAt?: number;
|
|
461
|
+
/** Person responsible for conducting the DPIA */
|
|
462
|
+
assessor: {
|
|
463
|
+
name: string;
|
|
464
|
+
role: string;
|
|
465
|
+
email: string;
|
|
466
|
+
};
|
|
467
|
+
/** Answers to all questions in the DPIA */
|
|
468
|
+
answers: Record<string, string | number | boolean | string[]>;
|
|
469
|
+
/** Risks identified in the DPIA */
|
|
470
|
+
risks: DPIARisk[];
|
|
471
|
+
/** Overall risk level of the processing activity */
|
|
472
|
+
overallRiskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
473
|
+
/** Whether the DPIA concluded that the processing can proceed */
|
|
474
|
+
canProceed: boolean;
|
|
475
|
+
/** Reasons why the processing can or cannot proceed */
|
|
476
|
+
conclusion: string;
|
|
477
|
+
/** Recommendations for the processing activity */
|
|
478
|
+
recommendations?: string[];
|
|
479
|
+
/** Next review date for the DPIA */
|
|
480
|
+
reviewDate?: number;
|
|
481
|
+
/** Version of the DPIA questionnaire used */
|
|
482
|
+
version: string;
|
|
483
|
+
/**
|
|
484
|
+
* Whether prior consultation with NDPC is required
|
|
485
|
+
* Per NDPA Section 28(2), consultation is required when DPIA indicates high residual risk
|
|
486
|
+
*/
|
|
487
|
+
ndpcConsultationRequired?: boolean;
|
|
488
|
+
/** Date when NDPC consultation was initiated */
|
|
489
|
+
ndpcConsultationDate?: number;
|
|
490
|
+
/** Reference number from NDPC consultation */
|
|
491
|
+
ndpcConsultationReference?: string;
|
|
492
|
+
/**
|
|
493
|
+
* The lawful basis for the processing activity being assessed
|
|
494
|
+
*/
|
|
495
|
+
lawfulBasis?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Whether this DPIA involves cross-border data transfers
|
|
498
|
+
*/
|
|
499
|
+
involvesCrossBorderTransfer?: boolean;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Represents a risk identified in the DPIA
|
|
504
|
+
*/
|
|
505
|
+
declare interface DPIARisk {
|
|
506
|
+
/** Unique identifier for the risk */
|
|
507
|
+
id: string;
|
|
508
|
+
/** Description of the risk */
|
|
509
|
+
description: string;
|
|
510
|
+
/** Likelihood of the risk occurring (1-5) */
|
|
511
|
+
likelihood: number;
|
|
512
|
+
/** Impact if the risk occurs (1-5) */
|
|
513
|
+
impact: number;
|
|
514
|
+
/** Overall risk score (likelihood * impact) */
|
|
515
|
+
score: number;
|
|
516
|
+
/** Risk level based on the score */
|
|
517
|
+
level: 'low' | 'medium' | 'high' | 'critical';
|
|
518
|
+
/** Measures to mitigate the risk */
|
|
519
|
+
mitigationMeasures?: string[];
|
|
520
|
+
/** Whether the risk has been mitigated */
|
|
521
|
+
mitigated: boolean;
|
|
522
|
+
/** Residual risk score after mitigation */
|
|
523
|
+
residualScore?: number;
|
|
524
|
+
/** Questions that identified this risk */
|
|
525
|
+
relatedQuestionIds: string[];
|
|
526
|
+
}
|
|
527
|
+
|
|
447
528
|
/**
|
|
448
529
|
* Represents a section in the DPIA questionnaire
|
|
449
530
|
*/
|
|
@@ -568,13 +649,7 @@ export declare interface NDPRBreachReportProps {
|
|
|
568
649
|
*/
|
|
569
650
|
copy?: NDPRBreachReportCopy;
|
|
570
651
|
/**
|
|
571
|
-
*
|
|
572
|
-
* If both are set, `copy.description` wins.
|
|
573
|
-
*/
|
|
574
|
-
formDescription?: string;
|
|
575
|
-
/**
|
|
576
|
-
* Body paragraph under the heading. Canonical name in 3.13+. Takes
|
|
577
|
-
* precedence over `formDescription`.
|
|
652
|
+
* Body paragraph under the heading.
|
|
578
653
|
*/
|
|
579
654
|
description?: string;
|
|
580
655
|
/**
|
|
@@ -663,7 +738,11 @@ export declare interface NDPRConsentCopy {
|
|
|
663
738
|
}
|
|
664
739
|
|
|
665
740
|
export declare interface NDPRConsentProps {
|
|
666
|
-
|
|
741
|
+
/**
|
|
742
|
+
* Consent categories to present. When omitted, the toolkit's
|
|
743
|
+
* default options are used. (4.0: legacy `extraOptions` was removed —
|
|
744
|
+
* pass the full options array here instead.)
|
|
745
|
+
*/
|
|
667
746
|
options?: ConsentOption[];
|
|
668
747
|
adapter?: StorageAdapter<ConsentSettings>;
|
|
669
748
|
position?: 'top' | 'bottom' | 'center' | 'inline';
|
|
@@ -693,15 +772,10 @@ export declare interface NDPRCrossBorderCopy {
|
|
|
693
772
|
|
|
694
773
|
export declare interface NDPRCrossBorderProps {
|
|
695
774
|
/**
|
|
696
|
-
* Initial transfers to seed the manager.
|
|
697
|
-
*
|
|
775
|
+
* Initial transfers to seed the manager. (4.0: the legacy
|
|
776
|
+
* `initialTransfers` alias was removed.)
|
|
698
777
|
*/
|
|
699
778
|
initialData?: CrossBorderTransfer[];
|
|
700
|
-
/**
|
|
701
|
-
* @deprecated Renamed to `initialData`. Will be removed in 4.0.
|
|
702
|
-
* If both are set, `initialData` wins.
|
|
703
|
-
*/
|
|
704
|
-
initialTransfers?: CrossBorderTransfer[];
|
|
705
779
|
adapter?: StorageAdapter<CrossBorderTransfer[]>;
|
|
706
780
|
classNames?: CrossBorderTransferManagerClassNames;
|
|
707
781
|
unstyled?: boolean;
|
|
@@ -772,7 +846,19 @@ export declare interface NDPRDPIAProps {
|
|
|
772
846
|
adapter?: StorageAdapter<DPIAAnswerMap>;
|
|
773
847
|
classNames?: DPIAQuestionnaireClassNames;
|
|
774
848
|
unstyled?: boolean;
|
|
849
|
+
/**
|
|
850
|
+
* Fired when the questionnaire is submitted, with the raw answer map.
|
|
851
|
+
* @deprecated Use `onResult` (4.1+) to receive a full `DPIAResult`
|
|
852
|
+
* containing the computed risk score. `onComplete` will be removed in
|
|
853
|
+
* 5.0.
|
|
854
|
+
*/
|
|
775
855
|
onComplete?: (answers: DPIAAnswerMap) => void;
|
|
856
|
+
/**
|
|
857
|
+
* Fired when the questionnaire is submitted, with the full `DPIAResult`
|
|
858
|
+
* including risks, overall risk level, conclusion, and recommendations.
|
|
859
|
+
* Replaces `onComplete` from 4.1+.
|
|
860
|
+
*/
|
|
861
|
+
onResult?: (result: DPIAResult) => void;
|
|
776
862
|
/**
|
|
777
863
|
* UX copy overrides — see {@link NDPRDPIACopy}.
|
|
778
864
|
*/
|
|
@@ -839,15 +925,10 @@ export declare interface NDPRLawfulBasisCopy {
|
|
|
839
925
|
|
|
840
926
|
export declare interface NDPRLawfulBasisProps {
|
|
841
927
|
/**
|
|
842
|
-
* Initial activities to seed the tracker.
|
|
843
|
-
*
|
|
928
|
+
* Initial activities to seed the tracker. (4.0: the legacy
|
|
929
|
+
* `initialActivities` alias was removed.)
|
|
844
930
|
*/
|
|
845
931
|
initialData?: ProcessingActivity[];
|
|
846
|
-
/**
|
|
847
|
-
* @deprecated Renamed to `initialData`. Will be removed in 4.0.
|
|
848
|
-
* If both are set, `initialData` wins.
|
|
849
|
-
*/
|
|
850
|
-
initialActivities?: ProcessingActivity[];
|
|
851
932
|
adapter?: StorageAdapter<ProcessingActivity[]>;
|
|
852
933
|
classNames?: LawfulBasisTrackerClassNames;
|
|
853
934
|
unstyled?: boolean;
|
package/dist/presets.d.ts
CHANGED
|
@@ -444,6 +444,87 @@ declare interface DPIAQuestionnaireClassNames {
|
|
|
444
444
|
progressBar?: string;
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Represents the result of a completed DPIA
|
|
449
|
+
*/
|
|
450
|
+
declare interface DPIAResult {
|
|
451
|
+
/** Unique identifier for the DPIA */
|
|
452
|
+
id: string;
|
|
453
|
+
/** Title of the DPIA */
|
|
454
|
+
title: string;
|
|
455
|
+
/** Description of the processing activity being assessed */
|
|
456
|
+
processingDescription: string;
|
|
457
|
+
/** Timestamp when the DPIA was started */
|
|
458
|
+
startedAt: number;
|
|
459
|
+
/** Timestamp when the DPIA was completed */
|
|
460
|
+
completedAt?: number;
|
|
461
|
+
/** Person responsible for conducting the DPIA */
|
|
462
|
+
assessor: {
|
|
463
|
+
name: string;
|
|
464
|
+
role: string;
|
|
465
|
+
email: string;
|
|
466
|
+
};
|
|
467
|
+
/** Answers to all questions in the DPIA */
|
|
468
|
+
answers: Record<string, string | number | boolean | string[]>;
|
|
469
|
+
/** Risks identified in the DPIA */
|
|
470
|
+
risks: DPIARisk[];
|
|
471
|
+
/** Overall risk level of the processing activity */
|
|
472
|
+
overallRiskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
473
|
+
/** Whether the DPIA concluded that the processing can proceed */
|
|
474
|
+
canProceed: boolean;
|
|
475
|
+
/** Reasons why the processing can or cannot proceed */
|
|
476
|
+
conclusion: string;
|
|
477
|
+
/** Recommendations for the processing activity */
|
|
478
|
+
recommendations?: string[];
|
|
479
|
+
/** Next review date for the DPIA */
|
|
480
|
+
reviewDate?: number;
|
|
481
|
+
/** Version of the DPIA questionnaire used */
|
|
482
|
+
version: string;
|
|
483
|
+
/**
|
|
484
|
+
* Whether prior consultation with NDPC is required
|
|
485
|
+
* Per NDPA Section 28(2), consultation is required when DPIA indicates high residual risk
|
|
486
|
+
*/
|
|
487
|
+
ndpcConsultationRequired?: boolean;
|
|
488
|
+
/** Date when NDPC consultation was initiated */
|
|
489
|
+
ndpcConsultationDate?: number;
|
|
490
|
+
/** Reference number from NDPC consultation */
|
|
491
|
+
ndpcConsultationReference?: string;
|
|
492
|
+
/**
|
|
493
|
+
* The lawful basis for the processing activity being assessed
|
|
494
|
+
*/
|
|
495
|
+
lawfulBasis?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Whether this DPIA involves cross-border data transfers
|
|
498
|
+
*/
|
|
499
|
+
involvesCrossBorderTransfer?: boolean;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Represents a risk identified in the DPIA
|
|
504
|
+
*/
|
|
505
|
+
declare interface DPIARisk {
|
|
506
|
+
/** Unique identifier for the risk */
|
|
507
|
+
id: string;
|
|
508
|
+
/** Description of the risk */
|
|
509
|
+
description: string;
|
|
510
|
+
/** Likelihood of the risk occurring (1-5) */
|
|
511
|
+
likelihood: number;
|
|
512
|
+
/** Impact if the risk occurs (1-5) */
|
|
513
|
+
impact: number;
|
|
514
|
+
/** Overall risk score (likelihood * impact) */
|
|
515
|
+
score: number;
|
|
516
|
+
/** Risk level based on the score */
|
|
517
|
+
level: 'low' | 'medium' | 'high' | 'critical';
|
|
518
|
+
/** Measures to mitigate the risk */
|
|
519
|
+
mitigationMeasures?: string[];
|
|
520
|
+
/** Whether the risk has been mitigated */
|
|
521
|
+
mitigated: boolean;
|
|
522
|
+
/** Residual risk score after mitigation */
|
|
523
|
+
residualScore?: number;
|
|
524
|
+
/** Questions that identified this risk */
|
|
525
|
+
relatedQuestionIds: string[];
|
|
526
|
+
}
|
|
527
|
+
|
|
447
528
|
/**
|
|
448
529
|
* Represents a section in the DPIA questionnaire
|
|
449
530
|
*/
|
|
@@ -568,13 +649,7 @@ export declare interface NDPRBreachReportProps {
|
|
|
568
649
|
*/
|
|
569
650
|
copy?: NDPRBreachReportCopy;
|
|
570
651
|
/**
|
|
571
|
-
*
|
|
572
|
-
* If both are set, `copy.description` wins.
|
|
573
|
-
*/
|
|
574
|
-
formDescription?: string;
|
|
575
|
-
/**
|
|
576
|
-
* Body paragraph under the heading. Canonical name in 3.13+. Takes
|
|
577
|
-
* precedence over `formDescription`.
|
|
652
|
+
* Body paragraph under the heading.
|
|
578
653
|
*/
|
|
579
654
|
description?: string;
|
|
580
655
|
/**
|
|
@@ -663,7 +738,11 @@ export declare interface NDPRConsentCopy {
|
|
|
663
738
|
}
|
|
664
739
|
|
|
665
740
|
export declare interface NDPRConsentProps {
|
|
666
|
-
|
|
741
|
+
/**
|
|
742
|
+
* Consent categories to present. When omitted, the toolkit's
|
|
743
|
+
* default options are used. (4.0: legacy `extraOptions` was removed —
|
|
744
|
+
* pass the full options array here instead.)
|
|
745
|
+
*/
|
|
667
746
|
options?: ConsentOption[];
|
|
668
747
|
adapter?: StorageAdapter<ConsentSettings>;
|
|
669
748
|
position?: 'top' | 'bottom' | 'center' | 'inline';
|
|
@@ -693,15 +772,10 @@ export declare interface NDPRCrossBorderCopy {
|
|
|
693
772
|
|
|
694
773
|
export declare interface NDPRCrossBorderProps {
|
|
695
774
|
/**
|
|
696
|
-
* Initial transfers to seed the manager.
|
|
697
|
-
*
|
|
775
|
+
* Initial transfers to seed the manager. (4.0: the legacy
|
|
776
|
+
* `initialTransfers` alias was removed.)
|
|
698
777
|
*/
|
|
699
778
|
initialData?: CrossBorderTransfer[];
|
|
700
|
-
/**
|
|
701
|
-
* @deprecated Renamed to `initialData`. Will be removed in 4.0.
|
|
702
|
-
* If both are set, `initialData` wins.
|
|
703
|
-
*/
|
|
704
|
-
initialTransfers?: CrossBorderTransfer[];
|
|
705
779
|
adapter?: StorageAdapter<CrossBorderTransfer[]>;
|
|
706
780
|
classNames?: CrossBorderTransferManagerClassNames;
|
|
707
781
|
unstyled?: boolean;
|
|
@@ -772,7 +846,19 @@ export declare interface NDPRDPIAProps {
|
|
|
772
846
|
adapter?: StorageAdapter<DPIAAnswerMap>;
|
|
773
847
|
classNames?: DPIAQuestionnaireClassNames;
|
|
774
848
|
unstyled?: boolean;
|
|
849
|
+
/**
|
|
850
|
+
* Fired when the questionnaire is submitted, with the raw answer map.
|
|
851
|
+
* @deprecated Use `onResult` (4.1+) to receive a full `DPIAResult`
|
|
852
|
+
* containing the computed risk score. `onComplete` will be removed in
|
|
853
|
+
* 5.0.
|
|
854
|
+
*/
|
|
775
855
|
onComplete?: (answers: DPIAAnswerMap) => void;
|
|
856
|
+
/**
|
|
857
|
+
* Fired when the questionnaire is submitted, with the full `DPIAResult`
|
|
858
|
+
* including risks, overall risk level, conclusion, and recommendations.
|
|
859
|
+
* Replaces `onComplete` from 4.1+.
|
|
860
|
+
*/
|
|
861
|
+
onResult?: (result: DPIAResult) => void;
|
|
776
862
|
/**
|
|
777
863
|
* UX copy overrides — see {@link NDPRDPIACopy}.
|
|
778
864
|
*/
|
|
@@ -839,15 +925,10 @@ export declare interface NDPRLawfulBasisCopy {
|
|
|
839
925
|
|
|
840
926
|
export declare interface NDPRLawfulBasisProps {
|
|
841
927
|
/**
|
|
842
|
-
* Initial activities to seed the tracker.
|
|
843
|
-
*
|
|
928
|
+
* Initial activities to seed the tracker. (4.0: the legacy
|
|
929
|
+
* `initialActivities` alias was removed.)
|
|
844
930
|
*/
|
|
845
931
|
initialData?: ProcessingActivity[];
|
|
846
|
-
/**
|
|
847
|
-
* @deprecated Renamed to `initialData`. Will be removed in 4.0.
|
|
848
|
-
* If both are set, `initialData` wins.
|
|
849
|
-
*/
|
|
850
|
-
initialActivities?: ProcessingActivity[];
|
|
851
932
|
adapter?: StorageAdapter<ProcessingActivity[]>;
|
|
852
933
|
classNames?: LawfulBasisTrackerClassNames;
|
|
853
934
|
unstyled?: boolean;
|
package/dist/presets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkZM5DLFCZ_js=require('./chunk-ZM5DLFCZ.js'),chunkKH3EQJQE_js=require('./chunk-KH3EQJQE.js'),chunk3E4IH7CE_js=require('./chunk-3E4IH7CE.js');require('./chunk-F5MGMNQF.js');var chunkNUWVPRNI_js=require('./chunk-NUWVPRNI.js'),chunkQGUOFGVJ_js=require('./chunk-QGUOFGVJ.js'),chunk7FXNGGMO_js=require('./chunk-7FXNGGMO.js'),chunkXYGGUGTO_js=require('./chunk-XYGGUGTO.js'),chunkBL5W472Q_js=require('./chunk-BL5W472Q.js');require('./chunk-NUOHT3LO.js'),require('./chunk-QHW4UKGJ.js'),require('./chunk-JS7SYL5P.js');var chunkRDALAH3Y_js=require('./chunk-RDALAH3Y.js');require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js'),require('./chunk-ZD2W3YU2.js'),require('./chunk-L2VO3MEJ.js'),require('./chunk-UZNWXJ2W.js'),require('./chunk-UXUMYP4L.js');var chunkWCTFED27_js=require('./chunk-WCTFED27.js');require('./chunk-ZVOIR4QH.js'),require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var J=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],Q=({categories:o=J,adapter:c,classNames:i,unstyled:A,onSubmit:h=()=>{},copy:e,formDescription:P,description:n,submitTo:l,submitOptions:s,onSubmitError:p,onSubmitSuccess:m})=>{var t,r;let f=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV!=="production"&&P!==void 0&&n===void 0&&!f.current&&(f.current=true,console.warn("[ndpr-toolkit/breach] NDPRBreachReportProps.formDescription is deprecated; rename to 'description'. Will be removed in 4.0."));},[P,n]);let R=d=>chunkRFPLZDIO_js.d(null,null,function*(){var u,D;if(l){let C=typeof(s==null?void 0:s.headers)=="function"?s.headers():(u=s==null?void 0:s.headers)!=null?u:{};try{let N=yield fetch(l,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},C),credentials:(D=s==null?void 0:s.credentials)!=null?D:"same-origin",body:JSON.stringify(d)});if(!N.ok)p==null||p({response:N});else if(m){let B;try{let y=yield N.clone().text();y&&(B=JSON.parse(y));}catch(y){}m({response:N,data:d,body:B});}}catch(N){p==null||p({error:N});}}else c&&c.save(d);h(d);}),g=(r=(t=e==null?void 0:e.description)!=null?t:n)!=null?r:P;return jsxRuntime.jsx(chunkQGUOFGVJ_js.a,{categories:o,onSubmit:R,classNames:i,unstyled:A,title:e==null?void 0:e.title,formDescription:g,submitButtonText:e==null?void 0:e.submitButton})};var G=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}],H=({sections:o=G,adapter:c,classNames:i,unstyled:A,onComplete:h=()=>{},copy:e,submitTo:P,submitOptions:n,onSubmitError:l,onSubmitSuccess:s})=>{let[p,m]=react.useState({}),[f,R]=react.useState(0),g=(D,C)=>{m(N=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},N),{[D]:C}));},t=D=>chunkRFPLZDIO_js.d(null,null,function*(){var C,N;if(P){let B=typeof(n==null?void 0:n.headers)=="function"?n.headers():(C=n==null?void 0:n.headers)!=null?C:{};try{let y=yield fetch(P,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},B),credentials:(N=n==null?void 0:n.credentials)!=null?N:"same-origin",body:JSON.stringify(D)});if(!y.ok)l==null||l({response:y});else if(s){let b;try{let x=yield y.clone().text();x&&(b=JSON.parse(x));}catch(x){}s({response:y,data:D,body:b});}}catch(y){l==null||l({error:y});}}else c&&c.save(D);h(D);}),r=()=>{f<o.length-1?R(D=>D+1):t(p);},d=()=>{f>0&&R(D=>D-1);},u=Math.round((f+1)/o.length*100);return jsxRuntime.jsx(chunkWCTFED27_js.a,{sections:o,answers:p,onAnswerChange:g,currentSectionIndex:f,onNextSection:r,onPrevSection:d,progress:u,classNames:i,unstyled:A,submitButtonText:e==null?void 0:e.submitButton,nextButtonText:e==null?void 0:e.nextButton,prevButtonText:e==null?void 0:e.prevButton})};var Z=({initialData:o,initialActivities:c,adapter:i,classNames:A,unstyled:h,copy:e})=>{var g;let P=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV!=="production"&&c!==void 0&&o===void 0&&!P.current&&(P.current=true,console.warn("[ndpr-toolkit/lawful-basis] NDPRLawfulBasisProps.initialActivities is deprecated; rename to 'initialData'. Will be removed in 4.0."));},[c,o]);let n=(g=o!=null?o:c)!=null?g:[],[l,s]=react.useState(()=>{if(i){let t=i.load();if(t&&!(t instanceof Promise))return t}return n});react.useEffect(()=>{if(!i)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let r=yield i.load();!t&&r&&s(r);}catch(r){}}),()=>{t=true;}},[i]);let p=t=>{i&&i.save(t);};return jsxRuntime.jsx(chunk7FXNGGMO_js.a,{activities:l,onAddActivity:t=>{let r=Date.now(),d=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`activity-${r}`,createdAt:r,updatedAt:r}),u=[...l,d];s(u),p(u);},onUpdateActivity:(t,r)=>{let d=l.map(u=>u.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},u),r),{updatedAt:Date.now()}):u);s(d),p(d);},onArchiveActivity:t=>{let r=l.map(d=>d.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},d),{status:"inactive",updatedAt:Date.now()}):d);s(r),p(r);},classNames:A,unstyled:h,title:e==null?void 0:e.title,description:e==null?void 0:e.description})};var se=({initialData:o,initialTransfers:c,adapter:i,classNames:A,unstyled:h,copy:e})=>{var g;let P=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV!=="production"&&c!==void 0&&o===void 0&&!P.current&&(P.current=true,console.warn("[ndpr-toolkit/cross-border] NDPRCrossBorderProps.initialTransfers is deprecated; rename to 'initialData'. Will be removed in 4.0."));},[c,o]);let n=(g=o!=null?o:c)!=null?g:[],[l,s]=react.useState(()=>{if(i){let t=i.load();if(t&&!(t instanceof Promise))return t}return n});react.useEffect(()=>{if(!i)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let r=yield i.load();!t&&r&&s(r);}catch(r){}}),()=>{t=true;}},[i]);let p=t=>{i&&i.save(t);};return jsxRuntime.jsx(chunkXYGGUGTO_js.a,{transfers:l,onAddTransfer:t=>{let r=Date.now(),d=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`transfer-${r}`,createdAt:r,updatedAt:r}),u=[...l,d];s(u),p(u);},onUpdateTransfer:(t,r)=>{let d=l.map(u=>u.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},u),r),{updatedAt:Date.now()}):u);s(d),p(d);},onRemoveTransfer:t=>{let r=l.filter(d=>d.id!==t);s(r),p(r);},classNames:A,unstyled:h,title:e==null?void 0:e.title,description:e==null?void 0:e.description})};var ne={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},de=({initialData:o,adapter:c,classNames:i,unstyled:A,copy:h})=>{let[e,P]=react.useState(o!=null?o:ne);react.useEffect(()=>{if(!c)return;let m=false;return chunkRFPLZDIO_js.d(null,null,function*(){let R=yield c.load();!m&&R&&P(R);}),()=>{m=true;}},[c]);let n=m=>{c&&c.save(m);};return jsxRuntime.jsx(chunkBL5W472Q_js.a,{ropa:e,onAddRecord:m=>{let f=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{records:[...e.records,m],lastUpdated:Date.now()});P(f),n(f);},onUpdateRecord:(m,f)=>{let R=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{records:e.records.map(g=>g.id===m?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),f),{updatedAt:Date.now()}):g),lastUpdated:Date.now()});P(R),n(R);},onArchiveRecord:m=>{let f=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{records:e.records.map(R=>R.id===m?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},R),{status:"archived",updatedAt:Date.now()}):R),lastUpdated:Date.now()});P(f),n(f);},classNames:i,unstyled:A,title:h==null?void 0:h.title,description:h==null?void 0:h.description})};var le=i=>{var A=i,{input:o}=A,c=chunkRFPLZDIO_js.c(A,["input"]);let h=chunkRDALAH3Y_js.a(o);return jsxRuntime.jsx(chunkNUWVPRNI_js.a,chunkRFPLZDIO_js.a({report:h},c))};Object.defineProperty(exports,"NDPRConsent",{enumerable:true,get:function(){return chunkZM5DLFCZ_js.a}});Object.defineProperty(exports,"NDPRSubjectRights",{enumerable:true,get:function(){return chunkKH3EQJQE_js.a}});Object.defineProperty(exports,"NDPRPrivacyPolicy",{enumerable:true,get:function(){return chunk3E4IH7CE_js.a}});exports.NDPRBreachReport=Q;exports.NDPRComplianceDashboard=le;exports.NDPRCrossBorder=se;exports.NDPRDPIA=H;exports.NDPRLawfulBasis=Z;exports.NDPRROPA=de;
|
|
2
|
+
'use strict';var chunk63WM5PHZ_js=require('./chunk-63WM5PHZ.js'),chunkKH3EQJQE_js=require('./chunk-KH3EQJQE.js'),chunk3E4IH7CE_js=require('./chunk-3E4IH7CE.js');require('./chunk-F5MGMNQF.js');var chunkNUWVPRNI_js=require('./chunk-NUWVPRNI.js'),chunkD2UWB5OI_js=require('./chunk-D2UWB5OI.js'),chunk65J4P5ID_js=require('./chunk-65J4P5ID.js'),chunkH2FDWK4F_js=require('./chunk-H2FDWK4F.js'),chunkHLFS3NXG_js=require('./chunk-HLFS3NXG.js');require('./chunk-NUOHT3LO.js'),require('./chunk-QHW4UKGJ.js'),require('./chunk-JS7SYL5P.js');var chunkRDALAH3Y_js=require('./chunk-RDALAH3Y.js');require('./chunk-6LJHLE6G.js'),require('./chunk-YFBDJ4FH.js'),require('./chunk-WZYCBW2R.js'),require('./chunk-4CVBQC66.js'),require('./chunk-ZD2W3YU2.js'),require('./chunk-L2VO3MEJ.js'),require('./chunk-UZNWXJ2W.js'),require('./chunk-UXUMYP4L.js');var chunkWCTFED27_js=require('./chunk-WCTFED27.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js');require('./chunk-ZVOIR4QH.js'),require('./chunk-AME4HJR4.js'),require('./chunk-YDKWD6MQ.js'),require('./chunk-TTMGFC6C.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),jsxRuntime=require('react/jsx-runtime'),react=require('react');var $=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],j=({categories:u=$,adapter:a,classNames:P,unstyled:h,onSubmit:r=()=>{},copy:o,description:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{var e;let c=d=>chunkRFPLZDIO_js.d(null,null,function*(){var f,N;if(i){let x=typeof(s==null?void 0:s.headers)=="function"?s.headers():(f=s==null?void 0:s.headers)!=null?f:{};try{let A=yield fetch(i,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},x),credentials:(N=s==null?void 0:s.credentials)!=null?N:"same-origin",body:JSON.stringify(d)});if(!A.ok)l==null||l({response:A});else if(R){let w;try{let y=yield A.clone().text();y&&(w=JSON.parse(y));}catch(y){}R({response:A,data:d,body:w});}}catch(A){l==null||l({error:A});}}else a&&a.save(d);r(d);}),t=(e=o==null?void 0:o.description)!=null?e:n;return jsxRuntime.jsx(chunkD2UWB5OI_js.a,{categories:u,onSubmit:c,classNames:P,unstyled:h,title:o==null?void 0:o.title,description:t,submitButtonText:o==null?void 0:o.submitButton})};var H=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function K(u,a){let P=[],h=i=>{let s=a[i.id];if(s!=null&&i.riskLevel)if(["select","radio","checkbox"].includes(i.type)&&i.options)(Array.isArray(s)?s:[s]).forEach(R=>{var t;let c=(t=i.options)==null?void 0:t.find(e=>e.value===R);if(c!=null&&c.riskLevel){let e=c.riskLevel,d=e==="low"?1:e==="medium"?3:5,f=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${i.text} - ${c.label}`,likelihood:d,impact:f,score:d*f,level:e,mitigated:false,relatedQuestionIds:[i.id]});}});else {let l=i.riskLevel,R=l==="low"?1:l==="medium"?3:5,c=l==="low"?1:l==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:i.text,likelihood:R,impact:c,score:R*c,level:l,mitigated:false,relatedQuestionIds:[i.id]});}};u.forEach(i=>i.questions.forEach(h));let r=Date.now(),o={id:`dpia_${r}`,title:"",processingDescription:"",startedAt:r,completedAt:r,assessor:{name:"",role:"",email:""},answers:a,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},n=chunkTQZWJGJ2_js.a(o);return o.overallRiskLevel=n.overallRiskLevel,o.canProceed=n.canProceed,o.conclusion=n.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",o.recommendations=n.recommendations,o}var X=({sections:u=H,adapter:a,classNames:P,unstyled:h,onComplete:r,onResult:o,copy:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{let[c,t]=react.useState({}),[e,d]=react.useState(0),f=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV==="production"||f.current||r!==void 0&&o===void 0&&(f.current=true,console.warn("[ndpr-toolkit/dpia] `onComplete` is deprecated; use `onResult` to receive the full DPIAResult. Will be removed in 5.0."));},[r,o]);let N=(v,C)=>{t(B=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},B),{[v]:C}));},x=v=>chunkRFPLZDIO_js.d(null,null,function*(){var C,B;if(i){let Q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(C=s==null?void 0:s.headers)!=null?C:{};try{let D=yield fetch(i,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},Q),credentials:(B=s==null?void 0:s.credentials)!=null?B:"same-origin",body:JSON.stringify(v)});if(!D.ok)l==null||l({response:D});else if(R){let I;try{let k=yield D.clone().text();k&&(I=JSON.parse(k));}catch(k){}R({response:D,data:v,body:I});}}catch(D){l==null||l({error:D});}}else a&&a.save(v);o&&o(K(u,v)),r==null||r(v);}),A=()=>{e<u.length-1?d(v=>v+1):x(c);},w=()=>{e>0&&d(v=>v-1);},y=Math.round((e+1)/u.length*100);return jsxRuntime.jsx(chunkWCTFED27_js.a,{sections:u,answers:c,onAnswerChange:N,currentSectionIndex:e,onNextSection:A,onPrevSection:w,progress:y,classNames:P,unstyled:h,submitButtonText:n==null?void 0:n.submitButton,nextButtonText:n==null?void 0:n.nextButton,prevButtonText:n==null?void 0:n.prevButton})};var te=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=react.useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});react.useEffect(()=>{if(!a)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsxRuntime.jsx(chunk65J4P5ID_js.a,{activities:n,onAdd:t=>{let e=Date.now(),d=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.map(d=>d.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},d),{status:"inactive",updatedAt:Date.now()}):d);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ae=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=react.useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});react.useEffect(()=>{if(!a)return;let t=false;return chunkRFPLZDIO_js.d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsxRuntime.jsx(chunkH2FDWK4F_js.a,{transfers:n,onAdd:t=>{let e=Date.now(),d=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.filter(d=>d.id!==t);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ce={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},le=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let[o,n]=react.useState(u!=null?u:ce);react.useEffect(()=>{if(!a)return;let c=false;return chunkRFPLZDIO_js.d(null,null,function*(){let e=yield a.load();!c&&e&&n(e);}),()=>{c=true;}},[a]);let i=c=>{a&&a.save(c);};return jsxRuntime.jsx(chunkHLFS3NXG_js.a,{ropa:o,onAdd:c=>{let t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{records:[...o.records,c],lastUpdated:Date.now()});n(t),i(t);},onUpdate:(c,t)=>{let e=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{records:o.records.map(d=>d.id===c?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},d),t),{updatedAt:Date.now()}):d),lastUpdated:Date.now()});n(e),i(e);},onArchive:c=>{let t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{records:o.records.map(e=>e.id===c?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});n(t),i(t);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ue=P=>{var h=P,{input:u}=h,a=chunkRFPLZDIO_js.c(h,["input"]);let r=chunkRDALAH3Y_js.a(u);return jsxRuntime.jsx(chunkNUWVPRNI_js.a,chunkRFPLZDIO_js.a({report:r},a))};Object.defineProperty(exports,"NDPRConsent",{enumerable:true,get:function(){return chunk63WM5PHZ_js.a}});Object.defineProperty(exports,"NDPRSubjectRights",{enumerable:true,get:function(){return chunkKH3EQJQE_js.a}});Object.defineProperty(exports,"NDPRPrivacyPolicy",{enumerable:true,get:function(){return chunk3E4IH7CE_js.a}});exports.NDPRBreachReport=j;exports.NDPRComplianceDashboard=ue;exports.NDPRCrossBorder=ae;exports.NDPRDPIA=X;exports.NDPRLawfulBasis=te;exports.NDPRROPA=le;
|
package/dist/presets.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{a as NDPRConsent}from'./chunk-737EMUUC.mjs';export{a as NDPRSubjectRights}from'./chunk-WVHMY2BV.mjs';export{a as NDPRPrivacyPolicy}from'./chunk-B2EXRSYG.mjs';import'./chunk-ELK6VFKC.mjs';import {a as a$7}from'./chunk-ZIZL37BG.mjs';import {a}from'./chunk-NUIRMJKQ.mjs';import {a as a$2}from'./chunk-RBKFNCGO.mjs';import {a as a$4}from'./chunk-42JPSNVV.mjs';import {a as a$5}from'./chunk-Z2M5VJX2.mjs';import'./chunk-CWY2FMIC.mjs';import'./chunk-KE2FZH2V.mjs';import'./chunk-IVSNHT24.mjs';import {a as a$6}from'./chunk-7RBO42IW.mjs';import'./chunk-BIJSMSUU.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';import'./chunk-I2ZBMR7F.mjs';import'./chunk-YTU4FNM2.mjs';import'./chunk-L3FR4PQE.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-ZQHGIOYP.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {d,b,a as a$3,c}from'./chunk-ZJYULEER.mjs';import {useRef,useEffect,useState}from'react';import {jsx}from'react/jsx-runtime';var J=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],Q=({categories:o=J,adapter:c,classNames:i,unstyled:A,onSubmit:h=()=>{},copy:e,formDescription:P,description:n,submitTo:l,submitOptions:s,onSubmitError:p,onSubmitSuccess:m})=>{var t,r;let f=useRef(false);useEffect(()=>{process.env.NODE_ENV!=="production"&&P!==void 0&&n===void 0&&!f.current&&(f.current=true,console.warn("[ndpr-toolkit/breach] NDPRBreachReportProps.formDescription is deprecated; rename to 'description'. Will be removed in 4.0."));},[P,n]);let R=d$1=>d(null,null,function*(){var u,D;if(l){let C=typeof(s==null?void 0:s.headers)=="function"?s.headers():(u=s==null?void 0:s.headers)!=null?u:{};try{let N=yield fetch(l,{method:"POST",headers:a$3({"Content-Type":"application/json"},C),credentials:(D=s==null?void 0:s.credentials)!=null?D:"same-origin",body:JSON.stringify(d$1)});if(!N.ok)p==null||p({response:N});else if(m){let B;try{let y=yield N.clone().text();y&&(B=JSON.parse(y));}catch(y){}m({response:N,data:d$1,body:B});}}catch(N){p==null||p({error:N});}}else c&&c.save(d$1);h(d$1);}),g=(r=(t=e==null?void 0:e.description)!=null?t:n)!=null?r:P;return jsx(a,{categories:o,onSubmit:R,classNames:i,unstyled:A,title:e==null?void 0:e.title,formDescription:g,submitButtonText:e==null?void 0:e.submitButton})};var G=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}],H=({sections:o=G,adapter:c,classNames:i,unstyled:A,onComplete:h=()=>{},copy:e,submitTo:P,submitOptions:n,onSubmitError:l,onSubmitSuccess:s})=>{let[p,m]=useState({}),[f,R]=useState(0),g=(D,C)=>{m(N=>b(a$3({},N),{[D]:C}));},t=D=>d(null,null,function*(){var C,N;if(P){let B=typeof(n==null?void 0:n.headers)=="function"?n.headers():(C=n==null?void 0:n.headers)!=null?C:{};try{let y=yield fetch(P,{method:"POST",headers:a$3({"Content-Type":"application/json"},B),credentials:(N=n==null?void 0:n.credentials)!=null?N:"same-origin",body:JSON.stringify(D)});if(!y.ok)l==null||l({response:y});else if(s){let b;try{let x=yield y.clone().text();x&&(b=JSON.parse(x));}catch(x){}s({response:y,data:D,body:b});}}catch(y){l==null||l({error:y});}}else c&&c.save(D);h(D);}),r=()=>{f<o.length-1?R(D=>D+1):t(p);},d$1=()=>{f>0&&R(D=>D-1);},u=Math.round((f+1)/o.length*100);return jsx(a$1,{sections:o,answers:p,onAnswerChange:g,currentSectionIndex:f,onNextSection:r,onPrevSection:d$1,progress:u,classNames:i,unstyled:A,submitButtonText:e==null?void 0:e.submitButton,nextButtonText:e==null?void 0:e.nextButton,prevButtonText:e==null?void 0:e.prevButton})};var Z=({initialData:o,initialActivities:c,adapter:i,classNames:A,unstyled:h,copy:e})=>{var g;let P=useRef(false);useEffect(()=>{process.env.NODE_ENV!=="production"&&c!==void 0&&o===void 0&&!P.current&&(P.current=true,console.warn("[ndpr-toolkit/lawful-basis] NDPRLawfulBasisProps.initialActivities is deprecated; rename to 'initialData'. Will be removed in 4.0."));},[c,o]);let n=(g=o!=null?o:c)!=null?g:[],[l,s]=useState(()=>{if(i){let t=i.load();if(t&&!(t instanceof Promise))return t}return n});useEffect(()=>{if(!i)return;let t=false;return d(null,null,function*(){try{let r=yield i.load();!t&&r&&s(r);}catch(r){}}),()=>{t=true;}},[i]);let p=t=>{i&&i.save(t);};return jsx(a$2,{activities:l,onAddActivity:t=>{let r=Date.now(),d=b(a$3({},t),{id:`activity-${r}`,createdAt:r,updatedAt:r}),u=[...l,d];s(u),p(u);},onUpdateActivity:(t,r)=>{let d=l.map(u=>u.id===t?b(a$3(a$3({},u),r),{updatedAt:Date.now()}):u);s(d),p(d);},onArchiveActivity:t=>{let r=l.map(d=>d.id===t?b(a$3({},d),{status:"inactive",updatedAt:Date.now()}):d);s(r),p(r);},classNames:A,unstyled:h,title:e==null?void 0:e.title,description:e==null?void 0:e.description})};var se=({initialData:o,initialTransfers:c,adapter:i,classNames:A,unstyled:h,copy:e})=>{var g;let P=useRef(false);useEffect(()=>{process.env.NODE_ENV!=="production"&&c!==void 0&&o===void 0&&!P.current&&(P.current=true,console.warn("[ndpr-toolkit/cross-border] NDPRCrossBorderProps.initialTransfers is deprecated; rename to 'initialData'. Will be removed in 4.0."));},[c,o]);let n=(g=o!=null?o:c)!=null?g:[],[l,s]=useState(()=>{if(i){let t=i.load();if(t&&!(t instanceof Promise))return t}return n});useEffect(()=>{if(!i)return;let t=false;return d(null,null,function*(){try{let r=yield i.load();!t&&r&&s(r);}catch(r){}}),()=>{t=true;}},[i]);let p=t=>{i&&i.save(t);};return jsx(a$4,{transfers:l,onAddTransfer:t=>{let r=Date.now(),d=b(a$3({},t),{id:`transfer-${r}`,createdAt:r,updatedAt:r}),u=[...l,d];s(u),p(u);},onUpdateTransfer:(t,r)=>{let d=l.map(u=>u.id===t?b(a$3(a$3({},u),r),{updatedAt:Date.now()}):u);s(d),p(d);},onRemoveTransfer:t=>{let r=l.filter(d=>d.id!==t);s(r),p(r);},classNames:A,unstyled:h,title:e==null?void 0:e.title,description:e==null?void 0:e.description})};var ne={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},de=({initialData:o,adapter:c,classNames:i,unstyled:A,copy:h})=>{let[e,P]=useState(o!=null?o:ne);useEffect(()=>{if(!c)return;let m=false;return d(null,null,function*(){let R=yield c.load();!m&&R&&P(R);}),()=>{m=true;}},[c]);let n=m=>{c&&c.save(m);};return jsx(a$5,{ropa:e,onAddRecord:m=>{let f=b(a$3({},e),{records:[...e.records,m],lastUpdated:Date.now()});P(f),n(f);},onUpdateRecord:(m,f)=>{let R=b(a$3({},e),{records:e.records.map(g=>g.id===m?b(a$3(a$3({},g),f),{updatedAt:Date.now()}):g),lastUpdated:Date.now()});P(R),n(R);},onArchiveRecord:m=>{let f=b(a$3({},e),{records:e.records.map(R=>R.id===m?b(a$3({},R),{status:"archived",updatedAt:Date.now()}):R),lastUpdated:Date.now()});P(f),n(f);},classNames:i,unstyled:A,title:h==null?void 0:h.title,description:h==null?void 0:h.description})};var le=i=>{var A=i,{input:o}=A,c$1=c(A,["input"]);let h=a$6(o);return jsx(a$7,a$3({report:h},c$1))};export{Q as NDPRBreachReport,le as NDPRComplianceDashboard,se as NDPRCrossBorder,H as NDPRDPIA,Z as NDPRLawfulBasis,de as NDPRROPA};
|
|
2
|
+
export{a as NDPRConsent}from'./chunk-6A6VI7ZP.mjs';export{a as NDPRSubjectRights}from'./chunk-WVHMY2BV.mjs';export{a as NDPRPrivacyPolicy}from'./chunk-B2EXRSYG.mjs';import'./chunk-ELK6VFKC.mjs';import {a as a$7}from'./chunk-ZIZL37BG.mjs';import {a}from'./chunk-DK7P5JEG.mjs';import {a as a$2}from'./chunk-DSIIEUAD.mjs';import {a as a$4}from'./chunk-UTXDZDYF.mjs';import {a as a$5}from'./chunk-W6VVLHRQ.mjs';import'./chunk-CWY2FMIC.mjs';import'./chunk-KE2FZH2V.mjs';import'./chunk-IVSNHT24.mjs';import {a as a$6}from'./chunk-7RBO42IW.mjs';import'./chunk-BIJSMSUU.mjs';import'./chunk-7BJXI2HI.mjs';import'./chunk-LWIKDDSU.mjs';import'./chunk-XP5PL6K7.mjs';import'./chunk-I2ZBMR7F.mjs';import'./chunk-YTU4FNM2.mjs';import'./chunk-L3FR4PQE.mjs';import'./chunk-EWVK45Z3.mjs';import {a as a$1}from'./chunk-ZQHGIOYP.mjs';import {a as a$8}from'./chunk-LRRENTT5.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-DBZSN4WP.mjs';import {d,b,a as a$3,c}from'./chunk-ZJYULEER.mjs';import {jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';var $=[{id:"unauthorized_access",name:"Unauthorized Access",description:"Unauthorized access to personal data",defaultSeverity:"high"},{id:"data_loss",name:"Data Loss",description:"Loss of personal data",defaultSeverity:"high"},{id:"data_theft",name:"Data Theft",description:"Theft of personal data",defaultSeverity:"critical"},{id:"system_breach",name:"System Breach",description:"Breach of system containing personal data",defaultSeverity:"critical"},{id:"accidental_disclosure",name:"Accidental Disclosure",description:"Unintended disclosure of personal data",defaultSeverity:"medium"}],j=({categories:u=$,adapter:a$1,classNames:P,unstyled:h,onSubmit:r=()=>{},copy:o,description:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{var e;let c=d$1=>d(null,null,function*(){var f,N;if(i){let x=typeof(s==null?void 0:s.headers)=="function"?s.headers():(f=s==null?void 0:s.headers)!=null?f:{};try{let A=yield fetch(i,{method:"POST",headers:a$3({"Content-Type":"application/json"},x),credentials:(N=s==null?void 0:s.credentials)!=null?N:"same-origin",body:JSON.stringify(d$1)});if(!A.ok)l==null||l({response:A});else if(R){let w;try{let y=yield A.clone().text();y&&(w=JSON.parse(y));}catch(y){}R({response:A,data:d$1,body:w});}}catch(A){l==null||l({error:A});}}else a$1&&a$1.save(d$1);r(d$1);}),t=(e=o==null?void 0:o.description)!=null?e:n;return jsx(a,{categories:u,onSubmit:c,classNames:P,unstyled:h,title:o==null?void 0:o.title,description:t,submitButtonText:o==null?void 0:o.submitButton})};var H=[{id:"project_overview",title:"Project Overview",description:"Provide basic details about the processing activity being assessed.",order:0,questions:[{id:"project_name",text:"What is the name of the project or processing activity?",type:"text",required:true},{id:"project_description",text:"Describe the nature and purpose of the processing.",guidance:"Include what personal data will be collected, why it is needed, and how it will be used.",type:"textarea",required:true},{id:"data_controller",text:"Who is the data controller responsible for this processing?",type:"text",required:true}]},{id:"necessity",title:"Necessity & Proportionality",description:"Assess whether the processing is necessary and proportionate to the purposes.",order:1,questions:[{id:"lawful_basis",text:"What is the lawful basis for processing under the NDPA 2023?",type:"select",required:true,options:[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_task",label:"Public Task (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}]},{id:"data_minimisation",text:"Is the processing limited to what is necessary for the specified purpose?",type:"radio",required:true,options:[{value:"yes",label:"Yes \u2014 only minimum data is collected",riskLevel:"low"},{value:"partial",label:"Partially \u2014 some additional data may be collected",riskLevel:"medium"},{value:"no",label:"No \u2014 more data is collected than strictly necessary",riskLevel:"high"}]}]},{id:"risk_identification",title:"Risk Identification",description:"Identify and assess risks to data subjects arising from the processing.",order:2,questions:[{id:"sensitive_data",text:"Does the processing involve sensitive personal data (e.g., health, biometric, financial, children's data)?",type:"radio",required:true,options:[{value:"no",label:"No sensitive data",riskLevel:"low"},{value:"yes_protected",label:"Yes, with appropriate safeguards",riskLevel:"medium"},{value:"yes_unprotected",label:"Yes, without adequate safeguards",riskLevel:"high"}]},{id:"scale",text:"What is the scale of processing?",type:"radio",required:true,options:[{value:"small",label:"Small scale (fewer than 1,000 individuals)",riskLevel:"low"},{value:"medium",label:"Medium scale (1,000 to 100,000 individuals)",riskLevel:"medium"},{value:"large",label:"Large scale (over 100,000 individuals)",riskLevel:"high"}]},{id:"cross_border",text:"Will data be transferred outside Nigeria?",type:"radio",required:true,options:[{value:"no",label:"No international transfers",riskLevel:"low"},{value:"adequate",label:"Yes, to countries with adequate protection",riskLevel:"medium"},{value:"inadequate",label:"Yes, to countries without adequate protection",riskLevel:"high"}]}]},{id:"mitigation",title:"Risk Mitigation & Measures",description:"Document the measures taken to address identified risks.",order:3,questions:[{id:"security_measures",text:"What technical and organisational security measures are in place?",guidance:"Include encryption, access controls, pseudonymisation, staff training, etc.",type:"textarea",required:true},{id:"retention_period",text:"What is the data retention period?",guidance:"Specify how long data will be kept and the criteria used to determine this.",type:"text",required:true},{id:"dpo_consulted",text:"Has the Data Protection Officer (DPO) been consulted on this assessment?",type:"radio",required:false,options:[{value:"yes",label:"Yes",riskLevel:"low"},{value:"no",label:"No",riskLevel:"medium"},{value:"na",label:"Not applicable \u2014 no DPO appointed",riskLevel:"medium"}]}]}];function K(u,a){let P=[],h=i=>{let s=a[i.id];if(s!=null&&i.riskLevel)if(["select","radio","checkbox"].includes(i.type)&&i.options)(Array.isArray(s)?s:[s]).forEach(R=>{var t;let c=(t=i.options)==null?void 0:t.find(e=>e.value===R);if(c!=null&&c.riskLevel){let e=c.riskLevel,d=e==="low"?1:e==="medium"?3:5,f=e==="low"?1:e==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:`${i.text} - ${c.label}`,likelihood:d,impact:f,score:d*f,level:e,mitigated:false,relatedQuestionIds:[i.id]});}});else {let l=i.riskLevel,R=l==="low"?1:l==="medium"?3:5,c=l==="low"?1:l==="medium"?3:5;P.push({id:`risk_${P.length+1}`,description:i.text,likelihood:R,impact:c,score:R*c,level:l,mitigated:false,relatedQuestionIds:[i.id]});}};u.forEach(i=>i.questions.forEach(h));let r=Date.now(),o={id:`dpia_${r}`,title:"",processingDescription:"",startedAt:r,completedAt:r,assessor:{name:"",role:"",email:""},answers:a,risks:P,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},n=a$8(o);return o.overallRiskLevel=n.overallRiskLevel,o.canProceed=n.canProceed,o.conclusion=n.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",o.recommendations=n.recommendations,o}var X=({sections:u=H,adapter:a,classNames:P,unstyled:h,onComplete:r,onResult:o,copy:n,submitTo:i,submitOptions:s,onSubmitError:l,onSubmitSuccess:R})=>{let[c,t]=useState({}),[e,d$1]=useState(0),f=useRef(false);useEffect(()=>{process.env.NODE_ENV==="production"||f.current||r!==void 0&&o===void 0&&(f.current=true,console.warn("[ndpr-toolkit/dpia] `onComplete` is deprecated; use `onResult` to receive the full DPIAResult. Will be removed in 5.0."));},[r,o]);let N=(v,C)=>{t(B=>b(a$3({},B),{[v]:C}));},x=v=>d(null,null,function*(){var C,B;if(i){let Q=typeof(s==null?void 0:s.headers)=="function"?s.headers():(C=s==null?void 0:s.headers)!=null?C:{};try{let D=yield fetch(i,{method:"POST",headers:a$3({"Content-Type":"application/json"},Q),credentials:(B=s==null?void 0:s.credentials)!=null?B:"same-origin",body:JSON.stringify(v)});if(!D.ok)l==null||l({response:D});else if(R){let I;try{let k=yield D.clone().text();k&&(I=JSON.parse(k));}catch(k){}R({response:D,data:v,body:I});}}catch(D){l==null||l({error:D});}}else a&&a.save(v);o&&o(K(u,v)),r==null||r(v);}),A=()=>{e<u.length-1?d$1(v=>v+1):x(c);},w=()=>{e>0&&d$1(v=>v-1);},y=Math.round((e+1)/u.length*100);return jsx(a$1,{sections:u,answers:c,onAnswerChange:N,currentSectionIndex:e,onNextSection:A,onPrevSection:w,progress:y,classNames:P,unstyled:h,submitButtonText:n==null?void 0:n.submitButton,nextButtonText:n==null?void 0:n.nextButton,prevButtonText:n==null?void 0:n.prevButton})};var te=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});useEffect(()=>{if(!a)return;let t=false;return d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsx(a$2,{activities:n,onAdd:t=>{let e=Date.now(),d=b(a$3({},t),{id:`activity-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?b(a$3(a$3({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.map(d=>d.id===t?b(a$3({},d),{status:"inactive",updatedAt:Date.now()}):d);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ae=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let o=u!=null?u:[],[n,i]=useState(()=>{if(a){let t=a.load();if(t&&!(t instanceof Promise))return t}return o});useEffect(()=>{if(!a)return;let t=false;return d(null,null,function*(){try{let e=yield a.load();!t&&e&&i(e);}catch(e){}}),()=>{t=true;}},[a]);let s=t=>{a&&a.save(t);};return jsx(a$4,{transfers:n,onAdd:t=>{let e=Date.now(),d=b(a$3({},t),{id:`transfer-${e}`,createdAt:e,updatedAt:e}),f=[...n,d];i(f),s(f);},onUpdate:(t,e)=>{let d=n.map(f=>f.id===t?b(a$3(a$3({},f),e),{updatedAt:Date.now()}):f);i(d),s(d);},onArchive:t=>{let e=n.filter(d=>d.id!==t);i(e),s(e);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ce={id:"ndpr-ropa-default",organizationName:"Your Organisation",organizationContact:"",organizationAddress:"",records:[],lastUpdated:Date.now(),version:"1.0"},le=({initialData:u,adapter:a,classNames:P,unstyled:h,copy:r})=>{let[o,n]=useState(u!=null?u:ce);useEffect(()=>{if(!a)return;let c=false;return d(null,null,function*(){let e=yield a.load();!c&&e&&n(e);}),()=>{c=true;}},[a]);let i=c=>{a&&a.save(c);};return jsx(a$5,{ropa:o,onAdd:c=>{let t=b(a$3({},o),{records:[...o.records,c],lastUpdated:Date.now()});n(t),i(t);},onUpdate:(c,t)=>{let e=b(a$3({},o),{records:o.records.map(d=>d.id===c?b(a$3(a$3({},d),t),{updatedAt:Date.now()}):d),lastUpdated:Date.now()});n(e),i(e);},onArchive:c=>{let t=b(a$3({},o),{records:o.records.map(e=>e.id===c?b(a$3({},e),{status:"archived",updatedAt:Date.now()}):e),lastUpdated:Date.now()});n(t),i(t);},classNames:P,unstyled:h,title:r==null?void 0:r.title,description:r==null?void 0:r.description})};var ue=P=>{var h=P,{input:u}=h,a=c(h,["input"]);let r=a$6(u);return jsx(a$7,a$3({report:r},a))};export{j as NDPRBreachReport,ue as NDPRComplianceDashboard,ae as NDPRCrossBorder,X as NDPRDPIA,te as NDPRLawfulBasis,le as NDPRROPA};
|
package/dist/ropa-lite.d.mts
CHANGED
|
@@ -175,7 +175,19 @@ export declare interface ROPAManagerLiteClassNames {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export declare interface ROPAManagerLiteProps {
|
|
178
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Flat list of processing records.
|
|
180
|
+
* @deprecated Use `ropa` (4.1+) to pass the full
|
|
181
|
+
* `RecordOfProcessingActivities` object, matching the full
|
|
182
|
+
* `ROPAManager` API. The `records` prop will be removed in 5.0.
|
|
183
|
+
*/
|
|
184
|
+
records?: ProcessingRecord[];
|
|
185
|
+
/**
|
|
186
|
+
* Full Record of Processing Activities (4.1+). Takes precedence over
|
|
187
|
+
* `records` when both are provided. This will become the canonical
|
|
188
|
+
* shape in 5.0.
|
|
189
|
+
*/
|
|
190
|
+
ropa?: RecordOfProcessingActivities;
|
|
179
191
|
title?: string;
|
|
180
192
|
description?: string;
|
|
181
193
|
className?: string;
|
package/dist/ropa-lite.d.ts
CHANGED
|
@@ -175,7 +175,19 @@ export declare interface ROPAManagerLiteClassNames {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
export declare interface ROPAManagerLiteProps {
|
|
178
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Flat list of processing records.
|
|
180
|
+
* @deprecated Use `ropa` (4.1+) to pass the full
|
|
181
|
+
* `RecordOfProcessingActivities` object, matching the full
|
|
182
|
+
* `ROPAManager` API. The `records` prop will be removed in 5.0.
|
|
183
|
+
*/
|
|
184
|
+
records?: ProcessingRecord[];
|
|
185
|
+
/**
|
|
186
|
+
* Full Record of Processing Activities (4.1+). Takes precedence over
|
|
187
|
+
* `records` when both are provided. This will become the canonical
|
|
188
|
+
* shape in 5.0.
|
|
189
|
+
*/
|
|
190
|
+
ropa?: RecordOfProcessingActivities;
|
|
179
191
|
title?: string;
|
|
180
192
|
description?: string;
|
|
181
193
|
className?: string;
|
package/dist/ropa-lite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js');require('./chunk-TTMGFC6C.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var
|
|
2
|
+
'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js');require('./chunk-TTMGFC6C.js'),require('./chunk-RFPLZDIO.js');var react=require('react'),jsxRuntime=require('react/jsx-runtime');var D={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},G=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"],I={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},E={active:"Active",inactive:"Inactive",archived:"Archived"};function $(n){return n?new Date(n).toLocaleDateString():"N/A"}function T(n){return !!n.nextReviewDate&&n.nextReviewDate<=Date.now()}var F=({records:n,ropa:p,title:_,description:x,className:O="",classNames:t,unstyled:d,showSummary:S=true,showComplianceGaps:k=true,onRecordClick:c})=>{var w,P;let A=chunkYDKWD6MQ_js.c(),B=(w=_!=null?_:A.ropa.title)!=null?w:"Record of Processing Activities (ROPA)",N=(P=x!=null?x:A.ropa.description)!=null?P:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",h=react.useRef(false);react.useEffect(()=>{process.env.NODE_ENV==="production"||h.current||n!==void 0&&p===void 0&&(h.current=true,console.warn("[ndpr-toolkit/ropa] ROPAManagerLite `records` is deprecated; pass the full `ropa` object instead. Will be removed in 5.0."));},[n,p]);let b=react.useMemo(()=>p?p.records:n!=null?n:[],[p,n]),f=react.useMemo(()=>p!=null?p:{id:"lite",organizationName:"",organizationContact:"",organizationAddress:"",records:b,lastUpdated:0,version:"0"},[p,b]),s=react.useMemo(()=>chunk4CVBQC66_js.b(f),[f]),u=react.useMemo(()=>chunk4CVBQC66_js.d(f),[f]);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${O}`,t==null?void 0:t.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",t==null?void 0:t.header,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.title,d),children:B}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:N})]}),S&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",t==null?void 0:t.summary,d),children:[jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[["p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center","ndpr-text-info","Total Records",s.totalRecords,false],["p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center","ndpr-text-success","Active",s.activeRecords,false],["p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center","ndpr-text-info","Cross-Border",s.crossBorderRecords,false],["p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center","ndpr-text-warning","Records with Gaps",u.length,true]].map(([r,o,l,g,m])=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(r,t==null?void 0:t.summaryCard,d),children:[jsxRuntime.jsx("p",{className:m?chunkAME4HJR4_js.a(`ndpr-stat__value ${o}`,t==null?void 0:t.complianceScore,d):`ndpr-stat__value ${o}`,children:g}),jsxRuntime.jsx("p",{className:`text-xs ${o}`,children:l})]},l))}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),G.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:D[r]}),jsxRuntime.jsx("span",{className:"font-medium",children:s.byLawfulBasis[r]||0})]},r))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),[["Sensitive Data",s.sensitiveDataRecords,false],["DPIA Required",s.dpiaRequiredRecords,false],["Automated Decisions",s.automatedDecisionRecords,false],["Due for Review",s.recordsDueForReview.length,s.recordsDueForReview.length>0]].map(([r,o,l])=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r}),jsxRuntime.jsx("span",{className:`font-medium ${l?"ndpr-text-destructive":""}`,children:o})]},r))]}),s.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),s.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]})]}),k&&u.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md mb-6",t==null?void 0:t.gapAlert,d),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),u.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((o,l)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:o},l))})]},r.recordId)),u.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",u.length-5," more record(s) with gaps."]})]}),b.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",t==null?void 0:t.table,d),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",t==null?void 0:t.tableHeader,d),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Retention"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"})]})}),jsxRuntime.jsx("tbody",{children:b.map(r=>{let o=T(r),l=u.some(m=>m.recordId===r.id),g=!!c;return jsxRuntime.jsxs("tr",{onClick:g?()=>c==null?void 0:c(r):void 0,role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:g?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c==null||c(r));}:void 0,className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${o?"bg-red-50 dark:bg-red-900/10":l?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} ${g?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,t==null?void 0:t.tableRow,d),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),o&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:D[r.lawfulBasis]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.retentionPeriod||"N/A"}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${I[r.status]}`,t==null?void 0:t.statusBadge,d),children:E[r.status]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:$(r.lastReviewedAt)})]},r.id)})})]})})]})};Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});exports.ROPAManagerLite=F;
|
package/dist/ropa-lite.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {b,d}from'./chunk-XP5PL6K7.mjs';export{b as generateROPASummary,d as identifyComplianceGaps}from'./chunk-XP5PL6K7.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var
|
|
2
|
+
import {b,d}from'./chunk-XP5PL6K7.mjs';export{b as generateROPASummary,d as identifyComplianceGaps}from'./chunk-XP5PL6K7.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import'./chunk-V5TZJJWU.mjs';import'./chunk-ZJYULEER.mjs';import {useRef,useEffect,useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var D={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},G=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"],I={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},E={active:"Active",inactive:"Inactive",archived:"Archived"};function $(n){return n?new Date(n).toLocaleDateString():"N/A"}function T(n){return !!n.nextReviewDate&&n.nextReviewDate<=Date.now()}var F=({records:n,ropa:p,title:_,description:x,className:O="",classNames:t,unstyled:d$1,showSummary:S=true,showComplianceGaps:k=true,onRecordClick:c$1})=>{var w,P;let A=c(),B=(w=_!=null?_:A.ropa.title)!=null?w:"Record of Processing Activities (ROPA)",N=(P=x!=null?x:A.ropa.description)!=null?P:"Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",h=useRef(false);useEffect(()=>{process.env.NODE_ENV==="production"||h.current||n!==void 0&&p===void 0&&(h.current=true,console.warn("[ndpr-toolkit/ropa] ROPAManagerLite `records` is deprecated; pass the full `ropa` object instead. Will be removed in 5.0."));},[n,p]);let b$1=useMemo(()=>p?p.records:n!=null?n:[],[p,n]),f=useMemo(()=>p!=null?p:{id:"lite",organizationName:"",organizationContact:"",organizationAddress:"",records:b$1,lastUpdated:0,version:"0"},[p,b$1]),s=useMemo(()=>b(f),[f]),u=useMemo(()=>d(f),[f]);return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${O}`,t==null?void 0:t.root,d$1),children:[jsxs("div",{className:a("",t==null?void 0:t.header,d$1),children:[jsx("h2",{className:a("ndpr-section-heading",t==null?void 0:t.title,d$1),children:B}),jsx("p",{className:"ndpr-card__subtitle",children:N})]}),S&&jsxs("div",{className:a("mb-6",t==null?void 0:t.summary,d$1),children:[jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[["p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center","ndpr-text-info","Total Records",s.totalRecords,false],["p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center","ndpr-text-success","Active",s.activeRecords,false],["p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center","ndpr-text-info","Cross-Border",s.crossBorderRecords,false],["p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center","ndpr-text-warning","Records with Gaps",u.length,true]].map(([r,o,l,g,m])=>jsxs("div",{className:a(r,t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:m?a(`ndpr-stat__value ${o}`,t==null?void 0:t.complianceScore,d$1):`ndpr-stat__value ${o}`,children:g}),jsx("p",{className:`text-xs ${o}`,children:l})]},l))}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),G.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:D[r]}),jsx("span",{className:"font-medium",children:s.byLawfulBasis[r]||0})]},r))]}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),[["Sensitive Data",s.sensitiveDataRecords,false],["DPIA Required",s.dpiaRequiredRecords,false],["Automated Decisions",s.automatedDecisionRecords,false],["Due for Review",s.recordsDueForReview.length,s.recordsDueForReview.length>0]].map(([r,o,l])=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r}),jsx("span",{className:`font-medium ${l?"ndpr-text-destructive":""}`,children:o})]},r))]}),s.topDepartments.length>0&&jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),s.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]})]}),k&&u.length>0&&jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md mb-6",t==null?void 0:t.gapAlert,d$1),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),u.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((o,l)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:o},l))})]},r.recordId)),u.length>5&&jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",u.length-5," more record(s) with gaps."]})]}),b$1.length===0?jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",t==null?void 0:t.table,d$1),children:[jsx("thead",{className:a("ndpr-table__head",t==null?void 0:t.tableHeader,d$1),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsx("th",{className:"ndpr-table__cell",children:"Retention"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"})]})}),jsx("tbody",{children:b$1.map(r=>{let o=T(r),l=u.some(m=>m.recordId===r.id),g=!!c$1;return jsxs("tr",{onClick:g?()=>c$1==null?void 0:c$1(r):void 0,role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:g?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c$1==null||c$1(r));}:void 0,className:a(`border-b dark:border-gray-600 ${o?"bg-red-50 dark:bg-red-900/10":l?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} ${g?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,t==null?void 0:t.tableRow,d$1),children:[jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"ndpr-form-field__hint",children:r.department}),o&&jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:"ndpr-badge ndpr-badge--info",children:D[r.lawfulBasis]})}),jsx("td",{className:"ndpr-table__cell",children:jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.retentionPeriod||"N/A"}),jsx("td",{className:"ndpr-table__cell",children:jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${I[r.status]}`,t==null?void 0:t.statusBadge,d$1),children:E[r.status]})}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:$(r.lastReviewedAt)})]},r.id)})})]})})]})};export{F as ROPAManagerLite};
|