@tantainnovative/ndpr-toolkit 1.0.5 → 1.0.7

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 (263) hide show
  1. package/README.md +88 -14
  2. package/dist/components/breach-notification/BreachNotificationForm.d.ts +18 -0
  3. package/dist/components/breach-notification/BreachNotificationForm.d.ts.map +1 -0
  4. package/dist/components/consent/ConsentBanner.d.ts +30 -0
  5. package/dist/components/consent/ConsentBanner.d.ts.map +1 -0
  6. package/dist/components/consent/ConsentManager.d.ts +51 -0
  7. package/dist/components/consent/ConsentManager.d.ts.map +1 -0
  8. package/dist/components/consent/ConsentSettings.d.ts +15 -0
  9. package/dist/components/consent/ConsentSettings.d.ts.map +1 -0
  10. package/dist/components/consent/unstyled/UnstyledConsentBanner.d.ts +7 -0
  11. package/dist/components/consent/unstyled/UnstyledConsentBanner.d.ts.map +1 -0
  12. package/dist/components/consent/unstyled/UnstyledConsentSettings.d.ts +7 -0
  13. package/dist/components/consent/unstyled/UnstyledConsentSettings.d.ts.map +1 -0
  14. package/dist/components/consent/unstyled/UnstyledConsentToggle.d.ts +8 -0
  15. package/dist/components/consent/unstyled/UnstyledConsentToggle.d.ts.map +1 -0
  16. package/dist/components/consent/unstyled/index.d.ts +4 -0
  17. package/dist/components/consent/unstyled/index.d.ts.map +1 -0
  18. package/dist/components/data-subject-rights/DataSubjectRequestForm.d.ts +14 -0
  19. package/dist/components/data-subject-rights/DataSubjectRequestForm.d.ts.map +1 -0
  20. package/dist/components/docs/DocLayout.d.ts +9 -0
  21. package/dist/components/docs/DocLayout.d.ts.map +1 -0
  22. package/dist/components/docs/index.d.ts +2 -0
  23. package/dist/components/docs/index.d.ts.map +1 -0
  24. package/dist/components/dpia/DPIAQuestionnaire.d.ts +9 -0
  25. package/dist/components/dpia/DPIAQuestionnaire.d.ts.map +1 -0
  26. package/dist/components/privacy-policy/PolicyGenerator.d.ts +12 -0
  27. package/dist/components/privacy-policy/PolicyGenerator.d.ts.map +1 -0
  28. package/dist/components/privacy-policy/data.d.ts +8 -0
  29. package/dist/components/privacy-policy/data.d.ts.map +1 -0
  30. package/dist/components/privacy-policy/shared/CheckboxField.d.ts +13 -0
  31. package/dist/components/privacy-policy/shared/CheckboxField.d.ts.map +1 -0
  32. package/dist/components/privacy-policy/shared/CheckboxGroup.d.ts +13 -0
  33. package/dist/components/privacy-policy/shared/CheckboxGroup.d.ts.map +1 -0
  34. package/dist/components/privacy-policy/shared/FormField.d.ts +13 -0
  35. package/dist/components/privacy-policy/shared/FormField.d.ts.map +1 -0
  36. package/dist/components/privacy-policy/shared/StepIndicator.d.ts +8 -0
  37. package/dist/components/privacy-policy/shared/StepIndicator.d.ts.map +1 -0
  38. package/dist/components/privacy-policy/steps/CustomSectionsStep.d.ts +15 -0
  39. package/dist/components/privacy-policy/steps/CustomSectionsStep.d.ts.map +1 -0
  40. package/dist/components/privacy-policy/steps/DataCollectionStep.d.ts +20 -0
  41. package/dist/components/privacy-policy/steps/DataCollectionStep.d.ts.map +1 -0
  42. package/dist/components/privacy-policy/steps/DataSharingStep.d.ts +34 -0
  43. package/dist/components/privacy-policy/steps/DataSharingStep.d.ts.map +1 -0
  44. package/dist/components/privacy-policy/steps/OrganizationInfoStep.d.ts +17 -0
  45. package/dist/components/privacy-policy/steps/OrganizationInfoStep.d.ts.map +1 -0
  46. package/dist/components/privacy-policy/steps/PolicyPreviewStep.d.ts +30 -0
  47. package/dist/components/privacy-policy/steps/PolicyPreviewStep.d.ts.map +1 -0
  48. package/dist/components/ui/Badge.d.ts +10 -0
  49. package/dist/components/ui/Badge.d.ts.map +1 -0
  50. package/dist/components/ui/Button.d.ts +11 -0
  51. package/dist/components/ui/Button.d.ts.map +1 -0
  52. package/dist/components/ui/Card.d.ts +10 -0
  53. package/dist/components/ui/Card.d.ts.map +1 -0
  54. package/dist/components/ui/Checkbox.d.ts +8 -0
  55. package/dist/components/ui/Checkbox.d.ts.map +1 -0
  56. package/dist/components/ui/FormField.d.ts +11 -0
  57. package/dist/components/ui/FormField.d.ts.map +1 -0
  58. package/dist/components/ui/Input.d.ts +6 -0
  59. package/dist/components/ui/Input.d.ts.map +1 -0
  60. package/dist/components/ui/Select.d.ts +6 -0
  61. package/dist/components/ui/Select.d.ts.map +1 -0
  62. package/dist/components/ui/TextArea.d.ts +6 -0
  63. package/dist/components/ui/TextArea.d.ts.map +1 -0
  64. package/dist/components/ui/dialog.d.ts +18 -0
  65. package/dist/components/ui/dialog.d.ts.map +1 -0
  66. package/dist/components/ui/label.d.ts +5 -0
  67. package/dist/components/ui/label.d.ts.map +1 -0
  68. package/dist/components/ui/switch.d.ts +5 -0
  69. package/dist/components/ui/switch.d.ts.map +1 -0
  70. package/dist/components/ui/tabs.d.ts +8 -0
  71. package/dist/components/ui/tabs.d.ts.map +1 -0
  72. package/dist/contexts/ConsentContext.d.ts +35 -0
  73. package/dist/contexts/ConsentContext.d.ts.map +1 -0
  74. package/dist/contexts/GenericConsentContext.d.ts +11 -0
  75. package/dist/contexts/GenericConsentContext.d.ts.map +1 -0
  76. package/dist/hooks/useConsent.d.ts +12 -0
  77. package/dist/hooks/useConsent.d.ts.map +1 -0
  78. package/dist/hooks/useConsentActions.d.ts +12 -0
  79. package/dist/hooks/useConsentActions.d.ts.map +1 -0
  80. package/dist/hooks/useConsentManager.d.ts +14 -0
  81. package/dist/hooks/useConsentManager.d.ts.map +1 -0
  82. package/dist/hooks/useConsentState.d.ts +10 -0
  83. package/dist/hooks/useConsentState.d.ts.map +1 -0
  84. package/dist/index.d.mts +256 -0
  85. package/dist/index.d.ts +24 -0
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.js +2 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/index.mjs +2 -0
  90. package/dist/index.mjs.map +1 -0
  91. package/dist/lib/consentService.d.ts +11 -0
  92. package/dist/lib/consentService.d.ts.map +1 -0
  93. package/dist/lib/dpiaQuestions.d.ts +3 -0
  94. package/dist/lib/dpiaQuestions.d.ts.map +1 -0
  95. package/dist/lib/requestService.d.ts +10 -0
  96. package/dist/lib/requestService.d.ts.map +1 -0
  97. package/dist/lib/utils.d.ts +3 -0
  98. package/dist/lib/utils.d.ts.map +1 -0
  99. package/dist/styles.css +38 -0
  100. package/dist/types/consent.d.ts +57 -0
  101. package/dist/types/consent.d.ts.map +1 -0
  102. package/dist/types/index.d.ts +91 -0
  103. package/dist/types/index.d.ts.map +1 -0
  104. package/dist/unstyled.d.mts +22 -0
  105. package/dist/unstyled.d.ts +2 -0
  106. package/dist/unstyled.d.ts.map +1 -0
  107. package/dist/unstyled.js +2 -0
  108. package/dist/unstyled.js.map +1 -0
  109. package/dist/unstyled.mjs +2 -0
  110. package/dist/unstyled.mjs.map +1 -0
  111. package/package.json +33 -5
  112. package/CHANGELOG.md +0 -16
  113. package/CNAME +0 -1
  114. package/CONTRIBUTING.md +0 -87
  115. package/RELEASE-NOTES-v1.0.0.md +0 -140
  116. package/RELEASE-NOTES-v1.0.1.md +0 -69
  117. package/SECURITY.md +0 -21
  118. package/components.json +0 -21
  119. package/eslint.config.mjs +0 -16
  120. package/next-env.d.ts +0 -5
  121. package/next.config.js +0 -15
  122. package/next.config.ts +0 -62
  123. package/packages/ndpr-toolkit/README.md +0 -467
  124. package/packages/ndpr-toolkit/dist/components/breach/BreachNotificationManager.d.ts +0 -62
  125. package/packages/ndpr-toolkit/dist/components/breach/BreachReportForm.d.ts +0 -66
  126. package/packages/ndpr-toolkit/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
  127. package/packages/ndpr-toolkit/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
  128. package/packages/ndpr-toolkit/dist/components/consent/ConsentBanner.d.ts +0 -79
  129. package/packages/ndpr-toolkit/dist/components/consent/ConsentManager.d.ts +0 -73
  130. package/packages/ndpr-toolkit/dist/components/consent/ConsentStorage.d.ts +0 -41
  131. package/packages/ndpr-toolkit/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
  132. package/packages/ndpr-toolkit/dist/components/dpia/DPIAReport.d.ts +0 -40
  133. package/packages/ndpr-toolkit/dist/components/dpia/StepIndicator.d.ts +0 -64
  134. package/packages/ndpr-toolkit/dist/components/dsr/DSRDashboard.d.ts +0 -58
  135. package/packages/ndpr-toolkit/dist/components/dsr/DSRRequestForm.d.ts +0 -74
  136. package/packages/ndpr-toolkit/dist/components/dsr/DSRTracker.d.ts +0 -56
  137. package/packages/ndpr-toolkit/dist/components/policy/PolicyExporter.d.ts +0 -65
  138. package/packages/ndpr-toolkit/dist/components/policy/PolicyGenerator.d.ts +0 -54
  139. package/packages/ndpr-toolkit/dist/components/policy/PolicyPreview.d.ts +0 -71
  140. package/packages/ndpr-toolkit/dist/hooks/useBreach.d.ts +0 -97
  141. package/packages/ndpr-toolkit/dist/hooks/useConsent.d.ts +0 -63
  142. package/packages/ndpr-toolkit/dist/hooks/useDPIA.d.ts +0 -92
  143. package/packages/ndpr-toolkit/dist/hooks/useDSR.d.ts +0 -72
  144. package/packages/ndpr-toolkit/dist/hooks/usePrivacyPolicy.d.ts +0 -87
  145. package/packages/ndpr-toolkit/dist/index.d.ts +0 -31
  146. package/packages/ndpr-toolkit/dist/index.esm.js +0 -2
  147. package/packages/ndpr-toolkit/dist/index.esm.js.map +0 -1
  148. package/packages/ndpr-toolkit/dist/index.js +0 -2
  149. package/packages/ndpr-toolkit/dist/index.js.map +0 -1
  150. package/packages/ndpr-toolkit/dist/setupTests.d.ts +0 -2
  151. package/packages/ndpr-toolkit/dist/types/breach.d.ts +0 -239
  152. package/packages/ndpr-toolkit/dist/types/consent.d.ts +0 -95
  153. package/packages/ndpr-toolkit/dist/types/dpia.d.ts +0 -196
  154. package/packages/ndpr-toolkit/dist/types/dsr.d.ts +0 -162
  155. package/packages/ndpr-toolkit/dist/types/privacy.d.ts +0 -204
  156. package/packages/ndpr-toolkit/dist/utils/breach.d.ts +0 -14
  157. package/packages/ndpr-toolkit/dist/utils/consent.d.ts +0 -10
  158. package/packages/ndpr-toolkit/dist/utils/dpia.d.ts +0 -12
  159. package/packages/ndpr-toolkit/dist/utils/dsr.d.ts +0 -11
  160. package/packages/ndpr-toolkit/dist/utils/privacy.d.ts +0 -12
  161. package/packages/ndpr-toolkit/package-lock.json +0 -8197
  162. package/packages/ndpr-toolkit/package.json +0 -71
  163. package/packages/ndpr-toolkit/rollup.config.js +0 -34
  164. package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +0 -701
  165. package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +0 -631
  166. package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +0 -569
  167. package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +0 -496
  168. package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +0 -270
  169. package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +0 -217
  170. package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +0 -206
  171. package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +0 -342
  172. package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +0 -373
  173. package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +0 -174
  174. package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +0 -717
  175. package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +0 -476
  176. package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +0 -620
  177. package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +0 -541
  178. package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +0 -454
  179. package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +0 -333
  180. package/packages/ndpr-toolkit/src/hooks/useBreach.ts +0 -409
  181. package/packages/ndpr-toolkit/src/hooks/useConsent.ts +0 -263
  182. package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +0 -457
  183. package/packages/ndpr-toolkit/src/hooks/useDSR.ts +0 -236
  184. package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +0 -428
  185. package/packages/ndpr-toolkit/src/index.ts +0 -44
  186. package/packages/ndpr-toolkit/src/setupTests.ts +0 -5
  187. package/packages/ndpr-toolkit/src/types/breach.ts +0 -283
  188. package/packages/ndpr-toolkit/src/types/consent.ts +0 -111
  189. package/packages/ndpr-toolkit/src/types/dpia.ts +0 -236
  190. package/packages/ndpr-toolkit/src/types/dsr.ts +0 -192
  191. package/packages/ndpr-toolkit/src/types/index.ts +0 -42
  192. package/packages/ndpr-toolkit/src/types/privacy.ts +0 -246
  193. package/packages/ndpr-toolkit/src/utils/breach.ts +0 -122
  194. package/packages/ndpr-toolkit/src/utils/consent.ts +0 -51
  195. package/packages/ndpr-toolkit/src/utils/dpia.ts +0 -104
  196. package/packages/ndpr-toolkit/src/utils/dsr.ts +0 -77
  197. package/packages/ndpr-toolkit/src/utils/privacy.ts +0 -100
  198. package/packages/ndpr-toolkit/tsconfig.json +0 -23
  199. package/postcss.config.mjs +0 -5
  200. package/public/NDPR TOOLKIT.svg +0 -1
  201. package/public/favicon/android-chrome-192x192.png +0 -0
  202. package/public/favicon/android-chrome-512x512.png +0 -0
  203. package/public/favicon/apple-touch-icon.png +0 -0
  204. package/public/favicon/favicon-16x16.png +0 -0
  205. package/public/favicon/favicon-32x32.png +0 -0
  206. package/public/favicon/site.webmanifest +0 -1
  207. package/public/file.svg +0 -1
  208. package/public/globe.svg +0 -1
  209. package/public/ndpr-toolkit-logo.svg +0 -108
  210. package/public/next.svg +0 -1
  211. package/public/vercel.svg +0 -1
  212. package/public/window.svg +0 -1
  213. package/src/app/accessibility.css +0 -70
  214. package/src/app/favicon.ico +0 -0
  215. package/src/app/globals.css +0 -123
  216. package/src/app/layout.tsx +0 -37
  217. package/src/app/ndpr-demos/breach/page.tsx +0 -354
  218. package/src/app/ndpr-demos/consent/page.tsx +0 -366
  219. package/src/app/ndpr-demos/dpia/page.tsx +0 -495
  220. package/src/app/ndpr-demos/dsr/page.tsx +0 -280
  221. package/src/app/ndpr-demos/page.tsx +0 -73
  222. package/src/app/ndpr-demos/policy/page.tsx +0 -771
  223. package/src/app/page.tsx +0 -452
  224. package/src/components/ErrorBoundary.tsx +0 -90
  225. package/src/components/breach-notification/BreachNotificationForm.tsx +0 -479
  226. package/src/components/consent/ConsentBanner.tsx +0 -193
  227. package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +0 -530
  228. package/src/components/dpia/DPIAQuestionnaire.tsx +0 -523
  229. package/src/components/privacy-policy/PolicyGenerator.tsx +0 -1062
  230. package/src/components/privacy-policy/data.ts +0 -98
  231. package/src/components/privacy-policy/shared/CheckboxField.tsx +0 -38
  232. package/src/components/privacy-policy/shared/CheckboxGroup.tsx +0 -85
  233. package/src/components/privacy-policy/shared/FormField.tsx +0 -79
  234. package/src/components/privacy-policy/shared/StepIndicator.tsx +0 -86
  235. package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +0 -361
  236. package/src/components/privacy-policy/steps/DataCollectionStep.tsx +0 -231
  237. package/src/components/privacy-policy/steps/DataSharingStep.tsx +0 -418
  238. package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +0 -202
  239. package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +0 -226
  240. package/src/components/ui/Badge.tsx +0 -46
  241. package/src/components/ui/Button.tsx +0 -59
  242. package/src/components/ui/Card.tsx +0 -92
  243. package/src/components/ui/Checkbox.tsx +0 -57
  244. package/src/components/ui/FormField.tsx +0 -50
  245. package/src/components/ui/Input.tsx +0 -38
  246. package/src/components/ui/Loading.tsx +0 -201
  247. package/src/components/ui/Select.tsx +0 -42
  248. package/src/components/ui/TextArea.tsx +0 -38
  249. package/src/components/ui/label.tsx +0 -24
  250. package/src/components/ui/switch.tsx +0 -31
  251. package/src/components/ui/tabs.tsx +0 -66
  252. package/src/hooks/useConsent.ts +0 -70
  253. package/src/hooks/useLoadingState.ts +0 -85
  254. package/src/lib/consentService.ts +0 -144
  255. package/src/lib/dpiaQuestions.ts +0 -188
  256. package/src/lib/requestService.ts +0 -79
  257. package/src/lib/sanitize.ts +0 -108
  258. package/src/lib/storage.ts +0 -222
  259. package/src/lib/utils.ts +0 -6
  260. package/src/types/html-to-docx.d.ts +0 -30
  261. package/src/types/index.ts +0 -77
  262. package/tailwind.config.ts +0 -65
  263. package/tsconfig.json +0 -41
