@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.
Files changed (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +293 -136
  3. package/dist/breach-6z0r-KuE.d.mts +17 -0
  4. package/dist/breach-BFfnvtRk.d.ts +17 -0
  5. package/dist/breach-BtFbDOmV.d.mts +185 -0
  6. package/dist/breach-BtFbDOmV.d.ts +185 -0
  7. package/dist/breach.d.mts +275 -0
  8. package/dist/breach.d.ts +275 -0
  9. package/dist/breach.js +2 -0
  10. package/dist/breach.js.map +1 -0
  11. package/dist/breach.mjs +2 -0
  12. package/dist/breach.mjs.map +1 -0
  13. package/dist/chunk-2SYNHRP6.mjs +2 -0
  14. package/dist/chunk-2SYNHRP6.mjs.map +1 -0
  15. package/dist/chunk-2XHD22J7.mjs +7 -0
  16. package/dist/chunk-2XHD22J7.mjs.map +1 -0
  17. package/dist/chunk-3YCV2BA6.js +2 -0
  18. package/dist/chunk-3YCV2BA6.js.map +1 -0
  19. package/dist/chunk-4A354HL3.js +2 -0
  20. package/dist/chunk-4A354HL3.js.map +1 -0
  21. package/dist/chunk-4DKT6IB6.js +94 -0
  22. package/dist/chunk-4DKT6IB6.js.map +1 -0
  23. package/dist/chunk-5ZBO2UPH.js +2 -0
  24. package/dist/chunk-5ZBO2UPH.js.map +1 -0
  25. package/dist/chunk-6GGGTRDZ.mjs +2 -0
  26. package/dist/chunk-6GGGTRDZ.mjs.map +1 -0
  27. package/dist/chunk-6JFTAYXV.mjs +2 -0
  28. package/dist/chunk-6JFTAYXV.mjs.map +1 -0
  29. package/dist/chunk-6JVYYLS7.js +2 -0
  30. package/dist/chunk-6JVYYLS7.js.map +1 -0
  31. package/dist/chunk-6SGG6WPA.mjs +2 -0
  32. package/dist/chunk-6SGG6WPA.mjs.map +1 -0
  33. package/dist/chunk-AQEGDEQM.js +7 -0
  34. package/dist/chunk-AQEGDEQM.js.map +1 -0
  35. package/dist/chunk-C2IJWCZQ.mjs +2 -0
  36. package/dist/chunk-C2IJWCZQ.mjs.map +1 -0
  37. package/dist/chunk-CMZTI7SG.js +2 -0
  38. package/dist/chunk-CMZTI7SG.js.map +1 -0
  39. package/dist/chunk-DB3JH4DS.mjs +2 -0
  40. package/dist/chunk-DB3JH4DS.mjs.map +1 -0
  41. package/dist/chunk-FFW7RUAG.mjs +94 -0
  42. package/dist/chunk-FFW7RUAG.mjs.map +1 -0
  43. package/dist/chunk-FK3CSFLJ.js +2 -0
  44. package/dist/chunk-FK3CSFLJ.js.map +1 -0
  45. package/dist/chunk-GIV2OHE6.mjs +2 -0
  46. package/dist/chunk-GIV2OHE6.mjs.map +1 -0
  47. package/dist/chunk-GMLNWS2N.mjs +2 -0
  48. package/dist/chunk-GMLNWS2N.mjs.map +1 -0
  49. package/dist/chunk-IQF726GS.js +2 -0
  50. package/dist/chunk-IQF726GS.js.map +1 -0
  51. package/dist/chunk-IWUUVRLJ.js +2 -0
  52. package/dist/chunk-IWUUVRLJ.js.map +1 -0
  53. package/dist/chunk-JUN6YPLL.mjs +72 -0
  54. package/dist/chunk-JUN6YPLL.mjs.map +1 -0
  55. package/dist/chunk-L3FKTBGV.js +72 -0
  56. package/dist/chunk-L3FKTBGV.js.map +1 -0
  57. package/dist/chunk-L52PDW6O.mjs +2 -0
  58. package/dist/chunk-L52PDW6O.mjs.map +1 -0
  59. package/dist/chunk-LI6WJ3LZ.js +2 -0
  60. package/dist/chunk-LI6WJ3LZ.js.map +1 -0
  61. package/dist/chunk-LXRXDTPI.js +2 -0
  62. package/dist/chunk-LXRXDTPI.js.map +1 -0
  63. package/dist/chunk-MQFZHA2D.js +2 -0
  64. package/dist/chunk-MQFZHA2D.js.map +1 -0
  65. package/dist/chunk-OITITR6K.mjs +2 -0
  66. package/dist/chunk-OITITR6K.mjs.map +1 -0
  67. package/dist/chunk-PDJGTQMY.mjs +2 -0
  68. package/dist/chunk-PDJGTQMY.mjs.map +1 -0
  69. package/dist/chunk-PGSA2O5P.mjs +2 -0
  70. package/dist/chunk-PGSA2O5P.mjs.map +1 -0
  71. package/dist/chunk-PM7CMTMB.js +4 -0
  72. package/dist/chunk-PM7CMTMB.js.map +1 -0
  73. package/dist/chunk-PYEX7DFR.mjs +4 -0
  74. package/dist/chunk-PYEX7DFR.mjs.map +1 -0
  75. package/dist/chunk-QKK5S54L.mjs +2 -0
  76. package/dist/chunk-QKK5S54L.mjs.map +1 -0
  77. package/dist/chunk-RB26MIRI.js +2 -0
  78. package/dist/chunk-RB26MIRI.js.map +1 -0
  79. package/dist/chunk-RGYK4VAY.mjs +2 -0
  80. package/dist/chunk-RGYK4VAY.mjs.map +1 -0
  81. package/dist/chunk-RHWW5FDP.js +16 -0
  82. package/dist/chunk-RHWW5FDP.js.map +1 -0
  83. package/dist/chunk-RYZEIDNR.js +2 -0
  84. package/dist/chunk-RYZEIDNR.js.map +1 -0
  85. package/dist/chunk-SLNMKGQ2.mjs +2 -0
  86. package/dist/chunk-SLNMKGQ2.mjs.map +1 -0
  87. package/dist/chunk-SSGJREE3.js +2 -0
  88. package/dist/chunk-SSGJREE3.js.map +1 -0
  89. package/dist/chunk-SWF3YVE5.js +4 -0
  90. package/dist/chunk-SWF3YVE5.js.map +1 -0
  91. package/dist/chunk-T44JQT2O.mjs +2 -0
  92. package/dist/chunk-T44JQT2O.mjs.map +1 -0
  93. package/dist/chunk-TDDAYVKK.js +2 -0
  94. package/dist/chunk-TDDAYVKK.js.map +1 -0
  95. package/dist/chunk-TXBZPCGF.mjs +2 -0
  96. package/dist/chunk-TXBZPCGF.mjs.map +1 -0
  97. package/dist/chunk-UUWVBENC.js +2 -0
  98. package/dist/chunk-UUWVBENC.js.map +1 -0
  99. package/dist/chunk-UYP64PV7.mjs +4 -0
  100. package/dist/chunk-UYP64PV7.mjs.map +1 -0
  101. package/dist/chunk-VMJBW3EF.mjs +2 -0
  102. package/dist/chunk-VMJBW3EF.mjs.map +1 -0
  103. package/dist/chunk-WW3X3ELF.js +2 -0
  104. package/dist/chunk-WW3X3ELF.js.map +1 -0
  105. package/dist/chunk-WWT2ZSNU.mjs +2 -0
  106. package/dist/chunk-WWT2ZSNU.mjs.map +1 -0
  107. package/dist/chunk-XMKA6GVK.mjs +16 -0
  108. package/dist/chunk-XMKA6GVK.mjs.map +1 -0
  109. package/dist/chunk-Y34DQYS7.js +2 -0
  110. package/dist/chunk-Y34DQYS7.js.map +1 -0
  111. package/dist/chunk-ZU73VG3X.js +2 -0
  112. package/dist/chunk-ZU73VG3X.js.map +1 -0
  113. package/dist/consent-CmVzqZUk.d.mts +99 -0
  114. package/dist/consent-CmVzqZUk.d.ts +99 -0
  115. package/dist/consent-DCc5zjXI.d.mts +24 -0
  116. package/dist/consent-DLWb5ota.d.ts +24 -0
  117. package/dist/consent.d.mts +197 -0
  118. package/dist/consent.d.ts +197 -0
  119. package/dist/consent.js +2 -0
  120. package/dist/consent.js.map +1 -0
  121. package/dist/consent.mjs +2 -0
  122. package/dist/consent.mjs.map +1 -0
  123. package/dist/core.d.mts +14 -0
  124. package/dist/core.d.ts +14 -0
  125. package/dist/core.js +2 -0
  126. package/dist/core.js.map +1 -0
  127. package/dist/core.mjs +2 -0
  128. package/dist/core.mjs.map +1 -0
  129. package/dist/cross-border-BrIy1ieh.d.mts +192 -0
  130. package/dist/cross-border-BrIy1ieh.d.ts +192 -0
  131. package/dist/cross-border.d.mts +58 -0
  132. package/dist/cross-border.d.ts +58 -0
  133. package/dist/cross-border.js +2 -0
  134. package/dist/cross-border.js.map +1 -0
  135. package/dist/cross-border.mjs +2 -0
  136. package/dist/cross-border.mjs.map +1 -0
  137. package/dist/dpia-B9ZZJG5a.d.mts +15 -0
  138. package/dist/dpia-fdtTd2DI.d.ts +15 -0
  139. package/dist/dpia-vWfE_9bO.d.mts +137 -0
  140. package/dist/dpia-vWfE_9bO.d.ts +137 -0
  141. package/dist/dpia.d.mts +179 -0
  142. package/dist/dpia.d.ts +179 -0
  143. package/dist/dpia.js +2 -0
  144. package/dist/dpia.js.map +1 -0
  145. package/dist/dpia.mjs +2 -0
  146. package/dist/dpia.mjs.map +1 -0
  147. package/dist/dsr-jq5NUEdz.d.ts +14 -0
  148. package/dist/dsr-pQzQ3H1O.d.mts +128 -0
  149. package/dist/dsr-pQzQ3H1O.d.ts +128 -0
  150. package/dist/dsr-whPkiI0_.d.mts +14 -0
  151. package/dist/dsr.d.mts +192 -0
  152. package/dist/dsr.d.ts +192 -0
  153. package/dist/dsr.js +2 -0
  154. package/dist/dsr.js.map +1 -0
  155. package/dist/dsr.mjs +2 -0
  156. package/dist/dsr.mjs.map +1 -0
  157. package/dist/hooks.d.mts +17 -0
  158. package/dist/hooks.d.ts +17 -0
  159. package/dist/hooks.js +2 -0
  160. package/dist/hooks.js.map +1 -0
  161. package/dist/hooks.mjs +2 -0
  162. package/dist/hooks.mjs.map +1 -0
  163. package/dist/index.d.mts +31 -448
  164. package/dist/index.d.ts +31 -448
  165. package/dist/index.js +1 -190
  166. package/dist/index.js.map +1 -1
  167. package/dist/index.mjs +1 -190
  168. package/dist/index.mjs.map +1 -1
  169. package/dist/lawful-basis-CWtvDG1x.d.mts +112 -0
  170. package/dist/lawful-basis-CWtvDG1x.d.ts +112 -0
  171. package/dist/lawful-basis-D-oXFizg.d.mts +57 -0
  172. package/dist/lawful-basis-v04AhbK2.d.ts +57 -0
  173. package/dist/lawful-basis.d.mts +55 -0
  174. package/dist/lawful-basis.d.ts +55 -0
  175. package/dist/lawful-basis.js +2 -0
  176. package/dist/lawful-basis.js.map +1 -0
  177. package/dist/lawful-basis.mjs +2 -0
  178. package/dist/lawful-basis.mjs.map +1 -0
  179. package/dist/policy.d.mts +195 -0
  180. package/dist/policy.d.ts +195 -0
  181. package/dist/policy.js +2 -0
  182. package/dist/policy.js.map +1 -0
  183. package/dist/policy.mjs +2 -0
  184. package/dist/policy.mjs.map +1 -0
  185. package/dist/privacy-9FcJceMr.d.mts +15 -0
  186. package/dist/privacy-BXz7O2ej.d.ts +15 -0
  187. package/dist/privacy-Ca6te9Ir.d.mts +138 -0
  188. package/dist/privacy-Ca6te9Ir.d.ts +138 -0
  189. package/dist/ropa-BebGfqKQ.d.ts +200 -0
  190. package/dist/ropa-Rb4dsFSz.d.mts +200 -0
  191. package/dist/ropa.d.mts +45 -0
  192. package/dist/ropa.d.ts +45 -0
  193. package/dist/ropa.js +2 -0
  194. package/dist/ropa.js.map +1 -0
  195. package/dist/ropa.mjs +2 -0
  196. package/dist/ropa.mjs.map +1 -0
  197. package/dist/unstyled.d.mts +4 -4
  198. package/dist/unstyled.d.ts +4 -4
  199. package/dist/unstyled.js +1 -1
  200. package/dist/unstyled.js.map +1 -1
  201. package/dist/unstyled.mjs +1 -1
  202. package/dist/unstyled.mjs.map +1 -1
  203. package/dist/useBreach-WrZzJilM.d.mts +99 -0
  204. package/dist/useBreach-vrh_XMpI.d.ts +99 -0
  205. package/dist/useConsent-D0pAfTlb.d.ts +65 -0
  206. package/dist/useConsent-DOt2Njst.d.mts +65 -0
  207. package/dist/useCrossBorderTransfer-D4FQYfFt.d.ts +66 -0
  208. package/dist/useCrossBorderTransfer-TVnY8_UX.d.mts +66 -0
  209. package/dist/useDPIA-DFDHBLSa.d.ts +94 -0
  210. package/dist/useDPIA-FqPofFaV.d.mts +94 -0
  211. package/dist/useDSR-DAqqOBXb.d.ts +74 -0
  212. package/dist/useDSR-OXM5Q9rf.d.mts +74 -0
  213. package/dist/useLawfulBasis-DNQ8YszQ.d.mts +68 -0
  214. package/dist/useLawfulBasis-RILM_xsx.d.ts +68 -0
  215. package/dist/usePrivacyPolicy-CfySfBLS.d.ts +89 -0
  216. package/dist/usePrivacyPolicy-Dit2sFuV.d.mts +89 -0
  217. package/dist/useROPA-Bcs6cRdi.d.ts +64 -0
  218. package/dist/useROPA-nmcSiUYv.d.mts +64 -0
  219. 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
- # Nigerian Data Protection Compliance Toolkit (NDPR-Toolkit)
1
+ # @tantainnovative/ndpr-toolkit
2
+
3
+ **Compliance infrastructure for the Nigeria Data Protection Act (NDPA) 2023**
2
4
 
3
5
  [![npm version](https://img.shields.io/npm/v/@tantainnovative/ndpr-toolkit.svg)](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0%2B-3178C6.svg)](https://www.typescriptlang.org/)
8
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@tantainnovative/ndpr-toolkit)](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
- 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.
14
+ ---
7
15
 
8
- ## Installation
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
- ## Project Vision
22
+ ---
19
23
 
20
- 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.
24
+ ## Choose Your Import Style
21
25
 
22
- ## Key Components
26
+ v2.0 ships modular entry points. Pick the layer you need -- the rest stays out of your bundle.
23
27
 
24
- ### 1. Consent Management System
28
+ ### Lightweight (zero UI dependencies)
25
29
 
26
- **New in v1.0.7:** Complete flexibility with headless mode, custom UI support, and event-driven architecture.
30
+ Types, validators, and utility functions. Works in any JS/TS environment -- Node, Deno, edge functions, or the browser.
27
31
 
28
- #### Features:
29
- - **Flexible Implementation**: Use pre-built UI, headless mode, or hybrid approach
30
- - **Full Customization**: Override any component or behavior
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
- #### Quick Start:
36
+ ### React Hooks
37
37
 
38
- ```tsx
39
- import { ConsentManager } from '@tantainnovative/ndpr-toolkit';
38
+ Stateful hooks for every module. Requires `react` only -- no Radix, no Tailwind.
40
39
 
41
- // Basic usage with pre-built UI
42
- function App() {
43
- return (
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
- // Headless mode with custom UI
51
- function HeadlessApp() {
52
- return (
53
- <ConsentManager headless>
54
- <YourCustomBanner />
55
- <YourCustomSettings />
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
- [See full consent management documentation](./docs/CONSENT_MANAGEMENT.md)
62
-
63
- ### 2. Data Subject Rights Portal
64
- - Pre-built UI components for handling:
65
- - Right to access personal data
66
- - Right to rectification
67
- - Right to erasure ("right to be forgotten")
68
- - Right to restrict processing
69
- - Right to data portability
70
- - Dashboard for data controllers to manage requests
71
- - Local storage requestService to track and update requests in demos
72
-
73
- ### 3. Privacy Policy Generator
74
- - Interactive wizard to create NDPR-compliant privacy policies
75
- - Template system with customizable sections
76
- - Auto-update notifications when regulatory requirements change
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
- ### Using the Toolkit in Your Project
71
+ A consent banner in under 10 lines:
97
72
 
98
73
  ```tsx
99
- import { ConsentManager, useConsent } from '@tantainnovative/ndpr-toolkit';
74
+ import { useConsent } from '@tantainnovative/ndpr-toolkit/hooks';
100
75
 
101
76
  function App() {
102
- return (
103
- <ConsentManager onConsentChange={(consent) => console.log('Consent updated:', consent)}>
104
- <YourApp />
105
- </ConsentManager>
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
- function YourApp() {
110
- const { consentState, openSettings } = useConsent();
111
-
112
- return (
113
- <div>
114
- {consentState.analytics && <AnalyticsScript />}
115
- <button onClick={openSettings}>Manage Cookies</button>
116
- </div>
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
- ### Development
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
- To contribute or run the demo locally:
122
+ **Key exports:** `ConsentBanner`, `ConsentManager`, `ConsentStorage`, `useConsent`, `validateConsent`, `validateConsentOptions`
124
123
 
125
- ```bash
126
- # Clone the repository
127
- git clone https://github.com/tantainnovative/ndpr-toolkit.git
128
- cd ndpr-toolkit
124
+ ---
125
+
126
+ ### 2. Data Subject Rights (DSR)
129
127
 
130
- # Install dependencies
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
- # Run development server
134
- pnpm dev
130
+ ```typescript
131
+ import { DSRRequestForm, DSRDashboard, useDSR, formatDSRRequest } from '@tantainnovative/ndpr-toolkit/dsr';
135
132
  ```
136
133
 
137
- Open [http://localhost:3000](http://localhost:3000) to see the demo.
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
- ## Deployment
142
+ **Key exports:** `DSRRequestForm`, `DSRDashboard`, `DSRTracker`, `useDSR`, `formatDSRRequest`
140
143
 
141
- ### GitHub Pages
144
+ ---
142
145
 
143
- 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:
146
+ ### 3. Data Protection Impact Assessment (DPIA)
144
147
 
145
- 1. The GitHub Actions workflow will build the project
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
- To manually deploy to GitHub Pages:
150
+ ```typescript
151
+ import { DPIAQuestionnaire, DPIAReport, useDPIA, assessDPIARisk } from '@tantainnovative/ndpr-toolkit/dpia';
152
+ ```
150
153
 
151
- ```bash
152
- # Build the project
153
- npm run build
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
- # Deploy to GitHub Pages (if you have gh-pages installed)
156
- npm run deploy
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
- #### Configuration
173
+ ```tsx
174
+ const { reportBreach, reports, assessRisk } = useBreach({
175
+ categories: breachCategories,
176
+ onReport: (report) => notifyNDPC(report),
177
+ });
178
+ ```
160
179
 
161
- The GitHub Pages deployment is configured in the following files:
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
- ## Technical Stack
182
+ ---
166
183
 
167
- - Next.js with App Router
168
- - TypeScript
169
- - Tailwind CSS
170
- - React
184
+ ### 5. Privacy Policy Generator
171
185
 
172
- ## License
186
+ **NDPA Sections 27-28** -- Multi-step wizard producing NDPA-compliant privacy policies with PDF/DOCX export.
173
187
 
174
- MIT License
188
+ ```typescript
189
+ import { PolicyGenerator, PolicyPreview, usePrivacyPolicy, generatePolicyText } from '@tantainnovative/ndpr-toolkit/policy';
190
+ ```
175
191
 
176
- ## Author
192
+ ```tsx
193
+ <PolicyGenerator
194
+ sections={policySections}
195
+ variables={policyVariables}
196
+ onGenerate={({ content }) => console.log(content)}
197
+ />
198
+ ```
177
199
 
178
- **Abraham Esandayinze Tanta**
200
+ The wizard covers organization info, data collection practices, data sharing, custom sections, and a preview with export.
179
201
 
180
- Senior Software Engineer with over a decade of experience in ethical hacking, software development, Linux and network administration. Based in Lagos, Nigeria.
202
+ **Key exports:** `PolicyGenerator`, `PolicyPreview`, `PolicyExporter`, `usePrivacyPolicy`, `generatePolicyText`
181
203
 
182
- - GitHub: [@mr-tanta](https://github.com/mr-tanta)
183
- - Email: sir.tanta@gmail.com
184
- - LinkedIn: [Abraham Tanta](https://linkedin.com/in/abraham-tanta)
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! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
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
- ## Support
347
+ ## Author
191
348
 
192
- If you find this toolkit helpful, please consider:
193
- - ⭐ Starring the repository
194
- - 🐛 Reporting bugs and issues
195
- - 💡 Suggesting new features
196
- - 🤝 Contributing to the codebase
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 };