@tantainnovative/ndpr-toolkit 1.0.2 → 1.0.3

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.
Files changed (212) hide show
  1. package/.claude/settings.local.json +20 -0
  2. package/.eslintrc.json +10 -0
  3. package/.github/workflows/ci.yml +36 -0
  4. package/.github/workflows/nextjs.yml +104 -0
  5. package/.husky/commit-msg +4 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.lintstagedrc.js +4 -0
  8. package/.nvmrc +1 -0
  9. package/.versionrc +17 -0
  10. package/CHANGELOG.md +16 -0
  11. package/CLAUDE.md +90 -0
  12. package/CNAME +1 -0
  13. package/CONTRIBUTING.md +87 -0
  14. package/README.md +84 -447
  15. package/RELEASE-NOTES-v1.0.0.md +140 -0
  16. package/RELEASE-NOTES-v1.0.1.md +69 -0
  17. package/SECURITY.md +21 -0
  18. package/commitlint.config.js +36 -0
  19. package/components.json +21 -0
  20. package/eslint.config.mjs +16 -0
  21. package/jest.config.js +31 -0
  22. package/jest.setup.js +15 -0
  23. package/next.config.js +15 -0
  24. package/next.config.ts +62 -0
  25. package/package.json +70 -52
  26. package/packages/ndpr-toolkit/README.md +467 -0
  27. package/packages/ndpr-toolkit/jest.config.js +23 -0
  28. package/packages/ndpr-toolkit/package-lock.json +8197 -0
  29. package/packages/ndpr-toolkit/package.json +71 -0
  30. package/packages/ndpr-toolkit/rollup.config.js +34 -0
  31. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentBanner.test.tsx +119 -0
  32. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentManager.test.tsx +122 -0
  33. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentStorage.test.tsx +270 -0
  34. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRDashboard.test.tsx +199 -0
  35. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRRequestForm.test.tsx +224 -0
  36. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRTracker.test.tsx +104 -0
  37. package/packages/ndpr-toolkit/src/__tests__/hooks/useConsent.test.tsx +161 -0
  38. package/packages/ndpr-toolkit/src/__tests__/hooks/useDSR.test.tsx +330 -0
  39. package/packages/ndpr-toolkit/src/__tests__/utils/breach.test.ts +149 -0
  40. package/packages/ndpr-toolkit/src/__tests__/utils/consent.test.ts +88 -0
  41. package/packages/ndpr-toolkit/src/__tests__/utils/dpia.test.ts +160 -0
  42. package/packages/ndpr-toolkit/src/__tests__/utils/dsr.test.ts +110 -0
  43. package/packages/ndpr-toolkit/src/__tests__/utils/privacy.test.ts +97 -0
  44. package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +701 -0
  45. package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +631 -0
  46. package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +569 -0
  47. package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +496 -0
  48. package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +270 -0
  49. package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +217 -0
  50. package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +206 -0
  51. package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +342 -0
  52. package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +373 -0
  53. package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +174 -0
  54. package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +717 -0
  55. package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +476 -0
  56. package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +620 -0
  57. package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +541 -0
  58. package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +454 -0
  59. package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +333 -0
  60. package/packages/ndpr-toolkit/src/hooks/useBreach.ts +409 -0
  61. package/packages/ndpr-toolkit/src/hooks/useConsent.ts +263 -0
  62. package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +457 -0
  63. package/packages/ndpr-toolkit/src/hooks/useDSR.ts +236 -0
  64. package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +428 -0
  65. package/{dist/index.d.ts → packages/ndpr-toolkit/src/index.ts} +13 -0
  66. package/packages/ndpr-toolkit/src/setupTests.ts +5 -0
  67. package/packages/ndpr-toolkit/src/types/breach.ts +283 -0
  68. package/packages/ndpr-toolkit/src/types/consent.ts +111 -0
  69. package/packages/ndpr-toolkit/src/types/dpia.ts +236 -0
  70. package/packages/ndpr-toolkit/src/types/dsr.ts +192 -0
  71. package/packages/ndpr-toolkit/src/types/index.ts +42 -0
  72. package/packages/ndpr-toolkit/src/types/privacy.ts +246 -0
  73. package/packages/ndpr-toolkit/src/utils/breach.ts +122 -0
  74. package/packages/ndpr-toolkit/src/utils/consent.ts +51 -0
  75. package/packages/ndpr-toolkit/src/utils/dpia.ts +104 -0
  76. package/packages/ndpr-toolkit/src/utils/dsr.ts +77 -0
  77. package/packages/ndpr-toolkit/src/utils/privacy.ts +100 -0
  78. package/packages/ndpr-toolkit/tsconfig.json +23 -0
  79. package/postcss.config.mjs +5 -0
  80. package/public/NDPR TOOLKIT.svg +1 -0
  81. package/public/favicon/android-chrome-192x192.png +0 -0
  82. package/public/favicon/android-chrome-512x512.png +0 -0
  83. package/public/favicon/apple-touch-icon.png +0 -0
  84. package/public/favicon/favicon-16x16.png +0 -0
  85. package/public/favicon/favicon-32x32.png +0 -0
  86. package/public/favicon/site.webmanifest +1 -0
  87. package/public/file.svg +1 -0
  88. package/public/globe.svg +1 -0
  89. package/public/ndpr-toolkit-logo.svg +108 -0
  90. package/public/next.svg +1 -0
  91. package/public/vercel.svg +1 -0
  92. package/public/window.svg +1 -0
  93. package/src/__tests__/example.test.ts +13 -0
  94. package/src/__tests__/requestService.test.ts +57 -0
  95. package/src/app/accessibility.css +70 -0
  96. package/src/app/docs/components/DocLayout.tsx +267 -0
  97. package/src/app/docs/components/breach-notification/page.tsx +797 -0
  98. package/src/app/docs/components/consent-management/page.tsx +576 -0
  99. package/src/app/docs/components/data-subject-rights/page.tsx +511 -0
  100. package/src/app/docs/components/dpia-questionnaire/layout.tsx +15 -0
  101. package/src/app/docs/components/dpia-questionnaire/metadata.ts +31 -0
  102. package/src/app/docs/components/dpia-questionnaire/page.tsx +666 -0
  103. package/src/app/docs/components/hooks/page.tsx +305 -0
  104. package/src/app/docs/components/page.tsx +84 -0
  105. package/src/app/docs/components/privacy-policy-generator/page.tsx +634 -0
  106. package/src/app/docs/guides/breach-notification-process/components/BestPractices.tsx +123 -0
  107. package/src/app/docs/guides/breach-notification-process/components/ImplementationSteps.tsx +328 -0
  108. package/src/app/docs/guides/breach-notification-process/components/Introduction.tsx +28 -0
  109. package/src/app/docs/guides/breach-notification-process/components/NotificationTimeline.tsx +91 -0
  110. package/src/app/docs/guides/breach-notification-process/components/Resources.tsx +118 -0
  111. package/src/app/docs/guides/breach-notification-process/page.tsx +39 -0
  112. package/src/app/docs/guides/conducting-dpia/page.tsx +593 -0
  113. package/src/app/docs/guides/data-subject-requests/page.tsx +666 -0
  114. package/src/app/docs/guides/managing-consent/page.tsx +738 -0
  115. package/src/app/docs/guides/ndpr-compliance-checklist/components/ComplianceChecklist.tsx +296 -0
  116. package/src/app/docs/guides/ndpr-compliance-checklist/components/ImplementationTools.tsx +145 -0
  117. package/src/app/docs/guides/ndpr-compliance-checklist/components/Introduction.tsx +33 -0
  118. package/src/app/docs/guides/ndpr-compliance-checklist/components/KeyRequirements.tsx +99 -0
  119. package/src/app/docs/guides/ndpr-compliance-checklist/components/Resources.tsx +159 -0
  120. package/src/app/docs/guides/ndpr-compliance-checklist/page.tsx +38 -0
  121. package/src/app/docs/guides/page.tsx +67 -0
  122. package/src/app/docs/layout.tsx +15 -0
  123. package/src/app/docs/metadata.ts +31 -0
  124. package/src/app/docs/page.tsx +572 -0
  125. package/src/app/favicon.ico +0 -0
  126. package/src/app/globals.css +123 -0
  127. package/src/app/layout.tsx +37 -0
  128. package/src/app/ndpr-demos/breach/page.tsx +354 -0
  129. package/src/app/ndpr-demos/consent/page.tsx +366 -0
  130. package/src/app/ndpr-demos/dpia/page.tsx +495 -0
  131. package/src/app/ndpr-demos/dsr/page.tsx +280 -0
  132. package/src/app/ndpr-demos/page.tsx +73 -0
  133. package/src/app/ndpr-demos/policy/page.tsx +771 -0
  134. package/src/app/page.tsx +452 -0
  135. package/src/components/ErrorBoundary.tsx +90 -0
  136. package/src/components/breach-notification/BreachNotificationForm.tsx +479 -0
  137. package/src/components/consent/ConsentBanner.tsx +159 -0
  138. package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +419 -0
  139. package/src/components/docs/DocLayout.tsx +289 -0
  140. package/src/components/docs/index.ts +2 -0
  141. package/src/components/dpia/DPIAQuestionnaire.tsx +483 -0
  142. package/src/components/privacy-policy/PolicyGenerator.tsx +1062 -0
  143. package/src/components/privacy-policy/data.ts +98 -0
  144. package/src/components/privacy-policy/shared/CheckboxField.tsx +38 -0
  145. package/src/components/privacy-policy/shared/CheckboxGroup.tsx +85 -0
  146. package/src/components/privacy-policy/shared/FormField.tsx +79 -0
  147. package/src/components/privacy-policy/shared/StepIndicator.tsx +86 -0
  148. package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +335 -0
  149. package/src/components/privacy-policy/steps/DataCollectionStep.tsx +231 -0
  150. package/src/components/privacy-policy/steps/DataSharingStep.tsx +418 -0
  151. package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +202 -0
  152. package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +172 -0
  153. package/src/components/ui/Badge.tsx +46 -0
  154. package/src/components/ui/Button.tsx +59 -0
  155. package/src/components/ui/Card.tsx +92 -0
  156. package/src/components/ui/Checkbox.tsx +57 -0
  157. package/src/components/ui/FormField.tsx +50 -0
  158. package/src/components/ui/Input.tsx +38 -0
  159. package/src/components/ui/Loading.tsx +201 -0
  160. package/src/components/ui/Select.tsx +42 -0
  161. package/src/components/ui/TextArea.tsx +38 -0
  162. package/src/components/ui/label.tsx +24 -0
  163. package/src/components/ui/switch.tsx +31 -0
  164. package/src/components/ui/tabs.tsx +66 -0
  165. package/src/hooks/useConsent.ts +64 -0
  166. package/src/hooks/useLoadingState.ts +85 -0
  167. package/src/lib/consentService.ts +137 -0
  168. package/src/lib/dpiaQuestions.ts +148 -0
  169. package/src/lib/requestService.ts +75 -0
  170. package/src/lib/sanitize.ts +108 -0
  171. package/src/lib/storage.ts +222 -0
  172. package/src/lib/utils.ts +6 -0
  173. package/src/types/html-to-docx.d.ts +30 -0
  174. package/src/types/index.ts +72 -0
  175. package/tailwind.config.ts +65 -0
  176. package/tsconfig.json +41 -0
  177. package/dist/components/breach/BreachNotificationManager.d.ts +0 -62
  178. package/dist/components/breach/BreachReportForm.d.ts +0 -66
  179. package/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
  180. package/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
  181. package/dist/components/consent/ConsentBanner.d.ts +0 -79
  182. package/dist/components/consent/ConsentManager.d.ts +0 -73
  183. package/dist/components/consent/ConsentStorage.d.ts +0 -41
  184. package/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
  185. package/dist/components/dpia/DPIAReport.d.ts +0 -40
  186. package/dist/components/dpia/StepIndicator.d.ts +0 -64
  187. package/dist/components/dsr/DSRDashboard.d.ts +0 -58
  188. package/dist/components/dsr/DSRRequestForm.d.ts +0 -74
  189. package/dist/components/dsr/DSRTracker.d.ts +0 -56
  190. package/dist/components/policy/PolicyExporter.d.ts +0 -65
  191. package/dist/components/policy/PolicyGenerator.d.ts +0 -54
  192. package/dist/components/policy/PolicyPreview.d.ts +0 -71
  193. package/dist/hooks/useBreach.d.ts +0 -97
  194. package/dist/hooks/useConsent.d.ts +0 -63
  195. package/dist/hooks/useDPIA.d.ts +0 -92
  196. package/dist/hooks/useDSR.d.ts +0 -72
  197. package/dist/hooks/usePrivacyPolicy.d.ts +0 -87
  198. package/dist/index.esm.js +0 -2
  199. package/dist/index.esm.js.map +0 -1
  200. package/dist/index.js +0 -2
  201. package/dist/index.js.map +0 -1
  202. package/dist/setupTests.d.ts +0 -2
  203. package/dist/types/breach.d.ts +0 -239
  204. package/dist/types/consent.d.ts +0 -95
  205. package/dist/types/dpia.d.ts +0 -196
  206. package/dist/types/dsr.d.ts +0 -162
  207. package/dist/types/privacy.d.ts +0 -204
  208. package/dist/utils/breach.d.ts +0 -14
  209. package/dist/utils/consent.d.ts +0 -10
  210. package/dist/utils/dpia.d.ts +0 -12
  211. package/dist/utils/dsr.d.ts +0 -11
  212. package/dist/utils/privacy.d.ts +0 -12
