@tantainnovative/ndpr-toolkit 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/.claude/settings.local.json +20 -0
  2. package/.eslintrc.json +10 -0
  3. package/.github/workflows/ci.yml +36 -0
  4. package/.github/workflows/nextjs.yml +104 -0
  5. package/.husky/commit-msg +4 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.lintstagedrc.js +4 -0
  8. package/.nvmrc +1 -0
  9. package/.versionrc +17 -0
  10. package/CHANGELOG.md +16 -0
  11. package/CLAUDE.md +90 -0
  12. package/CNAME +1 -0
  13. package/CONTRIBUTING.md +87 -0
  14. package/README.md +84 -431
  15. package/RELEASE-NOTES-v1.0.0.md +140 -0
  16. package/RELEASE-NOTES-v1.0.1.md +69 -0
  17. package/SECURITY.md +21 -0
  18. package/commitlint.config.js +36 -0
  19. package/components.json +21 -0
  20. package/eslint.config.mjs +16 -0
  21. package/jest.config.js +31 -0
  22. package/jest.setup.js +15 -0
  23. package/next.config.js +15 -0
  24. package/next.config.ts +62 -0
  25. package/package.json +70 -52
  26. package/packages/ndpr-toolkit/README.md +467 -0
  27. package/packages/ndpr-toolkit/jest.config.js +23 -0
  28. package/packages/ndpr-toolkit/package-lock.json +8197 -0
  29. package/packages/ndpr-toolkit/package.json +71 -0
  30. package/packages/ndpr-toolkit/rollup.config.js +34 -0
  31. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentBanner.test.tsx +119 -0
  32. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentManager.test.tsx +122 -0
  33. package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentStorage.test.tsx +270 -0
  34. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRDashboard.test.tsx +199 -0
  35. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRRequestForm.test.tsx +224 -0
  36. package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRTracker.test.tsx +104 -0
  37. package/packages/ndpr-toolkit/src/__tests__/hooks/useConsent.test.tsx +161 -0
  38. package/packages/ndpr-toolkit/src/__tests__/hooks/useDSR.test.tsx +330 -0
  39. package/packages/ndpr-toolkit/src/__tests__/utils/breach.test.ts +149 -0
  40. package/packages/ndpr-toolkit/src/__tests__/utils/consent.test.ts +88 -0
  41. package/packages/ndpr-toolkit/src/__tests__/utils/dpia.test.ts +160 -0
  42. package/packages/ndpr-toolkit/src/__tests__/utils/dsr.test.ts +110 -0
  43. package/packages/ndpr-toolkit/src/__tests__/utils/privacy.test.ts +97 -0
  44. package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +701 -0
  45. package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +631 -0
  46. package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +569 -0
  47. package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +496 -0
  48. package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +270 -0
  49. package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +217 -0
  50. package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +206 -0
  51. package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +342 -0
  52. package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +373 -0
  53. package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +174 -0
  54. package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +717 -0
  55. package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +476 -0
  56. package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +620 -0
  57. package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +541 -0
  58. package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +454 -0
  59. package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +333 -0
  60. package/packages/ndpr-toolkit/src/hooks/useBreach.ts +409 -0
  61. package/packages/ndpr-toolkit/src/hooks/useConsent.ts +263 -0
  62. package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +457 -0
  63. package/packages/ndpr-toolkit/src/hooks/useDSR.ts +236 -0
  64. package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +428 -0
  65. package/{dist/index.d.ts → packages/ndpr-toolkit/src/index.ts} +14 -1
  66. package/packages/ndpr-toolkit/src/setupTests.ts +5 -0
  67. package/packages/ndpr-toolkit/src/types/breach.ts +283 -0
  68. package/packages/ndpr-toolkit/src/types/consent.ts +111 -0
  69. package/packages/ndpr-toolkit/src/types/dpia.ts +236 -0
  70. package/packages/ndpr-toolkit/src/types/dsr.ts +192 -0
  71. package/packages/ndpr-toolkit/src/types/index.ts +42 -0
  72. package/packages/ndpr-toolkit/src/types/privacy.ts +246 -0
  73. package/packages/ndpr-toolkit/src/utils/breach.ts +122 -0
  74. package/packages/ndpr-toolkit/src/utils/consent.ts +51 -0
  75. package/packages/ndpr-toolkit/src/utils/dpia.ts +104 -0
  76. package/packages/ndpr-toolkit/src/utils/dsr.ts +77 -0
  77. package/packages/ndpr-toolkit/src/utils/privacy.ts +100 -0
  78. package/packages/ndpr-toolkit/tsconfig.json +23 -0
  79. package/postcss.config.mjs +5 -0
  80. package/public/NDPR TOOLKIT.svg +1 -0
  81. package/public/favicon/android-chrome-192x192.png +0 -0
  82. package/public/favicon/android-chrome-512x512.png +0 -0
  83. package/public/favicon/apple-touch-icon.png +0 -0
  84. package/public/favicon/favicon-16x16.png +0 -0
  85. package/public/favicon/favicon-32x32.png +0 -0
  86. package/public/favicon/site.webmanifest +1 -0
  87. package/public/file.svg +1 -0
  88. package/public/globe.svg +1 -0
  89. package/public/ndpr-toolkit-logo.svg +108 -0
  90. package/public/next.svg +1 -0
  91. package/public/vercel.svg +1 -0
  92. package/public/window.svg +1 -0
  93. package/src/__tests__/example.test.ts +13 -0
  94. package/src/__tests__/requestService.test.ts +57 -0
  95. package/src/app/accessibility.css +70 -0
  96. package/src/app/docs/components/DocLayout.tsx +267 -0
  97. package/src/app/docs/components/breach-notification/page.tsx +797 -0
  98. package/src/app/docs/components/consent-management/page.tsx +576 -0
  99. package/src/app/docs/components/data-subject-rights/page.tsx +511 -0
  100. package/src/app/docs/components/dpia-questionnaire/layout.tsx +15 -0
  101. package/src/app/docs/components/dpia-questionnaire/metadata.ts +31 -0
  102. package/src/app/docs/components/dpia-questionnaire/page.tsx +666 -0
  103. package/src/app/docs/components/hooks/page.tsx +305 -0
  104. package/src/app/docs/components/page.tsx +84 -0
  105. package/src/app/docs/components/privacy-policy-generator/page.tsx +634 -0
  106. package/src/app/docs/guides/breach-notification-process/components/BestPractices.tsx +123 -0
  107. package/src/app/docs/guides/breach-notification-process/components/ImplementationSteps.tsx +328 -0
  108. package/src/app/docs/guides/breach-notification-process/components/Introduction.tsx +28 -0
  109. package/src/app/docs/guides/breach-notification-process/components/NotificationTimeline.tsx +91 -0
  110. package/src/app/docs/guides/breach-notification-process/components/Resources.tsx +118 -0
  111. package/src/app/docs/guides/breach-notification-process/page.tsx +39 -0
  112. package/src/app/docs/guides/conducting-dpia/page.tsx +593 -0
  113. package/src/app/docs/guides/data-subject-requests/page.tsx +666 -0
  114. package/src/app/docs/guides/managing-consent/page.tsx +738 -0
  115. package/src/app/docs/guides/ndpr-compliance-checklist/components/ComplianceChecklist.tsx +296 -0
  116. package/src/app/docs/guides/ndpr-compliance-checklist/components/ImplementationTools.tsx +145 -0
  117. package/src/app/docs/guides/ndpr-compliance-checklist/components/Introduction.tsx +33 -0
  118. package/src/app/docs/guides/ndpr-compliance-checklist/components/KeyRequirements.tsx +99 -0
  119. package/src/app/docs/guides/ndpr-compliance-checklist/components/Resources.tsx +159 -0
  120. package/src/app/docs/guides/ndpr-compliance-checklist/page.tsx +38 -0
  121. package/src/app/docs/guides/page.tsx +67 -0
  122. package/src/app/docs/layout.tsx +15 -0
  123. package/src/app/docs/metadata.ts +31 -0
  124. package/src/app/docs/page.tsx +572 -0
  125. package/src/app/favicon.ico +0 -0
  126. package/src/app/globals.css +123 -0
  127. package/src/app/layout.tsx +37 -0
  128. package/src/app/ndpr-demos/breach/page.tsx +354 -0
  129. package/src/app/ndpr-demos/consent/page.tsx +366 -0
  130. package/src/app/ndpr-demos/dpia/page.tsx +495 -0
  131. package/src/app/ndpr-demos/dsr/page.tsx +280 -0
  132. package/src/app/ndpr-demos/page.tsx +73 -0
  133. package/src/app/ndpr-demos/policy/page.tsx +771 -0
  134. package/src/app/page.tsx +452 -0
  135. package/src/components/ErrorBoundary.tsx +90 -0
  136. package/src/components/breach-notification/BreachNotificationForm.tsx +479 -0
  137. package/src/components/consent/ConsentBanner.tsx +159 -0
  138. package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +419 -0
  139. package/src/components/docs/DocLayout.tsx +289 -0
  140. package/src/components/docs/index.ts +2 -0
  141. package/src/components/dpia/DPIAQuestionnaire.tsx +483 -0
  142. package/src/components/privacy-policy/PolicyGenerator.tsx +1062 -0
  143. package/src/components/privacy-policy/data.ts +98 -0
  144. package/src/components/privacy-policy/shared/CheckboxField.tsx +38 -0
  145. package/src/components/privacy-policy/shared/CheckboxGroup.tsx +85 -0
  146. package/src/components/privacy-policy/shared/FormField.tsx +79 -0
  147. package/src/components/privacy-policy/shared/StepIndicator.tsx +86 -0
  148. package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +335 -0
  149. package/src/components/privacy-policy/steps/DataCollectionStep.tsx +231 -0
  150. package/src/components/privacy-policy/steps/DataSharingStep.tsx +418 -0
  151. package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +202 -0
  152. package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +172 -0
  153. package/src/components/ui/Badge.tsx +46 -0
  154. package/src/components/ui/Button.tsx +59 -0
  155. package/src/components/ui/Card.tsx +92 -0
  156. package/src/components/ui/Checkbox.tsx +57 -0
  157. package/src/components/ui/FormField.tsx +50 -0
  158. package/src/components/ui/Input.tsx +38 -0
  159. package/src/components/ui/Loading.tsx +201 -0
  160. package/src/components/ui/Select.tsx +42 -0
  161. package/src/components/ui/TextArea.tsx +38 -0
  162. package/src/components/ui/label.tsx +24 -0
  163. package/src/components/ui/switch.tsx +31 -0
  164. package/src/components/ui/tabs.tsx +66 -0
  165. package/src/hooks/useConsent.ts +64 -0
  166. package/src/hooks/useLoadingState.ts +85 -0
  167. package/src/lib/consentService.ts +137 -0
  168. package/src/lib/dpiaQuestions.ts +148 -0
  169. package/src/lib/requestService.ts +75 -0
  170. package/src/lib/sanitize.ts +108 -0
  171. package/src/lib/storage.ts +222 -0
  172. package/src/lib/utils.ts +6 -0
  173. package/src/types/html-to-docx.d.ts +30 -0
  174. package/src/types/index.ts +72 -0
  175. package/tailwind.config.ts +65 -0
  176. package/tsconfig.json +41 -0
  177. package/dist/components/breach/BreachNotificationManager.d.ts +0 -62
  178. package/dist/components/breach/BreachReportForm.d.ts +0 -66
  179. package/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
  180. package/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
  181. package/dist/components/consent/ConsentBanner.d.ts +0 -79
  182. package/dist/components/consent/ConsentManager.d.ts +0 -73
  183. package/dist/components/consent/ConsentStorage.d.ts +0 -41
  184. package/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
  185. package/dist/components/dpia/DPIAReport.d.ts +0 -40
  186. package/dist/components/dpia/StepIndicator.d.ts +0 -64
  187. package/dist/components/dsr/DSRDashboard.d.ts +0 -58
  188. package/dist/components/dsr/DSRRequestForm.d.ts +0 -74
  189. package/dist/components/dsr/DSRTracker.d.ts +0 -56
  190. package/dist/components/policy/PolicyExporter.d.ts +0 -65
  191. package/dist/components/policy/PolicyGenerator.d.ts +0 -54
  192. package/dist/components/policy/PolicyPreview.d.ts +0 -71
  193. package/dist/hooks/useBreach.d.ts +0 -97
  194. package/dist/hooks/useConsent.d.ts +0 -63
  195. package/dist/hooks/useDPIA.d.ts +0 -92
  196. package/dist/hooks/useDSR.d.ts +0 -72
  197. package/dist/hooks/usePrivacyPolicy.d.ts +0 -87
  198. package/dist/index.esm.js +0 -2
  199. package/dist/index.esm.js.map +0 -1
  200. package/dist/index.js +0 -2
  201. package/dist/index.js.map +0 -1
  202. package/dist/setupTests.d.ts +0 -2
  203. package/dist/types/breach.d.ts +0 -239
  204. package/dist/types/consent.d.ts +0 -95
  205. package/dist/types/dpia.d.ts +0 -196
  206. package/dist/types/dsr.d.ts +0 -162
  207. package/dist/types/privacy.d.ts +0 -204
  208. package/dist/utils/breach.d.ts +0 -14
  209. package/dist/utils/consent.d.ts +0 -10
  210. package/dist/utils/dpia.d.ts +0 -12
  211. package/dist/utils/dsr.d.ts +0 -11
  212. package/dist/utils/privacy.d.ts +0 -12
