@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.
- package/.claude/settings.local.json +20 -0
- package/.eslintrc.json +10 -0
- package/.github/workflows/ci.yml +36 -0
- package/.github/workflows/nextjs.yml +104 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.lintstagedrc.js +4 -0
- package/.nvmrc +1 -0
- package/.versionrc +17 -0
- package/CHANGELOG.md +16 -0
- package/CLAUDE.md +90 -0
- package/CNAME +1 -0
- package/CONTRIBUTING.md +87 -0
- package/README.md +84 -447
- package/RELEASE-NOTES-v1.0.0.md +140 -0
- package/RELEASE-NOTES-v1.0.1.md +69 -0
- package/SECURITY.md +21 -0
- package/commitlint.config.js +36 -0
- package/components.json +21 -0
- package/eslint.config.mjs +16 -0
- package/jest.config.js +31 -0
- package/jest.setup.js +15 -0
- package/next.config.js +15 -0
- package/next.config.ts +62 -0
- package/package.json +70 -52
- package/packages/ndpr-toolkit/README.md +467 -0
- package/packages/ndpr-toolkit/jest.config.js +23 -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/__tests__/components/consent/ConsentBanner.test.tsx +119 -0
- package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentManager.test.tsx +122 -0
- package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentStorage.test.tsx +270 -0
- package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRDashboard.test.tsx +199 -0
- package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRRequestForm.test.tsx +224 -0
- package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRTracker.test.tsx +104 -0
- package/packages/ndpr-toolkit/src/__tests__/hooks/useConsent.test.tsx +161 -0
- package/packages/ndpr-toolkit/src/__tests__/hooks/useDSR.test.tsx +330 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/breach.test.ts +149 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/consent.test.ts +88 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/dpia.test.ts +160 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/dsr.test.ts +110 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/privacy.test.ts +97 -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/{dist/index.d.ts → packages/ndpr-toolkit/src/index.ts} +13 -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/public/NDPR TOOLKIT.svg +1 -0
- package/public/favicon/android-chrome-192x192.png +0 -0
- package/public/favicon/android-chrome-512x512.png +0 -0
- package/public/favicon/apple-touch-icon.png +0 -0
- package/public/favicon/favicon-16x16.png +0 -0
- package/public/favicon/favicon-32x32.png +0 -0
- package/public/favicon/site.webmanifest +1 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/ndpr-toolkit-logo.svg +108 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/__tests__/example.test.ts +13 -0
- package/src/__tests__/requestService.test.ts +57 -0
- package/src/app/accessibility.css +70 -0
- package/src/app/docs/components/DocLayout.tsx +267 -0
- package/src/app/docs/components/breach-notification/page.tsx +797 -0
- package/src/app/docs/components/consent-management/page.tsx +576 -0
- package/src/app/docs/components/data-subject-rights/page.tsx +511 -0
- package/src/app/docs/components/dpia-questionnaire/layout.tsx +15 -0
- package/src/app/docs/components/dpia-questionnaire/metadata.ts +31 -0
- package/src/app/docs/components/dpia-questionnaire/page.tsx +666 -0
- package/src/app/docs/components/hooks/page.tsx +305 -0
- package/src/app/docs/components/page.tsx +84 -0
- package/src/app/docs/components/privacy-policy-generator/page.tsx +634 -0
- package/src/app/docs/guides/breach-notification-process/components/BestPractices.tsx +123 -0
- package/src/app/docs/guides/breach-notification-process/components/ImplementationSteps.tsx +328 -0
- package/src/app/docs/guides/breach-notification-process/components/Introduction.tsx +28 -0
- package/src/app/docs/guides/breach-notification-process/components/NotificationTimeline.tsx +91 -0
- package/src/app/docs/guides/breach-notification-process/components/Resources.tsx +118 -0
- package/src/app/docs/guides/breach-notification-process/page.tsx +39 -0
- package/src/app/docs/guides/conducting-dpia/page.tsx +593 -0
- package/src/app/docs/guides/data-subject-requests/page.tsx +666 -0
- package/src/app/docs/guides/managing-consent/page.tsx +738 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/ComplianceChecklist.tsx +296 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/ImplementationTools.tsx +145 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/Introduction.tsx +33 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/KeyRequirements.tsx +99 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/Resources.tsx +159 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/page.tsx +38 -0
- package/src/app/docs/guides/page.tsx +67 -0
- package/src/app/docs/layout.tsx +15 -0
- package/src/app/docs/metadata.ts +31 -0
- package/src/app/docs/page.tsx +572 -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 +159 -0
- package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +419 -0
- package/src/components/docs/DocLayout.tsx +289 -0
- package/src/components/docs/index.ts +2 -0
- package/src/components/dpia/DPIAQuestionnaire.tsx +483 -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 +335 -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 +172 -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 +64 -0
- package/src/hooks/useLoadingState.ts +85 -0
- package/src/lib/consentService.ts +137 -0
- package/src/lib/dpiaQuestions.ts +148 -0
- package/src/lib/requestService.ts +75 -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 +72 -0
- package/tailwind.config.ts +65 -0
- package/tsconfig.json +41 -0
- package/dist/components/breach/BreachNotificationManager.d.ts +0 -62
- package/dist/components/breach/BreachReportForm.d.ts +0 -66
- package/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
- package/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
- package/dist/components/consent/ConsentBanner.d.ts +0 -79
- package/dist/components/consent/ConsentManager.d.ts +0 -73
- package/dist/components/consent/ConsentStorage.d.ts +0 -41
- package/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
- package/dist/components/dpia/DPIAReport.d.ts +0 -40
- package/dist/components/dpia/StepIndicator.d.ts +0 -64
- package/dist/components/dsr/DSRDashboard.d.ts +0 -58
- package/dist/components/dsr/DSRRequestForm.d.ts +0 -74
- package/dist/components/dsr/DSRTracker.d.ts +0 -56
- package/dist/components/policy/PolicyExporter.d.ts +0 -65
- package/dist/components/policy/PolicyGenerator.d.ts +0 -54
- package/dist/components/policy/PolicyPreview.d.ts +0 -71
- package/dist/hooks/useBreach.d.ts +0 -97
- package/dist/hooks/useConsent.d.ts +0 -63
- package/dist/hooks/useDPIA.d.ts +0 -92
- package/dist/hooks/useDSR.d.ts +0 -72
- package/dist/hooks/usePrivacyPolicy.d.ts +0 -87
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/setupTests.d.ts +0 -2
- package/dist/types/breach.d.ts +0 -239
- package/dist/types/consent.d.ts +0 -95
- package/dist/types/dpia.d.ts +0 -196
- package/dist/types/dsr.d.ts +0 -162
- package/dist/types/privacy.d.ts +0 -204
- package/dist/utils/breach.d.ts +0 -14
- package/dist/utils/consent.d.ts +0 -10
- package/dist/utils/dpia.d.ts +0 -12
- package/dist/utils/dsr.d.ts +0 -11
- package/dist/utils/privacy.d.ts +0 -12
package/README.md
CHANGED
|
@@ -1,467 +1,104 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
|
64
|
-
|
|
65
|
-
```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
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### React 19 Compatibility
|
|
77
|
-
|
|
78
|
-
If you're using React 19 and encounter peer dependency warnings with other packages in your project, you can use the `--legacy-peer-deps` flag:
|
|
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:
|
|
79
52
|
|
|
80
53
|
```bash
|
|
81
|
-
npm
|
|
54
|
+
npm run dev
|
|
55
|
+
# or
|
|
56
|
+
yarn dev
|
|
57
|
+
# or
|
|
58
|
+
pnpm dev
|
|
59
|
+
# or
|
|
60
|
+
bun dev
|
|
82
61
|
```
|
|
83
62
|
|
|
84
|
-
|
|
63
|
+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
85
64
|
|
|
86
|
-
|
|
87
|
-
legacy-peer-deps=true
|
|
88
|
-
```
|
|
65
|
+
## Deployment
|
|
89
66
|
|
|
90
|
-
|
|
67
|
+
### GitHub Pages
|
|
91
68
|
|
|
92
|
-
|
|
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:
|
|
93
70
|
|
|
94
|
-
|
|
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/`
|
|
95
74
|
|
|
96
|
-
|
|
97
|
-
import { ConsentBanner, ConsentManager, ConsentStorage, useConsent } from '@tantainnovative/ndpr-toolkit';
|
|
75
|
+
To manually deploy to GitHub Pages:
|
|
98
76
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
options={[
|
|
103
|
-
{
|
|
104
|
-
id: 'necessary',
|
|
105
|
-
label: 'Necessary Cookies',
|
|
106
|
-
description: 'Essential cookies for the website to function.',
|
|
107
|
-
required: true
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: 'analytics',
|
|
111
|
-
label: 'Analytics Cookies',
|
|
112
|
-
description: 'Cookies that help us understand how you use our website.',
|
|
113
|
-
required: false
|
|
114
|
-
}
|
|
115
|
-
]}
|
|
116
|
-
storageKey="my-app-consent"
|
|
117
|
-
autoLoad={true}
|
|
118
|
-
autoSave={true}
|
|
119
|
-
>
|
|
120
|
-
<AppContent />
|
|
121
|
-
<ConsentBanner
|
|
122
|
-
position="bottom"
|
|
123
|
-
privacyPolicyUrl="/privacy-policy"
|
|
124
|
-
showPreferences={true}
|
|
125
|
-
onSave={(consents) => console.log('Consent saved:', consents)}
|
|
126
|
-
/>
|
|
127
|
-
</ConsentManager>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function AppContent() {
|
|
132
|
-
// Use the useConsent hook to manage consent state
|
|
133
|
-
const { consents, hasConsented, updateConsent } = useConsent();
|
|
134
|
-
|
|
135
|
-
// Check if user has given consent for analytics
|
|
136
|
-
if (hasConsented('analytics')) {
|
|
137
|
-
// Initialize analytics
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<div>
|
|
142
|
-
{/* Your app content */}
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Privacy Policy Generator
|
|
149
|
-
|
|
150
|
-
```jsx
|
|
151
|
-
import { PolicyGenerator, PolicyPreview, PolicyExporter, usePrivacyPolicy } from '@tantainnovative/ndpr-toolkit';
|
|
152
|
-
|
|
153
|
-
function PrivacyPolicyPage() {
|
|
154
|
-
const { policy, updateVariableValue, generatePolicy } = usePrivacyPolicy();
|
|
155
|
-
const [generatedPolicy, setGeneratedPolicy] = useState(null);
|
|
156
|
-
|
|
157
|
-
// Define your variables
|
|
158
|
-
const variables = {
|
|
159
|
-
organizationName: 'Acme Corporation',
|
|
160
|
-
websiteUrl: 'https://acme.com',
|
|
161
|
-
contactEmail: 'privacy@acme.com',
|
|
162
|
-
lastUpdated: new Date().toLocaleDateString()
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
return (
|
|
166
|
-
<div>
|
|
167
|
-
{!generatedPolicy ? (
|
|
168
|
-
<PolicyGenerator
|
|
169
|
-
templates={[
|
|
170
|
-
{
|
|
171
|
-
id: 'standard',
|
|
172
|
-
name: 'Standard Privacy Policy',
|
|
173
|
-
description: 'A comprehensive privacy policy suitable for most websites and applications.',
|
|
174
|
-
sections: [
|
|
175
|
-
{
|
|
176
|
-
id: 'introduction',
|
|
177
|
-
title: 'Introduction',
|
|
178
|
-
template: 'This Privacy Policy explains how {{organizationName}} collects, uses, and protects your personal data when you visit {{websiteUrl}}.',
|
|
179
|
-
required: true,
|
|
180
|
-
included: true
|
|
181
|
-
},
|
|
182
|
-
// More sections...
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
]}
|
|
186
|
-
variables={variables}
|
|
187
|
-
onComplete={(data) => {
|
|
188
|
-
// Generate policy with variables
|
|
189
|
-
const result = generatePolicyText(data.sections, variables);
|
|
190
|
-
setGeneratedPolicy({
|
|
191
|
-
title: `Privacy Policy for ${variables.organizationName}`,
|
|
192
|
-
content: result.fullText,
|
|
193
|
-
lastUpdated: new Date()
|
|
194
|
-
});
|
|
195
|
-
}}
|
|
196
|
-
/>
|
|
197
|
-
) : (
|
|
198
|
-
<>
|
|
199
|
-
<PolicyPreview
|
|
200
|
-
policy={generatedPolicy}
|
|
201
|
-
variables={variables}
|
|
202
|
-
onVariableChange={(newVariables) => {
|
|
203
|
-
// Update variables and regenerate policy
|
|
204
|
-
}}
|
|
205
|
-
/>
|
|
206
|
-
|
|
207
|
-
<PolicyExporter
|
|
208
|
-
policy={generatedPolicy}
|
|
209
|
-
formats={['html', 'pdf', 'markdown']}
|
|
210
|
-
filename="privacy-policy"
|
|
211
|
-
/>
|
|
212
|
-
</>
|
|
213
|
-
)}
|
|
214
|
-
</div>
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Component Categories
|
|
220
|
-
|
|
221
|
-
### Consent Management
|
|
222
|
-
- `ConsentBanner`: Cookie consent banner with customizable options
|
|
223
|
-
- `ConsentManager`: Component for managing consent preferences
|
|
224
|
-
- `ConsentStorage`: Storage mechanism for consent settings with support for localStorage, sessionStorage, and cookies
|
|
225
|
-
- `useConsent`: Hook for managing consent state
|
|
226
|
-
|
|
227
|
-
### Data Subject Rights
|
|
228
|
-
- `DSRRequestForm`: Form for submitting data subject rights requests
|
|
229
|
-
- `DSRDashboard`: Admin dashboard for managing DSR requests
|
|
230
|
-
- `DSRTracker`: Component for tracking the status of DSR requests
|
|
231
|
-
- `useDSR`: Hook for managing DSR state
|
|
232
|
-
- Types: `DSRType`, `DSRStatus`, `DSRRequest` for type-safe implementation
|
|
233
|
-
|
|
234
|
-
### DPIA (Data Protection Impact Assessment)
|
|
235
|
-
- `DPIAQuestionnaire`: Interactive questionnaire for conducting DPIAs
|
|
236
|
-
- `DPIAReport`: Component for generating DPIA reports
|
|
237
|
-
- `StepIndicator`: Progress indicator for multi-step processes
|
|
238
|
-
- `useDPIA`: Hook for managing DPIA state
|
|
239
|
-
- Types: `DPIAQuestion`, `DPIASection`, `DPIARisk`, `DPIAResult` for structured assessments
|
|
240
|
-
|
|
241
|
-
### Breach Notification
|
|
242
|
-
- `BreachReportForm`: Form for reporting data breaches
|
|
243
|
-
- `BreachRiskAssessment`: Tool for assessing breach risk and severity
|
|
244
|
-
- `BreachNotificationManager`: Component for managing breach notifications
|
|
245
|
-
- `RegulatoryReportGenerator`: Tool for generating regulatory reports for NITDA
|
|
246
|
-
- `useBreach`: Hook for managing breach notification state
|
|
247
|
-
- Types: `BreachReport`, `RiskAssessment`, `NotificationRequirement` for compliance with 72-hour notification requirements
|
|
248
|
-
|
|
249
|
-
### Privacy Policy
|
|
250
|
-
- `PolicyGenerator`: Component for generating privacy policies
|
|
251
|
-
- `PolicyPreview`: Preview component for privacy policies
|
|
252
|
-
- `PolicyExporter`: Tool for exporting privacy policies to different formats
|
|
253
|
-
- `generatePolicyText`: Utility for creating dynamic policies with variable support
|
|
254
|
-
- `usePrivacyPolicy`: Hook for managing privacy policy state
|
|
255
|
-
|
|
256
|
-
## Implementation Guides
|
|
257
|
-
|
|
258
|
-
### Setting Up Consent Management
|
|
259
|
-
|
|
260
|
-
```jsx
|
|
261
|
-
// 1. Wrap your application with ConsentManager
|
|
262
|
-
import { ConsentManager } from 'ndpr-toolkit';
|
|
263
|
-
|
|
264
|
-
function App() {
|
|
265
|
-
return (
|
|
266
|
-
<ConsentManager
|
|
267
|
-
options={[
|
|
268
|
-
{ id: 'necessary', label: 'Necessary', description: '...', required: true },
|
|
269
|
-
{ id: 'analytics', label: 'Analytics', description: '...', required: false },
|
|
270
|
-
{ id: 'marketing', label: 'Marketing', description: '...', required: false }
|
|
271
|
-
]}
|
|
272
|
-
storageKey="my-app-consent"
|
|
273
|
-
autoLoad={true}
|
|
274
|
-
autoSave={true}
|
|
275
|
-
>
|
|
276
|
-
<YourApp />
|
|
277
|
-
</ConsentManager>
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// 2. Add the ConsentBanner to your layout
|
|
282
|
-
import { ConsentBanner } from 'ndpr-toolkit';
|
|
283
|
-
|
|
284
|
-
function Layout({ children }) {
|
|
285
|
-
return (
|
|
286
|
-
<>
|
|
287
|
-
{children}
|
|
288
|
-
<ConsentBanner
|
|
289
|
-
position="bottom"
|
|
290
|
-
privacyPolicyUrl="/privacy-policy"
|
|
291
|
-
showPreferences={true}
|
|
292
|
-
/>
|
|
293
|
-
</>
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// 3. Use the consent values in your components
|
|
298
|
-
import { useConsent } from 'ndpr-toolkit';
|
|
299
|
-
|
|
300
|
-
function AnalyticsComponent() {
|
|
301
|
-
const { hasConsented } = useConsent();
|
|
302
|
-
|
|
303
|
-
useEffect(() => {
|
|
304
|
-
if (hasConsented('analytics')) {
|
|
305
|
-
// Initialize analytics
|
|
306
|
-
}
|
|
307
|
-
}, [hasConsented]);
|
|
308
|
-
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### Implementing a Data Subject Rights Portal
|
|
314
|
-
|
|
315
|
-
```jsx
|
|
316
|
-
import { DSRRequestForm, DSRTracker, DSRDashboard, useDSR } from '@tantainnovative/ndpr-toolkit';
|
|
317
|
-
|
|
318
|
-
// 1. Create a form for data subjects to submit requests
|
|
319
|
-
function DSRPortal() {
|
|
320
|
-
const { submitRequest } = useDSR();
|
|
321
|
-
|
|
322
|
-
const handleSubmit = (formData) => {
|
|
323
|
-
const request = submitRequest({
|
|
324
|
-
type: formData.type,
|
|
325
|
-
subject: {
|
|
326
|
-
name: formData.name,
|
|
327
|
-
email: formData.email,
|
|
328
|
-
phone: formData.phone
|
|
329
|
-
},
|
|
330
|
-
details: formData.details
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
// Show confirmation with tracking ID
|
|
334
|
-
alert(`Your request has been submitted. Your tracking ID is: ${request.id}`);
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
return (
|
|
338
|
-
<DSRRequestForm
|
|
339
|
-
onSubmit={handleSubmit}
|
|
340
|
-
requestTypes={[
|
|
341
|
-
{ id: 'access', label: 'Access my data' },
|
|
342
|
-
{ id: 'rectification', label: 'Correct my data' },
|
|
343
|
-
{ id: 'erasure', label: 'Delete my data' },
|
|
344
|
-
{ id: 'restriction', label: 'Restrict processing of my data' },
|
|
345
|
-
{ id: 'portability', label: 'Data portability' },
|
|
346
|
-
{ id: 'objection', label: 'Object to processing' }
|
|
347
|
-
]}
|
|
348
|
-
/>
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// 2. Create an admin dashboard for managing requests
|
|
353
|
-
import { DSRDashboard } from '@tantainnovative/ndpr-toolkit';
|
|
354
|
-
|
|
355
|
-
function AdminDashboard() {
|
|
356
|
-
const { requests, updateRequest, deleteRequest } = useDSR();
|
|
357
|
-
|
|
358
|
-
return (
|
|
359
|
-
<DSRDashboard
|
|
360
|
-
requests={requests}
|
|
361
|
-
onUpdateRequest={updateRequest}
|
|
362
|
-
onDeleteRequest={deleteRequest}
|
|
363
|
-
/>
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### Setting Up a Breach Notification System
|
|
369
|
-
|
|
370
|
-
```jsx
|
|
371
|
-
import { BreachReportForm, BreachRiskAssessment, RegulatoryReportGenerator, useBreach } from '@tantainnovative/ndpr-toolkit';
|
|
372
|
-
|
|
373
|
-
// 1. Create a form for reporting breaches
|
|
374
|
-
function BreachReporting() {
|
|
375
|
-
const { submitBreachReport } = useBreach();
|
|
376
|
-
|
|
377
|
-
const handleSubmit = (formData) => {
|
|
378
|
-
const report = submitBreachReport({
|
|
379
|
-
title: formData.title,
|
|
380
|
-
description: formData.description,
|
|
381
|
-
category: formData.category,
|
|
382
|
-
discoveredAt: Date.now(),
|
|
383
|
-
reporter: {
|
|
384
|
-
name: formData.reporterName,
|
|
385
|
-
email: formData.reporterEmail,
|
|
386
|
-
department: formData.department
|
|
387
|
-
},
|
|
388
|
-
affectedSystems: formData.systems,
|
|
389
|
-
dataTypes: formData.dataTypes,
|
|
390
|
-
status: 'ongoing'
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
// Redirect to risk assessment
|
|
394
|
-
navigate(`/breach/${report.id}/assess`);
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
return (
|
|
398
|
-
<BreachReportForm
|
|
399
|
-
onSubmit={handleSubmit}
|
|
400
|
-
categories={[
|
|
401
|
-
{ id: 'unauthorized-access', label: 'Unauthorized Access' },
|
|
402
|
-
{ id: 'data-loss', label: 'Data Loss' },
|
|
403
|
-
{ id: 'system-compromise', label: 'System Compromise' }
|
|
404
|
-
]}
|
|
405
|
-
/>
|
|
406
|
-
);
|
|
407
|
-
}
|
|
77
|
+
```bash
|
|
78
|
+
# Build the project
|
|
79
|
+
npm run build
|
|
408
80
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
const { performRiskAssessment, determineNotificationRequirements } = useBreach();
|
|
412
|
-
|
|
413
|
-
const handleAssessment = (assessmentData) => {
|
|
414
|
-
const assessment = performRiskAssessment({
|
|
415
|
-
breachId,
|
|
416
|
-
assessor: {
|
|
417
|
-
name: 'Jane Smith',
|
|
418
|
-
role: 'Data Protection Officer',
|
|
419
|
-
email: 'jane@example.com'
|
|
420
|
-
},
|
|
421
|
-
...assessmentData
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
const requirements = determineNotificationRequirements({
|
|
425
|
-
breachId,
|
|
426
|
-
riskAssessmentId: assessment.id
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
// Show notification requirements
|
|
430
|
-
if (requirements.nitdaNotificationRequired) {
|
|
431
|
-
// Deadline is 72 hours from discovery
|
|
432
|
-
const deadline = new Date(requirements.nitdaNotificationDeadline);
|
|
433
|
-
alert(`NITDA notification required by ${deadline.toLocaleString()}`);
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
return (
|
|
438
|
-
<BreachRiskAssessment
|
|
439
|
-
breachId={breachId}
|
|
440
|
-
onComplete={handleAssessment}
|
|
441
|
-
/>
|
|
442
|
-
);
|
|
443
|
-
}
|
|
81
|
+
# Deploy to GitHub Pages (if you have gh-pages installed)
|
|
82
|
+
npm run deploy
|
|
444
83
|
```
|
|
445
84
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
For detailed documentation, visit [https://ndpr-toolkit.tantainnovative.com/docs](https://ndpr-toolkit.tantainnovative.com/docs)
|
|
85
|
+
#### Configuration
|
|
449
86
|
|
|
450
|
-
|
|
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
|
|
451
90
|
|
|
452
|
-
|
|
91
|
+
## Technical Stack
|
|
453
92
|
|
|
454
|
-
-
|
|
455
|
-
-
|
|
456
|
-
-
|
|
457
|
-
-
|
|
458
|
-
- [Privacy Policy Generator](https://ndpr-toolkit.tantainnovative.com/docs/components/privacy-policy-generator)
|
|
459
|
-
- [React Hooks](https://ndpr-toolkit.tantainnovative.com/docs/components/hooks)
|
|
93
|
+
- Next.js with App Router
|
|
94
|
+
- TypeScript
|
|
95
|
+
- Tailwind CSS
|
|
96
|
+
- React
|
|
460
97
|
|
|
461
|
-
##
|
|
98
|
+
## License
|
|
462
99
|
|
|
463
|
-
|
|
100
|
+
MIT License
|
|
464
101
|
|
|
465
|
-
##
|
|
102
|
+
## Developed by
|
|
466
103
|
|
|
467
|
-
|
|
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.
|