@tantainnovative/ndpr-toolkit 1.0.4 → 1.0.5
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/eslint.config.mjs +16 -0
- package/next.config.js +15 -0
- package/next.config.ts +62 -0
- package/package.json +1 -1
- package/packages/ndpr-toolkit/README.md +467 -0
- package/packages/ndpr-toolkit/dist/components/breach/BreachNotificationManager.d.ts +62 -0
- package/packages/ndpr-toolkit/dist/components/breach/BreachReportForm.d.ts +66 -0
- package/packages/ndpr-toolkit/dist/components/breach/BreachRiskAssessment.d.ts +50 -0
- package/packages/ndpr-toolkit/dist/components/breach/RegulatoryReportGenerator.d.ts +94 -0
- package/packages/ndpr-toolkit/dist/components/consent/ConsentBanner.d.ts +79 -0
- package/packages/ndpr-toolkit/dist/components/consent/ConsentManager.d.ts +73 -0
- package/packages/ndpr-toolkit/dist/components/consent/ConsentStorage.d.ts +41 -0
- package/packages/ndpr-toolkit/dist/components/dpia/DPIAQuestionnaire.d.ts +70 -0
- package/packages/ndpr-toolkit/dist/components/dpia/DPIAReport.d.ts +40 -0
- package/packages/ndpr-toolkit/dist/components/dpia/StepIndicator.d.ts +64 -0
- package/packages/ndpr-toolkit/dist/components/dsr/DSRDashboard.d.ts +58 -0
- package/packages/ndpr-toolkit/dist/components/dsr/DSRRequestForm.d.ts +74 -0
- package/packages/ndpr-toolkit/dist/components/dsr/DSRTracker.d.ts +56 -0
- package/packages/ndpr-toolkit/dist/components/policy/PolicyExporter.d.ts +65 -0
- package/packages/ndpr-toolkit/dist/components/policy/PolicyGenerator.d.ts +54 -0
- package/packages/ndpr-toolkit/dist/components/policy/PolicyPreview.d.ts +71 -0
- package/packages/ndpr-toolkit/dist/hooks/useBreach.d.ts +97 -0
- package/packages/ndpr-toolkit/dist/hooks/useConsent.d.ts +63 -0
- package/packages/ndpr-toolkit/dist/hooks/useDPIA.d.ts +92 -0
- package/packages/ndpr-toolkit/dist/hooks/useDSR.d.ts +72 -0
- package/packages/ndpr-toolkit/dist/hooks/usePrivacyPolicy.d.ts +87 -0
- package/packages/ndpr-toolkit/dist/index.d.ts +31 -0
- package/packages/ndpr-toolkit/dist/index.esm.js +2 -0
- package/packages/ndpr-toolkit/dist/index.esm.js.map +1 -0
- package/packages/ndpr-toolkit/dist/index.js +2 -0
- package/packages/ndpr-toolkit/dist/index.js.map +1 -0
- package/packages/ndpr-toolkit/dist/setupTests.d.ts +2 -0
- package/packages/ndpr-toolkit/dist/types/breach.d.ts +239 -0
- package/packages/ndpr-toolkit/dist/types/consent.d.ts +95 -0
- package/packages/ndpr-toolkit/dist/types/dpia.d.ts +196 -0
- package/packages/ndpr-toolkit/dist/types/dsr.d.ts +162 -0
- package/packages/ndpr-toolkit/dist/types/privacy.d.ts +204 -0
- package/packages/ndpr-toolkit/dist/utils/breach.d.ts +14 -0
- package/packages/ndpr-toolkit/dist/utils/consent.d.ts +10 -0
- package/packages/ndpr-toolkit/dist/utils/dpia.d.ts +12 -0
- package/packages/ndpr-toolkit/dist/utils/dsr.d.ts +11 -0
- package/packages/ndpr-toolkit/dist/utils/privacy.d.ts +12 -0
- package/packages/ndpr-toolkit/package-lock.json +8197 -0
- package/packages/ndpr-toolkit/package.json +71 -0
- package/packages/ndpr-toolkit/rollup.config.js +34 -0
- package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +701 -0
- package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +631 -0
- package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +569 -0
- package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +496 -0
- package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +270 -0
- package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +217 -0
- package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +206 -0
- package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +342 -0
- package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +373 -0
- package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +174 -0
- package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +717 -0
- package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +476 -0
- package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +620 -0
- package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +541 -0
- package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +454 -0
- package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +333 -0
- package/packages/ndpr-toolkit/src/hooks/useBreach.ts +409 -0
- package/packages/ndpr-toolkit/src/hooks/useConsent.ts +263 -0
- package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +457 -0
- package/packages/ndpr-toolkit/src/hooks/useDSR.ts +236 -0
- package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +428 -0
- package/packages/ndpr-toolkit/src/index.ts +44 -0
- package/packages/ndpr-toolkit/src/setupTests.ts +5 -0
- package/packages/ndpr-toolkit/src/types/breach.ts +283 -0
- package/packages/ndpr-toolkit/src/types/consent.ts +111 -0
- package/packages/ndpr-toolkit/src/types/dpia.ts +236 -0
- package/packages/ndpr-toolkit/src/types/dsr.ts +192 -0
- package/packages/ndpr-toolkit/src/types/index.ts +42 -0
- package/packages/ndpr-toolkit/src/types/privacy.ts +246 -0
- package/packages/ndpr-toolkit/src/utils/breach.ts +122 -0
- package/packages/ndpr-toolkit/src/utils/consent.ts +51 -0
- package/packages/ndpr-toolkit/src/utils/dpia.ts +104 -0
- package/packages/ndpr-toolkit/src/utils/dsr.ts +77 -0
- package/packages/ndpr-toolkit/src/utils/privacy.ts +100 -0
- package/packages/ndpr-toolkit/tsconfig.json +23 -0
- package/postcss.config.mjs +5 -0
- package/src/app/accessibility.css +70 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +123 -0
- package/src/app/layout.tsx +37 -0
- package/src/app/ndpr-demos/breach/page.tsx +354 -0
- package/src/app/ndpr-demos/consent/page.tsx +366 -0
- package/src/app/ndpr-demos/dpia/page.tsx +495 -0
- package/src/app/ndpr-demos/dsr/page.tsx +280 -0
- package/src/app/ndpr-demos/page.tsx +73 -0
- package/src/app/ndpr-demos/policy/page.tsx +771 -0
- package/src/app/page.tsx +452 -0
- package/src/components/ErrorBoundary.tsx +90 -0
- package/src/components/breach-notification/BreachNotificationForm.tsx +479 -0
- package/src/components/consent/ConsentBanner.tsx +193 -0
- package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +530 -0
- package/src/components/dpia/DPIAQuestionnaire.tsx +523 -0
- package/src/components/privacy-policy/PolicyGenerator.tsx +1062 -0
- package/src/components/privacy-policy/data.ts +98 -0
- package/src/components/privacy-policy/shared/CheckboxField.tsx +38 -0
- package/src/components/privacy-policy/shared/CheckboxGroup.tsx +85 -0
- package/src/components/privacy-policy/shared/FormField.tsx +79 -0
- package/src/components/privacy-policy/shared/StepIndicator.tsx +86 -0
- package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +361 -0
- package/src/components/privacy-policy/steps/DataCollectionStep.tsx +231 -0
- package/src/components/privacy-policy/steps/DataSharingStep.tsx +418 -0
- package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +202 -0
- package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +226 -0
- package/src/components/ui/Badge.tsx +46 -0
- package/src/components/ui/Button.tsx +59 -0
- package/src/components/ui/Card.tsx +92 -0
- package/src/components/ui/Checkbox.tsx +57 -0
- package/src/components/ui/FormField.tsx +50 -0
- package/src/components/ui/Input.tsx +38 -0
- package/src/components/ui/Loading.tsx +201 -0
- package/src/components/ui/Select.tsx +42 -0
- package/src/components/ui/TextArea.tsx +38 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/tabs.tsx +66 -0
- package/src/hooks/useConsent.ts +70 -0
- package/src/hooks/useLoadingState.ts +85 -0
- package/src/lib/consentService.ts +144 -0
- package/src/lib/dpiaQuestions.ts +188 -0
- package/src/lib/requestService.ts +79 -0
- package/src/lib/sanitize.ts +108 -0
- package/src/lib/storage.ts +222 -0
- package/src/lib/utils.ts +6 -0
- package/src/types/html-to-docx.d.ts +30 -0
- package/src/types/index.ts +77 -0
- package/tailwind.config.ts +65 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PolicyExporterProps {
|
|
3
|
+
/**
|
|
4
|
+
* The policy content to export
|
|
5
|
+
*/
|
|
6
|
+
content: string;
|
|
7
|
+
/**
|
|
8
|
+
* The policy title
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The organization name to include in the exported policy
|
|
13
|
+
*/
|
|
14
|
+
organizationName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The last updated date to include in the exported policy
|
|
17
|
+
*/
|
|
18
|
+
lastUpdated?: Date;
|
|
19
|
+
/**
|
|
20
|
+
* Callback function called when the export is complete
|
|
21
|
+
*/
|
|
22
|
+
onExportComplete?: (format: string, url: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Title displayed on the exporter
|
|
25
|
+
* @default "Export Privacy Policy"
|
|
26
|
+
*/
|
|
27
|
+
componentTitle?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Description text displayed on the exporter
|
|
30
|
+
* @default "Export your NDPR-compliant privacy policy in various formats."
|
|
31
|
+
*/
|
|
32
|
+
description?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom CSS class for the exporter
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom CSS class for the buttons
|
|
39
|
+
*/
|
|
40
|
+
buttonClassName?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to show the export history
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
showExportHistory?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to include the NDPR compliance notice in the exported policy
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
includeComplianceNotice?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to include the organization logo in the exported policy
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
includeLogo?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* URL of the organization logo
|
|
58
|
+
*/
|
|
59
|
+
logoUrl?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Custom CSS styles for the exported policy
|
|
62
|
+
*/
|
|
63
|
+
customStyles?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare const PolicyExporter: React.FC<PolicyExporterProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PolicySection, PolicyVariable } from '../../types/privacy';
|
|
3
|
+
export interface PolicyGeneratorProps {
|
|
4
|
+
/**
|
|
5
|
+
* List of policy sections
|
|
6
|
+
*/
|
|
7
|
+
sections: PolicySection[];
|
|
8
|
+
/**
|
|
9
|
+
* List of policy variables
|
|
10
|
+
*/
|
|
11
|
+
variables: PolicyVariable[];
|
|
12
|
+
/**
|
|
13
|
+
* Callback function called when the policy is generated
|
|
14
|
+
*/
|
|
15
|
+
onGenerate: (policy: {
|
|
16
|
+
sections: PolicySection[];
|
|
17
|
+
variables: PolicyVariable[];
|
|
18
|
+
content: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Title displayed on the generator
|
|
22
|
+
* @default "NDPR Privacy Policy Generator"
|
|
23
|
+
*/
|
|
24
|
+
title?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Description text displayed on the generator
|
|
27
|
+
* @default "Generate an NDPR-compliant privacy policy for your organization."
|
|
28
|
+
*/
|
|
29
|
+
description?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Custom CSS class for the generator
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Custom CSS class for the buttons
|
|
36
|
+
*/
|
|
37
|
+
buttonClassName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Text for the generate button
|
|
40
|
+
* @default "Generate Policy"
|
|
41
|
+
*/
|
|
42
|
+
generateButtonText?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to show a preview of the generated policy
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
showPreview?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether to allow editing the policy content
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
allowEditing?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare const PolicyGenerator: React.FC<PolicyGeneratorProps>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PolicySection, PolicyVariable } from '../../types/privacy';
|
|
3
|
+
export interface PolicyPreviewProps {
|
|
4
|
+
/**
|
|
5
|
+
* The policy content to preview
|
|
6
|
+
*/
|
|
7
|
+
content: string;
|
|
8
|
+
/**
|
|
9
|
+
* The policy sections
|
|
10
|
+
*/
|
|
11
|
+
sections?: PolicySection[];
|
|
12
|
+
/**
|
|
13
|
+
* The policy variables
|
|
14
|
+
*/
|
|
15
|
+
variables?: PolicyVariable[];
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called when the policy is exported
|
|
18
|
+
*/
|
|
19
|
+
onExport?: (format: 'pdf' | 'html' | 'markdown' | 'docx') => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function called when the policy is edited
|
|
22
|
+
*/
|
|
23
|
+
onEdit?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Title displayed on the preview
|
|
26
|
+
* @default "Privacy Policy Preview"
|
|
27
|
+
*/
|
|
28
|
+
title?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Description text displayed on the preview
|
|
31
|
+
* @default "Preview your NDPR-compliant privacy policy before exporting."
|
|
32
|
+
*/
|
|
33
|
+
description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Custom CSS class for the preview
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom CSS class for the buttons
|
|
40
|
+
*/
|
|
41
|
+
buttonClassName?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to show the export options
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
showExportOptions?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to show the edit button
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
showEditButton?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to show the table of contents
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
showTableOfContents?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to show the policy metadata
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
showMetadata?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The organization name to display in the policy
|
|
64
|
+
*/
|
|
65
|
+
organizationName?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The last updated date to display in the policy
|
|
68
|
+
*/
|
|
69
|
+
lastUpdated?: Date;
|
|
70
|
+
}
|
|
71
|
+
export declare const PolicyPreview: React.FC<PolicyPreviewProps>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BreachReport, BreachCategory, RiskAssessment, NotificationRequirement, RegulatoryNotification } from '../types/breach';
|
|
2
|
+
interface UseBreachOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Available breach categories
|
|
5
|
+
*/
|
|
6
|
+
categories: BreachCategory[];
|
|
7
|
+
/**
|
|
8
|
+
* Initial breach reports
|
|
9
|
+
*/
|
|
10
|
+
initialReports?: BreachReport[];
|
|
11
|
+
/**
|
|
12
|
+
* Storage key for breach data
|
|
13
|
+
* @default "ndpr_breach_data"
|
|
14
|
+
*/
|
|
15
|
+
storageKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to use local storage to persist breach data
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
useLocalStorage?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function called when a breach is reported
|
|
23
|
+
*/
|
|
24
|
+
onReport?: (report: BreachReport) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Callback function called when a risk assessment is completed
|
|
27
|
+
*/
|
|
28
|
+
onAssessment?: (assessment: RiskAssessment) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback function called when a notification is sent
|
|
31
|
+
*/
|
|
32
|
+
onNotification?: (notification: RegulatoryNotification) => void;
|
|
33
|
+
}
|
|
34
|
+
interface UseBreachReturn {
|
|
35
|
+
/**
|
|
36
|
+
* All breach reports
|
|
37
|
+
*/
|
|
38
|
+
reports: BreachReport[];
|
|
39
|
+
/**
|
|
40
|
+
* All risk assessments
|
|
41
|
+
*/
|
|
42
|
+
assessments: RiskAssessment[];
|
|
43
|
+
/**
|
|
44
|
+
* All regulatory notifications
|
|
45
|
+
*/
|
|
46
|
+
notifications: RegulatoryNotification[];
|
|
47
|
+
/**
|
|
48
|
+
* Submit a new breach report
|
|
49
|
+
*/
|
|
50
|
+
reportBreach: (reportData: Omit<BreachReport, 'id' | 'reportedAt'>) => BreachReport;
|
|
51
|
+
/**
|
|
52
|
+
* Update an existing breach report
|
|
53
|
+
*/
|
|
54
|
+
updateReport: (id: string, updates: Partial<BreachReport>) => BreachReport | null;
|
|
55
|
+
/**
|
|
56
|
+
* Get a breach report by ID
|
|
57
|
+
*/
|
|
58
|
+
getReport: (id: string) => BreachReport | null;
|
|
59
|
+
/**
|
|
60
|
+
* Conduct a risk assessment for a breach
|
|
61
|
+
*/
|
|
62
|
+
assessRisk: (breachId: string, assessmentData: Omit<RiskAssessment, 'id' | 'breachId' | 'assessedAt'>) => RiskAssessment;
|
|
63
|
+
/**
|
|
64
|
+
* Get a risk assessment for a breach
|
|
65
|
+
*/
|
|
66
|
+
getAssessment: (breachId: string) => RiskAssessment | null;
|
|
67
|
+
/**
|
|
68
|
+
* Calculate notification requirements based on a risk assessment
|
|
69
|
+
*/
|
|
70
|
+
calculateNotificationRequirements: (breachId: string) => NotificationRequirement | null;
|
|
71
|
+
/**
|
|
72
|
+
* Send a regulatory notification
|
|
73
|
+
*/
|
|
74
|
+
sendNotification: (breachId: string, notificationData: Omit<RegulatoryNotification, 'id' | 'breachId' | 'sentAt'>) => RegulatoryNotification;
|
|
75
|
+
/**
|
|
76
|
+
* Get a regulatory notification for a breach
|
|
77
|
+
*/
|
|
78
|
+
getNotification: (breachId: string) => RegulatoryNotification | null;
|
|
79
|
+
/**
|
|
80
|
+
* Get breaches that require notification within the next X hours
|
|
81
|
+
*/
|
|
82
|
+
getBreachesRequiringNotification: (hoursThreshold?: number) => Array<{
|
|
83
|
+
report: BreachReport;
|
|
84
|
+
assessment: RiskAssessment;
|
|
85
|
+
requirements: NotificationRequirement;
|
|
86
|
+
hoursRemaining: number;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Clear all breach data
|
|
90
|
+
*/
|
|
91
|
+
clearBreachData: () => void;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Hook for managing data breach notifications in compliance with NDPR
|
|
95
|
+
*/
|
|
96
|
+
export declare function useBreach({ categories, initialReports, storageKey, useLocalStorage, onReport, onAssessment, onNotification }: UseBreachOptions): UseBreachReturn;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ConsentOption, ConsentSettings, ConsentStorageOptions } from '../types/consent';
|
|
2
|
+
interface UseConsentOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Consent options to present to the user
|
|
5
|
+
*/
|
|
6
|
+
options: ConsentOption[];
|
|
7
|
+
/**
|
|
8
|
+
* Storage options for consent settings
|
|
9
|
+
*/
|
|
10
|
+
storageOptions?: ConsentStorageOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Version of the consent form
|
|
13
|
+
* @default "1.0"
|
|
14
|
+
*/
|
|
15
|
+
version?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called when consent settings change
|
|
18
|
+
*/
|
|
19
|
+
onChange?: (settings: ConsentSettings) => void;
|
|
20
|
+
}
|
|
21
|
+
interface UseConsentReturn {
|
|
22
|
+
/**
|
|
23
|
+
* Current consent settings
|
|
24
|
+
*/
|
|
25
|
+
settings: ConsentSettings | null;
|
|
26
|
+
/**
|
|
27
|
+
* Whether consent has been given for a specific option
|
|
28
|
+
*/
|
|
29
|
+
hasConsent: (optionId: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Update consent settings
|
|
32
|
+
*/
|
|
33
|
+
updateConsent: (consents: Record<string, boolean>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Accept all consent options
|
|
36
|
+
*/
|
|
37
|
+
acceptAll: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Reject all non-required consent options
|
|
40
|
+
*/
|
|
41
|
+
rejectAll: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the consent banner should be shown
|
|
44
|
+
*/
|
|
45
|
+
shouldShowBanner: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether consent settings are valid
|
|
48
|
+
*/
|
|
49
|
+
isValid: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Validation errors (if any)
|
|
52
|
+
*/
|
|
53
|
+
validationErrors: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Reset consent settings (clear from storage)
|
|
56
|
+
*/
|
|
57
|
+
resetConsent: () => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Hook for managing user consent in compliance with NDPR
|
|
61
|
+
*/
|
|
62
|
+
export declare function useConsent({ options, storageOptions, version, onChange }: UseConsentOptions): UseConsentReturn;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DPIAQuestion, DPIASection, DPIAResult } from '../types/dpia';
|
|
2
|
+
interface UseDPIAOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Sections of the DPIA questionnaire
|
|
5
|
+
*/
|
|
6
|
+
sections: DPIASection[];
|
|
7
|
+
/**
|
|
8
|
+
* Initial answers (if resuming a DPIA)
|
|
9
|
+
*/
|
|
10
|
+
initialAnswers?: Record<string, any>;
|
|
11
|
+
/**
|
|
12
|
+
* Storage key for DPIA data
|
|
13
|
+
* @default "ndpr_dpia_data"
|
|
14
|
+
*/
|
|
15
|
+
storageKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to use local storage to persist DPIA data
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
useLocalStorage?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function called when the DPIA is completed
|
|
23
|
+
*/
|
|
24
|
+
onComplete?: (result: DPIAResult) => void;
|
|
25
|
+
}
|
|
26
|
+
interface UseDPIAReturn {
|
|
27
|
+
/**
|
|
28
|
+
* Current section index
|
|
29
|
+
*/
|
|
30
|
+
currentSectionIndex: number;
|
|
31
|
+
/**
|
|
32
|
+
* Current section
|
|
33
|
+
*/
|
|
34
|
+
currentSection: DPIASection | null;
|
|
35
|
+
/**
|
|
36
|
+
* All answers
|
|
37
|
+
*/
|
|
38
|
+
answers: Record<string, any>;
|
|
39
|
+
/**
|
|
40
|
+
* Update an answer
|
|
41
|
+
*/
|
|
42
|
+
updateAnswer: (questionId: string, value: any) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Go to the next section
|
|
45
|
+
*/
|
|
46
|
+
nextSection: () => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Go to the previous section
|
|
49
|
+
*/
|
|
50
|
+
prevSection: () => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Go to a specific section
|
|
53
|
+
*/
|
|
54
|
+
goToSection: (index: number) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Check if the current section is valid
|
|
57
|
+
*/
|
|
58
|
+
isCurrentSectionValid: () => boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Get validation errors for the current section
|
|
61
|
+
*/
|
|
62
|
+
getCurrentSectionErrors: () => Record<string, string>;
|
|
63
|
+
/**
|
|
64
|
+
* Check if the DPIA is complete
|
|
65
|
+
*/
|
|
66
|
+
isComplete: () => boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Complete the DPIA and generate a result
|
|
69
|
+
*/
|
|
70
|
+
completeDPIA: (assessorInfo: {
|
|
71
|
+
name: string;
|
|
72
|
+
role: string;
|
|
73
|
+
email: string;
|
|
74
|
+
}, title: string, processingDescription: string) => DPIAResult;
|
|
75
|
+
/**
|
|
76
|
+
* Get the visible questions for the current section
|
|
77
|
+
*/
|
|
78
|
+
getVisibleQuestions: () => DPIAQuestion[];
|
|
79
|
+
/**
|
|
80
|
+
* Reset the DPIA
|
|
81
|
+
*/
|
|
82
|
+
resetDPIA: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Progress percentage
|
|
85
|
+
*/
|
|
86
|
+
progress: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Hook for conducting Data Protection Impact Assessments in compliance with NDPR
|
|
90
|
+
*/
|
|
91
|
+
export declare function useDPIA({ sections, initialAnswers, storageKey, useLocalStorage, onComplete }: UseDPIAOptions): UseDPIAReturn;
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DSRRequest, RequestStatus, RequestType } from '../types/dsr';
|
|
2
|
+
interface UseDSROptions {
|
|
3
|
+
/**
|
|
4
|
+
* Initial requests to load
|
|
5
|
+
*/
|
|
6
|
+
initialRequests?: DSRRequest[];
|
|
7
|
+
/**
|
|
8
|
+
* Available request types
|
|
9
|
+
*/
|
|
10
|
+
requestTypes: RequestType[];
|
|
11
|
+
/**
|
|
12
|
+
* Storage key for requests
|
|
13
|
+
* @default "ndpr_dsr_requests"
|
|
14
|
+
*/
|
|
15
|
+
storageKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to use local storage to persist requests
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
useLocalStorage?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function called when a request is submitted
|
|
23
|
+
*/
|
|
24
|
+
onSubmit?: (request: DSRRequest) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Callback function called when a request is updated
|
|
27
|
+
*/
|
|
28
|
+
onUpdate?: (request: DSRRequest) => void;
|
|
29
|
+
}
|
|
30
|
+
interface UseDSRReturn {
|
|
31
|
+
/**
|
|
32
|
+
* All requests
|
|
33
|
+
*/
|
|
34
|
+
requests: DSRRequest[];
|
|
35
|
+
/**
|
|
36
|
+
* Submit a new request
|
|
37
|
+
*/
|
|
38
|
+
submitRequest: (requestData: Omit<DSRRequest, 'id' | 'status' | 'submittedAt' | 'updatedAt' | 'estimatedCompletionDate'>) => DSRRequest;
|
|
39
|
+
/**
|
|
40
|
+
* Update an existing request
|
|
41
|
+
*/
|
|
42
|
+
updateRequest: (id: string, updates: Partial<DSRRequest>) => DSRRequest | null;
|
|
43
|
+
/**
|
|
44
|
+
* Get a request by ID
|
|
45
|
+
*/
|
|
46
|
+
getRequest: (id: string) => DSRRequest | null;
|
|
47
|
+
/**
|
|
48
|
+
* Get requests by status
|
|
49
|
+
*/
|
|
50
|
+
getRequestsByStatus: (status: RequestStatus) => DSRRequest[];
|
|
51
|
+
/**
|
|
52
|
+
* Get requests by type
|
|
53
|
+
*/
|
|
54
|
+
getRequestsByType: (type: string) => DSRRequest[];
|
|
55
|
+
/**
|
|
56
|
+
* Get the request type definition by ID
|
|
57
|
+
*/
|
|
58
|
+
getRequestType: (typeId: string) => RequestType | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Format a request for display or submission
|
|
61
|
+
*/
|
|
62
|
+
formatRequest: (request: DSRRequest) => Record<string, any>;
|
|
63
|
+
/**
|
|
64
|
+
* Clear all requests
|
|
65
|
+
*/
|
|
66
|
+
clearRequests: () => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Hook for managing Data Subject Requests in compliance with NDPR
|
|
70
|
+
*/
|
|
71
|
+
export declare function useDSR({ initialRequests, requestTypes, storageKey, useLocalStorage, onSubmit, onUpdate }: UseDSROptions): UseDSRReturn;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { PolicyTemplate, OrganizationInfo, PrivacyPolicy } from '../types/privacy';
|
|
2
|
+
interface UsePrivacyPolicyOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Available policy templates
|
|
5
|
+
*/
|
|
6
|
+
templates: PolicyTemplate[];
|
|
7
|
+
/**
|
|
8
|
+
* Initial policy data (if editing an existing policy)
|
|
9
|
+
*/
|
|
10
|
+
initialPolicy?: PrivacyPolicy;
|
|
11
|
+
/**
|
|
12
|
+
* Storage key for policy data
|
|
13
|
+
* @default "ndpr_privacy_policy"
|
|
14
|
+
*/
|
|
15
|
+
storageKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to use local storage to persist policy data
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
useLocalStorage?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function called when a policy is generated
|
|
23
|
+
*/
|
|
24
|
+
onGenerate?: (policy: PrivacyPolicy) => void;
|
|
25
|
+
}
|
|
26
|
+
interface UsePrivacyPolicyReturn {
|
|
27
|
+
/**
|
|
28
|
+
* Current policy data
|
|
29
|
+
*/
|
|
30
|
+
policy: PrivacyPolicy | null;
|
|
31
|
+
/**
|
|
32
|
+
* Selected template
|
|
33
|
+
*/
|
|
34
|
+
selectedTemplate: PolicyTemplate | null;
|
|
35
|
+
/**
|
|
36
|
+
* Organization information
|
|
37
|
+
*/
|
|
38
|
+
organizationInfo: OrganizationInfo;
|
|
39
|
+
/**
|
|
40
|
+
* Select a template
|
|
41
|
+
*/
|
|
42
|
+
selectTemplate: (templateId: string) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Update organization information
|
|
45
|
+
*/
|
|
46
|
+
updateOrganizationInfo: (updates: Partial<OrganizationInfo>) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Toggle whether a section is included in the policy
|
|
49
|
+
*/
|
|
50
|
+
toggleSection: (sectionId: string, included: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Update section content
|
|
53
|
+
*/
|
|
54
|
+
updateSectionContent: (sectionId: string, content: string) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Update variable values
|
|
57
|
+
*/
|
|
58
|
+
updateVariableValue: (variable: string, value: string) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Generate the policy
|
|
61
|
+
*/
|
|
62
|
+
generatePolicy: () => PrivacyPolicy;
|
|
63
|
+
/**
|
|
64
|
+
* Get the generated policy text
|
|
65
|
+
*/
|
|
66
|
+
getPolicyText: () => {
|
|
67
|
+
fullText: string;
|
|
68
|
+
sectionTexts: Record<string, string>;
|
|
69
|
+
missingVariables: string[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Reset the policy
|
|
73
|
+
*/
|
|
74
|
+
resetPolicy: () => void;
|
|
75
|
+
/**
|
|
76
|
+
* Check if the policy is valid
|
|
77
|
+
*/
|
|
78
|
+
isValid: () => {
|
|
79
|
+
valid: boolean;
|
|
80
|
+
errors: string[];
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Hook for generating NDPR-compliant privacy policies
|
|
85
|
+
*/
|
|
86
|
+
export declare function usePrivacyPolicy({ templates, initialPolicy, storageKey, useLocalStorage, onGenerate }: UsePrivacyPolicyOptions): UsePrivacyPolicyReturn;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { ConsentBanner } from './components/consent/ConsentBanner';
|
|
2
|
+
export { ConsentManager } from './components/consent/ConsentManager';
|
|
3
|
+
export { ConsentStorage } from './components/consent/ConsentStorage';
|
|
4
|
+
export type { ConsentOption, ConsentSettings, ConsentStorageOptions } from './types/consent';
|
|
5
|
+
export { DSRRequestForm } from './components/dsr/DSRRequestForm';
|
|
6
|
+
export { DSRDashboard } from './components/dsr/DSRDashboard';
|
|
7
|
+
export { DSRTracker } from './components/dsr/DSRTracker';
|
|
8
|
+
export type { DSRRequest, RequestType, DSRStatus, DSRType, RequestStatus } from './types/dsr';
|
|
9
|
+
export { DPIAQuestionnaire } from './components/dpia/DPIAQuestionnaire';
|
|
10
|
+
export { DPIAReport } from './components/dpia/DPIAReport';
|
|
11
|
+
export { StepIndicator } from './components/dpia/StepIndicator';
|
|
12
|
+
export type { DPIAQuestion, DPIASection, DPIAResult } from './types/dpia';
|
|
13
|
+
export { BreachReportForm } from './components/breach/BreachReportForm';
|
|
14
|
+
export { BreachRiskAssessment } from './components/breach/BreachRiskAssessment';
|
|
15
|
+
export { BreachNotificationManager } from './components/breach/BreachNotificationManager';
|
|
16
|
+
export { RegulatoryReportGenerator } from './components/breach/RegulatoryReportGenerator';
|
|
17
|
+
export type { BreachReport, RiskAssessment, NotificationRequirement, RegulatoryNotification } from './types/breach';
|
|
18
|
+
export { PolicyGenerator } from './components/policy/PolicyGenerator';
|
|
19
|
+
export { PolicyPreview } from './components/policy/PolicyPreview';
|
|
20
|
+
export { PolicyExporter } from './components/policy/PolicyExporter';
|
|
21
|
+
export type { PolicySection, PolicyTemplate, PolicyVariable, OrganizationInfo, PrivacyPolicy } from './types/privacy';
|
|
22
|
+
export { validateConsent } from './utils/consent';
|
|
23
|
+
export { formatDSRRequest } from './utils/dsr';
|
|
24
|
+
export { assessDPIARisk } from './utils/dpia';
|
|
25
|
+
export { calculateBreachSeverity } from './utils/breach';
|
|
26
|
+
export { generatePolicyText } from './utils/privacy';
|
|
27
|
+
export { useConsent } from './hooks/useConsent';
|
|
28
|
+
export { useDSR } from './hooks/useDSR';
|
|
29
|
+
export { useDPIA } from './hooks/useDPIA';
|
|
30
|
+
export { useBreach } from './hooks/useBreach';
|
|
31
|
+
export { usePrivacyPolicy } from './hooks/usePrivacyPolicy';
|