@@ -0,0 +1,20 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(find:*)",
5
+ "Bash(grep:*)",
6
+ "Bash(git push:*)",
7
+ "Bash(npm run lint)",
8
+ "Bash(pnpm lint:*)",
9
+ "Bash(pnpm install:*)",
10
+ "Bash(git add:*)",
11
+ "Bash(git commit:*)",
12
+ "Bash(pnpm add:*)",
13
+ "Bash(pnpm build:*)",
14
+ "Bash(sed:*)",
15
+ "Bash(cat:*)",
16
+ "Bash(npm:*)"
17
+ ],
18
+ "deny": []
19
+ }
20
+ }
package/.eslintrc.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "next/core-web-vitals",
3
+ "rules": {
4
+ "@typescript-eslint/no-unused-vars": "off",
5
+ "@typescript-eslint/no-empty-object-type": "off",
6
+ "react/no-unescaped-entities": "off",
7
+ "@typescript-eslint/no-explicit-any": "off"
8
+ },
9
+ "ignorePatterns": ["node_modules/**/*"]
10
+ }
@@ -0,0 +1,36 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [20.x]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Use Node.js ${{ matrix.node-version }}
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ cache: 'npm'
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Lint
30
+ run: npm run lint
31
+
32
+ - name: Type check
33
+ run: npx tsc --noEmit
34
+
35
+ - name: Run tests
36
+ run: npm test
@@ -0,0 +1,104 @@
1
+ # Sample workflow for building and deploying a Next.js site to GitHub Pages
2
+ #
3
+ # To get started with Next.js see: https://nextjs.org/docs/getting-started
4
+ #
5
+ name: Deploy Next.js site to Pages
6
+
7
+ on:
8
+ # Runs on pushes targeting the default branch
9
+ push:
10
+ branches: ["main"]
11
+
12
+ # Allows you to run this workflow manually from the Actions tab
13
+ workflow_dispatch:
14
+
15
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16
+ permissions:
17
+ contents: read
18
+ pages: write
19
+ id-token: write
20
+
21
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23
+ concurrency:
24
+ group: "pages"
25
+ cancel-in-progress: false
26
+
27
+ jobs:
28
+ # Build job
29
+ build:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@v4
34
+ - name: Detect package manager
35
+ id: detect-package-manager
36
+ run: |
37
+ if [ -f "${{ github.workspace }}/pnpm-lock.yaml" ]; then
38
+ echo "manager=pnpm" >> $GITHUB_OUTPUT
39
+ echo "command=install" >> $GITHUB_OUTPUT
40
+ echo "runner=pnpm" >> $GITHUB_OUTPUT
41
+ exit 0
42
+ elif [ -f "${{ github.workspace }}/yarn.lock" ]; then
43
+ echo "manager=yarn" >> $GITHUB_OUTPUT
44
+ echo "command=install" >> $GITHUB_OUTPUT
45
+ echo "runner=yarn" >> $GITHUB_OUTPUT
46
+ exit 0
47
+ elif [ -f "${{ github.workspace }}/package.json" ]; then
48
+ echo "manager=npm" >> $GITHUB_OUTPUT
49
+ echo "command=ci" >> $GITHUB_OUTPUT
50
+ echo "runner=npx --no-install" >> $GITHUB_OUTPUT
51
+ exit 0
52
+ else
53
+ echo "Unable to determine package manager"
54
+ exit 1
55
+ fi
56
+ - name: Setup Node
57
+ uses: actions/setup-node@v4
58
+ with:
59
+ node-version: "20"
60
+ cache: ${{ steps.detect-package-manager.outputs.manager }}
61
+ - name: Setup pnpm
62
+ if: steps.detect-package-manager.outputs.manager == 'pnpm'
63
+ uses: pnpm/action-setup@v2
64
+ with:
65
+ version: 8
66
+ run_install: false
67
+ - name: Setup Pages
68
+ uses: actions/configure-pages@v5
69
+ with:
70
+ # Automatically inject basePath in your Next.js configuration file and disable
71
+ # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
72
+ #
73
+ # You may remove this line if you want to manage the configuration yourself.
74
+ static_site_generator: next
75
+ - name: Restore cache
76
+ uses: actions/cache@v4
77
+ with:
78
+ path: |
79
+ .next/cache
80
+ # Generate a new cache whenever packages or source files change.
81
+ key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
82
+ # If source files changed but packages didn't, rebuild from a prior cache.
83
+ restore-keys: |
84
+ ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
85
+ - name: Install dependencies
86
+ run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
87
+ - name: Build with Next.js
88
+ run: ${{ steps.detect-package-manager.outputs.runner }} next build
89
+ - name: Upload artifact
90
+ uses: actions/upload-pages-artifact@v3
91
+ with:
92
+ path: ./out
93
+
94
+ # Deployment job
95
+ deploy:
96
+ environment:
97
+ name: github-pages
98
+ url: ${{ steps.deployment.outputs.page_url }}
99
+ runs-on: ubuntu-latest
100
+ needs: build
101
+ steps:
102
+ - name: Deploy to GitHub Pages
103
+ id: deployment
104
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx --no -- commitlint --edit ${1}
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
3
+ '*.{json,md}': ['prettier --write'],
4
+ };
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 20
package/.versionrc ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "types": [
3
+ {"type": "feat", "section": "Features"},
4
+ {"type": "fix", "section": "Bug Fixes"},
5
+ {"type": "chore", "hidden": true},
6
+ {"type": "docs", "section": "Documentation"},
7
+ {"type": "style", "hidden": true},
8
+ {"type": "refactor", "section": "Code Refactoring"},
9
+ {"type": "perf", "section": "Performance Improvements"},
10
+ {"type": "test", "hidden": true},
11
+ {"type": "build", "hidden": true},
12
+ {"type": "ci", "hidden": true}
13
+ ],
14
+ "commitUrlFormat": "https://github.com/tantainnovative/ndpr-toolkit/commit/{{hash}}",
15
+ "compareUrlFormat": "https://github.com/tantainnovative/ndpr-toolkit/compare/{{previousTag}}...{{currentTag}}",
16
+ "releaseCommitMessageFormat": "chore(release): {{currentTag}}"
17
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## 1.0.0 (2025-05-02)
6
+
7
+
8
+ ### Features
9
+
10
+ * initial implementation of NDPR-Toolkit with all key components ([b41aeef](https://github.com/tantainnovative/ndpr-toolkit/commit/b41aeefe3184ce69ed09f3d8c0fdacb860a98427))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * resolve ESLint errors for successful build ([3f78939](https://github.com/tantainnovative/ndpr-toolkit/commit/3f7893902cc7ec67913a7e19f6a804d01e69896e))
16
+ * resolve type errors for successful build ([b827186](https://github.com/tantainnovative/ndpr-toolkit/commit/b8271865a77b097f0ce839ad13555b4bfe12fe2e))
package/CLAUDE.md ADDED
@@ -0,0 +1,90 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ The Nigerian Data Protection Compliance Toolkit (NDPR-Toolkit) is a Next.js application that helps developers implement NDPR and DPA compliant features. It's deployed as a static site to GitHub Pages.
8
+
9
+ ## Development Commands
10
+
11
+ ### Package Manager
12
+ Always use `pnpm` for all package management operations.
13
+
14
+ ### Core Commands
15
+ - **Development server**: `pnpm dev` (uses Turbopack)
16
+ - **Build**: `pnpm build`
17
+ - **Production server**: `pnpm start`
18
+ - **Static export**: `pnpm export` or `pnpm build:static`
19
+ - **Deploy to GitHub Pages**: `pnpm deploy`
20
+
21
+ ### Testing
22
+ - **Run tests**: `pnpm test`
23
+ - **Run specific test**: `pnpm test -- path/to/test.spec.ts`
24
+ - **Tests use**: Jest with React Testing Library and jest-environment-jsdom
25
+
26
+ ### Code Quality
27
+ - **Lint**: `pnpm lint`
28
+ - **Git hooks**: Pre-commit runs lint-staged, commit-msg runs commitlint
29
+ - **Commit format**: Use conventional commits (feat, fix, docs, style, refactor, test, chore)
30
+
31
+ ### Release Management
32
+ - **Standard release**: `pnpm release`
33
+ - **Version bumps**: `pnpm release:patch`, `pnpm release:minor`, `pnpm release:major`
34
+
35
+ ## Architecture
36
+
37
+ ### Tech Stack
38
+ - **Next.js 15.3.1** with App Router
39
+ - **React 19** with TypeScript
40
+ - **Tailwind CSS v4** with custom theme configuration
41
+ - **Radix UI** for accessible components
42
+ - **Nextra** for documentation pages
43
+
44
+ ### Project Structure
45
+ ```
46
+ src/
47
+ ├── app/ # Next.js pages (App Router)
48
+ │ ├── docs/ # Documentation pages
49
+ │ ├── ndpr-demos/ # Interactive NDPR compliance demos
50
+ │ └── page.tsx # Homepage
51
+ ├── components/ # Feature-based component organization
52
+ │ ├── breach-notification/
53
+ │ ├── consent/
54
+ │ ├── data-subject-rights/
55
+ │ ├── dpia/
56
+ │ ├── privacy-policy/
57
+ │ └── ui/ # Base UI components
58
+ ├── hooks/ # Custom React hooks
59
+ ├── lib/ # Services and utilities
60
+ │ ├── consentService.ts
61
+ │ ├── requestService.ts # LocalStorage-based state management
62
+ │ └── utils.ts
63
+ └── types/ # TypeScript type definitions
64
+ ```
65
+
66
+ ### Key Patterns
67
+
68
+ 1. **State Management**: Demo data persists in localStorage via service layer (e.g., `requestService.ts`)
69
+ 2. **Component Architecture**: Feature-based organization with modular, reusable components
70
+ 3. **Static Site**: Configured for GitHub Pages with basePath and assetPrefix in `next.config.ts`
71
+ 4. **Type Safety**: Comprehensive TypeScript types in `types/` directory
72
+ 5. **Styling**: Tailwind CSS with CSS variables for theming
73
+
74
+ ### NDPR Compliance Features
75
+
76
+ When working on NDPR features, understand these core modules:
77
+
78
+ 1. **Consent Management** (`components/consent/`): Multi-purpose consent with granular controls
79
+ 2. **Data Subject Rights** (`components/data-subject-rights/`): Request portal for access, deletion, etc.
80
+ 3. **Privacy Policy Generator** (`components/privacy-policy/`): Step-by-step wizard
81
+ 4. **DPIA Tool** (`components/dpia/`): Data Protection Impact Assessment questionnaire
82
+ 5. **Breach Notification** (`components/breach-notification/`): Incident reporting system
83
+
84
+ ### Important Notes
85
+
86
+ - All data in demos uses localStorage - no backend required
87
+ - Components are designed for NDPR/DPA compliance out of the box
88
+ - The project auto-deploys to GitHub Pages on main branch pushes
89
+ - TypeScript strict mode is enabled - maintain type safety
90
+ - Follow existing component patterns when adding new features
package/CNAME ADDED
@@ -0,0 +1 @@
1
+ ndprtoolkit.com.ng
@@ -0,0 +1,87 @@
1
+ # Contributing to NDPR-Toolkit
2
+
3
+ Thank you for considering contributing to the Nigerian Data Protection Compliance Toolkit! This document outlines the process for contributing to this project.
4
+
5
+ ## Code of Conduct
6
+
7
+ By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and considerate of others.
8
+
9
+ ## How to Contribute
10
+
11
+ ### Reporting Bugs
12
+
13
+ If you find a bug, please create an issue in the GitHub repository with the following information:
14
+
15
+ 1. A clear, descriptive title
16
+ 2. Steps to reproduce the bug
17
+ 3. Expected behavior
18
+ 4. Actual behavior
19
+ 5. Screenshots (if applicable)
20
+ 6. Environment information (browser, OS, etc.)
21
+
22
+ ### Suggesting Features
23
+
24
+ We welcome feature suggestions! Please create an issue with:
25
+
26
+ 1. A clear, descriptive title
27
+ 2. Detailed description of the proposed feature
28
+ 3. Any relevant examples or mockups
29
+ 4. Explanation of why this feature would be useful to the project
30
+
31
+ ### Pull Requests
32
+
33
+ We follow a standard GitHub workflow:
34
+
35
+ 1. Fork the repository
36
+ 2. Create a new branch for your feature or bug fix
37
+ 3. Make your changes
38
+ 4. Write or update tests as needed
39
+ 5. Ensure all tests pass
40
+ 6. Commit your changes using conventional commit messages
41
+ 7. Push to your fork
42
+ 8. Submit a pull request
43
+
44
+ ### Commit Message Convention
45
+
46
+ We use conventional commits to automate versioning and changelog generation. Please format your commit messages as follows:
47
+
48
+ ```
49
+ <type>(<scope>): <description>
50
+
51
+ [optional body]
52
+
53
+ [optional footer(s)]
54
+ ```
55
+
56
+ Types include:
57
+ - `feat`: A new feature
58
+ - `fix`: A bug fix
59
+ - `docs`: Documentation changes
60
+ - `style`: Code style changes (formatting, etc.)
61
+ - `refactor`: Code changes that neither fix bugs nor add features
62
+ - `perf`: Performance improvements
63
+ - `test`: Adding or updating tests
64
+ - `chore`: Changes to the build process or auxiliary tools
65
+
66
+ Example:
67
+ ```
68
+ feat(consent): add ability to customize consent banner colors
69
+ ```
70
+
71
+ ## Development Setup
72
+
73
+ 1. Clone your fork of the repository
74
+ 2. Install dependencies: `npm install`
75
+ 3. Start the development server: `npm run dev`
76
+ 4. Make your changes
77
+ 5. Run tests: `npm test`
78
+
79
+ ## Release Process
80
+
81
+ Releases are managed by the maintainers using semantic versioning. The process is automated through GitHub Actions.
82
+
83
+ ## Questions?
84
+
85
+ If you have any questions about contributing, please open an issue with your question.
86
+
87
+ Thank you for contributing to the NDPR-Toolkit!