@tantainnovative/ndpr-toolkit 2.4.1 → 3.0.0

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 (182) hide show
  1. package/README.md +226 -246
  2. package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
  3. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
  4. package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
  5. package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
  6. package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
  7. package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
  8. package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
  9. package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
  10. package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
  11. package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
  12. package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
  13. package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
  14. package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
  15. package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
  16. package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
  17. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
  18. package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-BIqSVjfC.d.mts} +4 -98
  19. package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BNWaPBGU.d.ts} +4 -98
  20. package/dist/PolicyGenerator-BvcWPbxp.d.mts +96 -0
  21. package/dist/PolicyGenerator-BzRwtlgn.d.ts +96 -0
  22. package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
  23. package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
  24. package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
  25. package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
  26. package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
  27. package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
  28. package/dist/adapters.d.mts +25 -0
  29. package/dist/adapters.d.ts +25 -0
  30. package/dist/adapters.js +2 -0
  31. package/dist/adapters.mjs +2 -0
  32. package/dist/breach.d.mts +36 -431
  33. package/dist/breach.d.ts +36 -431
  34. package/dist/breach.js +1 -1
  35. package/dist/breach.mjs +1 -1
  36. package/dist/chunk-27NYSWUG.mjs +2 -0
  37. package/dist/chunk-2ORDHJRD.js +2 -0
  38. package/dist/chunk-2W7ARAW2.js +2 -0
  39. package/dist/chunk-3F34NACG.js +2 -0
  40. package/dist/chunk-3RGJV3VF.js +7 -0
  41. package/dist/chunk-3UWT64FI.mjs +2 -0
  42. package/dist/chunk-3V23O4ZJ.js +2 -0
  43. package/dist/chunk-3XAUN5IM.mjs +3 -0
  44. package/dist/chunk-5VMHKNJY.js +2 -0
  45. package/dist/chunk-6D3ZUGBB.mjs +2 -0
  46. package/dist/chunk-6E54NSAO.mjs +2 -0
  47. package/dist/chunk-7F5F5YWI.mjs +2 -0
  48. package/dist/chunk-7FIUX3ZM.js +89 -0
  49. package/dist/chunk-FR7ZYZXB.js +2 -0
  50. package/dist/chunk-FY5G6DGZ.js +7 -0
  51. package/dist/chunk-G26I6MP5.mjs +2 -0
  52. package/dist/chunk-GPJVTGHR.mjs +2 -0
  53. package/dist/chunk-GVANK6PL.js +3 -0
  54. package/dist/chunk-HNZK7LY3.mjs +2 -0
  55. package/dist/chunk-IKEPXHCZ.js +2 -0
  56. package/dist/chunk-IQQW52EF.js +2 -0
  57. package/dist/chunk-ISSGO2YT.mjs +72 -0
  58. package/dist/chunk-J6IKAGUP.mjs +89 -0
  59. package/dist/chunk-KHRBU5K7.js +2 -0
  60. package/dist/chunk-KNE4NXCY.mjs +7 -0
  61. package/dist/chunk-LFNA6WYQ.mjs +2 -0
  62. package/dist/chunk-NPI5T6NH.mjs +7 -0
  63. package/dist/chunk-NPLXE43Q.mjs +2 -0
  64. package/dist/chunk-P7BSBCB3.js +2 -0
  65. package/dist/chunk-PEH5GIMN.js +2 -0
  66. package/dist/chunk-RSUDIFZV.mjs +2 -0
  67. package/dist/chunk-SBNAMPAP.mjs +2 -0
  68. package/dist/chunk-SVCRYM4I.mjs +2 -0
  69. package/dist/chunk-U6VWHC46.js +72 -0
  70. package/dist/chunk-UK656RCG.js +2 -0
  71. package/dist/chunk-UNKXYVXY.js +2 -0
  72. package/dist/chunk-UOSEH6DC.js +2 -0
  73. package/dist/chunk-V37BM2LF.js +2 -0
  74. package/dist/chunk-V3MXWGXU.mjs +2 -0
  75. package/dist/chunk-VDZKGCAF.js +2 -0
  76. package/dist/chunk-WLSW4Z4W.mjs +2 -0
  77. package/dist/chunk-XSK4BSZJ.mjs +2 -0
  78. package/dist/chunk-YJCGEOLO.mjs +2 -0
  79. package/dist/chunk-ZCZ5RRZO.js +2 -0
  80. package/dist/compliance-score-racQe_E_.d.mts +115 -0
  81. package/dist/compliance-score-racQe_E_.d.ts +115 -0
  82. package/dist/consent.d.mts +67 -295
  83. package/dist/consent.d.ts +67 -295
  84. package/dist/consent.js +1 -1
  85. package/dist/consent.mjs +1 -1
  86. package/dist/core.d.mts +8 -5
  87. package/dist/core.d.ts +8 -5
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/cross-border-BBi9rZyO.d.mts +54 -0
  91. package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
  92. package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
  93. package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
  94. package/dist/cross-border.d.mts +32 -4
  95. package/dist/cross-border.d.ts +32 -4
  96. package/dist/cross-border.js +1 -1
  97. package/dist/cross-border.mjs +1 -1
  98. package/dist/dpia.d.mts +28 -284
  99. package/dist/dpia.d.ts +28 -284
  100. package/dist/dpia.js +1 -1
  101. package/dist/dpia.mjs +1 -1
  102. package/dist/dsr.d.mts +29 -300
  103. package/dist/dsr.d.ts +29 -300
  104. package/dist/dsr.js +1 -1
  105. package/dist/dsr.mjs +1 -1
  106. package/dist/hooks.d.mts +21 -10
  107. package/dist/hooks.d.ts +21 -10
  108. package/dist/hooks.js +1 -1
  109. package/dist/hooks.mjs +1 -1
  110. package/dist/index.d.mts +28 -18
  111. package/dist/index.d.ts +28 -18
  112. package/dist/index.js +1 -1
  113. package/dist/index.mjs +1 -1
  114. package/dist/lawful-basis.d.mts +31 -4
  115. package/dist/lawful-basis.d.ts +31 -4
  116. package/dist/lawful-basis.js +1 -1
  117. package/dist/lawful-basis.mjs +1 -1
  118. package/dist/policy.d.mts +36 -4
  119. package/dist/policy.d.ts +36 -4
  120. package/dist/policy.js +1 -1
  121. package/dist/policy.mjs +1 -1
  122. package/dist/presets.d.mts +124 -0
  123. package/dist/presets.d.ts +124 -0
  124. package/dist/presets.js +2 -0
  125. package/dist/presets.mjs +2 -0
  126. package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
  127. package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
  128. package/dist/ropa-CyynscU6.d.ts +51 -0
  129. package/dist/ropa-NIgxd8uP.d.mts +51 -0
  130. package/dist/ropa.d.mts +30 -4
  131. package/dist/ropa.d.ts +30 -4
  132. package/dist/ropa.js +1 -1
  133. package/dist/ropa.mjs +1 -1
  134. package/dist/styling-B7CBzYG7.d.ts +165 -0
  135. package/dist/styling-uJLsBbER.d.mts +165 -0
  136. package/dist/types-DK2CoKOC.d.mts +10 -0
  137. package/dist/types-DK2CoKOC.d.ts +10 -0
  138. package/dist/unstyled.d.mts +4 -4
  139. package/dist/unstyled.d.ts +4 -4
  140. package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
  141. package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
  142. package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
  143. package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
  144. package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
  145. package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
  146. package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
  147. package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
  148. package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
  149. package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
  150. package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
  151. package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
  152. package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
  153. package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
  154. package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
  155. package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
  156. package/package.json +18 -2
  157. package/dist/chunk-2XFAV267.mjs +0 -2
  158. package/dist/chunk-32UIWTGD.js +0 -72
  159. package/dist/chunk-3YCV2BA6.js +0 -2
  160. package/dist/chunk-4A354HL3.js +0 -2
  161. package/dist/chunk-5ZBO2UPH.js +0 -2
  162. package/dist/chunk-6GGGTRDZ.mjs +0 -2
  163. package/dist/chunk-BGHQTZAC.js +0 -94
  164. package/dist/chunk-BZTTQS4A.mjs +0 -7
  165. package/dist/chunk-EKVTLHBQ.js +0 -2
  166. package/dist/chunk-GMLNWS2N.mjs +0 -2
  167. package/dist/chunk-IBEKLDBY.mjs +0 -2
  168. package/dist/chunk-K3GMTMQ6.js +0 -2
  169. package/dist/chunk-L52PDW6O.mjs +0 -2
  170. package/dist/chunk-LI6WJ3LZ.js +0 -2
  171. package/dist/chunk-LXRXDTPI.js +0 -2
  172. package/dist/chunk-NW4A3JW6.mjs +0 -2
  173. package/dist/chunk-OITITR6K.mjs +0 -2
  174. package/dist/chunk-PDJGTQMY.mjs +0 -2
  175. package/dist/chunk-SKJCQKFL.mjs +0 -94
  176. package/dist/chunk-T44JQT2O.mjs +0 -2
  177. package/dist/chunk-TCJCE6WN.js +0 -2
  178. package/dist/chunk-VMJBW3EF.mjs +0 -2
  179. package/dist/chunk-WW3X3ELF.js +0 -2
  180. package/dist/chunk-XMYUYQH7.mjs +0 -72
  181. package/dist/chunk-ZNTMZ6NM.js +0 -7
  182. package/dist/chunk-ZU73VG3X.js +0 -2
