@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
package/dist/hooks/useDSR.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { DSRRequest, RequestStatus, RequestType } from '../types/dsr';
|
|
2
|
-
interface UseDSROptions {
|
|
3
|
-
/**
|
|
4
|
-
* Initial requests to load
|
|
5
|
-
*/
|
|
6
|
-
initialRequests?: DSRRequest[];
|
|
7
|
-
/**
|
|
8
|
-
* Available request types
|
|
9
|
-
*/
|
|
10
|
-
requestTypes: RequestType[];
|
|
11
|
-
/**
|
|
12
|
-
* Storage key for requests
|
|
13
|
-
* @default "ndpr_dsr_requests"
|
|
14
|
-
*/
|
|
15
|
-
storageKey?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to use local storage to persist requests
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
useLocalStorage?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Callback function called when a request is submitted
|
|
23
|
-
*/
|
|
24
|
-
onSubmit?: (request: DSRRequest) => void;
|
|
25
|
-
/**
|
|
26
|
-
* Callback function called when a request is updated
|
|
27
|
-
*/
|
|
28
|
-
onUpdate?: (request: DSRRequest) => void;
|
|
29
|
-
}
|
|
30
|
-
interface UseDSRReturn {
|
|
31
|
-
/**
|
|
32
|
-
* All requests
|
|
33
|
-
*/
|
|
34
|
-
requests: DSRRequest[];
|
|
35
|
-
/**
|
|
36
|
-
* Submit a new request
|
|
37
|
-
*/
|
|
38
|
-
submitRequest: (requestData: Omit<DSRRequest, 'id' | 'status' | 'submittedAt' | 'updatedAt' | 'estimatedCompletionDate'>) => DSRRequest;
|
|
39
|
-
/**
|
|
40
|
-
* Update an existing request
|
|
41
|
-
*/
|
|
42
|
-
updateRequest: (id: string, updates: Partial<DSRRequest>) => DSRRequest | null;
|
|
43
|
-
/**
|
|
44
|
-
* Get a request by ID
|
|
45
|
-
*/
|
|
46
|
-
getRequest: (id: string) => DSRRequest | null;
|
|
47
|
-
/**
|
|
48
|
-
* Get requests by status
|
|
49
|
-
*/
|
|
50
|
-
getRequestsByStatus: (status: RequestStatus) => DSRRequest[];
|
|
51
|
-
/**
|
|
52
|
-
* Get requests by type
|
|
53
|
-
*/
|
|
54
|
-
getRequestsByType: (type: string) => DSRRequest[];
|
|
55
|
-
/**
|
|
56
|
-
* Get the request type definition by ID
|
|
57
|
-
*/
|
|
58
|
-
getRequestType: (typeId: string) => RequestType | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Format a request for display or submission
|
|
61
|
-
*/
|
|
62
|
-
formatRequest: (request: DSRRequest) => Record<string, any>;
|
|
63
|
-
/**
|
|
64
|
-
* Clear all requests
|
|
65
|
-
*/
|
|
66
|
-
clearRequests: () => void;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Hook for managing Data Subject Requests in compliance with NDPR
|
|
70
|
-
*/
|
|
71
|
-
export declare function useDSR({ initialRequests, requestTypes, storageKey, useLocalStorage, onSubmit, onUpdate }: UseDSROptions): UseDSRReturn;
|
|
72
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { PolicyTemplate, OrganizationInfo, PrivacyPolicy } from '../types/privacy';
|
|
2
|
-
interface UsePrivacyPolicyOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Available policy templates
|
|
5
|
-
*/
|
|
6
|
-
templates: PolicyTemplate[];
|
|
7
|
-
/**
|
|
8
|
-
* Initial policy data (if editing an existing policy)
|
|
9
|
-
*/
|
|
10
|
-
initialPolicy?: PrivacyPolicy;
|
|
11
|
-
/**
|
|
12
|
-
* Storage key for policy data
|
|
13
|
-
* @default "ndpr_privacy_policy"
|
|
14
|
-
*/
|
|
15
|
-
storageKey?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Whether to use local storage to persist policy data
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
useLocalStorage?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Callback function called when a policy is generated
|
|
23
|
-
*/
|
|
24
|
-
onGenerate?: (policy: PrivacyPolicy) => void;
|
|
25
|
-
}
|
|
26
|
-
interface UsePrivacyPolicyReturn {
|
|
27
|
-
/**
|
|
28
|
-
* Current policy data
|
|
29
|
-
*/
|
|
30
|
-
policy: PrivacyPolicy | null;
|
|
31
|
-
/**
|
|
32
|
-
* Selected template
|
|
33
|
-
*/
|
|
34
|
-
selectedTemplate: PolicyTemplate | null;
|
|
35
|
-
/**
|
|
36
|
-
* Organization information
|
|
37
|
-
*/
|
|
38
|
-
organizationInfo: OrganizationInfo;
|
|
39
|
-
/**
|
|
40
|
-
* Select a template
|
|
41
|
-
*/
|
|
42
|
-
selectTemplate: (templateId: string) => boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Update organization information
|
|
45
|
-
*/
|
|
46
|
-
updateOrganizationInfo: (updates: Partial<OrganizationInfo>) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Toggle whether a section is included in the policy
|
|
49
|
-
*/
|
|
50
|
-
toggleSection: (sectionId: string, included: boolean) => void;
|
|
51
|
-
/**
|
|
52
|
-
* Update section content
|
|
53
|
-
*/
|
|
54
|
-
updateSectionContent: (sectionId: string, content: string) => void;
|
|
55
|
-
/**
|
|
56
|
-
* Update variable values
|
|
57
|
-
*/
|
|
58
|
-
updateVariableValue: (variable: string, value: string) => void;
|
|
59
|
-
/**
|
|
60
|
-
* Generate the policy
|
|
61
|
-
*/
|
|
62
|
-
generatePolicy: () => PrivacyPolicy;
|
|
63
|
-
/**
|
|
64
|
-
* Get the generated policy text
|
|
65
|
-
*/
|
|
66
|
-
getPolicyText: () => {
|
|
67
|
-
fullText: string;
|
|
68
|
-
sectionTexts: Record<string, string>;
|
|
69
|
-
missingVariables: string[];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Reset the policy
|
|
73
|
-
*/
|
|
74
|
-
resetPolicy: () => void;
|
|
75
|
-
/**
|
|
76
|
-
* Check if the policy is valid
|
|
77
|
-
*/
|
|
78
|
-
isValid: () => {
|
|
79
|
-
valid: boolean;
|
|
80
|
-
errors: string[];
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Hook for generating NDPR-compliant privacy policies
|
|
85
|
-
*/
|
|
86
|
-
export declare function usePrivacyPolicy({ templates, initialPolicy, storageKey, useLocalStorage, onGenerate }: UsePrivacyPolicyOptions): UsePrivacyPolicyReturn;
|
|
87
|
-
export {};
|