@@ -1,280 +0,0 @@
1
- 'use client';
2
-
3
- import React, { useState, useEffect } from 'react';
4
- import Link from 'next/link';
5
- import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
6
- import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/components/ui/Card';
7
- import { DSRRequestForm, DSRDashboard, DSRTracker, DSRRequest, DSRStatus, DSRType, RequestType } from '@tantainnovative/ndpr-toolkit';
8
- import { v4 as uuidv4 } from 'uuid';
9
-
10
- export default function DSRDemoPage() {
11
- const [requests, setRequests] = useState<DSRRequest[]>([]);
12
- const [activeTab, setActiveTab] = useState('request-form');
13
- const [isClient, setIsClient] = useState(false);
14
-
15
- // Define request types
16
- const requestTypes: RequestType[] = [
17
- {
18
- id: 'access',
19
- name: 'Access Request',
20
- description: 'Request to access your personal data',
21
- estimatedCompletionTime: 30,
22
- requiresAdditionalInfo: false
23
- },
24
- {
25
- id: 'erasure',
26
- name: 'Erasure Request',
27
- description: 'Request to delete your personal data',
28
- estimatedCompletionTime: 45,
29
- requiresAdditionalInfo: false
30
- },
31
- {
32
- id: 'rectification',
33
- name: 'Rectification Request',
34
- description: 'Request to correct your personal data',
35
- estimatedCompletionTime: 15,
36
- requiresAdditionalInfo: true
37
- },
38
- {
39
- id: 'restriction',
40
- name: 'Restriction Request',
41
- description: 'Request to restrict processing of your personal data',
42
- estimatedCompletionTime: 20,
43
- requiresAdditionalInfo: true
44
- }
45
- ];
46
-
47
- // This effect runs only on the client side after hydration
48
- useEffect(() => {
49
- setIsClient(true);
50
-
51
- // Load sample data for demo purposes
52
- const sampleRequests: DSRRequest[] = [
53
- {
54
- id: uuidv4(),
55
- type: 'access' as DSRType,
56
- status: 'pending' as DSRStatus,
57
- createdAt: Date.now() - 3 * 24 * 60 * 60 * 1000, // 3 days ago
58
- updatedAt: Date.now() - 3 * 24 * 60 * 60 * 1000,
59
- dueDate: Date.now() + 12 * 24 * 60 * 60 * 1000, // Due in 12 days
60
- subject: {
61
- name: 'John Doe',
62
- email: 'john@example.com',
63
- phone: '1234567890'
64
- },
65
- description: 'I want to access all my personal data stored in your systems.'
66
- },
67
- {
68
- id: uuidv4(),
69
- type: 'erasure' as DSRType,
70
- status: 'inProgress' as DSRStatus,
71
- createdAt: Date.now() - 5 * 24 * 60 * 60 * 1000, // 5 days ago
72
- updatedAt: Date.now() - 2 * 24 * 60 * 60 * 1000, // 2 days ago
73
- dueDate: Date.now() + 5 * 24 * 60 * 60 * 1000, // Due in 5 days
74
- subject: {
75
- name: 'Jane Smith',
76
- email: 'jane@example.com'
77
- },
78
- description: 'Please delete all my personal data from your systems.'
79
- },
80
- {
81
- id: uuidv4(),
82
- type: 'rectification' as DSRType,
83
- status: 'completed' as DSRStatus,
84
- createdAt: Date.now() - 10 * 24 * 60 * 60 * 1000, // 10 days ago
85
- updatedAt: Date.now() - 1 * 24 * 60 * 60 * 1000, // 1 day ago
86
- completedAt: Date.now() - 1 * 24 * 60 * 60 * 1000,
87
- dueDate: Date.now() - 2 * 24 * 60 * 60 * 1000, // Due 2 days ago (but completed)
88
- subject: {
89
- name: 'Bob Johnson',
90
- email: 'bob@example.com'
91
- },
92
- description: 'My address is incorrect. Please update it to 123 Main St.'
93
- },
94
- {
95
- id: uuidv4(),
96
- type: 'restriction' as DSRType,
97
- status: 'pending' as DSRStatus,
98
- createdAt: Date.now() - 15 * 24 * 60 * 60 * 1000, // 15 days ago
99
- updatedAt: Date.now() - 15 * 24 * 60 * 60 * 1000,
100
- dueDate: Date.now() - 5 * 24 * 60 * 60 * 1000, // Due 5 days ago (overdue)
101
- subject: {
102
- name: 'Alice Williams',
103
- email: 'alice@example.com',
104
- phone: '9876543210'
105
- },
106
- description: 'I want to restrict processing of my personal data for marketing purposes.'
107
- }
108
- ];
109
-
110
- setRequests(sampleRequests);
111
- }, []);
112
-
113
- interface SubmitData {
114
- requestType: string;
115
- dataSubject: {
116
- fullName: string;
117
- email: string;
118
- phone?: string;
119
- };
120
- additionalInfo?: {
121
- description?: string;
122
- };
123
- }
124
-
125
- const handleSubmitRequest = (data: Record<string, unknown>) => {
126
- const req = data as unknown as SubmitData;
127
- console.log('Received form data:', data);
128
-
129
- // Calculate due date based on request type (30 days for access, 15 days for erasure, etc.)
130
- let dueDays = 30; // Default to 30 days
131
- if (req.requestType === 'erasure') dueDays = 15;
132
- if (req.requestType === 'rectification') dueDays = 10;
133
- if (req.requestType === 'restriction') dueDays = 20;
134
-
135
- const newRequest: DSRRequest = {
136
- id: uuidv4(),
137
- type: req.requestType as DSRType,
138
- status: 'pending' as DSRStatus,
139
- createdAt: Date.now(),
140
- updatedAt: Date.now(),
141
- dueDate: Date.now() + (dueDays * 24 * 60 * 60 * 1000), // Set due date based on request type
142
- subject: {
143
- name: req.dataSubject.fullName,
144
- email: req.dataSubject.email,
145
- phone: req.dataSubject.phone
146
- },
147
- description: req.additionalInfo?.description || 'No description provided'
148
- };
149
-
150
- setRequests((prev) => [newRequest, ...prev]);
151
- setActiveTab('dashboard');
152
- };
153
-
154
- const handleUpdateStatus = (requestId: string, status: DSRStatus) => {
155
- setRequests((prev) =>
156
- prev.map((request) => {
157
- if (request.id === requestId) {
158
- return {
159
- ...request,
160
- status,
161
- updatedAt: Date.now(),
162
- ...(status === 'completed' ? { completedAt: Date.now() } : {})
163
- };
164
- }
165
- return request;
166
- })
167
- );
168
- };
169
-
170
- const handleSelectRequest = (requestId: string) => {
171
- // In a real application, you might want to show detailed information
172
- // about the selected request or perform other actions
173
- console.log(`Request selected: ${requestId}`);
174
- };
175
-
176
- if (!isClient) {
177
- return <div>Loading...</div>;
178
- }
179
-
180
- return (
181
- <div className="container mx-auto py-10">
182
- <div className="mb-6">
183
- <Link href="/ndpr-demos" className="text-blue-600 hover:underline">
184
- ← Back to NDPR Demos
185
- </Link>
186
- </div>
187
-
188
- <h1 className="text-3xl font-bold mb-8">Data Subject Rights Demo</h1>
189
-
190
- <Tabs value={activeTab} onValueChange={setActiveTab}>
191
- <TabsList className="mb-6">
192
- <TabsTrigger value="request-form">DSR Request Form</TabsTrigger>
193
- <TabsTrigger value="dashboard">DSR Dashboard</TabsTrigger>
194
- <TabsTrigger value="tracker">DSR Tracker</TabsTrigger>
195
- </TabsList>
196
-
197
- <TabsContent value="request-form" className="mt-6">
198
- <Card>
199
- <CardHeader>
200
- <CardTitle>Data Subject Request Form</CardTitle>
201
- <CardDescription>
202
- This form allows data subjects to submit requests to exercise their rights under NDPR.
203
- </CardDescription>
204
- </CardHeader>
205
- <CardContent>
206
- <DSRRequestForm
207
- requestTypes={requestTypes}
208
- onSubmit={handleSubmitRequest}
209
- title="Submit a Data Subject Request"
210
- description="Use this form to submit a request regarding your personal data."
211
- submitButtonText="Submit Request"
212
- />
213
- </CardContent>
214
- </Card>
215
- </TabsContent>
216
-
217
- <TabsContent value="dashboard" className="mt-6">
218
- <Card>
219
- <CardHeader>
220
- <CardTitle>Data Subject Request Dashboard</CardTitle>
221
- <CardDescription>
222
- This dashboard allows administrators to manage and respond to data subject requests.
223
- </CardDescription>
224
- </CardHeader>
225
- <CardContent>
226
- <DSRDashboard
227
- requests={requests}
228
- onUpdateStatus={handleUpdateStatus}
229
- onSelectRequest={handleSelectRequest}
230
- title="DSR Management Dashboard"
231
- description="Track and manage data subject requests in compliance with NDPR requirements."
232
- showRequestDetails={true}
233
- showRequestTimeline={true}
234
- showDeadlineAlerts={true}
235
- />
236
- </CardContent>
237
- </Card>
238
- </TabsContent>
239
-
240
- <TabsContent value="tracker" className="mt-6">
241
- <Card>
242
- <CardHeader>
243
- <CardTitle>Data Subject Request Tracker</CardTitle>
244
- <CardDescription>
245
- This component provides a simplified view for tracking DSR requests.
246
- </CardDescription>
247
- </CardHeader>
248
- <CardContent>
249
- <DSRTracker
250
- requests={requests}
251
- onSelectRequest={handleSelectRequest}
252
- title="DSR Request Tracker"
253
- description="Track the status of data subject requests"
254
- />
255
- </CardContent>
256
- </Card>
257
- </TabsContent>
258
- </Tabs>
259
-
260
- <div className="mt-10 p-4 bg-gray-100 rounded-lg">
261
- <h2 className="text-xl font-semibold mb-2">Implementation Notes</h2>
262
- <p className="mb-4">
263
- This demo showcases the DSR components from the NDPR Toolkit:
264
- </p>
265
- <ul className="list-disc pl-5 space-y-2">
266
- <li><code>DSRRequestForm</code>: For collecting and validating data subject requests</li>
267
- <li><code>DSRDashboard</code>: For managing and processing requests</li>
268
- <li><code>DSRTracker</code>: For tracking request status and metrics</li>
269
- </ul>
270
- <p className="mt-4">
271
- For detailed documentation, see the{' '}
272
- <Link href="/docs/components/data-subject-rights" className="text-blue-600 hover:underline">
273
- DSR documentation
274
- </Link>
275
- .
276
- </p>
277
- </div>
278
- </div>
279
- );
280
- }
@@ -1,73 +0,0 @@
1
- 'use client';
2
-
3
- import React from 'react';
4
- import Link from 'next/link';
5
- import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '@/components/ui/Card';
6
-
7
-
8
- export default function NDPRDemosPage() {
9
- const demos = [
10
- {
11
- title: 'Data Subject Rights',
12
- description: 'Demos for DSR request forms, dashboard, and tracking components',
13
- href: '/ndpr-demos/dsr'
14
- },
15
- {
16
- title: 'Consent Management',
17
- description: 'Demos for consent banner, manager, and storage components',
18
- href: '/ndpr-demos/consent'
19
- },
20
- {
21
- title: 'DPIA Tools',
22
- description: 'Demos for Data Protection Impact Assessment components',
23
- href: '/ndpr-demos/dpia'
24
- },
25
- {
26
- title: 'Breach Management',
27
- description: 'Demos for data breach notification and management components',
28
- href: '/ndpr-demos/breach'
29
- },
30
- {
31
- title: 'Privacy Policy',
32
- description: 'Demos for privacy policy generation and management',
33
- href: '/ndpr-demos/policy'
34
- }
35
- ];
36
-
37
- return (
38
- <div className="container mx-auto py-10">
39
- <h1 className="text-3xl font-bold mb-8">NDPR Toolkit Demos</h1>
40
- <p className="text-lg mb-6">
41
- These demos showcase the components and functionality of the NDPR Toolkit package.
42
- Each demo demonstrates how to use the toolkit in a real-world application.
43
- </p>
44
-
45
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
46
- {demos.map((demo, index) => (
47
- <Link key={index} href={demo.href} className="no-underline">
48
- <Card className="h-full hover:shadow-lg transition-shadow">
49
- <CardHeader>
50
- <CardTitle>{demo.title}</CardTitle>
51
- <CardDescription>{demo.description}</CardDescription>
52
- </CardHeader>
53
- <CardContent>
54
- <div className="text-sm text-blue-600">View Demo →</div>
55
- </CardContent>
56
- </Card>
57
- </Link>
58
- ))}
59
- </div>
60
-
61
- <div className="mt-10 p-4 bg-gray-100 rounded-lg">
62
- <h2 className="text-xl font-semibold mb-2">Documentation</h2>
63
- <p>
64
- For detailed documentation on how to use the NDPR Toolkit, please visit the{' '}
65
- <Link href="/docs" className="text-blue-600 hover:underline">
66
- documentation pages
67
- </Link>
68
- .
69
- </p>
70
- </div>
71
- </div>
72
- );
73
- }