package/dist/dpia.d.ts CHANGED
@@ -1,293 +1,37 @@
1
- import React from 'react';
1
+ import { b as DPIAQuestionnaireProps } from './DPIAQuestionnaire-DdSqXG3x.js';
2
+ export { D as DPIAQuestionnaire, a as DPIAQuestionnaireClassNames } from './DPIAQuestionnaire-DdSqXG3x.js';
3
+ import { c as DPIAReportProps, d as StepIndicatorProps } from './StepIndicator-D9ZATz_O.js';
4
+ export { D as DPIAReport, a as DPIAReportClassNames, S as StepIndicator, b as StepIndicatorClassNames } from './StepIndicator-D9ZATz_O.js';
5
+ import { U as UseDPIAReturn } from './useDPIA-Dl16Te3r.js';
6
+ export { u as useDPIA } from './useDPIA-Dl16Te3r.js';
7
+ export { a as assessDPIARisk } from './dpia-B0Pok5us.js';
2
8
  import { c as DPIASection, a as DPIAResult } from './dpia-5OQVA1R_.js';
3
9
  export { D as DPIAQuestion, b as DPIARisk } from './dpia-5OQVA1R_.js';
4
- export { u as useDPIA } from './useDPIA-DBsg2yZx.js';
5
- export { a as assessDPIARisk } from './dpia-B0Pok5us.js';
10
+ import * as React from 'react';
11
+ import React__default from 'react';
12
+ import { S as StorageAdapter } from './types-DK2CoKOC.js';
6
13
 
