@tantainnovative/ndpr-toolkit 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +80 -38
- package/dist/adapters.d.mts +34 -25
- package/dist/adapters.d.ts +34 -25
- package/dist/breach.d.mts +803 -44
- package/dist/breach.d.ts +803 -44
- package/dist/breach.js +2 -1
- package/dist/breach.mjs +2 -1
- package/dist/{chunk-2WH4DLV5.js → chunk-3EGQWLJ6.js} +3 -3
- package/dist/chunk-B4Z5MBUC.mjs +2 -0
- package/dist/{chunk-LSCMXAPY.mjs → chunk-CKGJK4D7.mjs} +3 -3
- package/dist/{chunk-XSEZDQLB.js → chunk-CKJAECGV.js} +2 -2
- package/dist/{chunk-AHSMDPG5.js → chunk-CPK5D5FY.js} +2 -2
- package/dist/{chunk-DCJK5OZT.mjs → chunk-CWHBCQGT.mjs} +2 -2
- package/dist/{chunk-KSERBMXW.mjs → chunk-F5TXUA4O.mjs} +3 -3
- package/dist/{chunk-BN77GP4W.mjs → chunk-GN5C32JB.mjs} +2 -2
- package/dist/{chunk-ZLSWOFAY.mjs → chunk-GRLIPT5V.mjs} +2 -2
- package/dist/{chunk-DUY6F3GT.mjs → chunk-H3EYBSVP.mjs} +3 -3
- package/dist/{chunk-MG73MOZC.mjs → chunk-I557S566.mjs} +2 -2
- package/dist/{chunk-QVULSG6J.mjs → chunk-ID2NYIVE.mjs} +3 -3
- package/dist/chunk-J5WCPZLW.js +2 -0
- package/dist/{chunk-4R42ZNO7.mjs → chunk-JFFOPHU3.mjs} +57 -57
- package/dist/{chunk-P2YV6DR3.js → chunk-LIM64IV2.js} +3 -3
- package/dist/chunk-LU7PKE7Y.mjs +2 -0
- package/dist/{chunk-HQSU7LGM.js → chunk-LWXZMKC2.js} +4 -4
- package/dist/{chunk-XMBSJJ5U.js → chunk-ORFC66EA.js} +3 -3
- package/dist/{chunk-VTITKWGX.mjs → chunk-QSVVAZVT.mjs} +2 -2
- package/dist/chunk-SCWNM4PC.mjs +2 -0
- package/dist/{chunk-EHAZIKDX.js → chunk-SKKOMFXH.js} +2 -2
- package/dist/{chunk-WH6ZMUOS.mjs → chunk-TUNQUVHU.mjs} +2 -2
- package/dist/chunk-TV4U6AIS.js +2 -0
- package/dist/{chunk-ZYLDLGFL.js → chunk-VIQUXWJC.js} +2 -2
- package/dist/{chunk-SUEGUY35.js → chunk-XIM7KMD6.js} +2 -2
- package/dist/{chunk-P6QAFBCV.js → chunk-XNSZ7KUH.js} +2 -2
- package/dist/{chunk-RNTNHVKZ.js → chunk-YPKUHSK4.js} +2 -2
- package/dist/{chunk-UFPSUO52.js → chunk-Z73T6MWY.js} +57 -57
- package/dist/consent.d.mts +648 -84
- package/dist/consent.d.ts +648 -84
- package/dist/consent.js +2 -1
- package/dist/consent.mjs +2 -1
- package/dist/core.d.mts +2049 -23
- package/dist/core.d.ts +2049 -23
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +470 -99
- package/dist/cross-border.d.ts +470 -99
- package/dist/cross-border.js +1 -0
- package/dist/cross-border.mjs +1 -0
- package/dist/dpia.d.mts +591 -37
- package/dist/dpia.d.ts +591 -37
- package/dist/dpia.js +1 -0
- package/dist/dpia.mjs +1 -0
- package/dist/dsr.d.mts +654 -37
- package/dist/dsr.d.ts +654 -37
- package/dist/dsr.js +2 -1
- package/dist/dsr.mjs +2 -1
- package/dist/hooks.d.mts +2174 -30
- package/dist/hooks.d.ts +2174 -30
- package/dist/hooks.js +2 -1
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.mts +4428 -43
- package/dist/index.d.ts +4428 -43
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/lawful-basis.d.mts +368 -32
- package/dist/lawful-basis.d.ts +368 -32
- package/dist/lawful-basis.js +1 -0
- package/dist/lawful-basis.mjs +1 -0
- package/dist/policy.d.mts +1178 -83
- package/dist/policy.d.ts +1178 -83
- package/dist/policy.js +2 -1
- package/dist/policy.mjs +2 -1
- package/dist/presets.d.mts +1020 -114
- package/dist/presets.d.ts +1020 -114
- package/dist/presets.js +2 -1
- package/dist/presets.mjs +2 -1
- package/dist/ropa.d.mts +396 -31
- package/dist/ropa.d.ts +396 -31
- package/dist/ropa.js +2 -1
- package/dist/ropa.mjs +2 -1
- package/dist/server.d.mts +2133 -24
- package/dist/server.d.ts +2133 -24
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.d.mts +523 -55
- package/dist/unstyled.d.ts +523 -55
- package/dist/unstyled.js +2 -1
- package/dist/unstyled.mjs +2 -1
- package/package.json +3 -3
- package/dist/BreachReportForm-DpRrBoxU.d.ts +0 -158
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +0 -158
- package/dist/ConsentBanner-F5ayys5K.d.mts +0 -156
- package/dist/ConsentBanner-VqIPophc.d.ts +0 -156
- package/dist/ConsentManager-C7I3PDe8.d.mts +0 -105
- package/dist/ConsentManager-CQ2IZtUU.d.ts +0 -105
- package/dist/CrossBorderTransferManager-D5Lc0e46.d.ts +0 -90
- package/dist/CrossBorderTransferManager-DkZhv9vD.d.mts +0 -90
- package/dist/DPIAQuestionnaire-VXBoWFMC.d.ts +0 -123
- package/dist/DPIAQuestionnaire-jkt1Veb6.d.mts +0 -123
- package/dist/DSRRequestForm-D8rPTNmU.d.ts +0 -146
- package/dist/DSRRequestForm-DRouEr9j.d.mts +0 -146
- package/dist/DSRTracker-Bl__d4df.d.ts +0 -163
- package/dist/DSRTracker-CSVDfgQQ.d.mts +0 -163
- package/dist/LawfulBasisTracker-CBqOxX1D.d.mts +0 -85
- package/dist/LawfulBasisTracker-Cg30NbDA.d.ts +0 -85
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +0 -44
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +0 -44
- package/dist/NDPRProvider-DYFb8xEl.d.ts +0 -68
- package/dist/NDPRProvider-U3QNu6MA.d.mts +0 -68
- package/dist/PolicyExporter-Bgi6nz82.d.mts +0 -291
- package/dist/PolicyExporter-BnvuFncj.d.ts +0 -291
- package/dist/ROPAManager-BS4eB8Hw.d.mts +0 -79
- package/dist/ROPAManager-qxTrXLkD.d.ts +0 -79
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +0 -282
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +0 -282
- package/dist/StepIndicator-CgrlokSV.d.ts +0 -171
- package/dist/StepIndicator-W8S_QjgO.d.mts +0 -171
- package/dist/breach-B_-6lDqS.d.mts +0 -17
- package/dist/breach-CzXqSsaY.d.ts +0 -17
- package/dist/breach-Eu9byel8.d.mts +0 -185
- package/dist/breach-Eu9byel8.d.ts +0 -185
- package/dist/chunk-5X32J5IA.mjs +0 -2
- package/dist/chunk-7D2OIPHH.mjs +0 -2
- package/dist/chunk-JKKRPS4P.js +0 -2
- package/dist/chunk-NCOZB2WU.mjs +0 -2
- package/dist/chunk-RGNP45VR.js +0 -2
- package/dist/compliance-score-racQe_E_.d.mts +0 -115
- package/dist/compliance-score-racQe_E_.d.ts +0 -115
- package/dist/consent-CmVzqZUk.d.mts +0 -99
- package/dist/consent-CmVzqZUk.d.ts +0 -99
- package/dist/consent-audit-BdByjYlM.d.mts +0 -65
- package/dist/consent-audit-DhbfMR0n.d.ts +0 -65
- package/dist/cross-border-BBi9rZyO.d.mts +0 -54
- package/dist/cross-border-Dy-U9Hu6.d.ts +0 -54
- package/dist/cross-border-UyT00llA.d.mts +0 -141
- package/dist/cross-border-UyT00llA.d.ts +0 -141
- package/dist/docx-BxKascXN.d.ts +0 -64
- package/dist/docx-CV7Vsry_.d.mts +0 -64
- package/dist/dpia-D82hUrJe.d.ts +0 -15
- package/dist/dpia-DQDFw2_l.d.mts +0 -15
- package/dist/dpia-c9GiiOq0.d.mts +0 -137
- package/dist/dpia-c9GiiOq0.d.ts +0 -137
- package/dist/dsr-CIx5sd7e.d.ts +0 -14
- package/dist/dsr-XZ_HqTlA.d.mts +0 -14
- package/dist/dsr-yKbqX531.d.mts +0 -128
- package/dist/dsr-yKbqX531.d.ts +0 -128
- package/dist/lawful-basis-BEyI0kGg.d.ts +0 -57
- package/dist/lawful-basis-C2eGaoHM.d.mts +0 -57
- package/dist/lawful-basis-Cv1VmDLn.d.mts +0 -112
- package/dist/lawful-basis-Cv1VmDLn.d.ts +0 -112
- package/dist/locale-CxJx2tzn.d.mts +0 -25
- package/dist/locale-DSkrtf-c.d.ts +0 -25
- package/dist/policy-engine-CCUCud2T.d.ts +0 -154
- package/dist/policy-engine-fYSqEqSW.d.mts +0 -154
- package/dist/policy-sections-BYx6fEFk.d.ts +0 -56
- package/dist/policy-sections-Dm97Nq8m.d.mts +0 -56
- package/dist/policy-templates-DhLwq4R-.d.ts +0 -43
- package/dist/policy-templates-DwYl2329.d.mts +0 -43
- package/dist/privacy-Ca6te9Ir.d.mts +0 -138
- package/dist/privacy-Ca6te9Ir.d.ts +0 -138
- package/dist/ropa-BDTM06tr.d.ts +0 -152
- package/dist/ropa-CFHuT7jE.d.mts +0 -152
- package/dist/ropa-CyynscU6.d.ts +0 -51
- package/dist/ropa-NIgxd8uP.d.mts +0 -51
- package/dist/sanitize-CxxwKxAx.d.mts +0 -94
- package/dist/sanitize-CxxwKxAx.d.ts +0 -94
- package/dist/styling-BMDGQDgS.d.mts +0 -64
- package/dist/styling-BaoQtV06.d.ts +0 -64
- package/dist/types-DK2CoKOC.d.mts +0 -10
- package/dist/types-DK2CoKOC.d.ts +0 -10
- package/dist/useAdaptivePolicyWizard-BnjW4OR4.d.mts +0 -52
- package/dist/useAdaptivePolicyWizard-sb3m4-Zk.d.ts +0 -52
- package/dist/useBreach-CPr86Yan.d.mts +0 -115
- package/dist/useBreach-DkVXvtJK.d.ts +0 -115
- package/dist/useConsent-DCNkIJHR.d.mts +0 -75
- package/dist/useConsent-dOcELSfX.d.ts +0 -75
- package/dist/useCrossBorderTransfer-DixjLjN1.d.mts +0 -78
- package/dist/useCrossBorderTransfer-DvSq06lv.d.ts +0 -78
- package/dist/useDPIA-B6180UQn.d.mts +0 -109
- package/dist/useDPIA-CTqbNbww.d.ts +0 -109
- package/dist/useDSR-WvHk8_iu.d.mts +0 -85
- package/dist/useDSR-wH4H6hSM.d.ts +0 -85
- package/dist/useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts +0 -162
- package/dist/useDefaultPrivacyPolicy-DkOqMg2e.d.ts +0 -162
- package/dist/useLawfulBasis-CKJ-kw84.d.mts +0 -79
- package/dist/useLawfulBasis-DFTmu1ca.d.ts +0 -79
- package/dist/useROPA-BSSU1rfx.d.ts +0 -76
- package/dist/useROPA-C2hjaBTz.d.mts +0 -76
package/dist/consent.d.mts
CHANGED
|
@@ -1,84 +1,648 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
declare interface AcceptButtonProps {
|
|
5
|
+
children?: React__default.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
unstyled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Appends a single audit entry to the consent audit log in localStorage.
|
|
12
|
+
* The log is append-only; existing entries are never modified.
|
|
13
|
+
*
|
|
14
|
+
* @param entry - The audit entry to append
|
|
15
|
+
* @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
|
|
16
|
+
*/
|
|
17
|
+
export declare function appendAuditEntry(entry: ConsentAuditEntry, storageKey?: string): void;
|
|
18
|
+
|
|
19
|
+
export declare const Consent: {
|
|
20
|
+
Provider: React$1.FC<ConsentProviderProps>;
|
|
21
|
+
OptionList: React$1.FC<OptionListProps>;
|
|
22
|
+
AcceptButton: React$1.FC<AcceptButtonProps>;
|
|
23
|
+
RejectButton: React$1.FC<RejectButtonProps>;
|
|
24
|
+
SaveButton: React$1.FC<SaveButtonProps>;
|
|
25
|
+
Banner: React$1.FC<ConsentBannerProps>;
|
|
26
|
+
Settings: React$1.FC<ConsentManagerProps>;
|
|
27
|
+
Storage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React.ReactElement | null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export declare const ConsentAcceptButton: React__default.FC<AcceptButtonProps>;
|
|
31
|
+
|
|
32
|
+
export declare interface ConsentAnalyticsEvent {
|
|
33
|
+
action: 'shown' | 'accepted_all' | 'rejected_all' | 'customized' | 'dismissed';
|
|
34
|
+
timestamp: number;
|
|
35
|
+
version: string;
|
|
36
|
+
categories?: Record<string, boolean>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Represents a single entry in the consent audit trail.
|
|
41
|
+
* Each entry captures what happened, when, and the full consent state
|
|
42
|
+
* at that point in time, satisfying NDPA recordkeeping requirements.
|
|
43
|
+
*/
|
|
44
|
+
export declare interface ConsentAuditEntry {
|
|
45
|
+
/** The type of consent action that occurred */
|
|
46
|
+
action: 'consent_given' | 'consent_withdrawn' | 'consent_updated' | 'consent_expired';
|
|
47
|
+
/** Unix timestamp (ms) when the action occurred */
|
|
48
|
+
timestamp: number;
|
|
49
|
+
/** Version of the consent form at the time of the action */
|
|
50
|
+
version: string;
|
|
51
|
+
/** Full snapshot of consent category states */
|
|
52
|
+
categories: Record<string, boolean>;
|
|
53
|
+
/** How consent was collected (e.g. "banner", "customize", "api") */
|
|
54
|
+
method: string;
|
|
55
|
+
/** Browser user-agent string for forensic traceability */
|
|
56
|
+
userAgent?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Consent banner component. Implements NDPA Sections 25-26 consent requirements
|
|
61
|
+
* for obtaining and managing data subject consent.
|
|
62
|
+
*/
|
|
63
|
+
export declare const ConsentBanner: React__default.FC<ConsentBannerProps>;
|
|
64
|
+
|
|
65
|
+
export declare interface ConsentBannerClassNames {
|
|
66
|
+
root?: string;
|
|
67
|
+
container?: string;
|
|
68
|
+
title?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
optionsList?: string;
|
|
71
|
+
optionItem?: string;
|
|
72
|
+
optionCheckbox?: string;
|
|
73
|
+
optionLabel?: string;
|
|
74
|
+
optionDescription?: string;
|
|
75
|
+
buttonGroup?: string;
|
|
76
|
+
acceptButton?: string;
|
|
77
|
+
rejectButton?: string;
|
|
78
|
+
customizeButton?: string;
|
|
79
|
+
saveButton?: string;
|
|
80
|
+
customizePanel?: string;
|
|
81
|
+
selectAllButton?: string;
|
|
82
|
+
/** Alias for acceptButton */
|
|
83
|
+
primaryButton?: string;
|
|
84
|
+
/** Alias for rejectButton */
|
|
85
|
+
secondaryButton?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare interface ConsentBannerProps {
|
|
89
|
+
/**
|
|
90
|
+
* Array of consent options to display
|
|
91
|
+
*/
|
|
92
|
+
options: ConsentOption[];
|
|
93
|
+
/**
|
|
94
|
+
* Callback function called when user saves their consent choices
|
|
95
|
+
*/
|
|
96
|
+
onSave: (settings: ConsentSettings) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Title displayed on the banner
|
|
99
|
+
* @default "We Value Your Privacy"
|
|
100
|
+
*/
|
|
101
|
+
title?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Description text displayed on the banner
|
|
104
|
+
* @default "We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26."
|
|
105
|
+
*/
|
|
106
|
+
description?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Text for the accept all button
|
|
109
|
+
* @default "Accept All"
|
|
110
|
+
*/
|
|
111
|
+
acceptAllButtonText?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Text for the reject all button
|
|
114
|
+
* @default "Reject All"
|
|
115
|
+
*/
|
|
116
|
+
rejectAllButtonText?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Text for the customize button
|
|
119
|
+
* @default "Customize"
|
|
120
|
+
*/
|
|
121
|
+
customizeButtonText?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Text for the save button
|
|
124
|
+
* @default "Save Preferences"
|
|
125
|
+
*/
|
|
126
|
+
saveButtonText?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Position of the banner.
|
|
129
|
+
* 'top', 'bottom', and 'center' render via a portal to document.body
|
|
130
|
+
* with fixed positioning so the banner overlays the page.
|
|
131
|
+
* 'inline' renders in the normal DOM tree without a portal.
|
|
132
|
+
* @default "bottom"
|
|
133
|
+
*/
|
|
134
|
+
position?: 'top' | 'bottom' | 'center' | 'inline';
|
|
135
|
+
/**
|
|
136
|
+
* Visual treatment.
|
|
137
|
+
* - 'bar' (default): full-width strip pinned to the edge.
|
|
138
|
+
* - 'card' : bounded floating card with rounded corners and a margin
|
|
139
|
+
* from the screen edges. Pairs well with `position="bottom"`.
|
|
140
|
+
* - 'modal' : centered card with a backdrop overlay. Forces center
|
|
141
|
+
* placement regardless of `position`.
|
|
142
|
+
* @default "bar"
|
|
143
|
+
*/
|
|
144
|
+
variant?: 'bar' | 'card' | 'modal';
|
|
145
|
+
/**
|
|
146
|
+
* z-index applied to the fixed-position banner.
|
|
147
|
+
* Ignored when position is 'inline'.
|
|
148
|
+
* @default 9999
|
|
149
|
+
*/
|
|
150
|
+
zIndex?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Version of the consent form
|
|
153
|
+
* @default "1.0"
|
|
154
|
+
*/
|
|
155
|
+
version?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Whether to show the banner
|
|
158
|
+
* If not provided, the banner will be shown if no consent has been saved
|
|
159
|
+
*/
|
|
160
|
+
show?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Storage key for consent settings
|
|
163
|
+
* @default "ndpr_consent"
|
|
164
|
+
*/
|
|
165
|
+
storageKey?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the banner manages its own localStorage persistence.
|
|
168
|
+
* Set to false when an external storage mechanism (e.g., ConsentStorage)
|
|
169
|
+
* is responsible for persisting consent settings under the same key.
|
|
170
|
+
* This avoids race conditions where two writers target the same storage key.
|
|
171
|
+
* @default true
|
|
172
|
+
*/
|
|
173
|
+
manageStorage?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Custom CSS class for the banner
|
|
176
|
+
*/
|
|
177
|
+
className?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Custom CSS class for the buttons
|
|
180
|
+
*/
|
|
181
|
+
buttonClassName?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Custom CSS class for the primary button
|
|
184
|
+
*/
|
|
185
|
+
primaryButtonClassName?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Custom CSS class for the secondary button
|
|
188
|
+
*/
|
|
189
|
+
secondaryButtonClassName?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
192
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
193
|
+
*/
|
|
194
|
+
classNames?: ConsentBannerClassNames;
|
|
195
|
+
/**
|
|
196
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
197
|
+
* can style from scratch using classNames.
|
|
198
|
+
*/
|
|
199
|
+
unstyled?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Optional analytics callback fired on each user interaction.
|
|
202
|
+
* Called when the banner is shown, accepted, rejected, customized, or dismissed.
|
|
203
|
+
*/
|
|
204
|
+
onAnalytics?: (event: ConsentAnalyticsEvent) => void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
declare interface ConsentContextValue {
|
|
208
|
+
options: ConsentOption[];
|
|
209
|
+
settings: ConsentSettings | null;
|
|
210
|
+
hasConsent: (optionId: string) => boolean;
|
|
211
|
+
updateConsent: (consents: Record<string, boolean>) => void;
|
|
212
|
+
acceptAll: () => void;
|
|
213
|
+
rejectAll: () => void;
|
|
214
|
+
shouldShowBanner: boolean;
|
|
215
|
+
isValid: boolean;
|
|
216
|
+
validationErrors: string[];
|
|
217
|
+
resetConsent: () => void;
|
|
218
|
+
isLoading: boolean;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Consent management component. Implements NDPA Sections 25-26 consent requirements,
|
|
223
|
+
* allowing data subjects to review and update their consent preferences.
|
|
224
|
+
*/
|
|
225
|
+
export declare const ConsentManager: React__default.FC<ConsentManagerProps>;
|
|
226
|
+
|
|
227
|
+
export declare interface ConsentManagerClassNames {
|
|
228
|
+
root?: string;
|
|
229
|
+
header?: string;
|
|
230
|
+
title?: string;
|
|
231
|
+
description?: string;
|
|
232
|
+
optionsList?: string;
|
|
233
|
+
optionItem?: string;
|
|
234
|
+
toggle?: string;
|
|
235
|
+
saveButton?: string;
|
|
236
|
+
resetButton?: string;
|
|
237
|
+
/** Alias for saveButton */
|
|
238
|
+
primaryButton?: string;
|
|
239
|
+
/** Alias for resetButton */
|
|
240
|
+
secondaryButton?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
declare interface ConsentManagerProps {
|
|
244
|
+
/**
|
|
245
|
+
* Array of consent options to display
|
|
246
|
+
*/
|
|
247
|
+
options: ConsentOption[];
|
|
248
|
+
/**
|
|
249
|
+
* Current consent settings
|
|
250
|
+
*/
|
|
251
|
+
settings?: ConsentSettings;
|
|
252
|
+
/**
|
|
253
|
+
* Callback function called when user saves their consent choices
|
|
254
|
+
*/
|
|
255
|
+
onSave: (settings: ConsentSettings) => void;
|
|
256
|
+
/**
|
|
257
|
+
* Title displayed in the manager
|
|
258
|
+
* @default "Manage Your Privacy Settings"
|
|
259
|
+
*/
|
|
260
|
+
title?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Description text displayed in the manager
|
|
263
|
+
* @default "Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26."
|
|
264
|
+
*/
|
|
265
|
+
description?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Text for the save button
|
|
268
|
+
* @default "Save Preferences"
|
|
269
|
+
*/
|
|
270
|
+
saveButtonText?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Text for the reset button
|
|
273
|
+
* @default "Reset to Defaults"
|
|
274
|
+
*/
|
|
275
|
+
resetButtonText?: string;
|
|
276
|
+
/**
|
|
277
|
+
* Version of the consent form
|
|
278
|
+
* @default "1.0"
|
|
279
|
+
*/
|
|
280
|
+
version?: string;
|
|
281
|
+
/**
|
|
282
|
+
* Custom CSS class for the manager
|
|
283
|
+
*/
|
|
284
|
+
className?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Custom CSS class for the buttons
|
|
287
|
+
*/
|
|
288
|
+
buttonClassName?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Custom CSS class for the primary button
|
|
291
|
+
*/
|
|
292
|
+
primaryButtonClassName?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Custom CSS class for the secondary button
|
|
295
|
+
*/
|
|
296
|
+
secondaryButtonClassName?: string;
|
|
297
|
+
/**
|
|
298
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
299
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
300
|
+
*/
|
|
301
|
+
classNames?: ConsentManagerClassNames;
|
|
302
|
+
/**
|
|
303
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
304
|
+
* can style from scratch using classNames.
|
|
305
|
+
*/
|
|
306
|
+
unstyled?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Whether to show a success message after saving
|
|
309
|
+
* @default true
|
|
310
|
+
*/
|
|
311
|
+
showSuccessMessage?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Success message to display after saving
|
|
314
|
+
* @default "Your preferences have been saved."
|
|
315
|
+
*/
|
|
316
|
+
successMessage?: string;
|
|
317
|
+
/**
|
|
318
|
+
* Duration to show the success message (in milliseconds)
|
|
319
|
+
* @default 3000
|
|
320
|
+
*/
|
|
321
|
+
successMessageDuration?: number;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Consent types aligned with NDPA 2023 Section 25-26
|
|
326
|
+
* Consent must be freely given, specific, informed, and unambiguous
|
|
327
|
+
*/
|
|
328
|
+
/**
|
|
329
|
+
* Represents a consent option that can be presented to users
|
|
330
|
+
*/
|
|
331
|
+
export declare interface ConsentOption {
|
|
332
|
+
/** Unique identifier for the consent option */
|
|
333
|
+
id: string;
|
|
334
|
+
/** Display label for the consent option */
|
|
335
|
+
label: string;
|
|
336
|
+
/** Detailed description of what this consent option covers */
|
|
337
|
+
description: string;
|
|
338
|
+
/** Whether this consent option is required (cannot be declined) */
|
|
339
|
+
required: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* The specific purpose for which data will be processed
|
|
342
|
+
* NDPA Section 25(2) requires consent to be specific to each purpose
|
|
343
|
+
*/
|
|
344
|
+
purpose: string;
|
|
345
|
+
/**
|
|
346
|
+
* Default state of the consent option
|
|
347
|
+
* @default false
|
|
348
|
+
*/
|
|
349
|
+
defaultValue?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* Categories of personal data covered by this consent option
|
|
352
|
+
*/
|
|
353
|
+
dataCategories?: string[];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export declare const ConsentOptionList: React__default.FC<OptionListProps>;
|
|
357
|
+
|
|
358
|
+
export declare const ConsentProvider: React__default.FC<ConsentProviderProps>;
|
|
359
|
+
|
|
360
|
+
export declare interface ConsentProviderProps {
|
|
361
|
+
options: ConsentOption[];
|
|
362
|
+
adapter?: StorageAdapter<ConsentSettings>;
|
|
363
|
+
version?: string;
|
|
364
|
+
onChange?: (settings: ConsentSettings) => void;
|
|
365
|
+
children: React__default.ReactNode;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export declare const ConsentRejectButton: React__default.FC<RejectButtonProps>;
|
|
369
|
+
|
|
370
|
+
export declare const ConsentSaveButton: React__default.FC<SaveButtonProps>;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Represents the user's consent settings
|
|
374
|
+
*/
|
|
375
|
+
export declare interface ConsentSettings {
|
|
376
|
+
/** Map of consent option IDs to boolean values indicating consent status */
|
|
377
|
+
consents: Record<string, boolean>;
|
|
378
|
+
/** Timestamp when consent was last updated */
|
|
379
|
+
timestamp: number;
|
|
380
|
+
/** Version of the consent form that was accepted */
|
|
381
|
+
version: string;
|
|
382
|
+
/** Method used to collect consent (e.g., "banner", "settings", "api") */
|
|
383
|
+
method: string;
|
|
384
|
+
/** Whether the user has actively made a choice (as opposed to default settings) */
|
|
385
|
+
hasInteracted: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* The lawful basis under which processing is conducted
|
|
388
|
+
* Required by NDPA Section 25(1)
|
|
389
|
+
*/
|
|
390
|
+
lawfulBasis?: LawfulBasisType;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React__default.ReactElement | null;
|
|
394
|
+
|
|
395
|
+
export declare interface ConsentStorageClassNames {
|
|
396
|
+
root?: string;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Represents the storage mechanism for consent settings
|
|
401
|
+
*/
|
|
402
|
+
export declare interface ConsentStorageOptions {
|
|
403
|
+
/**
|
|
404
|
+
* Storage key for consent settings
|
|
405
|
+
* @default "ndpr_consent"
|
|
406
|
+
*/
|
|
407
|
+
storageKey?: string;
|
|
408
|
+
/**
|
|
409
|
+
* Storage type to use
|
|
410
|
+
* @default "localStorage"
|
|
411
|
+
*/
|
|
412
|
+
storageType?: 'localStorage' | 'sessionStorage' | 'cookie';
|
|
413
|
+
/**
|
|
414
|
+
* Cookie options (only used when storageType is "cookie")
|
|
415
|
+
*/
|
|
416
|
+
cookieOptions?: {
|
|
417
|
+
/** Domain for the cookie */
|
|
418
|
+
domain?: string;
|
|
419
|
+
/**
|
|
420
|
+
* Path for the cookie
|
|
421
|
+
* @default "/"
|
|
422
|
+
*/
|
|
423
|
+
path?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Expiration days for the cookie
|
|
426
|
+
* @default 365
|
|
427
|
+
*/
|
|
428
|
+
expires?: number;
|
|
429
|
+
/**
|
|
430
|
+
* Whether the cookie should be secure
|
|
431
|
+
* @default true
|
|
432
|
+
*/
|
|
433
|
+
secure?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* SameSite attribute for the cookie
|
|
436
|
+
* @default "Lax"
|
|
437
|
+
*/
|
|
438
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare interface ConsentStorageProps {
|
|
443
|
+
/**
|
|
444
|
+
* Current consent settings
|
|
445
|
+
*/
|
|
446
|
+
settings: ConsentSettings;
|
|
447
|
+
/**
|
|
448
|
+
* Storage options for consent settings
|
|
449
|
+
*/
|
|
450
|
+
storageOptions?: ConsentStorageOptions;
|
|
451
|
+
/**
|
|
452
|
+
* Callback function called when settings are loaded from storage
|
|
453
|
+
*/
|
|
454
|
+
onLoad?: (settings: ConsentSettings | null) => void;
|
|
455
|
+
/**
|
|
456
|
+
* Callback function called when settings are saved to storage
|
|
457
|
+
*/
|
|
458
|
+
onSave?: (settings: ConsentSettings) => void;
|
|
459
|
+
/**
|
|
460
|
+
* Whether to automatically save settings to storage
|
|
461
|
+
* @default true
|
|
462
|
+
*/
|
|
463
|
+
autoSave?: boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Whether to automatically load settings from storage on mount
|
|
466
|
+
* @default true
|
|
467
|
+
*/
|
|
468
|
+
autoLoad?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
471
|
+
*/
|
|
472
|
+
classNames?: ConsentStorageClassNames;
|
|
473
|
+
/**
|
|
474
|
+
* When true, all default classes are removed so consumers
|
|
475
|
+
* can style from scratch using classNames.
|
|
476
|
+
*/
|
|
477
|
+
unstyled?: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Children to render
|
|
480
|
+
* Can be either React nodes or a render prop function that receives storage methods
|
|
481
|
+
*/
|
|
482
|
+
children?: React__default.ReactNode | ((props: {
|
|
483
|
+
loadSettings: () => ConsentSettings | null;
|
|
484
|
+
saveSettings: (settings: ConsentSettings) => void;
|
|
485
|
+
clearSettings: () => void;
|
|
486
|
+
loaded: boolean;
|
|
487
|
+
}) => React__default.ReactNode);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Creates a new audit entry from consent settings. If `previousSettings` is
|
|
492
|
+
* provided, the action is automatically determined by comparing old and new
|
|
493
|
+
* states. Otherwise `action` defaults to `'consent_given'`.
|
|
494
|
+
*/
|
|
495
|
+
export declare function createAuditEntry(settings: ConsentSettings, previousSettings?: ConsentSettings | null, actionOverride?: ConsentAuditEntry['action']): ConsentAuditEntry;
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Retrieves the full consent audit log from localStorage.
|
|
499
|
+
* Returns an empty array if no log exists or parsing fails.
|
|
500
|
+
*
|
|
501
|
+
* @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
|
|
502
|
+
*/
|
|
503
|
+
export declare function getAuditLog(storageKey?: string): ConsentAuditEntry[];
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Lawful basis for processing personal data per NDPA Section 25(1)
|
|
507
|
+
*/
|
|
508
|
+
export declare type LawfulBasisType = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_interest' | 'legitimate_interests';
|
|
509
|
+
|
|
510
|
+
declare interface OptionListProps {
|
|
511
|
+
classNames?: {
|
|
512
|
+
root?: string;
|
|
513
|
+
optionItem?: string;
|
|
514
|
+
optionCheckbox?: string;
|
|
515
|
+
optionLabel?: string;
|
|
516
|
+
optionDescription?: string;
|
|
517
|
+
};
|
|
518
|
+
unstyled?: boolean;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
declare interface RejectButtonProps {
|
|
522
|
+
children?: React__default.ReactNode;
|
|
523
|
+
className?: string;
|
|
524
|
+
unstyled?: boolean;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Resolves class names for a component section.
|
|
529
|
+
* If unstyled is true, only the override class is used (or empty string).
|
|
530
|
+
* If an override is provided, it fully REPLACES the default — no appending.
|
|
531
|
+
* Otherwise the default class string is returned as-is.
|
|
532
|
+
*/
|
|
533
|
+
export declare function resolveClass(defaultClass: string, override?: string, unstyled?: boolean): string;
|
|
534
|
+
|
|
535
|
+
declare interface SaveButtonProps {
|
|
536
|
+
children?: React__default.ReactNode;
|
|
537
|
+
className?: string;
|
|
538
|
+
unstyled?: boolean;
|
|
539
|
+
consents?: Record<string, boolean>;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
export declare interface StorageAdapter<T = unknown> {
|
|
543
|
+
/** Load persisted data. Called once on hook mount. */
|
|
544
|
+
load(): T | null | Promise<T | null>;
|
|
545
|
+
/** Persist data. Called on every state change. */
|
|
546
|
+
save(data: T): void | Promise<void>;
|
|
547
|
+
/** Clear persisted data. Called on reset. */
|
|
548
|
+
remove(): void | Promise<void>;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Hook for managing user consent in compliance with NDPA
|
|
553
|
+
*/
|
|
554
|
+
export declare function useConsent({ options, adapter, storageOptions, version, onChange, }: UseConsentOptions): UseConsentReturn;
|
|
555
|
+
|
|
556
|
+
export declare function useConsentCompound(): ConsentContextValue;
|
|
557
|
+
|
|
558
|
+
declare interface UseConsentOptions {
|
|
559
|
+
/**
|
|
560
|
+
* Consent options to present to the user
|
|
561
|
+
*/
|
|
562
|
+
options: ConsentOption[];
|
|
563
|
+
/**
|
|
564
|
+
* Pluggable storage adapter. When provided, takes precedence over storageOptions.
|
|
565
|
+
*/
|
|
566
|
+
adapter?: StorageAdapter<ConsentSettings>;
|
|
567
|
+
/**
|
|
568
|
+
* Storage options for consent settings
|
|
569
|
+
* @deprecated Use adapter instead
|
|
570
|
+
*/
|
|
571
|
+
storageOptions?: ConsentStorageOptions;
|
|
572
|
+
/**
|
|
573
|
+
* Version of the consent form
|
|
574
|
+
* @default "1.0"
|
|
575
|
+
*/
|
|
576
|
+
version?: string;
|
|
577
|
+
/**
|
|
578
|
+
* Callback function called when consent settings change
|
|
579
|
+
*/
|
|
580
|
+
onChange?: (settings: ConsentSettings) => void;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
declare interface UseConsentReturn {
|
|
584
|
+
/**
|
|
585
|
+
* Current consent settings
|
|
586
|
+
*/
|
|
587
|
+
settings: ConsentSettings | null;
|
|
588
|
+
/**
|
|
589
|
+
* Whether consent has been given for a specific option
|
|
590
|
+
*/
|
|
591
|
+
hasConsent: (optionId: string) => boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Update consent settings
|
|
594
|
+
*/
|
|
595
|
+
updateConsent: (consents: Record<string, boolean>) => void;
|
|
596
|
+
/**
|
|
597
|
+
* Accept all consent options
|
|
598
|
+
*/
|
|
599
|
+
acceptAll: () => void;
|
|
600
|
+
/**
|
|
601
|
+
* Reject all non-required consent options
|
|
602
|
+
*/
|
|
603
|
+
rejectAll: () => void;
|
|
604
|
+
/**
|
|
605
|
+
* Whether the consent banner should be shown
|
|
606
|
+
*/
|
|
607
|
+
shouldShowBanner: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Whether consent settings are valid
|
|
610
|
+
*/
|
|
611
|
+
isValid: boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Validation errors (if any)
|
|
614
|
+
*/
|
|
615
|
+
validationErrors: string[];
|
|
616
|
+
/**
|
|
617
|
+
* Reset consent settings (clear from storage)
|
|
618
|
+
*/
|
|
619
|
+
resetConsent: () => void;
|
|
620
|
+
/**
|
|
621
|
+
* Whether the adapter is still loading data (relevant for async adapters)
|
|
622
|
+
*/
|
|
623
|
+
isLoading: boolean;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Validates consent settings to ensure they meet NDPA requirements
|
|
628
|
+
* @param settings The consent settings to validate
|
|
629
|
+
* @returns An object containing validation result and any error messages
|
|
630
|
+
*/
|
|
631
|
+
export declare function validateConsent(settings: ConsentSettings): {
|
|
632
|
+
valid: boolean;
|
|
633
|
+
errors: string[];
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Validates that consent options meet NDPA Section 26 requirements.
|
|
638
|
+
* Each consent option must specify a purpose for which data will be processed,
|
|
639
|
+
* as consent must be specific and informed per the Nigeria Data Protection Act.
|
|
640
|
+
* @param options The consent options to validate
|
|
641
|
+
* @returns An object containing validation result and any error messages
|
|
642
|
+
*/
|
|
643
|
+
export declare function validateConsentOptions(options: ConsentOption[]): {
|
|
644
|
+
valid: boolean;
|
|
645
|
+
errors: string[];
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
export { }
|