@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.
- package/.claude/settings.local.json +20 -0
- package/.eslintrc.json +10 -0
- package/.github/workflows/ci.yml +36 -0
- package/.github/workflows/nextjs.yml +104 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.lintstagedrc.js +4 -0
- package/.nvmrc +1 -0
- package/.versionrc +17 -0
- package/CHANGELOG.md +16 -0
- package/CLAUDE.md +90 -0
- package/CNAME +1 -0
- package/CONTRIBUTING.md +87 -0
- package/README.md +84 -431
- package/RELEASE-NOTES-v1.0.0.md +140 -0
- package/RELEASE-NOTES-v1.0.1.md +69 -0
- package/SECURITY.md +21 -0
- package/commitlint.config.js +36 -0
- package/components.json +21 -0
- package/eslint.config.mjs +16 -0
- package/jest.config.js +31 -0
- package/jest.setup.js +15 -0
- package/next.config.js +15 -0
- package/next.config.ts +62 -0
- package/package.json +70 -52
- package/packages/ndpr-toolkit/README.md +467 -0
- package/packages/ndpr-toolkit/jest.config.js +23 -0
- package/packages/ndpr-toolkit/package-lock.json +8197 -0
- package/packages/ndpr-toolkit/package.json +71 -0
- package/packages/ndpr-toolkit/rollup.config.js +34 -0
- package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentBanner.test.tsx +119 -0
- package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentManager.test.tsx +122 -0
- package/packages/ndpr-toolkit/src/__tests__/components/consent/ConsentStorage.test.tsx +270 -0
- package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRDashboard.test.tsx +199 -0
- package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRRequestForm.test.tsx +224 -0
- package/packages/ndpr-toolkit/src/__tests__/components/dsr/DSRTracker.test.tsx +104 -0
- package/packages/ndpr-toolkit/src/__tests__/hooks/useConsent.test.tsx +161 -0
- package/packages/ndpr-toolkit/src/__tests__/hooks/useDSR.test.tsx +330 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/breach.test.ts +149 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/consent.test.ts +88 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/dpia.test.ts +160 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/dsr.test.ts +110 -0
- package/packages/ndpr-toolkit/src/__tests__/utils/privacy.test.ts +97 -0
- package/packages/ndpr-toolkit/src/components/breach/BreachNotificationManager.tsx +701 -0
- package/packages/ndpr-toolkit/src/components/breach/BreachReportForm.tsx +631 -0
- package/packages/ndpr-toolkit/src/components/breach/BreachRiskAssessment.tsx +569 -0
- package/packages/ndpr-toolkit/src/components/breach/RegulatoryReportGenerator.tsx +496 -0
- package/packages/ndpr-toolkit/src/components/consent/ConsentBanner.tsx +270 -0
- package/packages/ndpr-toolkit/src/components/consent/ConsentManager.tsx +217 -0
- package/packages/ndpr-toolkit/src/components/consent/ConsentStorage.tsx +206 -0
- package/packages/ndpr-toolkit/src/components/dpia/DPIAQuestionnaire.tsx +342 -0
- package/packages/ndpr-toolkit/src/components/dpia/DPIAReport.tsx +373 -0
- package/packages/ndpr-toolkit/src/components/dpia/StepIndicator.tsx +174 -0
- package/packages/ndpr-toolkit/src/components/dsr/DSRDashboard.tsx +717 -0
- package/packages/ndpr-toolkit/src/components/dsr/DSRRequestForm.tsx +476 -0
- package/packages/ndpr-toolkit/src/components/dsr/DSRTracker.tsx +620 -0
- package/packages/ndpr-toolkit/src/components/policy/PolicyExporter.tsx +541 -0
- package/packages/ndpr-toolkit/src/components/policy/PolicyGenerator.tsx +454 -0
- package/packages/ndpr-toolkit/src/components/policy/PolicyPreview.tsx +333 -0
- package/packages/ndpr-toolkit/src/hooks/useBreach.ts +409 -0
- package/packages/ndpr-toolkit/src/hooks/useConsent.ts +263 -0
- package/packages/ndpr-toolkit/src/hooks/useDPIA.ts +457 -0
- package/packages/ndpr-toolkit/src/hooks/useDSR.ts +236 -0
- package/packages/ndpr-toolkit/src/hooks/usePrivacyPolicy.ts +428 -0
- package/{dist/index.d.ts → packages/ndpr-toolkit/src/index.ts} +14 -1
- package/packages/ndpr-toolkit/src/setupTests.ts +5 -0
- package/packages/ndpr-toolkit/src/types/breach.ts +283 -0
- package/packages/ndpr-toolkit/src/types/consent.ts +111 -0
- package/packages/ndpr-toolkit/src/types/dpia.ts +236 -0
- package/packages/ndpr-toolkit/src/types/dsr.ts +192 -0
- package/packages/ndpr-toolkit/src/types/index.ts +42 -0
- package/packages/ndpr-toolkit/src/types/privacy.ts +246 -0
- package/packages/ndpr-toolkit/src/utils/breach.ts +122 -0
- package/packages/ndpr-toolkit/src/utils/consent.ts +51 -0
- package/packages/ndpr-toolkit/src/utils/dpia.ts +104 -0
- package/packages/ndpr-toolkit/src/utils/dsr.ts +77 -0
- package/packages/ndpr-toolkit/src/utils/privacy.ts +100 -0
- package/packages/ndpr-toolkit/tsconfig.json +23 -0
- package/postcss.config.mjs +5 -0
- package/public/NDPR TOOLKIT.svg +1 -0
- package/public/favicon/android-chrome-192x192.png +0 -0
- package/public/favicon/android-chrome-512x512.png +0 -0
- package/public/favicon/apple-touch-icon.png +0 -0
- package/public/favicon/favicon-16x16.png +0 -0
- package/public/favicon/favicon-32x32.png +0 -0
- package/public/favicon/site.webmanifest +1 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/ndpr-toolkit-logo.svg +108 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/__tests__/example.test.ts +13 -0
- package/src/__tests__/requestService.test.ts +57 -0
- package/src/app/accessibility.css +70 -0
- package/src/app/docs/components/DocLayout.tsx +267 -0
- package/src/app/docs/components/breach-notification/page.tsx +797 -0
- package/src/app/docs/components/consent-management/page.tsx +576 -0
- package/src/app/docs/components/data-subject-rights/page.tsx +511 -0
- package/src/app/docs/components/dpia-questionnaire/layout.tsx +15 -0
- package/src/app/docs/components/dpia-questionnaire/metadata.ts +31 -0
- package/src/app/docs/components/dpia-questionnaire/page.tsx +666 -0
- package/src/app/docs/components/hooks/page.tsx +305 -0
- package/src/app/docs/components/page.tsx +84 -0
- package/src/app/docs/components/privacy-policy-generator/page.tsx +634 -0
- package/src/app/docs/guides/breach-notification-process/components/BestPractices.tsx +123 -0
- package/src/app/docs/guides/breach-notification-process/components/ImplementationSteps.tsx +328 -0
- package/src/app/docs/guides/breach-notification-process/components/Introduction.tsx +28 -0
- package/src/app/docs/guides/breach-notification-process/components/NotificationTimeline.tsx +91 -0
- package/src/app/docs/guides/breach-notification-process/components/Resources.tsx +118 -0
- package/src/app/docs/guides/breach-notification-process/page.tsx +39 -0
- package/src/app/docs/guides/conducting-dpia/page.tsx +593 -0
- package/src/app/docs/guides/data-subject-requests/page.tsx +666 -0
- package/src/app/docs/guides/managing-consent/page.tsx +738 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/ComplianceChecklist.tsx +296 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/ImplementationTools.tsx +145 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/Introduction.tsx +33 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/KeyRequirements.tsx +99 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/components/Resources.tsx +159 -0
- package/src/app/docs/guides/ndpr-compliance-checklist/page.tsx +38 -0
- package/src/app/docs/guides/page.tsx +67 -0
- package/src/app/docs/layout.tsx +15 -0
- package/src/app/docs/metadata.ts +31 -0
- package/src/app/docs/page.tsx +572 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +123 -0
- package/src/app/layout.tsx +37 -0
- package/src/app/ndpr-demos/breach/page.tsx +354 -0
- package/src/app/ndpr-demos/consent/page.tsx +366 -0
- package/src/app/ndpr-demos/dpia/page.tsx +495 -0
- package/src/app/ndpr-demos/dsr/page.tsx +280 -0
- package/src/app/ndpr-demos/page.tsx +73 -0
- package/src/app/ndpr-demos/policy/page.tsx +771 -0
- package/src/app/page.tsx +452 -0
- package/src/components/ErrorBoundary.tsx +90 -0
- package/src/components/breach-notification/BreachNotificationForm.tsx +479 -0
- package/src/components/consent/ConsentBanner.tsx +159 -0
- package/src/components/data-subject-rights/DataSubjectRequestForm.tsx +419 -0
- package/src/components/docs/DocLayout.tsx +289 -0
- package/src/components/docs/index.ts +2 -0
- package/src/components/dpia/DPIAQuestionnaire.tsx +483 -0
- package/src/components/privacy-policy/PolicyGenerator.tsx +1062 -0
- package/src/components/privacy-policy/data.ts +98 -0
- package/src/components/privacy-policy/shared/CheckboxField.tsx +38 -0
- package/src/components/privacy-policy/shared/CheckboxGroup.tsx +85 -0
- package/src/components/privacy-policy/shared/FormField.tsx +79 -0
- package/src/components/privacy-policy/shared/StepIndicator.tsx +86 -0
- package/src/components/privacy-policy/steps/CustomSectionsStep.tsx +335 -0
- package/src/components/privacy-policy/steps/DataCollectionStep.tsx +231 -0
- package/src/components/privacy-policy/steps/DataSharingStep.tsx +418 -0
- package/src/components/privacy-policy/steps/OrganizationInfoStep.tsx +202 -0
- package/src/components/privacy-policy/steps/PolicyPreviewStep.tsx +172 -0
- package/src/components/ui/Badge.tsx +46 -0
- package/src/components/ui/Button.tsx +59 -0
- package/src/components/ui/Card.tsx +92 -0
- package/src/components/ui/Checkbox.tsx +57 -0
- package/src/components/ui/FormField.tsx +50 -0
- package/src/components/ui/Input.tsx +38 -0
- package/src/components/ui/Loading.tsx +201 -0
- package/src/components/ui/Select.tsx +42 -0
- package/src/components/ui/TextArea.tsx +38 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/tabs.tsx +66 -0
- package/src/hooks/useConsent.ts +64 -0
- package/src/hooks/useLoadingState.ts +85 -0
- package/src/lib/consentService.ts +137 -0
- package/src/lib/dpiaQuestions.ts +148 -0
- package/src/lib/requestService.ts +75 -0
- package/src/lib/sanitize.ts +108 -0
- package/src/lib/storage.ts +222 -0
- package/src/lib/utils.ts +6 -0
- package/src/types/html-to-docx.d.ts +30 -0
- package/src/types/index.ts +72 -0
- package/tailwind.config.ts +65 -0
- package/tsconfig.json +41 -0
- package/dist/components/breach/BreachNotificationManager.d.ts +0 -62
- package/dist/components/breach/BreachReportForm.d.ts +0 -66
- package/dist/components/breach/BreachRiskAssessment.d.ts +0 -50
- package/dist/components/breach/RegulatoryReportGenerator.d.ts +0 -94
- package/dist/components/consent/ConsentBanner.d.ts +0 -79
- package/dist/components/consent/ConsentManager.d.ts +0 -73
- package/dist/components/consent/ConsentStorage.d.ts +0 -41
- package/dist/components/dpia/DPIAQuestionnaire.d.ts +0 -70
- package/dist/components/dpia/DPIAReport.d.ts +0 -40
- package/dist/components/dpia/StepIndicator.d.ts +0 -64
- package/dist/components/dsr/DSRDashboard.d.ts +0 -58
- package/dist/components/dsr/DSRRequestForm.d.ts +0 -74
- package/dist/components/dsr/DSRTracker.d.ts +0 -56
- package/dist/components/policy/PolicyExporter.d.ts +0 -65
- package/dist/components/policy/PolicyGenerator.d.ts +0 -54
- package/dist/components/policy/PolicyPreview.d.ts +0 -71
- package/dist/hooks/useBreach.d.ts +0 -97
- package/dist/hooks/useConsent.d.ts +0 -63
- package/dist/hooks/useDPIA.d.ts +0 -92
- package/dist/hooks/useDSR.d.ts +0 -72
- package/dist/hooks/usePrivacyPolicy.d.ts +0 -87
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/setupTests.d.ts +0 -2
- package/dist/types/breach.d.ts +0 -239
- package/dist/types/consent.d.ts +0 -95
- package/dist/types/dpia.d.ts +0 -196
- package/dist/types/dsr.d.ts +0 -162
- package/dist/types/privacy.d.ts +0 -204
- package/dist/utils/breach.d.ts +0 -14
- package/dist/utils/consent.d.ts +0 -10
- package/dist/utils/dpia.d.ts +0 -12
- package/dist/utils/dsr.d.ts +0 -11
- package/dist/utils/privacy.d.ts +0 -12
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# NDPR Toolkit v1.0.1 Release Notes
|
|
2
|
+
|
|
3
|
+
**Release Date:** May 4, 2025
|
|
4
|
+
**Package:** [@tantainnovative/ndpr-toolkit](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
|
|
5
|
+
**Version:** 1.0.1
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This release adds React 19 compatibility to the NDPR Toolkit while maintaining support for React 18. The update ensures that the toolkit can be seamlessly integrated into projects using either React version.
|
|
10
|
+
|
|
11
|
+
## What's New
|
|
12
|
+
|
|
13
|
+
### React 19 Compatibility
|
|
14
|
+
|
|
15
|
+
- Updated peer dependencies to support both React 18 and React 19
|
|
16
|
+
- Added installation instructions for React 19 users
|
|
17
|
+
- Maintained full functionality across all components with the newer React version
|
|
18
|
+
|
|
19
|
+
### Installation Notes
|
|
20
|
+
|
|
21
|
+
When using the toolkit with React 19, you may encounter peer dependency warnings with other packages in your project. To resolve these, you can use the `--legacy-peer-deps` flag:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @tantainnovative/ndpr-toolkit --legacy-peer-deps
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Alternatively, you can create a `.npmrc` file in your project root with the following content:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
legacy-peer-deps=true
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This will make npm ignore peer dependency conflicts during installation.
|
|
34
|
+
|
|
35
|
+
## Technical Specifications
|
|
36
|
+
|
|
37
|
+
- **Framework Compatibility**: React 18+ and React 19+
|
|
38
|
+
- **TypeScript Support**: Full TypeScript definitions for all components and utilities
|
|
39
|
+
- **Modular Architecture**: Use only what you need with tree-shakable imports
|
|
40
|
+
- **Customization**: Extensive theming and styling options
|
|
41
|
+
- **Accessibility**: WCAG 2.1 AA compliant components
|
|
42
|
+
- **Performance**: Optimized bundle size with minimal dependencies
|
|
43
|
+
|
|
44
|
+
## Bug Fixes
|
|
45
|
+
|
|
46
|
+
- No bug fixes in this release; this is purely a compatibility update
|
|
47
|
+
|
|
48
|
+
## Documentation Updates
|
|
49
|
+
|
|
50
|
+
- Added React 19 compatibility notes to README.md
|
|
51
|
+
- Updated installation instructions with guidance for handling peer dependency conflicts
|
|
52
|
+
|
|
53
|
+
## Upgrading from v1.0.0
|
|
54
|
+
|
|
55
|
+
This is a drop-in replacement for v1.0.0 with no breaking changes. To upgrade:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install @tantainnovative/ndpr-toolkit@1.0.1
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or with peer dependency resolution:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @tantainnovative/ndpr-toolkit@1.0.1 --legacy-peer-deps
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
© 2025 Tanta Innovative. All rights reserved.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Use this section to tell people about which versions of your project are
|
|
6
|
+
currently being supported with security updates.
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| ------- | ------------------ |
|
|
10
|
+
| 5.1.x | :white_check_mark: |
|
|
11
|
+
| 5.0.x | :x: |
|
|
12
|
+
| 4.0.x | :white_check_mark: |
|
|
13
|
+
| < 4.0 | :x: |
|
|
14
|
+
|
|
15
|
+
## Reporting a Vulnerability
|
|
16
|
+
|
|
17
|
+
Use this section to tell people how to report a vulnerability.
|
|
18
|
+
|
|
19
|
+
Tell them where to go, how often they can expect to get an update on a
|
|
20
|
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
|
21
|
+
declined, etc.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@commitlint/config-conventional'],
|
|
3
|
+
rules: {
|
|
4
|
+
'body-leading-blank': [1, 'always'],
|
|
5
|
+
'body-max-line-length': [2, 'always', 100],
|
|
6
|
+
'footer-leading-blank': [1, 'always'],
|
|
7
|
+
'footer-max-line-length': [2, 'always', 100],
|
|
8
|
+
'header-max-length': [2, 'always', 100],
|
|
9
|
+
'subject-case': [
|
|
10
|
+
2,
|
|
11
|
+
'never',
|
|
12
|
+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
|
|
13
|
+
],
|
|
14
|
+
'subject-empty': [2, 'never'],
|
|
15
|
+
'subject-full-stop': [2, 'never', '.'],
|
|
16
|
+
'type-case': [2, 'always', 'lower-case'],
|
|
17
|
+
'type-empty': [2, 'never'],
|
|
18
|
+
'type-enum': [
|
|
19
|
+
2,
|
|
20
|
+
'always',
|
|
21
|
+
[
|
|
22
|
+
'build',
|
|
23
|
+
'chore',
|
|
24
|
+
'ci',
|
|
25
|
+
'docs',
|
|
26
|
+
'feat',
|
|
27
|
+
'fix',
|
|
28
|
+
'perf',
|
|
29
|
+
'refactor',
|
|
30
|
+
'revert',
|
|
31
|
+
'style',
|
|
32
|
+
'test',
|
|
33
|
+
],
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
};
|
package/components.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/app/globals.css",
|
|
9
|
+
"baseColor": "gray",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/utils",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "lucide"
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { dirname } from "path";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const eslintConfig = [
|
|
13
|
+
...compat.extends("next/core-web-vitals", "next/typescript"),
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export default eslintConfig;
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const nextJest = require('next/jest');
|
|
2
|
+
|
|
3
|
+
const createJestConfig = nextJest({
|
|
4
|
+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
|
5
|
+
dir: './',
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// Add any custom config to be passed to Jest
|
|
9
|
+
const customJestConfig = {
|
|
10
|
+
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
11
|
+
testEnvironment: 'jest-environment-jsdom',
|
|
12
|
+
moduleNameMapper: {
|
|
13
|
+
// Handle module aliases (if you have them in tsconfig.json)
|
|
14
|
+
'^@/(.*)$': '<rootDir>/src/$1',
|
|
15
|
+
},
|
|
16
|
+
testPathIgnorePatterns: [
|
|
17
|
+
'<rootDir>/node_modules/',
|
|
18
|
+
'<rootDir>/.next/',
|
|
19
|
+
'<rootDir>/out/'
|
|
20
|
+
],
|
|
21
|
+
collectCoverage: true,
|
|
22
|
+
collectCoverageFrom: [
|
|
23
|
+
'src/**/*.{js,jsx,ts,tsx}',
|
|
24
|
+
'!src/**/*.d.ts',
|
|
25
|
+
'!src/**/_*.{js,jsx,ts,tsx}',
|
|
26
|
+
'!src/**/index.{js,jsx,ts,tsx}',
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
31
|
+
module.exports = createJestConfig(customJestConfig);
|
package/jest.setup.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Learn more: https://github.com/testing-library/jest-dom
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
|
|
4
|
+
// Mock localStorage for tests
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
Object.defineProperty(window, 'localStorage', {
|
|
7
|
+
value: {
|
|
8
|
+
getItem: jest.fn(),
|
|
9
|
+
setItem: jest.fn(),
|
|
10
|
+
removeItem: jest.fn(),
|
|
11
|
+
clear: jest.fn(),
|
|
12
|
+
},
|
|
13
|
+
writable: true
|
|
14
|
+
});
|
|
15
|
+
}
|
package/next.config.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @type {import('next').NextConfig} */
|
|
2
|
+
const nextConfig = {
|
|
3
|
+
output: 'export',
|
|
4
|
+
basePath: '',
|
|
5
|
+
images: {
|
|
6
|
+
unoptimized: true,
|
|
7
|
+
},
|
|
8
|
+
eslint: {
|
|
9
|
+
// Warning: This allows production builds to successfully complete even if
|
|
10
|
+
// your project has ESLint errors.
|
|
11
|
+
ignoreDuringBuilds: true,
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = nextConfig
|
package/next.config.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
|
+
|
|
3
|
+
// Check if we're in development mode
|
|
4
|
+
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
5
|
+
|
|
6
|
+
// Repository name for GitHub Pages
|
|
7
|
+
const REPO_NAME = 'ndpr-toolkit';
|
|
8
|
+
|
|
9
|
+
const nextConfig: NextConfig = {
|
|
10
|
+
reactStrictMode: true,
|
|
11
|
+
|
|
12
|
+
// These settings apply to all environments
|
|
13
|
+
poweredByHeader: false,
|
|
14
|
+
|
|
15
|
+
// Fix for hydration errors
|
|
16
|
+
// This ensures consistent rendering between server and client
|
|
17
|
+
experimental: {
|
|
18
|
+
// Reduce hydration mismatches by making SSR output match client rendering
|
|
19
|
+
scrollRestoration: true,
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
// Optimize fonts to reduce hydration mismatches
|
|
23
|
+
optimizeFonts: true,
|
|
24
|
+
|
|
25
|
+
// Suppress hydration warnings in development
|
|
26
|
+
onDemandEntries: {
|
|
27
|
+
// Keep pages in memory for longer to avoid reloading
|
|
28
|
+
maxInactiveAge: 25 * 1000,
|
|
29
|
+
pagesBufferLength: 5,
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// Only use static export, basePath and assetPrefix in production
|
|
33
|
+
...(isDevelopment
|
|
34
|
+
? {
|
|
35
|
+
// Development config - no basePath or static export
|
|
36
|
+
}
|
|
37
|
+
: {
|
|
38
|
+
// Production config for GitHub Pages
|
|
39
|
+
output: 'export', // Enable static HTML export
|
|
40
|
+
trailingSlash: true, // Important for GitHub Pages to work correctly with routing
|
|
41
|
+
images: {
|
|
42
|
+
unoptimized: true, // Required for static export
|
|
43
|
+
},
|
|
44
|
+
basePath: `/${REPO_NAME}`,
|
|
45
|
+
assetPrefix: `/${REPO_NAME}`,
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Add a custom export script to generate a .nojekyll file
|
|
51
|
+
// This prevents GitHub Pages from ignoring files that begin with an underscore
|
|
52
|
+
if (process.env.NODE_ENV === 'production') {
|
|
53
|
+
const { execSync } = require('child_process');
|
|
54
|
+
try {
|
|
55
|
+
execSync('touch out/.nojekyll');
|
|
56
|
+
console.log('Created .nojekyll file');
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('Error creating .nojekyll file:', error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default nextConfig;
|
package/package.json
CHANGED
|
@@ -1,71 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tantainnovative/ndpr-toolkit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"module": "dist/index.esm.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Nigerian Data Protection Compliance Toolkit for implementing NDPR and DPA compliant features",
|
|
11
6
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"lint": "
|
|
16
|
-
"
|
|
7
|
+
"dev": "next dev --turbopack",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "next lint",
|
|
11
|
+
"test": "jest --passWithNoTests",
|
|
12
|
+
"prepare": "husky install",
|
|
13
|
+
"export": "next export",
|
|
14
|
+
"build:static": "next build",
|
|
15
|
+
"deploy": "next build && touch out/.nojekyll && gh-pages -d out",
|
|
16
|
+
"release": "standard-version",
|
|
17
|
+
"release:minor": "standard-version --release-as minor",
|
|
18
|
+
"release:major": "standard-version --release-as major",
|
|
19
|
+
"release:patch": "standard-version --release-as patch"
|
|
17
20
|
},
|
|
18
21
|
"keywords": [
|
|
19
22
|
"ndpr",
|
|
23
|
+
"dpa",
|
|
24
|
+
"nigeria",
|
|
20
25
|
"data-protection",
|
|
21
|
-
"privacy",
|
|
22
26
|
"compliance",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"dpia",
|
|
26
|
-
"data-subject-rights",
|
|
27
|
-
"breach-notification"
|
|
27
|
+
"privacy",
|
|
28
|
+
"gdpr"
|
|
28
29
|
],
|
|
29
30
|
"author": "Tanta Innovative",
|
|
30
31
|
"license": "MIT",
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|
|
33
|
-
"url": "https://github.com/tantainnovative/ndpr-toolkit"
|
|
34
|
+
"url": "git+https://github.com/tantainnovative/ndpr-toolkit.git"
|
|
34
35
|
},
|
|
35
|
-
"
|
|
36
|
-
"
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/tantainnovative/ndpr-toolkit/issues"
|
|
37
38
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"react-
|
|
39
|
+
"homepage": "https://github.com/tantainnovative/ndpr-toolkit#readme",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@radix-ui/react-label": "^2.1.4",
|
|
42
|
+
"@radix-ui/react-slot": "^1.2.0",
|
|
43
|
+
"@radix-ui/react-switch": "^1.2.2",
|
|
44
|
+
"@radix-ui/react-tabs": "^1.1.9",
|
|
45
|
+
"@tantainnovative/ndpr-toolkit": "^1.0.1",
|
|
46
|
+
"class-variance-authority": "^0.7.1",
|
|
47
|
+
"clsx": "^2.1.1",
|
|
48
|
+
"docx": "^9.4.1",
|
|
49
|
+
"gray-matter": "^4.0.3",
|
|
50
|
+
"html-to-docx": "^1.8.0",
|
|
51
|
+
"jspdf": "^3.0.1",
|
|
52
|
+
"jspdf-autotable": "^5.0.2",
|
|
53
|
+
"lucide-react": "^0.507.0",
|
|
54
|
+
"next": "15.3.1",
|
|
55
|
+
"next-mdx-remote": "^5.0.0",
|
|
56
|
+
"nextra": "^4.2.17",
|
|
57
|
+
"nextra-theme-docs": "^4.2.17",
|
|
58
|
+
"react": "^19.0.0",
|
|
59
|
+
"react-dom": "^19.0.0",
|
|
60
|
+
"react-markdown": "^10.1.0",
|
|
61
|
+
"tailwind-merge": "^2.6.0",
|
|
62
|
+
"uuid": "^11.1.0"
|
|
41
63
|
},
|
|
42
64
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@testing-library/
|
|
48
|
-
"@testing-library/react
|
|
49
|
-
"@
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/react": "^
|
|
52
|
-
"@types/react-dom": "^
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"eslint": "^
|
|
56
|
-
"eslint-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"jest": "^
|
|
60
|
-
"jest-environment-jsdom": "^
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"typescript": "^4.7.2"
|
|
67
|
-
},
|
|
68
|
-
"dependencies": {
|
|
69
|
-
"tslib": "^2.4.0"
|
|
65
|
+
"@commitlint/cli": "^19.0.0",
|
|
66
|
+
"@commitlint/config-conventional": "^19.0.0",
|
|
67
|
+
"@eslint/eslintrc": "^3",
|
|
68
|
+
"@tailwindcss/postcss": "^4.1.5",
|
|
69
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
70
|
+
"@testing-library/react": "^16.3.0",
|
|
71
|
+
"@types/jest": "^29.5.0",
|
|
72
|
+
"@types/node": "^20",
|
|
73
|
+
"@types/react": "^19",
|
|
74
|
+
"@types/react-dom": "^19",
|
|
75
|
+
"@types/uuid": "^9.0.0",
|
|
76
|
+
"autoprefixer": "^10.4.21",
|
|
77
|
+
"eslint": "^9",
|
|
78
|
+
"eslint-config-next": "15.3.1",
|
|
79
|
+
"gh-pages": "^6.3.0",
|
|
80
|
+
"husky": "^9.0.0",
|
|
81
|
+
"jest": "^29.5.0",
|
|
82
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
83
|
+
"prettier": "^3.6.2",
|
|
84
|
+
"standard-version": "^9.5.0",
|
|
85
|
+
"tailwindcss": "^4",
|
|
86
|
+
"tw-animate-css": "^1.2.9",
|
|
87
|
+
"typescript": "^5"
|
|
70
88
|
}
|
|
71
89
|
}
|