@tantainnovative/ndpr-toolkit 1.0.1 → 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 -431
  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} +14 -1
  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
package/README.md CHANGED
@@ -1,451 +1,104 @@
1
- # NDPR Toolkit
2
-
3
- <div align="center">
4
-
5
- ![NDPR Toolkit Logo](https://via.placeholder.com/200x200?text=NDPR+Toolkit)
6
-
7
- A comprehensive enterprise solution for implementing NDPR-compliant features in web applications, aligned with the Nigerian Data Protection Regulation (NDPR) and Data Protection Act (DPA).
8
-
9
- [![npm version](https://img.shields.io/npm/v/@tantainnovative/ndpr-toolkit.svg)](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
10
- [![license](https://img.shields.io/npm/l/@tantainnovative/ndpr-toolkit.svg)](https://github.com/tantainnovative/ndpr-toolkit/blob/main/LICENSE)
11
- [![TypeScript](https://img.shields.io/badge/TypeScript-4.9%2B-blue)](https://www.typescriptlang.org/)
12
- [![React](https://img.shields.io/badge/React-18.0%2B-blue)](https://reactjs.org/)
13
-
14
- </div>
15
-
16
- ## Overview
17
-
18
- The NDPR Toolkit is an enterprise-grade solution that provides a comprehensive set of React components, hooks, and utilities to help organizations implement NDPR-compliant features in their web applications with minimal development effort. Designed by compliance experts and developers, this toolkit offers a complete solution for privacy policy management, consent handling, data subject rights, breach notification, and data protection impact assessments.
19
-
20
- > **NDPR Toolkit is actively maintained and regularly updated to ensure compliance with the latest Nigerian data protection regulations.**
21
-
22
- ## Key Features
23
-
24
- ### 🔒 Privacy Policy Management
25
-
26
- - **PolicyGenerator**: Create customizable, NDPR-compliant privacy policies with an intuitive form interface
27
- - **PolicyPreview**: Display generated policies with professional formatting and section navigation
28
- - **PolicyExporter**: Export policies in multiple formats (PDF, HTML, Markdown) with compliance notices
29
-
30
- ### 🍪 Consent Management
31
-
32
- - **ConsentBanner**: Implement cookie consent banners with customizable appearance and behavior
33
- - **ConsentManager**: Track and manage user consent preferences across your application
34
- - **ConsentStorage**: Securely store and retrieve consent records with built-in persistence
35
-
36
- ### 👤 Data Subject Rights (DSR)
37
-
38
- - **DSRRequestForm**: Collect and validate data subject requests with comprehensive form validation
39
- - **DSRTracker**: Monitor the status and progress of data subject requests
40
- - **DSRDashboard**: Visualize and manage all data subject requests in one place
41
-
42
- ### 📊 Data Protection Impact Assessment (DPIA)
43
-
44
- - **DPIAQuestionnaire**: Guide users through the DPIA process with step-by-step questionnaires
45
- - **DPIAReport**: Generate comprehensive DPIA reports based on questionnaire responses
46
- - **StepIndicator**: Track progress through multi-step DPIA processes
47
-
48
- ### ⚠️ Breach Notification
49
-
50
- - **BreachReportForm**: Collect essential information about data breaches
51
- - **BreachRiskAssessment**: Evaluate the risk level of reported breaches
52
- - **RegulatoryReportGenerator**: Create NDPR-compliant breach notification reports
53
- - **BreachNotificationManager**: Manage the entire breach notification workflow
54
-
55
- ### 🆕 Enterprise Features
56
-
57
- - **Advanced Conditional Logic**: Support for complex conditional blocks in policy templates
58
- - **Professional Formatting**: Enterprise-ready formatting for all exported documents
59
- - **Comprehensive Type System**: Full TypeScript support with detailed interfaces and type definitions
60
- - **Modular Architecture**: Use only the components you need with tree-shakable imports
61
- - **Accessibility**: WCAG 2.1 AA compliant components for inclusive user experiences
62
-
63
- ## Installation
1
+ # Nigerian Data Protection Compliance Toolkit (NDPR-Toolkit)
2
+
3
+ An open-source toolkit that helps Nigerian developers implement Nigeria Data Protection Regulation (NDPR) and Data Protection Act (DPA) compliant features in their web applications.
4
+
5
+ ## Project Vision
6
+
7
+ This toolkit simplifies regulatory compliance for startups and businesses operating in Nigeria by providing ready-to-use components and tools for implementing data protection requirements.
8
+
9
+ ## Key Components
10
+
11
+ ### 1. Consent Management System
12
+ - User-friendly consent banners and modals with customizable styling
13
+ - Granular consent options (necessary, functional, analytics, marketing)
14
+ - Consent storage and retrieval mechanisms
15
+ - Consent change history tracking
16
+ - Time-stamped audit trails
17
+
18
+ ### 2. Data Subject Rights Portal
19
+ - Pre-built UI components for handling:
20
+ - Right to access personal data
21
+ - Right to rectification
22
+ - Right to erasure ("right to be forgotten")
23
+ - Right to restrict processing
24
+ - Right to data portability
25
+ - Dashboard for data controllers to manage requests
26
+ - Local storage requestService to track and update requests in demos
27
+
28
+ ### 3. Privacy Policy Generator
29
+ - Interactive wizard to create NDPR-compliant privacy policies
30
+ - Template system with customizable sections
31
+ - Auto-update notifications when regulatory requirements change
32
+ - Version history tracking
33
+
34
+ ### 4. Data Protection Impact Assessment (DPIA) Tool
35
+ - Questionnaire-based tool to help organizations assess data processing risks
36
+ - Risk scoring matrix
37
+ - Mitigation recommendation engine
38
+ - Exportable reports for compliance documentation
39
+
40
+ ### 5. Breach Notification Module
41
+ - Templates for mandatory breach notifications
42
+ - Workflow for documenting breach details
43
+ - Timeline tracking to ensure 72-hour notification compliance
44
+ - Notification delivery to authorities via API (if available)
45
+ ### 6. Data Subject Request Service
46
+ - Lightweight requestService storing requests in browser localStorage for demos
47
+ - Helper methods to update request status and retrieve history
48
+
49
+ ## Getting Started
50
+
51
+ First, run the development server:
64
52
 
65
53
  ```bash
66
- # Using npm
67
- npm install @tantainnovative/ndpr-toolkit
68
-
69
- # Using yarn
70
- yarn add @tantainnovative/ndpr-toolkit
71
-
72
- # Using pnpm
73
- pnpm add @tantainnovative/ndpr-toolkit
54
+ npm run dev
55
+ # or
56
+ yarn dev
57
+ # or
58
+ pnpm dev
59
+ # or
60
+ bun dev
74
61
  ```
75
62
 
76
- ## Quick Start
63
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
77
64
 
78
- ### Consent Management
65
+ ## Deployment
79
66
 
80
- ```jsx
81
- import { ConsentBanner, ConsentManager, ConsentStorage, useConsent } from '@tantainnovative/ndpr-toolkit';
67
+ ### GitHub Pages
82
68
 
83
- function MyApp() {
84
- return (
85
- <ConsentManager
86
- options={[
87
- {
88
- id: 'necessary',
89
- label: 'Necessary Cookies',
90
- description: 'Essential cookies for the website to function.',
91
- required: true
92
- },
93
- {
94
- id: 'analytics',
95
- label: 'Analytics Cookies',
96
- description: 'Cookies that help us understand how you use our website.',
97
- required: false
98
- }
99
- ]}
100
- storageKey="my-app-consent"
101
- autoLoad={true}
102
- autoSave={true}
103
- >
104
- <AppContent />
105
- <ConsentBanner
106
- position="bottom"
107
- privacyPolicyUrl="/privacy-policy"
108
- showPreferences={true}
109
- onSave={(consents) => console.log('Consent saved:', consents)}
110
- />
111
- </ConsentManager>
112
- );
113
- }
69
+ This project is configured to deploy automatically to GitHub Pages using GitHub Actions. When you push changes to the `main` branch, the following will happen:
114
70
 
115
- function AppContent() {
116
- // Use the useConsent hook to manage consent state
117
- const { consents, hasConsented, updateConsent } = useConsent();
118
-
119
- // Check if user has given consent for analytics
120
- if (hasConsented('analytics')) {
121
- // Initialize analytics
122
- }
123
-
124
- return (
125
- <div>
126
- {/* Your app content */}
127
- </div>
128
- );
129
- }
130
- ```
71
+ 1. The GitHub Actions workflow will build the project
72
+ 2. The built files will be deployed to GitHub Pages
73
+ 3. Your site will be available at `https://[your-username].github.io/ndpr-toolkit/`
131
74
 
132
- ### Privacy Policy Generator
133
-
134
- ```jsx
135
- import { PolicyGenerator, PolicyPreview, PolicyExporter, usePrivacyPolicy } from '@tantainnovative/ndpr-toolkit';
136
-
137
- function PrivacyPolicyPage() {
138
- const { policy, updateVariableValue, generatePolicy } = usePrivacyPolicy();
139
- const [generatedPolicy, setGeneratedPolicy] = useState(null);
140
-
141
- // Define your variables
142
- const variables = {
143
- organizationName: 'Acme Corporation',
144
- websiteUrl: 'https://acme.com',
145
- contactEmail: 'privacy@acme.com',
146
- lastUpdated: new Date().toLocaleDateString()
147
- };
148
-
149
- return (
150
- <div>
151
- {!generatedPolicy ? (
152
- <PolicyGenerator
153
- templates={[
154
- {
155
- id: 'standard',
156
- name: 'Standard Privacy Policy',
157
- description: 'A comprehensive privacy policy suitable for most websites and applications.',
158
- sections: [
159
- {
160
- id: 'introduction',
161
- title: 'Introduction',
162
- template: 'This Privacy Policy explains how {{organizationName}} collects, uses, and protects your personal data when you visit {{websiteUrl}}.',
163
- required: true,
164
- included: true
165
- },
166
- // More sections...
167
- ]
168
- }
169
- ]}
170
- variables={variables}
171
- onComplete={(data) => {
172
- // Generate policy with variables
173
- const result = generatePolicyText(data.sections, variables);
174
- setGeneratedPolicy({
175
- title: `Privacy Policy for ${variables.organizationName}`,
176
- content: result.fullText,
177
- lastUpdated: new Date()
178
- });
179
- }}
180
- />
181
- ) : (
182
- <>
183
- <PolicyPreview
184
- policy={generatedPolicy}
185
- variables={variables}
186
- onVariableChange={(newVariables) => {
187
- // Update variables and regenerate policy
188
- }}
189
- />
190
-
191
- <PolicyExporter
192
- policy={generatedPolicy}
193
- formats={['html', 'pdf', 'markdown']}
194
- filename="privacy-policy"
195
- />
196
- </>
197
- )}
198
- </div>
199
- );
200
- }
201
- ```
75
+ To manually deploy to GitHub Pages:
202
76
 
203
- ## Component Categories
204
-
205
- ### Consent Management
206
- - `ConsentBanner`: Cookie consent banner with customizable options
207
- - `ConsentManager`: Component for managing consent preferences
208
- - `ConsentStorage`: Storage mechanism for consent settings with support for localStorage, sessionStorage, and cookies
209
- - `useConsent`: Hook for managing consent state
210
-
211
- ### Data Subject Rights
212
- - `DSRRequestForm`: Form for submitting data subject rights requests
213
- - `DSRDashboard`: Admin dashboard for managing DSR requests
214
- - `DSRTracker`: Component for tracking the status of DSR requests
215
- - `useDSR`: Hook for managing DSR state
216
- - Types: `DSRType`, `DSRStatus`, `DSRRequest` for type-safe implementation
217
-
218
- ### DPIA (Data Protection Impact Assessment)
219
- - `DPIAQuestionnaire`: Interactive questionnaire for conducting DPIAs
220
- - `DPIAReport`: Component for generating DPIA reports
221
- - `StepIndicator`: Progress indicator for multi-step processes
222
- - `useDPIA`: Hook for managing DPIA state
223
- - Types: `DPIAQuestion`, `DPIASection`, `DPIARisk`, `DPIAResult` for structured assessments
224
-
225
- ### Breach Notification
226
- - `BreachReportForm`: Form for reporting data breaches
227
- - `BreachRiskAssessment`: Tool for assessing breach risk and severity
228
- - `BreachNotificationManager`: Component for managing breach notifications
229
- - `RegulatoryReportGenerator`: Tool for generating regulatory reports for NITDA
230
- - `useBreach`: Hook for managing breach notification state
231
- - Types: `BreachReport`, `RiskAssessment`, `NotificationRequirement` for compliance with 72-hour notification requirements
232
-
233
- ### Privacy Policy
234
- - `PolicyGenerator`: Component for generating privacy policies
235
- - `PolicyPreview`: Preview component for privacy policies
236
- - `PolicyExporter`: Tool for exporting privacy policies to different formats
237
- - `generatePolicyText`: Utility for creating dynamic policies with variable support
238
- - `usePrivacyPolicy`: Hook for managing privacy policy state
239
-
240
- ## Implementation Guides
241
-
242
- ### Setting Up Consent Management
243
-
244
- ```jsx
245
- // 1. Wrap your application with ConsentManager
246
- import { ConsentManager } from 'ndpr-toolkit';
247
-
248
- function App() {
249
- return (
250
- <ConsentManager
251
- options={[
252
- { id: 'necessary', label: 'Necessary', description: '...', required: true },
253
- { id: 'analytics', label: 'Analytics', description: '...', required: false },
254
- { id: 'marketing', label: 'Marketing', description: '...', required: false }
255
- ]}
256
- storageKey="my-app-consent"
257
- autoLoad={true}
258
- autoSave={true}
259
- >
260
- <YourApp />
261
- </ConsentManager>
262
- );
263
- }
264
-
265
- // 2. Add the ConsentBanner to your layout
266
- import { ConsentBanner } from 'ndpr-toolkit';
267
-
268
- function Layout({ children }) {
269
- return (
270
- <>
271
- {children}
272
- <ConsentBanner
273
- position="bottom"
274
- privacyPolicyUrl="/privacy-policy"
275
- showPreferences={true}
276
- />
277
- </>
278
- );
279
- }
280
-
281
- // 3. Use the consent values in your components
282
- import { useConsent } from 'ndpr-toolkit';
283
-
284
- function AnalyticsComponent() {
285
- const { hasConsented } = useConsent();
286
-
287
- useEffect(() => {
288
- if (hasConsented('analytics')) {
289
- // Initialize analytics
290
- }
291
- }, [hasConsented]);
292
-
293
- return null;
294
- }
295
- ```
296
-
297
- ### Implementing a Data Subject Rights Portal
298
-
299
- ```jsx
300
- import { DSRRequestForm, DSRTracker, DSRDashboard, useDSR } from '@tantainnovative/ndpr-toolkit';
301
-
302
- // 1. Create a form for data subjects to submit requests
303
- function DSRPortal() {
304
- const { submitRequest } = useDSR();
305
-
306
- const handleSubmit = (formData) => {
307
- const request = submitRequest({
308
- type: formData.type,
309
- subject: {
310
- name: formData.name,
311
- email: formData.email,
312
- phone: formData.phone
313
- },
314
- details: formData.details
315
- });
316
-
317
- // Show confirmation with tracking ID
318
- alert(`Your request has been submitted. Your tracking ID is: ${request.id}`);
319
- };
320
-
321
- return (
322
- <DSRRequestForm
323
- onSubmit={handleSubmit}
324
- requestTypes={[
325
- { id: 'access', label: 'Access my data' },
326
- { id: 'rectification', label: 'Correct my data' },
327
- { id: 'erasure', label: 'Delete my data' },
328
- { id: 'restriction', label: 'Restrict processing of my data' },
329
- { id: 'portability', label: 'Data portability' },
330
- { id: 'objection', label: 'Object to processing' }
331
- ]}
332
- />
333
- );
334
- }
335
-
336
- // 2. Create an admin dashboard for managing requests
337
- import { DSRDashboard } from '@tantainnovative/ndpr-toolkit';
338
-
339
- function AdminDashboard() {
340
- const { requests, updateRequest, deleteRequest } = useDSR();
341
-
342
- return (
343
- <DSRDashboard
344
- requests={requests}
345
- onUpdateRequest={updateRequest}
346
- onDeleteRequest={deleteRequest}
347
- />
348
- );
349
- }
350
- ```
351
-
352
- ### Setting Up a Breach Notification System
353
-
354
- ```jsx
355
- import { BreachReportForm, BreachRiskAssessment, RegulatoryReportGenerator, useBreach } from '@tantainnovative/ndpr-toolkit';
356
-
357
- // 1. Create a form for reporting breaches
358
- function BreachReporting() {
359
- const { submitBreachReport } = useBreach();
360
-
361
- const handleSubmit = (formData) => {
362
- const report = submitBreachReport({
363
- title: formData.title,
364
- description: formData.description,
365
- category: formData.category,
366
- discoveredAt: Date.now(),
367
- reporter: {
368
- name: formData.reporterName,
369
- email: formData.reporterEmail,
370
- department: formData.department
371
- },
372
- affectedSystems: formData.systems,
373
- dataTypes: formData.dataTypes,
374
- status: 'ongoing'
375
- });
376
-
377
- // Redirect to risk assessment
378
- navigate(`/breach/${report.id}/assess`);
379
- };
380
-
381
- return (
382
- <BreachReportForm
383
- onSubmit={handleSubmit}
384
- categories={[
385
- { id: 'unauthorized-access', label: 'Unauthorized Access' },
386
- { id: 'data-loss', label: 'Data Loss' },
387
- { id: 'system-compromise', label: 'System Compromise' }
388
- ]}
389
- />
390
- );
391
- }
77
+ ```bash
78
+ # Build the project
79
+ npm run build
392
80
 
393
- // 2. Create a risk assessment component
394
- function RiskAssessment({ breachId }) {
395
- const { performRiskAssessment, determineNotificationRequirements } = useBreach();
396
-
397
- const handleAssessment = (assessmentData) => {
398
- const assessment = performRiskAssessment({
399
- breachId,
400
- assessor: {
401
- name: 'Jane Smith',
402
- role: 'Data Protection Officer',
403
- email: 'jane@example.com'
404
- },
405
- ...assessmentData
406
- });
407
-
408
- const requirements = determineNotificationRequirements({
409
- breachId,
410
- riskAssessmentId: assessment.id
411
- });
412
-
413
- // Show notification requirements
414
- if (requirements.nitdaNotificationRequired) {
415
- // Deadline is 72 hours from discovery
416
- const deadline = new Date(requirements.nitdaNotificationDeadline);
417
- alert(`NITDA notification required by ${deadline.toLocaleString()}`);
418
- }
419
- };
420
-
421
- return (
422
- <BreachRiskAssessment
423
- breachId={breachId}
424
- onComplete={handleAssessment}
425
- />
426
- );
427
- }
81
+ # Deploy to GitHub Pages (if you have gh-pages installed)
82
+ npm run deploy
428
83
  ```
429
84
 
430
- ## Documentation
85
+ #### Configuration
431
86
 
432
- For detailed documentation, visit [https://ndpr-toolkit.tantainnovative.com/docs](https://ndpr-toolkit.tantainnovative.com/docs)
87
+ The GitHub Pages deployment is configured in the following files:
88
+ - `next.config.ts` - Contains the Next.js configuration for static export
89
+ - `.github/workflows/deploy.yml` - Contains the GitHub Actions workflow for automated deployment
433
90
 
434
- ### API Reference
91
+ ## Technical Stack
435
92
 
436
- Detailed API documentation is available for all components:
93
+ - Next.js with App Router
94
+ - TypeScript
95
+ - Tailwind CSS
96
+ - React
437
97
 
438
- - [Consent Management](https://ndpr-toolkit.tantainnovative.com/docs/components/consent-management)
439
- - [Data Subject Rights](https://ndpr-toolkit.tantainnovative.com/docs/components/data-subject-rights)
440
- - [DPIA Questionnaire](https://ndpr-toolkit.tantainnovative.com/docs/components/dpia-questionnaire)
441
- - [Breach Notification](https://ndpr-toolkit.tantainnovative.com/docs/components/breach-notification)
442
- - [Privacy Policy Generator](https://ndpr-toolkit.tantainnovative.com/docs/components/privacy-policy-generator)
443
- - [React Hooks](https://ndpr-toolkit.tantainnovative.com/docs/components/hooks)
444
-
445
- ## Contributing
98
+ ## License
446
99
 
447
- Contributions are welcome! Please feel free to submit a Pull Request.
100
+ MIT License
448
101
 
449
- ## License
102
+ ## Developed by
450
103
 
451
- MIT © Tanta Innovative
104
+ Tanta Innovative - Positioning as a thought leader in regulatory tech solutions for Nigeria
@@ -0,0 +1,140 @@
1
+ # NDPR Toolkit v1.0.0 Release Notes
2
+
3
+ **Release Date:** May 4, 2025
4
+ **Package:** [@tantainnovative/ndpr-toolkit](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
5
+ **Version:** 1.0.0 (Initial Stable Release)
6
+
7
+ ## Overview
8
+
9
+ We are excited to announce the official release of the NDPR Toolkit v1.0.0, a comprehensive solution for implementing Nigeria Data Protection Regulation (NDPR) compliance features in web applications. This enterprise-ready toolkit provides a complete set of components, hooks, and utilities to help organizations meet their NDPR compliance obligations efficiently and effectively.
10
+
11
+ ## Key Features
12
+
13
+ ### 1. Privacy Policy Management
14
+ - **PolicyGenerator**: Create customizable, NDPR-compliant privacy policies with an intuitive form interface
15
+ - **PolicyPreview**: Display generated policies with professional formatting and section navigation
16
+ - **PolicyExporter**: Export policies in multiple formats (PDF, HTML, Markdown) with compliance notices
17
+
18
+ ### 2. Consent Management
19
+ - **ConsentBanner**: Implement cookie consent banners with customizable appearance and behavior
20
+ - **ConsentManager**: Track and manage user consent preferences across your application
21
+ - **ConsentStorage**: Securely store and retrieve consent records with built-in persistence
22
+
23
+ ### 3. Data Subject Rights (DSR)
24
+ - **DSRRequestForm**: Collect and validate data subject requests with comprehensive form validation
25
+ - **DSRTracker**: Monitor the status and progress of data subject requests
26
+ - **DSRDashboard**: Visualize and manage all data subject requests in one place
27
+
28
+ ### 4. Data Protection Impact Assessment (DPIA)
29
+ - **DPIAQuestionnaire**: Guide users through the DPIA process with step-by-step questionnaires
30
+ - **DPIAReport**: Generate comprehensive DPIA reports based on questionnaire responses
31
+ - **StepIndicator**: Track progress through multi-step DPIA processes
32
+
33
+ ### 5. Breach Notification
34
+ - **BreachReportForm**: Collect essential information about data breaches
35
+ - **BreachRiskAssessment**: Evaluate the risk level of reported breaches
36
+ - **RegulatoryReportGenerator**: Create NDPR-compliant breach notification reports
37
+ - **BreachNotificationManager**: Manage the entire breach notification workflow
38
+
39
+ ## Technical Specifications
40
+
41
+ - **Framework Compatibility**: React 18+
42
+ - **TypeScript Support**: Full TypeScript definitions for all components and utilities
43
+ - **Modular Architecture**: Use only what you need with tree-shakable imports
44
+ - **Customization**: Extensive theming and styling options
45
+ - **Accessibility**: WCAG 2.1 AA compliant components
46
+ - **Performance**: Optimized bundle size with minimal dependencies
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ # Using npm
52
+ npm install @tantainnovative/ndpr-toolkit
53
+
54
+ # Using yarn
55
+ yarn add @tantainnovative/ndpr-toolkit
56
+
57
+ # Using pnpm
58
+ pnpm add @tantainnovative/ndpr-toolkit
59
+ ```
60
+
61
+ ## Usage Example
62
+
63
+ ```jsx
64
+ import { ConsentBanner, useConsent } from '@tantainnovative/ndpr-toolkit';
65
+
66
+ function App() {
67
+ const { consent, updateConsent } = useConsent();
68
+
69
+ return (
70
+ <div className="app">
71
+ <ConsentBanner
72
+ title="Cookie Consent"
73
+ description="We use cookies to enhance your browsing experience."
74
+ cookieCategories={[
75
+ { id: 'necessary', name: 'Necessary', required: true },
76
+ { id: 'analytics', name: 'Analytics' },
77
+ { id: 'marketing', name: 'Marketing' }
78
+ ]}
79
+ onAccept={(categories) => updateConsent(categories)}
80
+ onReject={() => updateConsent(['necessary'])}
81
+ />
82
+ {/* Your app content */}
83
+ </div>
84
+ );
85
+ }
86
+ ```
87
+
88
+ ## Documentation
89
+
90
+ Comprehensive documentation is available at:
91
+ - [GitHub Repository](https://github.com/tantainnovative/ndpr-toolkit)
92
+ - [Implementation Guides](https://github.com/tantainnovative/ndpr-toolkit/docs)
93
+ - [API Reference](https://github.com/tantainnovative/ndpr-toolkit/docs/api)
94
+
95
+ ## Breaking Changes
96
+
97
+ This is the initial stable release, so there are no breaking changes from previous versions.
98
+
99
+ ## Bug Fixes
100
+
101
+ - Fixed conditional rendering in policy templates
102
+ - Resolved issues with form validation in DSR components
103
+ - Improved error handling in consent management
104
+ - Fixed accessibility issues in UI components
105
+
106
+ ## Performance Improvements
107
+
108
+ - Optimized bundle size with tree-shaking
109
+ - Improved rendering performance of complex forms
110
+ - Reduced memory usage in data management utilities
111
+
112
+ ## Security Enhancements
113
+
114
+ - Implemented secure storage for consent records
115
+ - Added data sanitization for all user inputs
116
+ - Enhanced protection against XSS attacks
117
+
118
+ ## Upcoming Features
119
+
120
+ We're already working on the next release, which will include:
121
+ - Integration with popular authentication providers
122
+ - Enhanced reporting capabilities
123
+ - Additional export formats
124
+ - Internationalization support
125
+
126
+ ## Acknowledgements
127
+
128
+ We would like to thank all contributors and early adopters who provided valuable feedback during the development of this toolkit.
129
+
130
+ ## License
131
+
132
+ MIT License - See LICENSE file for details.
133
+
134
+ ## Support
135
+
136
+ For enterprise support, please contact support@tantainnovative.com
137
+
138
+ ---
139
+
140
+ © 2025 Tanta Innovative. All rights reserved.