7
- interface DPIAQuestionnaireClassNames {
8
- /** Outermost wrapper */
9
- root?: string;
10
- /** Header area containing progress indicator */
11
- header?: string;
12
- /** Section title */
13
- title?: string;
14
- /** Section container */
15
- section?: string;
16
- /** Section title heading */
17
- sectionTitle?: string;
18
- /** Individual question wrapper */
19
- question?: string;
20
- /** Question label text */
21
- questionText?: string;
22
- /** Guidance / help text below a question */
23
- guidance?: string;
24
- /** Text / textarea / select inputs */
25
- input?: string;
26
- /** Radio option group container */
27
- radioGroup?: string;
28
- /** Individual radio option row */
29
- radioOption?: string;
30
- /** Navigation button container */
31
- navigation?: string;
32
- /** Next / submit button */
33
- nextButton?: string;
34
- /** Previous button */
35
- prevButton?: string;
36
- /** Alias for nextButton */
37
- primaryButton?: string;
38
- /** Alias for prevButton */
39
- secondaryButton?: string;
40
- /** Progress bar wrapper */
41
- progressBar?: string;
42
- }
43
- interface DPIAQuestionnaireProps {
44
- /**
45
- * Sections of the DPIA questionnaire
46
- */
14
+ interface DPIAProviderProps {
47
15
  sections: DPIASection[];
48
- /**
49
- * Current answers to the questionnaire
50
- */
51
- answers: Record<string, any>;
52
- /**
53
- * Callback function called when an answer is updated
54
- */
55
- onAnswerChange: (questionId: string, value: any) => void;
56
- /**
57
- * Current section index
58
- */
59
- currentSectionIndex: number;
60
- /**
61
- * Callback function called when user navigates to the next section
62
- */
63
- onNextSection?: () => void;
64
- /**
65
- * Callback function called when user navigates to the previous section
66
- */
67
- onPrevSection?: () => void;
68
- /**
69
- * Validation errors for the current section
70
- */
71
- validationErrors?: Record<string, string>;
72
- /**
73
- * Whether the questionnaire is in read-only mode
74
- * @default false
75
- */
76
- readOnly?: boolean;
77
- /**
78
- * Custom CSS class for the questionnaire
79
- */
80
- className?: string;
81
- /**
82
- * Custom CSS class for the buttons
83
- */
84
- buttonClassName?: string;
85
- /**
86
- * Text for the next button
87
- * @default "Next"
88
- */
89
- nextButtonText?: string;
90
- /**
91
- * Text for the previous button
92
- * @default "Previous"
93
- */
94
- prevButtonText?: string;
95
- /**
96
- * Text for the submit button (shown on the last section)
97
- * @default "Submit"
98
- */
99
- submitButtonText?: string;
100
- /**
101
- * Whether to show a progress indicator
102
- * @default true
103
- */
104
- showProgress?: boolean;
105
- /**
106
- * Current progress percentage (0-100)
107
- */
108
- progress?: number;
109
- /**
110
- * Per-section class name overrides
111
- */
112
- classNames?: DPIAQuestionnaireClassNames;
113
- /**
114
- * When true, all default classes are stripped.
115
- * Only explicit overrides from `classNames` are applied.
116
- * @default false
117
- */
118
- unstyled?: boolean;
16
+ initialAnswers?: Record<string, any>;
17
+ adapter?: StorageAdapter<Record<string, any>>;
18
+ storageKey?: string;
19
+ useLocalStorage?: boolean;
20
+ onComplete?: (result: DPIAResult) => void;
21
+ children: React__default.ReactNode;
119
22
  }
120
- /**
121
- * DPIA questionnaire component. Implements NDPA Section 38 requirements
122
- * for conducting Data Protection Impact Assessments on high-risk processing activities.
123
- */
124
- declare const DPIAQuestionnaire: React.FC<DPIAQuestionnaireProps>;
23
+ declare const DPIAProvider: React__default.FC<DPIAProviderProps>;
125
24
 
126
- interface DPIAReportClassNames {
127
- /** Outermost wrapper */
128
- root?: string;
129
- /** Report header area */
130
- header?: string;
131
- /** Main report title */
132
- title?: string;
133
- /** Executive summary section */
134
- summary?: string;
135
- /** Risk level badge */
136
- riskBadge?: string;
137
- /** Risks table element */
138
- riskTable?: string;
139
- /** Individual risk row */
140
- riskRow?: string;
141
- /** Recommendation list item */
142
- recommendation?: string;
143
- /** Conclusion text */
144
- conclusion?: string;
145
- /** Print button */
146
- printButton?: string;
147
- /** Alias for printButton */
148
- primaryButton?: string;
149
- }
150
- interface DPIAReportProps {
151
- /**
152
- * The DPIA result to display
153
- */
154
- result: DPIAResult;
155
- /**
156
- * The sections of the DPIA questionnaire
157
- */
158
- sections: DPIASection[];
159
- /**
160
- * Whether to show the full report or just a summary
161
- * @default true
162
- */
163
- showFullReport?: boolean;
164
- /**
165
- * Whether to allow printing the report
166
- * @default true
167
- */
168
- allowPrint?: boolean;
169
- /**
170
- * Whether to allow exporting the report as PDF
171
- * @default true
172
- */
173
- allowExport?: boolean;
174
- /**
175
- * Callback function called when the report is exported
176
- */
177
- onExport?: (format: 'pdf' | 'docx' | 'html') => void;
178
- /**
179
- * Custom CSS class for the report container
180
- */
181
- className?: string;
182
- /**
183
- * Custom CSS class for the buttons
184
- */
185
- buttonClassName?: string;
186
- /**
187
- * Per-section class name overrides
188
- */
189
- classNames?: DPIAReportClassNames;
190
- /**
191
- * When true, all default classes are stripped.
192
- * Only explicit overrides from `classNames` are applied.
193
- * @default false
194
- */
195
- unstyled?: boolean;
196
- }
197
- /**
198
- * DPIA report component. Implements NDPA Sections 38-39 requirements for documenting
199
- * and presenting Data Protection Impact Assessment findings, risks, and recommendations.
200
- */
201
- declare const DPIAReport: React.FC<DPIAReportProps>;
25
+ declare const DPIA: {
26
+ Provider: React.FC<DPIAProviderProps>;
27
+ Questionnaire: React.FC<DPIAQuestionnaireProps>;
28
+ Report: React.FC<DPIAReportProps>;
29
+ StepIndicator: React.FC<StepIndicatorProps>;
30
+ };
202
31
 
203
- interface Step {
204
- /**
205
- * Unique identifier for the step
206
- */
207
- id: string;
208
- /**
209
- * Display label for the step
210
- */
211
- label: string;
212
- /**
213
- * Optional description for the step
214
- */
215
- description?: string;
216
- /**
217
- * Whether the step is completed
218
- */
219
- completed: boolean;
220
- /**
221
- * Whether the step is the current active step
222
- */
223
- active: boolean;
224
- /**
225
- * Optional icon for the step
226
- */
227
- icon?: React.ReactNode;
228
- }
229
- interface StepIndicatorClassNames {
230
- /** Outermost wrapper */
231
- root?: string;
232
- /** Individual step wrapper */
233
- step?: string;
234
- /** Active step circle / indicator */
235
- stepActive?: string;
236
- /** Completed step circle / indicator */
237
- stepCompleted?: string;
238
- /** Pending (incomplete, inactive) step circle / indicator */
239
- stepPending?: string;
240
- /** Connector line between steps */
241
- connector?: string;
242
- /** Step label text */
243
- label?: string;
244
- }
245
- interface StepIndicatorProps {
246
- /**
247
- * Array of steps to display
248
- */
249
- steps: Step[];
250
- /**
251
- * Callback function called when a step is clicked
252
- */
253
- onStepClick?: (stepId: string) => void;
254
- /**
255
- * Whether the steps are clickable
256
- * @default true
257
- */
258
- clickable?: boolean;
259
- /**
260
- * Orientation of the step indicator
261
- * @default "horizontal"
262
- */
263
- orientation?: 'horizontal' | 'vertical';
264
- /**
265
- * Custom CSS class for the container
266
- */
267
- className?: string;
268
- /**
269
- * Custom CSS class for the active step
270
- */
271
- activeStepClassName?: string;
272
- /**
273
- * Custom CSS class for completed steps
274
- */
275
- completedStepClassName?: string;
276
- /**
277
- * Custom CSS class for incomplete steps
278
- */
279
- incompleteStepClassName?: string;
280
- /**
281
- * Per-section class name overrides
282
- */
283
- classNames?: StepIndicatorClassNames;
284
- /**
285
- * When true, all default classes are stripped.
286
- * Only explicit overrides from `classNames` are applied.
287
- * @default false
288
- */
289
- unstyled?: boolean;
32
+ interface DPIAContextValue extends UseDPIAReturn {
33
+ sections: DPIASection[];
290
34
  }
291
- declare const StepIndicator: React.FC<StepIndicatorProps>;
35
+ declare function useDPIACompound(): DPIAContextValue;
292
36
 
293
- export { DPIAQuestionnaire, type DPIAQuestionnaireClassNames, DPIAReport, type DPIAReportClassNames, DPIAResult, DPIASection, StepIndicator, type StepIndicatorClassNames };
37
+ export { DPIA, DPIAProvider, type DPIAProviderProps, DPIAResult, DPIASection, StorageAdapter, useDPIACompound };
package/dist/dpia.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkZNTMZ6NM_js=require('./chunk-ZNTMZ6NM.js'),chunk3YCV2BA6_js=require('./chunk-3YCV2BA6.js'),chunkSSGJREE3_js=require('./chunk-SSGJREE3.js');require('./chunk-E64TU6IU.js'),require('./chunk-MQFZHA2D.js');Object.defineProperty(exports,"DPIAQuestionnaire",{enumerable:true,get:function(){return chunkZNTMZ6NM_js.a}});Object.defineProperty(exports,"DPIAReport",{enumerable:true,get:function(){return chunkZNTMZ6NM_js.b}});Object.defineProperty(exports,"StepIndicator",{enumerable:true,get:function(){return chunkZNTMZ6NM_js.c}});Object.defineProperty(exports,"useDPIA",{enumerable:true,get:function(){return chunk3YCV2BA6_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkSSGJREE3_js.a}});//# sourceMappingURL=dpia.js.map
1
+ 'use strict';var chunkFY5G6DGZ_js=require('./chunk-FY5G6DGZ.js'),chunkUNKXYVXY_js=require('./chunk-UNKXYVXY.js'),chunkZCZ5RRZO_js=require('./chunk-ZCZ5RRZO.js'),chunkSSGJREE3_js=require('./chunk-SSGJREE3.js');require('./chunk-E64TU6IU.js'),require('./chunk-UK656RCG.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var i=react.createContext(null);function v(){let o=react.useContext(i);if(!o)throw new Error("DPIA compound components must be wrapped in <DPIA.Provider>. Example: <DPIA.Provider sections={...}><DPIA.Questionnaire /></DPIA.Provider>");return o}var p=({sections:o,initialAnswers:a,adapter:m,storageKey:I,useLocalStorage:A,onComplete:d,children:D})=>{let u=chunkZCZ5RRZO_js.a({sections:o,initialAnswers:a,adapter:m,storageKey:I,useLocalStorage:A,onComplete:d}),c=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{sections:o});return jsxRuntime.jsx(i.Provider,{value:c,children:D})};var y={Provider:p,Questionnaire:chunkUNKXYVXY_js.a,Report:chunkFY5G6DGZ_js.a,StepIndicator:chunkFY5G6DGZ_js.b};Object.defineProperty(exports,"DPIAReport",{enumerable:true,get:function(){return chunkFY5G6DGZ_js.a}});Object.defineProperty(exports,"StepIndicator",{enumerable:true,get:function(){return chunkFY5G6DGZ_js.b}});Object.defineProperty(exports,"DPIAQuestionnaire",{enumerable:true,get:function(){return chunkUNKXYVXY_js.a}});Object.defineProperty(exports,"useDPIA",{enumerable:true,get:function(){return chunkZCZ5RRZO_js.a}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkSSGJREE3_js.a}});exports.DPIA=y;exports.DPIAProvider=p;exports.useDPIACompound=v;//# sourceMappingURL=dpia.js.map
2
2
  //# sourceMappingURL=dpia.js.map
package/dist/dpia.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{a as DPIAQuestionnaire,b as DPIAReport,c as StepIndicator}from'./chunk-BZTTQS4A.mjs';export{a as useDPIA}from'./chunk-6GGGTRDZ.mjs';export{a as assessDPIARisk}from'./chunk-PGSA2O5P.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=dpia.mjs.map
1
+ import {b,a}from'./chunk-NPI5T6NH.mjs';export{a as DPIAReport,b as StepIndicator}from'./chunk-NPI5T6NH.mjs';import {a as a$1}from'./chunk-V3MXWGXU.mjs';export{a as DPIAQuestionnaire}from'./chunk-V3MXWGXU.mjs';import {a as a$2}from'./chunk-HNZK7LY3.mjs';export{a as useDPIA}from'./chunk-HNZK7LY3.mjs';export{a as assessDPIARisk}from'./chunk-PGSA2O5P.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-SBNAMPAP.mjs';import {b as b$1,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var i=createContext(null);function v(){let o=useContext(i);if(!o)throw new Error("DPIA compound components must be wrapped in <DPIA.Provider>. Example: <DPIA.Provider sections={...}><DPIA.Questionnaire /></DPIA.Provider>");return o}var p=({sections:o,initialAnswers:a,adapter:m,storageKey:I,useLocalStorage:A,onComplete:d,children:D})=>{let u=a$2({sections:o,initialAnswers:a,adapter:m,storageKey:I,useLocalStorage:A,onComplete:d}),c=b$1(a$3({},u),{sections:o});return jsx(i.Provider,{value:c,children:D})};var y={Provider:p,Questionnaire:a$1,Report:a,StepIndicator:b};export{y as DPIA,p as DPIAProvider,v as useDPIACompound};//# sourceMappingURL=dpia.mjs.map
2
2
  //# sourceMappingURL=dpia.mjs.map
package/dist/dsr.d.mts CHANGED
@@ -1,308 +1,37 @@
1
- import React from 'react';
2
- import { c as RequestType, D as DSRRequest, a as DSRStatus } from './dsr-Cm9lzWG7.mjs';
3
- export { b as DSRType, R as RequestStatus } from './dsr-Cm9lzWG7.mjs';
4
- export { u as useDSR } from './useDSR-YYZ6FYFs.mjs';
1
+ import { c as DSRRequestFormProps } from './DSRRequestForm-BY8PogCU.mjs';
2
+ export { D as DSRFormSubmission, a as DSRRequestForm, b as DSRRequestFormClassNames } from './DSRRequestForm-BY8PogCU.mjs';
3
+ import { d as DSRDashboardProps, e as DSRTrackerProps } from './DSRTracker-C6u_jAaK.mjs';
4
+ export { D as DSRDashboard, a as DSRDashboardClassNames, b as DSRTracker, c as DSRTrackerClassNames } from './DSRTracker-C6u_jAaK.mjs';
5
+ import { U as UseDSRReturn } from './useDSR-C1LksCfP.mjs';
6
+ export { u as useDSR } from './useDSR-C1LksCfP.mjs';
5
7
  export { f as formatDSRRequest } from './dsr-D_eTNc4S.mjs';
8
+ import { c as RequestType, D as DSRRequest } from './dsr-Cm9lzWG7.mjs';
9
+ export { a as DSRStatus, b as DSRType, R as RequestStatus } from './dsr-Cm9lzWG7.mjs';
10
+ import * as React from 'react';
11
+ import React__default from 'react';
12
+ import { S as StorageAdapter } from './types-DK2CoKOC.mjs';
6
13
 
7
- /**
8
- * Represents the data submitted by the DSR request form.
9
- */
10
- interface DSRFormSubmission {
11
- /** The selected request type identifier */
12
- requestType: string;
13
- /** Data subject personal information */
14
- dataSubject: {
15
- fullName: string;
16
- email: string;
17
- phone?: string;
18
- identifierType: string;
19
- identifierValue: string;
20
- };
21
- /** Additional information provided for the selected request type */
22
- additionalInfo?: Record<string, any>;
23
- /** Timestamp (ms) when the form was submitted */
24
- submittedAt: number;
25
- }
26
- interface DSRRequestFormClassNames {
27
- root?: string;
28
- title?: string;
29
- description?: string;
30
- form?: string;
31
- fieldGroup?: string;
32
- label?: string;
33
- input?: string;
34
- select?: string;
35
- textarea?: string;
36
- submitButton?: string;
37
- /** Alias for submitButton */
38
- primaryButton?: string;
39
- successMessage?: string;
40
- /** Custom class applied when isSubmitting is true (e.g. a loading overlay) */
41
- loadingOverlay?: string;
42
- }
43
- interface DSRRequestFormProps {
44
- /**
45
- * Array of request types that can be submitted
46
- */
14
+ interface DSRProviderProps {
47
15
  requestTypes: RequestType[];
48
- /**
49
- * Callback function called when form is submitted
50
- */
51
- onSubmit: (data: DSRFormSubmission) => void;
52
- /**
53
- * Callback function called when form validation fails
54
- */
55
- onValidationError?: (errors: Record<string, string>) => void;
56
- /**
57
- * Title displayed on the form
58
- * @default "Submit a Data Subject Request"
59
- */
60
- title?: string;
61
- /**
62
- * Description text displayed on the form
63
- * @default "Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36."
64
- */
65
- description?: string;
66
- /**
67
- * Text for the submit button
68
- * @default "Submit Request"
69
- */
70
- submitButtonText?: string;
71
- /**
72
- * Custom CSS class for the form
73
- */
74
- className?: string;
75
- /**
76
- * Custom CSS class for the submit button
77
- */
78
- buttonClassName?: string;
79
- /**
80
- * Whether to show a confirmation message after submission
81
- * @default true
82
- */
83
- showConfirmation?: boolean;
84
- /**
85
- * Confirmation message to display after submission
86
- * @default "Your request has been submitted successfully. You will receive a confirmation email shortly."
87
- */
88
- confirmationMessage?: string;
89
- /**
90
- * Whether to require identity verification
91
- * @default true
92
- */
93
- requireIdentityVerification?: boolean;
94
- /**
95
- * Types of identifiers accepted for verification
96
- * @default ["email", "account", "customer_id"]
97
- */
98
- identifierTypes?: Array<{
99
- id: string;
100
- label: string;
101
- }>;
102
- /**
103
- * Whether to collect additional contact information
104
- * @default true
105
- */
106
- collectAdditionalContact?: boolean;
107
- /**
108
- * Custom labels for form fields
109
- */
110
- labels?: {
111
- name?: string;
112
- email?: string;
113
- requestType?: string;
114
- description?: string;
115
- submit?: string;
116
- };
117
- /**
118
- * Object of CSS class overrides keyed by semantic section name.
119
- */
120
- classNames?: DSRRequestFormClassNames;
121
- /**
122
- * When true, all default Tailwind classes are removed so consumers
123
- * can style from scratch using classNames.
124
- */
125
- unstyled?: boolean;
126
- /**
127
- * Whether the form is currently submitting.
128
- * When true, the submit button is disabled and shows "Submitting..." text.
129
- */
130
- isSubmitting?: boolean;
131
- /**
132
- * Default values to pre-fill form fields.
133
- * Useful for editing existing requests or pre-populating known data.
134
- */
135
- defaultValues?: Partial<DSRFormSubmission>;
136
- /**
137
- * Callback fired when the form is reset via the Reset button.
138
- * To fully remount the component (clearing all internal state),
139
- * change the `key` prop from the parent.
140
- */
141
- onReset?: () => void;
16
+ adapter?: StorageAdapter<DSRRequest[]>;
17
+ storageKey?: string;
18
+ useLocalStorage?: boolean;
19
+ onSubmit?: (request: DSRRequest) => void;
20
+ onUpdate?: (request: DSRRequest) => void;
21
+ children: React__default.ReactNode;
142
22
  }
143
- /**
144
- * Data Subject Request form component. Implements NDPA Part IV, Sections 29-36
145
- * covering data subject rights including access, rectification, erasure, and portability.
146
- */
147
- declare const DSRRequestForm: React.FC<DSRRequestFormProps>;
23
+ declare const DSRProvider: React__default.FC<DSRProviderProps>;
148
24
 
149
- interface DSRDashboardClassNames {
150
- root?: string;
151
- header?: string;
152
- title?: string;
153
- filters?: string;
154
- requestList?: string;
155
- requestItem?: string;
156
- statusBadge?: string;
157
- detailPanel?: string;
158
- }
159
- interface DSRDashboardProps {
160
- /**
161
- * List of DSR requests to display
162
- */
163
- requests: DSRRequest[];
164
- /**
165
- * Callback function called when a request is selected
166
- */
167
- onSelectRequest?: (requestId: string) => void;
168
- /**
169
- * Callback function called when a request status is updated
170
- */
171
- onUpdateStatus?: (requestId: string, status: DSRStatus) => void;
172
- /**
173
- * Callback function called when a request is assigned
174
- */
175
- onAssignRequest?: (requestId: string, assignee: string) => void;
176
- /**
177
- * Title displayed on the dashboard
178
- * @default "Data Subject Request Dashboard"
179
- */
180
- title?: string;
181
- /**
182
- * Description text displayed on the dashboard
183
- * @default "Track and manage data subject requests in compliance with NDPA Part IV requirements."
184
- */
185
- description?: string;
186
- /**
187
- * Custom CSS class for the dashboard
188
- */
189
- className?: string;
190
- /**
191
- * Custom CSS class for the buttons
192
- */
193
- buttonClassName?: string;
194
- /**
195
- * Whether to show the request details
196
- * @default true
197
- */
198
- showRequestDetails?: boolean;
199
- /**
200
- * Whether to show the request timeline
201
- * @default true
202
- */
203
- showRequestTimeline?: boolean;
204
- /**
205
- * Whether to show the deadline alerts
206
- * @default true
207
- */
208
- showDeadlineAlerts?: boolean;
209
- /**
210
- * List of possible assignees
211
- */
212
- assignees?: string[];
213
- /**
214
- * Object of CSS class overrides keyed by semantic section name.
215
- */
216
- classNames?: DSRDashboardClassNames;
217
- /**
218
- * When true, all default Tailwind classes are removed so consumers
219
- * can style from scratch using classNames.
220
- */
221
- unstyled?: boolean;
222
- }
223
- /**
224
- * Data Subject Request dashboard component. Supports compliance with NDPA Part IV,
225
- * providing tools to track, manage, and respond to data subject requests within required timeframes.
226
- */
227
- declare const DSRDashboard: React.FC<DSRDashboardProps>;
25
+ declare const DSR: {
26
+ Provider: React.FC<DSRProviderProps>;
27
+ Form: React.FC<DSRRequestFormProps>;
28
+ Dashboard: React.FC<DSRDashboardProps>;
29
+ Tracker: React.FC<DSRTrackerProps>;
30
+ };
228
31
 
229
- interface DSRTrackerClassNames {
230
- root?: string;
231
- header?: string;
232
- title?: string;
233
- stats?: string;
234
- statCard?: string;
235
- table?: string;
236
- tableHeader?: string;
237
- tableRow?: string;
238
- statusBadge?: string;
239
- }
240
- interface DSRTrackerProps {
241
- /**
242
- * List of DSR requests to track
243
- */
244
- requests: DSRRequest[];
245
- /**
246
- * Callback function called when a request is selected
247
- */
248
- onSelectRequest?: (requestId: string) => void;
249
- /**
250
- * Title displayed on the tracker
251
- * @default "DSR Request Tracker"
252
- */
253
- title?: string;
254
- /**
255
- * Description text displayed on the tracker
256
- * @default "Track the status and progress of data subject requests as required by NDPA Part IV."
257
- */
258
- description?: string;
259
- /**
260
- * Custom CSS class for the tracker
261
- */
262
- className?: string;
263
- /**
264
- * Custom CSS class for the buttons
265
- */
266
- buttonClassName?: string;
267
- /**
268
- * Whether to show the summary statistics
269
- * @default true
270
- */
271
- showSummaryStats?: boolean;
272
- /**
273
- * Whether to show the request type breakdown
274
- * @default true
275
- */
276
- showTypeBreakdown?: boolean;
277
- /**
278
- * Whether to show the status breakdown
279
- * @default true
280
- */
281
- showStatusBreakdown?: boolean;
282
- /**
283
- * Whether to show the timeline chart
284
- * @default true
285
- */
286
- showTimelineChart?: boolean;
287
- /**
288
- * Whether to show the overdue requests
289
- * @default true
290
- */
291
- showOverdueRequests?: boolean;
292
- /**
293
- * Object of CSS class overrides keyed by semantic section name.
294
- */
295
- classNames?: DSRTrackerClassNames;
296
- /**
297
- * When true, all default Tailwind classes are removed so consumers
298
- * can style from scratch using classNames.
299
- */
300
- unstyled?: boolean;
32
+ interface DSRContextValue extends UseDSRReturn {
33
+ requestTypes: RequestType[];
301
34
  }
302
- /**
303
- * DSR tracking and analytics component. Supports compliance with NDPA Part IV,
304
- * providing summary statistics, deadline tracking, and compliance metrics for data subject requests.
305
- */
306
- declare const DSRTracker: React.FC<DSRTrackerProps>;
35
+ declare function useDSRCompound(): DSRContextValue;
307
36
 
308
- export { DSRDashboard, type DSRDashboardClassNames, type DSRFormSubmission, DSRRequest, DSRRequestForm, type DSRRequestFormClassNames, DSRStatus, DSRTracker, type DSRTrackerClassNames, RequestType };
37
+ export { DSR, DSRProvider, type DSRProviderProps, DSRRequest, RequestType, StorageAdapter, useDSRCompound };