@tantainnovative/ndpr-toolkit 1.0.10 → 2.1.1
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/LICENSE +21 -0
- package/README.md +293 -136
- package/dist/breach-6z0r-KuE.d.mts +17 -0
- package/dist/breach-BFfnvtRk.d.ts +17 -0
- package/dist/breach-BtFbDOmV.d.mts +185 -0
- package/dist/breach-BtFbDOmV.d.ts +185 -0
- package/dist/breach.d.mts +275 -0
- package/dist/breach.d.ts +275 -0
- package/dist/breach.js +2 -0
- package/dist/breach.js.map +1 -0
- package/dist/breach.mjs +2 -0
- package/dist/breach.mjs.map +1 -0
- package/dist/chunk-2SYNHRP6.mjs +2 -0
- package/dist/chunk-2SYNHRP6.mjs.map +1 -0
- package/dist/chunk-2XHD22J7.mjs +7 -0
- package/dist/chunk-2XHD22J7.mjs.map +1 -0
- package/dist/chunk-3YCV2BA6.js +2 -0
- package/dist/chunk-3YCV2BA6.js.map +1 -0
- package/dist/chunk-4A354HL3.js +2 -0
- package/dist/chunk-4A354HL3.js.map +1 -0
- package/dist/chunk-4DKT6IB6.js +94 -0
- package/dist/chunk-4DKT6IB6.js.map +1 -0
- package/dist/chunk-5ZBO2UPH.js +2 -0
- package/dist/chunk-5ZBO2UPH.js.map +1 -0
- package/dist/chunk-6GGGTRDZ.mjs +2 -0
- package/dist/chunk-6GGGTRDZ.mjs.map +1 -0
- package/dist/chunk-6JFTAYXV.mjs +2 -0
- package/dist/chunk-6JFTAYXV.mjs.map +1 -0
- package/dist/chunk-6JVYYLS7.js +2 -0
- package/dist/chunk-6JVYYLS7.js.map +1 -0
- package/dist/chunk-6SGG6WPA.mjs +2 -0
- package/dist/chunk-6SGG6WPA.mjs.map +1 -0
- package/dist/chunk-AQEGDEQM.js +7 -0
- package/dist/chunk-AQEGDEQM.js.map +1 -0
- package/dist/chunk-C2IJWCZQ.mjs +2 -0
- package/dist/chunk-C2IJWCZQ.mjs.map +1 -0
- package/dist/chunk-CMZTI7SG.js +2 -0
- package/dist/chunk-CMZTI7SG.js.map +1 -0
- package/dist/chunk-DB3JH4DS.mjs +2 -0
- package/dist/chunk-DB3JH4DS.mjs.map +1 -0
- package/dist/chunk-FFW7RUAG.mjs +94 -0
- package/dist/chunk-FFW7RUAG.mjs.map +1 -0
- package/dist/chunk-FK3CSFLJ.js +2 -0
- package/dist/chunk-FK3CSFLJ.js.map +1 -0
- package/dist/chunk-GIV2OHE6.mjs +2 -0
- package/dist/chunk-GIV2OHE6.mjs.map +1 -0
- package/dist/chunk-GMLNWS2N.mjs +2 -0
- package/dist/chunk-GMLNWS2N.mjs.map +1 -0
- package/dist/chunk-IQF726GS.js +2 -0
- package/dist/chunk-IQF726GS.js.map +1 -0
- package/dist/chunk-IWUUVRLJ.js +2 -0
- package/dist/chunk-IWUUVRLJ.js.map +1 -0
- package/dist/chunk-JUN6YPLL.mjs +72 -0
- package/dist/chunk-JUN6YPLL.mjs.map +1 -0
- package/dist/chunk-L3FKTBGV.js +72 -0
- package/dist/chunk-L3FKTBGV.js.map +1 -0
- package/dist/chunk-L52PDW6O.mjs +2 -0
- package/dist/chunk-L52PDW6O.mjs.map +1 -0
- package/dist/chunk-LI6WJ3LZ.js +2 -0
- package/dist/chunk-LI6WJ3LZ.js.map +1 -0
- package/dist/chunk-LXRXDTPI.js +2 -0
- package/dist/chunk-LXRXDTPI.js.map +1 -0
- package/dist/chunk-MQFZHA2D.js +2 -0
- package/dist/chunk-MQFZHA2D.js.map +1 -0
- package/dist/chunk-OITITR6K.mjs +2 -0
- package/dist/chunk-OITITR6K.mjs.map +1 -0
- package/dist/chunk-PDJGTQMY.mjs +2 -0
- package/dist/chunk-PDJGTQMY.mjs.map +1 -0
- package/dist/chunk-PGSA2O5P.mjs +2 -0
- package/dist/chunk-PGSA2O5P.mjs.map +1 -0
- package/dist/chunk-PM7CMTMB.js +4 -0
- package/dist/chunk-PM7CMTMB.js.map +1 -0
- package/dist/chunk-PYEX7DFR.mjs +4 -0
- package/dist/chunk-PYEX7DFR.mjs.map +1 -0
- package/dist/chunk-QKK5S54L.mjs +2 -0
- package/dist/chunk-QKK5S54L.mjs.map +1 -0
- package/dist/chunk-RB26MIRI.js +2 -0
- package/dist/chunk-RB26MIRI.js.map +1 -0
- package/dist/chunk-RGYK4VAY.mjs +2 -0
- package/dist/chunk-RGYK4VAY.mjs.map +1 -0
- package/dist/chunk-RHWW5FDP.js +16 -0
- package/dist/chunk-RHWW5FDP.js.map +1 -0
- package/dist/chunk-RYZEIDNR.js +2 -0
- package/dist/chunk-RYZEIDNR.js.map +1 -0
- package/dist/chunk-SLNMKGQ2.mjs +2 -0
- package/dist/chunk-SLNMKGQ2.mjs.map +1 -0
- package/dist/chunk-SSGJREE3.js +2 -0
- package/dist/chunk-SSGJREE3.js.map +1 -0
- package/dist/chunk-SWF3YVE5.js +4 -0
- package/dist/chunk-SWF3YVE5.js.map +1 -0
- package/dist/chunk-T44JQT2O.mjs +2 -0
- package/dist/chunk-T44JQT2O.mjs.map +1 -0
- package/dist/chunk-TDDAYVKK.js +2 -0
- package/dist/chunk-TDDAYVKK.js.map +1 -0
- package/dist/chunk-TXBZPCGF.mjs +2 -0
- package/dist/chunk-TXBZPCGF.mjs.map +1 -0
- package/dist/chunk-UUWVBENC.js +2 -0
- package/dist/chunk-UUWVBENC.js.map +1 -0
- package/dist/chunk-UYP64PV7.mjs +4 -0
- package/dist/chunk-UYP64PV7.mjs.map +1 -0
- package/dist/chunk-VMJBW3EF.mjs +2 -0
- package/dist/chunk-VMJBW3EF.mjs.map +1 -0
- package/dist/chunk-WW3X3ELF.js +2 -0
- package/dist/chunk-WW3X3ELF.js.map +1 -0
- package/dist/chunk-WWT2ZSNU.mjs +2 -0
- package/dist/chunk-WWT2ZSNU.mjs.map +1 -0
- package/dist/chunk-XMKA6GVK.mjs +16 -0
- package/dist/chunk-XMKA6GVK.mjs.map +1 -0
- package/dist/chunk-Y34DQYS7.js +2 -0
- package/dist/chunk-Y34DQYS7.js.map +1 -0
- package/dist/chunk-ZU73VG3X.js +2 -0
- package/dist/chunk-ZU73VG3X.js.map +1 -0
- package/dist/consent-CmVzqZUk.d.mts +99 -0
- package/dist/consent-CmVzqZUk.d.ts +99 -0
- package/dist/consent-DCc5zjXI.d.mts +24 -0
- package/dist/consent-DLWb5ota.d.ts +24 -0
- package/dist/consent.d.mts +197 -0
- package/dist/consent.d.ts +197 -0
- package/dist/consent.js +2 -0
- package/dist/consent.js.map +1 -0
- package/dist/consent.mjs +2 -0
- package/dist/consent.mjs.map +1 -0
- package/dist/core.d.mts +14 -0
- package/dist/core.d.ts +14 -0
- package/dist/core.js +2 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +2 -0
- package/dist/core.mjs.map +1 -0
- package/dist/cross-border-BrIy1ieh.d.mts +192 -0
- package/dist/cross-border-BrIy1ieh.d.ts +192 -0
- package/dist/cross-border.d.mts +58 -0
- package/dist/cross-border.d.ts +58 -0
- package/dist/cross-border.js +2 -0
- package/dist/cross-border.js.map +1 -0
- package/dist/cross-border.mjs +2 -0
- package/dist/cross-border.mjs.map +1 -0
- package/dist/dpia-B9ZZJG5a.d.mts +15 -0
- package/dist/dpia-fdtTd2DI.d.ts +15 -0
- package/dist/dpia-vWfE_9bO.d.mts +137 -0
- package/dist/dpia-vWfE_9bO.d.ts +137 -0
- package/dist/dpia.d.mts +179 -0
- package/dist/dpia.d.ts +179 -0
- package/dist/dpia.js +2 -0
- package/dist/dpia.js.map +1 -0
- package/dist/dpia.mjs +2 -0
- package/dist/dpia.mjs.map +1 -0
- package/dist/dsr-jq5NUEdz.d.ts +14 -0
- package/dist/dsr-pQzQ3H1O.d.mts +128 -0
- package/dist/dsr-pQzQ3H1O.d.ts +128 -0
- package/dist/dsr-whPkiI0_.d.mts +14 -0
- package/dist/dsr.d.mts +192 -0
- package/dist/dsr.d.ts +192 -0
- package/dist/dsr.js +2 -0
- package/dist/dsr.js.map +1 -0
- package/dist/dsr.mjs +2 -0
- package/dist/dsr.mjs.map +1 -0
- package/dist/hooks.d.mts +17 -0
- package/dist/hooks.d.ts +17 -0
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hooks.mjs +2 -0
- package/dist/hooks.mjs.map +1 -0
- package/dist/index.d.mts +31 -448
- package/dist/index.d.ts +31 -448
- package/dist/index.js +1 -190
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -190
- package/dist/index.mjs.map +1 -1
- package/dist/lawful-basis-CWtvDG1x.d.mts +112 -0
- package/dist/lawful-basis-CWtvDG1x.d.ts +112 -0
- package/dist/lawful-basis-D-oXFizg.d.mts +57 -0
- package/dist/lawful-basis-v04AhbK2.d.ts +57 -0
- package/dist/lawful-basis.d.mts +55 -0
- package/dist/lawful-basis.d.ts +55 -0
- package/dist/lawful-basis.js +2 -0
- package/dist/lawful-basis.js.map +1 -0
- package/dist/lawful-basis.mjs +2 -0
- package/dist/lawful-basis.mjs.map +1 -0
- package/dist/policy.d.mts +195 -0
- package/dist/policy.d.ts +195 -0
- package/dist/policy.js +2 -0
- package/dist/policy.js.map +1 -0
- package/dist/policy.mjs +2 -0
- package/dist/policy.mjs.map +1 -0
- package/dist/privacy-9FcJceMr.d.mts +15 -0
- package/dist/privacy-BXz7O2ej.d.ts +15 -0
- package/dist/privacy-Ca6te9Ir.d.mts +138 -0
- package/dist/privacy-Ca6te9Ir.d.ts +138 -0
- package/dist/ropa-BebGfqKQ.d.ts +200 -0
- package/dist/ropa-Rb4dsFSz.d.mts +200 -0
- package/dist/ropa.d.mts +45 -0
- package/dist/ropa.d.ts +45 -0
- package/dist/ropa.js +2 -0
- package/dist/ropa.js.map +1 -0
- package/dist/ropa.mjs +2 -0
- package/dist/ropa.mjs.map +1 -0
- package/dist/unstyled.d.mts +4 -4
- package/dist/unstyled.d.ts +4 -4
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.js.map +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/unstyled.mjs.map +1 -1
- package/dist/useBreach-WrZzJilM.d.mts +99 -0
- package/dist/useBreach-vrh_XMpI.d.ts +99 -0
- package/dist/useConsent-D0pAfTlb.d.ts +65 -0
- package/dist/useConsent-DOt2Njst.d.mts +65 -0
- package/dist/useCrossBorderTransfer-D4FQYfFt.d.ts +66 -0
- package/dist/useCrossBorderTransfer-TVnY8_UX.d.mts +66 -0
- package/dist/useDPIA-DFDHBLSa.d.ts +94 -0
- package/dist/useDPIA-FqPofFaV.d.mts +94 -0
- package/dist/useDSR-DAqqOBXb.d.ts +74 -0
- package/dist/useDSR-OXM5Q9rf.d.mts +74 -0
- package/dist/useLawfulBasis-DNQ8YszQ.d.mts +68 -0
- package/dist/useLawfulBasis-RILM_xsx.d.ts +68 -0
- package/dist/usePrivacyPolicy-CfySfBLS.d.ts +89 -0
- package/dist/usePrivacyPolicy-Dit2sFuV.d.mts +89 -0
- package/dist/useROPA-Bcs6cRdi.d.ts +64 -0
- package/dist/useROPA-nmcSiUYv.d.mts +64 -0
- package/package.json +146 -20
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Abraham Esandayinze Tanta
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,196 +1,353 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tantainnovative/ndpr-toolkit
|
|
2
|
+
|
|
3
|
+
**Compliance infrastructure for the Nigeria Data Protection Act (NDPA) 2023**
|
|
2
4
|
|
|
3
5
|
[](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
[](https://bundlephobia.com/package/@tantainnovative/ndpr-toolkit)
|
|
9
|
+
|
|
10
|
+
Eight production-ready modules covering consent, data subject rights, DPIA, breach notification, privacy policies, lawful basis tracking, cross-border transfers, and ROPA -- everything a data controller or processor needs under the NDPA.
|
|
11
|
+
|
|
12
|
+
**[Documentation](https://ndprtoolkit.com.ng)** | **[Live Demos](https://ndprtoolkit.com.ng/ndpr-demos)** | **[npm](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)**
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
---
|
|
7
15
|
|
|
8
|
-
##
|
|
16
|
+
## Install
|
|
9
17
|
|
|
10
18
|
```bash
|
|
11
|
-
npm install @tantainnovative/ndpr-toolkit
|
|
12
|
-
# or
|
|
13
|
-
yarn add @tantainnovative/ndpr-toolkit
|
|
14
|
-
# or
|
|
15
19
|
pnpm add @tantainnovative/ndpr-toolkit
|
|
16
20
|
```
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
---
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
## Choose Your Import Style
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
v2.0 ships modular entry points. Pick the layer you need -- the rest stays out of your bundle.
|
|
23
27
|
|
|
24
|
-
###
|
|
28
|
+
### Lightweight (zero UI dependencies)
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
Types, validators, and utility functions. Works in any JS/TS environment -- Node, Deno, edge functions, or the browser.
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- **Event-Driven**: Subscribe to consent changes with event listeners
|
|
32
|
-
- **TypeScript Support**: Fully typed with generic support for custom categories
|
|
33
|
-
- **Granular Consent**: Analytics, marketing, functional, and custom categories
|
|
34
|
-
- **Audit Trail**: Time-stamped consent history tracking
|
|
32
|
+
```typescript
|
|
33
|
+
import { validateConsent, getLawfulBasisDescription } from '@tantainnovative/ndpr-toolkit/core';
|
|
34
|
+
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
### React Hooks
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
import { ConsentManager } from '@tantainnovative/ndpr-toolkit';
|
|
38
|
+
Stateful hooks for every module. Requires `react` only -- no Radix, no Tailwind.
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<ConsentManager>
|
|
45
|
-
{/* Your app content */}
|
|
46
|
-
</ConsentManager>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
40
|
+
```typescript
|
|
41
|
+
import { useConsent, useLawfulBasis } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
42
|
+
```
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
</ConsentManager>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
44
|
+
### Full UI Components
|
|
45
|
+
|
|
46
|
+
Pre-built, styled components. Requires Tailwind CSS plus a handful of Radix primitives.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { ConsentBanner, LawfulBasisTracker } from '@tantainnovative/ndpr-toolkit';
|
|
59
50
|
```
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- Version history tracking
|
|
78
|
-
|
|
79
|
-
### 4. Data Protection Impact Assessment (DPIA) Tool
|
|
80
|
-
- Questionnaire-based tool to help organizations assess data processing risks
|
|
81
|
-
- Risk scoring matrix
|
|
82
|
-
- Mitigation recommendation engine
|
|
83
|
-
- Exportable reports for compliance documentation
|
|
84
|
-
|
|
85
|
-
### 5. Breach Notification Module
|
|
86
|
-
- Templates for mandatory breach notifications
|
|
87
|
-
- Workflow for documenting breach details
|
|
88
|
-
- Timeline tracking to ensure 72-hour notification compliance
|
|
89
|
-
- Notification delivery to authorities via API (if available)
|
|
90
|
-
### 6. Data Subject Request Service
|
|
91
|
-
- Lightweight requestService storing requests in browser localStorage for demos
|
|
92
|
-
- Helper methods to update request status and retrieve history
|
|
52
|
+
Install the UI peer dependencies:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm add @radix-ui/react-switch @radix-ui/react-tabs @radix-ui/react-label @radix-ui/react-slot lucide-react tailwind-merge clsx class-variance-authority
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Per-Module Imports
|
|
59
|
+
|
|
60
|
+
Need just one module? Import it directly to keep your bundle minimal.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { ConsentBanner, useConsent } from '@tantainnovative/ndpr-toolkit/consent';
|
|
64
|
+
import { BreachReportForm, useBreach } from '@tantainnovative/ndpr-toolkit/breach';
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
93
68
|
|
|
94
69
|
## Quick Start
|
|
95
70
|
|
|
96
|
-
|
|
71
|
+
A consent banner in under 10 lines:
|
|
97
72
|
|
|
98
73
|
```tsx
|
|
99
|
-
import {
|
|
74
|
+
import { useConsent } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
100
75
|
|
|
101
76
|
function App() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
77
|
+
const { hasConsent, acceptAll, rejectAll, shouldShowBanner } = useConsent({
|
|
78
|
+
options: [
|
|
79
|
+
{ id: 'essential', label: 'Essential', description: 'Required for the site to function', required: true, purpose: 'Site operation' },
|
|
80
|
+
{ id: 'analytics', label: 'Analytics', description: 'Help us improve', required: false, purpose: 'Usage analytics' },
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if (shouldShowBanner) {
|
|
85
|
+
return (
|
|
86
|
+
<div>
|
|
87
|
+
<p>We use cookies to improve your experience.</p>
|
|
88
|
+
<button onClick={acceptAll}>Accept All</button>
|
|
89
|
+
<button onClick={rejectAll}>Reject Optional</button>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return <main>{hasConsent('analytics') && <AnalyticsScript />}</main>;
|
|
107
95
|
}
|
|
96
|
+
```
|
|
108
97
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Modules
|
|
101
|
+
|
|
102
|
+
### 1. Consent Management
|
|
103
|
+
|
|
104
|
+
**NDPA Sections 25-26** -- Freely given, specific, informed, and unambiguous consent.
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
import { ConsentBanner, ConsentManager, useConsent, validateConsent } from '@tantainnovative/ndpr-toolkit/consent';
|
|
119
108
|
```
|
|
120
109
|
|
|
121
|
-
|
|
110
|
+
```tsx
|
|
111
|
+
<ConsentManager
|
|
112
|
+
options={[
|
|
113
|
+
{ id: 'essential', label: 'Essential', description: 'Required for the site to function', required: true, purpose: 'Site operation' },
|
|
114
|
+
{ id: 'analytics', label: 'Analytics', description: 'Help us improve', required: false, purpose: 'Usage analytics' },
|
|
115
|
+
]}
|
|
116
|
+
onSave={(settings) => {
|
|
117
|
+
if (settings.consents.analytics) loadAnalytics();
|
|
118
|
+
}}
|
|
119
|
+
/>
|
|
120
|
+
```
|
|
122
121
|
|
|
123
|
-
|
|
122
|
+
**Key exports:** `ConsentBanner`, `ConsentManager`, `ConsentStorage`, `useConsent`, `validateConsent`, `validateConsentOptions`
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
cd ndpr-toolkit
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### 2. Data Subject Rights (DSR)
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
pnpm install
|
|
128
|
+
**NDPA Part IV, Sections 29-36** -- All 8 rights: information, access, rectification, erasure, restriction, portability, objection, and automated decision-making.
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
```typescript
|
|
131
|
+
import { DSRRequestForm, DSRDashboard, useDSR, formatDSRRequest } from '@tantainnovative/ndpr-toolkit/dsr';
|
|
135
132
|
```
|
|
136
133
|
|
|
137
|
-
|
|
134
|
+
```tsx
|
|
135
|
+
const { submitRequest, requests } = useDSR({
|
|
136
|
+
requestTypes: [
|
|
137
|
+
{ id: 'access', name: 'Access Request', description: 'Right of access (Section 30)', estimatedCompletionTime: 30, requiresAdditionalInfo: false },
|
|
138
|
+
],
|
|
139
|
+
});
|
|
140
|
+
```
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
**Key exports:** `DSRRequestForm`, `DSRDashboard`, `DSRTracker`, `useDSR`, `formatDSRRequest`
|
|
140
143
|
|
|
141
|
-
|
|
144
|
+
---
|
|
142
145
|
|
|
143
|
-
|
|
146
|
+
### 3. Data Protection Impact Assessment (DPIA)
|
|
144
147
|
|
|
145
|
-
|
|
146
|
-
2. The built files will be deployed to GitHub Pages
|
|
147
|
-
3. Your site will be available at `https://[your-username].github.io/ndpr-toolkit/`
|
|
148
|
+
**NDPA Section 38-39** -- Mandatory risk assessment for high-risk processing activities.
|
|
148
149
|
|
|
149
|
-
|
|
150
|
+
```typescript
|
|
151
|
+
import { DPIAQuestionnaire, DPIAReport, useDPIA, assessDPIARisk } from '@tantainnovative/ndpr-toolkit/dpia';
|
|
152
|
+
```
|
|
150
153
|
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
```tsx
|
|
155
|
+
const { currentSection, answers, nextSection, completeDPIA } = useDPIA({
|
|
156
|
+
sections: dpiaSections,
|
|
157
|
+
onComplete: (result) => saveAssessment(result),
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Key exports:** `DPIAQuestionnaire`, `DPIAReport`, `StepIndicator`, `useDPIA`, `assessDPIARisk`
|
|
162
|
+
|
|
163
|
+
---
|
|
154
164
|
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
### 4. Breach Notification
|
|
166
|
+
|
|
167
|
+
**NDPA Section 40** -- 72-hour notification to the NDPC, plus data subject notification.
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { BreachReportForm, BreachNotificationManager, useBreach, calculateBreachSeverity } from '@tantainnovative/ndpr-toolkit/breach';
|
|
157
171
|
```
|
|
158
172
|
|
|
159
|
-
|
|
173
|
+
```tsx
|
|
174
|
+
const { reportBreach, reports, assessRisk } = useBreach({
|
|
175
|
+
categories: breachCategories,
|
|
176
|
+
onReport: (report) => notifyNDPC(report),
|
|
177
|
+
});
|
|
178
|
+
```
|
|
160
179
|
|
|
161
|
-
|
|
162
|
-
- `next.config.ts` - Contains the Next.js configuration for static export
|
|
163
|
-
- `.github/workflows/deploy.yml` - Contains the GitHub Actions workflow for automated deployment
|
|
180
|
+
**Key exports:** `BreachReportForm`, `BreachRiskAssessment`, `BreachNotificationManager`, `RegulatoryReportGenerator`, `useBreach`, `calculateBreachSeverity`
|
|
164
181
|
|
|
165
|
-
|
|
182
|
+
---
|
|
166
183
|
|
|
167
|
-
|
|
168
|
-
- TypeScript
|
|
169
|
-
- Tailwind CSS
|
|
170
|
-
- React
|
|
184
|
+
### 5. Privacy Policy Generator
|
|
171
185
|
|
|
172
|
-
|
|
186
|
+
**NDPA Sections 27-28** -- Multi-step wizard producing NDPA-compliant privacy policies with PDF/DOCX export.
|
|
173
187
|
|
|
174
|
-
|
|
188
|
+
```typescript
|
|
189
|
+
import { PolicyGenerator, PolicyPreview, usePrivacyPolicy, generatePolicyText } from '@tantainnovative/ndpr-toolkit/policy';
|
|
190
|
+
```
|
|
175
191
|
|
|
176
|
-
|
|
192
|
+
```tsx
|
|
193
|
+
<PolicyGenerator
|
|
194
|
+
sections={policySections}
|
|
195
|
+
variables={policyVariables}
|
|
196
|
+
onGenerate={({ content }) => console.log(content)}
|
|
197
|
+
/>
|
|
198
|
+
```
|
|
177
199
|
|
|
178
|
-
|
|
200
|
+
The wizard covers organization info, data collection practices, data sharing, custom sections, and a preview with export.
|
|
179
201
|
|
|
180
|
-
|
|
202
|
+
**Key exports:** `PolicyGenerator`, `PolicyPreview`, `PolicyExporter`, `usePrivacyPolicy`, `generatePolicyText`
|
|
181
203
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### 6. Lawful Basis Tracker
|
|
207
|
+
|
|
208
|
+
**NDPA Section 25** -- Document and manage the lawful basis for every processing activity. Covers all six bases: consent, contract, legal obligation, vital interests, public interest, and legitimate interests.
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { LawfulBasisTracker, useLawfulBasis, validateProcessingActivity, getLawfulBasisDescription } from '@tantainnovative/ndpr-toolkit/lawful-basis';
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```tsx
|
|
215
|
+
const { activities, addActivity, getSummary } = useLawfulBasis();
|
|
216
|
+
|
|
217
|
+
addActivity({
|
|
218
|
+
name: 'Email marketing',
|
|
219
|
+
description: 'Send promotional emails',
|
|
220
|
+
lawfulBasis: 'consent',
|
|
221
|
+
lawfulBasisJustification: 'Explicit opt-in at signup',
|
|
222
|
+
dataCategories: ['email', 'name'],
|
|
223
|
+
involvesSensitiveData: false,
|
|
224
|
+
dataSubjectCategories: ['customers'],
|
|
225
|
+
purposes: ['marketing'],
|
|
226
|
+
retentionPeriod: '2 years',
|
|
227
|
+
crossBorderTransfer: false,
|
|
228
|
+
status: 'active',
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Key exports:** `LawfulBasisTracker`, `useLawfulBasis`, `validateProcessingActivity`, `getLawfulBasisDescription`, `assessComplianceGaps`, `generateLawfulBasisSummary`
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### 7. Cross-Border Transfer Assessment
|
|
237
|
+
|
|
238
|
+
**NDPA Part VI, Sections 41-45** -- Evaluate adequacy decisions, standard contractual clauses, binding corporate rules, and derogations for international data transfers.
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
import { CrossBorderTransferManager, useCrossBorderTransfer, validateTransfer, assessTransferRisk } from '@tantainnovative/ndpr-toolkit/cross-border';
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
const { transfers, addTransfer, getSummary } = useCrossBorderTransfer({
|
|
246
|
+
onAdd: (transfer) => logTransfer(transfer),
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Key exports:** `CrossBorderTransferManager`, `useCrossBorderTransfer`, `validateTransfer`, `getTransferMechanismDescription`, `assessTransferRisk`, `isNDPCApprovalRequired`
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
### 8. Record of Processing Activities (ROPA)
|
|
255
|
+
|
|
256
|
+
**NDPC Regulatory Guidance** -- Maintain comprehensive records of all processing activities for audit readiness.
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
import { ROPAManager, useROPA, generateROPASummary, exportROPAToCSV } from '@tantainnovative/ndpr-toolkit/ropa';
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
const { ropa, addRecord, getSummary } = useROPA({
|
|
264
|
+
initialData: { id: 'ropa-1', organizationName: 'Acme Ltd', organizationContact: 'dpo@acme.ng', organizationAddress: 'Lagos, Nigeria', records: [], lastUpdated: Date.now(), version: '1.0' },
|
|
265
|
+
});
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**Key exports:** `ROPAManager`, `useROPA`, `validateProcessingRecord`, `generateROPASummary`, `exportROPAToCSV`, `identifyComplianceGaps`
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Available Import Paths
|
|
273
|
+
|
|
274
|
+
| Path | What you get | Dependencies |
|
|
275
|
+
|------|-------------|--------------|
|
|
276
|
+
| `/core` | Types + utility functions | `tslib`, `uuid` |
|
|
277
|
+
| `/hooks` | React hooks for all 8 modules | `react` |
|
|
278
|
+
| `/consent` | Consent components + hook + utils | `react`, Radix, Tailwind |
|
|
279
|
+
| `/dsr` | DSR components + hook + utils | `react`, Radix, Tailwind |
|
|
280
|
+
| `/dpia` | DPIA components + hook + utils | `react`, Radix, Tailwind |
|
|
281
|
+
| `/breach` | Breach components + hook + utils | `react`, Radix, Tailwind |
|
|
282
|
+
| `/policy` | Policy components + hook + utils | `react`, Radix, Tailwind, `jspdf` |
|
|
283
|
+
| `/lawful-basis` | Lawful basis component + hook + utils | `react`, Radix, Tailwind |
|
|
284
|
+
| `/cross-border` | Cross-border component + hook + utils | `react`, Radix, Tailwind |
|
|
285
|
+
| `/ropa` | ROPA component + hook + utils | `react`, Radix, Tailwind |
|
|
286
|
+
| `/unstyled` | Unstyled consent primitives | `react` |
|
|
287
|
+
| `.` (default) | Everything | All peer deps |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## NDPA 2023 Overview
|
|
292
|
+
|
|
293
|
+
The **Nigeria Data Protection Act (NDPA) 2023** replaced the NDPR 2019 and established the **Nigeria Data Protection Commission (NDPC)** as the independent regulatory body.
|
|
294
|
+
|
|
295
|
+
| Aspect | NDPR (2019) | NDPA (2023) |
|
|
296
|
+
|--------|-------------|-------------|
|
|
297
|
+
| Legal status | NITDA regulation | Act of the National Assembly |
|
|
298
|
+
| Regulator | NITDA | NDPC (independent commission) |
|
|
299
|
+
| Scope | Organizations processing data in Nigeria | Broader territorial + extraterritorial application |
|
|
300
|
+
| Enforcement | Limited | Independent investigation and penalty powers |
|
|
301
|
+
| Data subject rights | 6 rights | 8 rights (added information + automated decision-making) |
|
|
302
|
+
| Cross-border transfers | Basic provisions | Comprehensive framework with adequacy decisions |
|
|
303
|
+
| Breach notification | 72 hours to NITDA | 72 hours to NDPC (Section 40) |
|
|
304
|
+
| DPIA | Recommended | Required for high-risk processing (Section 38) |
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## TypeScript
|
|
309
|
+
|
|
310
|
+
The toolkit is written in TypeScript and exports all types:
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
import type {
|
|
314
|
+
// Consent
|
|
315
|
+
ConsentOption, ConsentSettings, LawfulBasisType,
|
|
316
|
+
// DSR
|
|
317
|
+
DSRRequest, DSRType, DSRStatus, RequestType,
|
|
318
|
+
// DPIA
|
|
319
|
+
DPIAQuestion, DPIASection, DPIAResult, DPIARisk,
|
|
320
|
+
// Breach
|
|
321
|
+
BreachReport, BreachCategory, RiskAssessment,
|
|
322
|
+
// Policy
|
|
323
|
+
PolicySection, PolicyTemplate, OrganizationInfo, PrivacyPolicy,
|
|
324
|
+
// Lawful Basis
|
|
325
|
+
LawfulBasis, ProcessingActivity, LawfulBasisSummary,
|
|
326
|
+
// Cross-Border
|
|
327
|
+
CrossBorderTransfer, TransferMechanism, AdequacyStatus,
|
|
328
|
+
// ROPA
|
|
329
|
+
ProcessingRecord, RecordOfProcessingActivities, ROPASummary,
|
|
330
|
+
} from '@tantainnovative/ndpr-toolkit/core';
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
185
334
|
|
|
186
335
|
## Contributing
|
|
187
336
|
|
|
188
|
-
Contributions are welcome
|
|
337
|
+
Contributions are welcome. Please read the [Contributing Guide](./CONTRIBUTING.md) before submitting a pull request.
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## License
|
|
342
|
+
|
|
343
|
+
MIT
|
|
344
|
+
|
|
345
|
+
---
|
|
189
346
|
|
|
190
|
-
##
|
|
347
|
+
## Author
|
|
191
348
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
349
|
+
**Abraham Esandayinze Tanta** — Software Engineer & Data Protection Compliance Specialist
|
|
350
|
+
|
|
351
|
+
- GitHub: [@mr-tanta](https://github.com/mr-tanta)
|
|
352
|
+
- LinkedIn: [mr-tanta](https://linkedin.com/in/mr-tanta)
|
|
353
|
+
- Organization: [Tanta Innovative](https://github.com/tantainnovative)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { B as BreachReport, R as RiskAssessment } from './breach-BtFbDOmV.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the severity of a data breach based on various factors
|
|
5
|
+
* @param report The breach report
|
|
6
|
+
* @param assessment The risk assessment (if available)
|
|
7
|
+
* @returns The calculated severity and notification requirements
|
|
8
|
+
*/
|
|
9
|
+
declare function calculateBreachSeverity(report: BreachReport, assessment?: RiskAssessment): {
|
|
10
|
+
severityLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
11
|
+
notificationRequired: boolean;
|
|
12
|
+
urgentNotificationRequired: boolean;
|
|
13
|
+
timeframeHours: number;
|
|
14
|
+
justification: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { calculateBreachSeverity as c };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { B as BreachReport, R as RiskAssessment } from './breach-BtFbDOmV.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the severity of a data breach based on various factors
|
|
5
|
+
* @param report The breach report
|
|
6
|
+
* @param assessment The risk assessment (if available)
|
|
7
|
+
* @returns The calculated severity and notification requirements
|
|
8
|
+
*/
|
|
9
|
+
declare function calculateBreachSeverity(report: BreachReport, assessment?: RiskAssessment): {
|
|
10
|
+
severityLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
11
|
+
notificationRequired: boolean;
|
|
12
|
+
urgentNotificationRequired: boolean;
|
|
13
|
+
timeframeHours: number;
|
|
14
|
+
justification: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { calculateBreachSeverity as c };
|