@@ -1,64 +0,0 @@
1
- import React from 'react';
2
- export interface Step {
3
- /**
4
- * Unique identifier for the step
5
- */
6
- id: string;
7
- /**
8
- * Display label for the step
9
- */
10
- label: string;
11
- /**
12
- * Optional description for the step
13
- */
14
- description?: string;
15
- /**
16
- * Whether the step is completed
17
- */
18
- completed: boolean;
19
- /**
20
- * Whether the step is the current active step
21
- */
22
- active: boolean;
23
- /**
24
- * Optional icon for the step
25
- */
26
- icon?: React.ReactNode;
27
- }
28
- export interface StepIndicatorProps {
29
- /**
30
- * Array of steps to display
31
- */
32
- steps: Step[];
33
- /**
34
- * Callback function called when a step is clicked
35
- */
36
- onStepClick?: (stepId: string) => void;
37
- /**
38
- * Whether the steps are clickable
39
- * @default true
40
- */
41
- clickable?: boolean;
42
- /**
43
- * Orientation of the step indicator
44
- * @default "horizontal"
45
- */
46
- orientation?: 'horizontal' | 'vertical';
47
- /**
48
- * Custom CSS class for the container
49
- */
50
- className?: string;
51
- /**
52
- * Custom CSS class for the active step
53
- */
54
- activeStepClassName?: string;
55
- /**
56
- * Custom CSS class for completed steps
57
- */
58
- completedStepClassName?: string;
59
- /**
60
- * Custom CSS class for incomplete steps
61
- */
62
- incompleteStepClassName?: string;
63
- }
64
- export declare const StepIndicator: React.FC<StepIndicatorProps>;
@@ -1,58 +0,0 @@
1
- import React from 'react';
2
- import { DSRRequest, DSRStatus } from '../../types/dsr';
3
- export interface DSRDashboardProps {
4
- /**
5
- * List of DSR requests to display
6
- */
7
- requests: DSRRequest[];
8
- /**
9
- * Callback function called when a request is selected
10
- */
11
- onSelectRequest?: (requestId: string) => void;
12
- /**
13
- * Callback function called when a request status is updated
14
- */
15
- onUpdateStatus?: (requestId: string, status: DSRStatus) => void;
16
- /**
17
- * Callback function called when a request is assigned
18
- */
19
- onAssignRequest?: (requestId: string, assignee: string) => void;
20
- /**
21
- * Title displayed on the dashboard
22
- * @default "Data Subject Request Dashboard"
23
- */
24
- title?: string;
25
- /**
26
- * Description text displayed on the dashboard
27
- * @default "Track and manage data subject requests in compliance with NDPR requirements."
28
- */
29
- description?: string;
30
- /**
31
- * Custom CSS class for the dashboard
32
- */
33
- className?: string;
34
- /**
35
- * Custom CSS class for the buttons
36
- */
37
- buttonClassName?: string;
38
- /**
39
- * Whether to show the request details
40
- * @default true
41
- */
42
- showRequestDetails?: boolean;
43
- /**
44
- * Whether to show the request timeline
45
- * @default true
46
- */
47
- showRequestTimeline?: boolean;
48
- /**
49
- * Whether to show the deadline alerts
50
- * @default true
51
- */
52
- showDeadlineAlerts?: boolean;
53
- /**
54
- * List of possible assignees
55
- */
56
- assignees?: string[];
57
- }
58
- export declare const DSRDashboard: React.FC<DSRDashboardProps>;
@@ -1,74 +0,0 @@
1
- import React from 'react';
2
- import { RequestType } from '../../types/dsr';
3
- export interface DSRRequestFormProps {
4
- /**
5
- * Array of request types that can be submitted
6
- */
7
- requestTypes: RequestType[];
8
- /**
9
- * Callback function called when form is submitted
10
- */
11
- onSubmit: (formData: any) => void;
12
- /**
13
- * Title displayed on the form
14
- * @default "Submit a Data Subject Request"
15
- */
16
- title?: string;
17
- /**
18
- * Description text displayed on the form
19
- * @default "Use this form to exercise your rights under the Nigeria Data Protection Regulation (NDPR)."
20
- */
21
- description?: string;
22
- /**
23
- * Text for the submit button
24
- * @default "Submit Request"
25
- */
26
- submitButtonText?: string;
27
- /**
28
- * Custom CSS class for the form
29
- */
30
- className?: string;
31
- /**
32
- * Custom CSS class for the submit button
33
- */
34
- buttonClassName?: string;
35
- /**
36
- * Whether to show a confirmation message after submission
37
- * @default true
38
- */
39
- showConfirmation?: boolean;
40
- /**
41
- * Confirmation message to display after submission
42
- * @default "Your request has been submitted successfully. You will receive a confirmation email shortly."
43
- */
44
- confirmationMessage?: string;
45
- /**
46
- * Whether to require identity verification
47
- * @default true
48
- */
49
- requireIdentityVerification?: boolean;
50
- /**
51
- * Types of identifiers accepted for verification
52
- * @default ["email", "account", "customer_id"]
53
- */
54
- identifierTypes?: Array<{
55
- id: string;
56
- label: string;
57
- }>;
58
- /**
59
- * Whether to collect additional contact information
60
- * @default true
61
- */
62
- collectAdditionalContact?: boolean;
63
- /**
64
- * Custom labels for form fields
65
- */
66
- labels?: {
67
- name?: string;
68
- email?: string;
69
- requestType?: string;
70
- description?: string;
71
- submit?: string;
72
- };
73
- }
74
- export declare const DSRRequestForm: React.FC<DSRRequestFormProps>;
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { DSRRequest } from '../../types/dsr';
3
- export interface DSRTrackerProps {
4
- /**
5
- * List of DSR requests to track
6
- */
7
- requests: DSRRequest[];
8
- /**
9
- * Callback function called when a request is selected
10
- */
11
- onSelectRequest?: (requestId: string) => void;
12
- /**
13
- * Title displayed on the tracker
14
- * @default "DSR Request Tracker"
15
- */
16
- title?: string;
17
- /**
18
- * Description text displayed on the tracker
19
- * @default "Track the status and progress of data subject requests."
20
- */
21
- description?: string;
22
- /**
23
- * Custom CSS class for the tracker
24
- */
25
- className?: string;
26
- /**
27
- * Custom CSS class for the buttons
28
- */
29
- buttonClassName?: string;
30
- /**
31
- * Whether to show the summary statistics
32
- * @default true
33
- */
34
- showSummaryStats?: boolean;
35
- /**
36
- * Whether to show the request type breakdown
37
- * @default true
38
- */
39
- showTypeBreakdown?: boolean;
40
- /**
41
- * Whether to show the status breakdown
42
- * @default true
43
- */
44
- showStatusBreakdown?: boolean;
45
- /**
46
- * Whether to show the timeline chart
47
- * @default true
48
- */
49
- showTimelineChart?: boolean;
50
- /**
51
- * Whether to show the overdue requests
52
- * @default true
53
- */
54
- showOverdueRequests?: boolean;
55
- }
56
- export declare const DSRTracker: React.FC<DSRTrackerProps>;
@@ -1,65 +0,0 @@
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>;
@@ -1,54 +0,0 @@
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>;
@@ -1,71 +0,0 @@
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>;
@@ -1,97 +0,0 @@
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 {};
@@ -1,63 +0,0 @@
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 {};
@@ -1,92 +0,0 @@
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 {};