@tantainnovative/ndpr-toolkit 3.4.1 → 3.5.1
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 +19 -0
- 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 +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/{chunk-ASLMPY54.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-MLOWRZXO.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-NFJ4CB63.mjs → chunk-ID2NYIVE.mjs} +3 -3
- package/dist/chunk-J5WCPZLW.js +2 -0
- 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-4BOEFDDE.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/consent.d.mts +648 -84
- package/dist/consent.d.ts +648 -84
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -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/dpia.d.mts +591 -37
- package/dist/dpia.d.ts +591 -37
- package/dist/dsr.d.mts +654 -37
- package/dist/dsr.d.ts +654 -37
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +2174 -30
- package/dist/hooks.d.ts +2174 -30
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +4428 -43
- package/dist/index.d.ts +4428 -43
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +368 -32
- package/dist/lawful-basis.d.ts +368 -32
- package/dist/policy.d.mts +1178 -83
- package/dist/policy.d.ts +1178 -83
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +1020 -114
- package/dist/presets.d.ts +1020 -114
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.d.mts +396 -31
- package/dist/ropa.d.ts +396 -31
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -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 +1 -1
- package/dist/unstyled.mjs +1 -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-2L7BSG7G.mjs +0 -2
- package/dist/chunk-5X32J5IA.mjs +0 -2
- package/dist/chunk-7D2OIPHH.mjs +0 -2
- package/dist/chunk-JKKRPS4P.js +0 -2
- package/dist/chunk-UHTJ6UFW.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-4n8g4zul.d.mts +0 -64
- package/dist/docx-VvcTLYZM.d.ts +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-5qTfp2z4.d.mts +0 -174
- package/dist/policy-engine-DzPxskOK.d.ts +0 -174
- package/dist/policy-sections-9tCb7VU7.d.ts +0 -56
- package/dist/policy-sections-CBWcJv-R.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-BSLyltzZ.d.mts +0 -52
- package/dist/useAdaptivePolicyWizard-CL7C7MTZ.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/unstyled.d.ts
CHANGED
|
@@ -1,55 +1,523 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
|
|
3
|
-
export
|
|
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
|
-
declare
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
export declare interface ConsentAnalyticsEvent {
|
|
4
|
+
action: 'shown' | 'accepted_all' | 'rejected_all' | 'customized' | 'dismissed';
|
|
5
|
+
timestamp: number;
|
|
6
|
+
version: string;
|
|
7
|
+
categories?: Record<string, boolean>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Unstyled entry — design-system-friendly component variants.
|
|
12
|
+
*
|
|
13
|
+
* Components imported from this subpath default `unstyled` to `true`,
|
|
14
|
+
* which strips every default class name from the rendered markup.
|
|
15
|
+
* Consumers using their own design system (Tailwind, Mantine, Chakra,
|
|
16
|
+
* shadcn, raw CSS) get logic + accessibility + semantic structure
|
|
17
|
+
* without any pre-applied visual styling.
|
|
18
|
+
*
|
|
19
|
+
* Markup, ARIA attributes, focus management, keyboard handling, and the
|
|
20
|
+
* `data-ndpr-component` data attributes are all preserved — those are
|
|
21
|
+
* part of the contract, not styling.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // app/cookie-banner.tsx
|
|
26
|
+
* import { ConsentBanner } from '@tantainnovative/ndpr-toolkit/unstyled';
|
|
27
|
+
*
|
|
28
|
+
* export function CookieBanner() {
|
|
29
|
+
* return (
|
|
30
|
+
* <ConsentBanner
|
|
31
|
+
* options={[]}
|
|
32
|
+
* onSave={() => {}}
|
|
33
|
+
* classNames={{
|
|
34
|
+
* root: 'fixed bottom-0 inset-x-0 bg-white p-6 shadow-2xl',
|
|
35
|
+
* title: 'text-xl font-bold mb-2',
|
|
36
|
+
* buttonGroup: 'flex gap-2 mt-4',
|
|
37
|
+
* acceptButton: 'btn-primary',
|
|
38
|
+
* rejectButton: 'btn-secondary',
|
|
39
|
+
* }}
|
|
40
|
+
* />
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* For components not yet migrated to the BEM stylesheet (DPIA, Breach,
|
|
46
|
+
* ROPA, etc.), import them from their normal subpath and pass
|
|
47
|
+
* `unstyled` manually if available — the migration completes in 3.5.x.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ConsentBanner: React__default.FC<ConsentBannerProps>;
|
|
50
|
+
|
|
51
|
+
export declare interface ConsentBannerClassNames {
|
|
52
|
+
root?: string;
|
|
53
|
+
container?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
optionsList?: string;
|
|
57
|
+
optionItem?: string;
|
|
58
|
+
optionCheckbox?: string;
|
|
59
|
+
optionLabel?: string;
|
|
60
|
+
optionDescription?: string;
|
|
61
|
+
buttonGroup?: string;
|
|
62
|
+
acceptButton?: string;
|
|
63
|
+
rejectButton?: string;
|
|
64
|
+
customizeButton?: string;
|
|
65
|
+
saveButton?: string;
|
|
66
|
+
customizePanel?: string;
|
|
67
|
+
selectAllButton?: string;
|
|
68
|
+
/** Alias for acceptButton */
|
|
69
|
+
primaryButton?: string;
|
|
70
|
+
/** Alias for rejectButton */
|
|
71
|
+
secondaryButton?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare interface ConsentBannerProps {
|
|
75
|
+
/**
|
|
76
|
+
* Array of consent options to display
|
|
77
|
+
*/
|
|
78
|
+
options: ConsentOption[];
|
|
79
|
+
/**
|
|
80
|
+
* Callback function called when user saves their consent choices
|
|
81
|
+
*/
|
|
82
|
+
onSave: (settings: ConsentSettings) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Title displayed on the banner
|
|
85
|
+
* @default "We Value Your Privacy"
|
|
86
|
+
*/
|
|
87
|
+
title?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Description text displayed on the banner
|
|
90
|
+
* @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."
|
|
91
|
+
*/
|
|
92
|
+
description?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Text for the accept all button
|
|
95
|
+
* @default "Accept All"
|
|
96
|
+
*/
|
|
97
|
+
acceptAllButtonText?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Text for the reject all button
|
|
100
|
+
* @default "Reject All"
|
|
101
|
+
*/
|
|
102
|
+
rejectAllButtonText?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Text for the customize button
|
|
105
|
+
* @default "Customize"
|
|
106
|
+
*/
|
|
107
|
+
customizeButtonText?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Text for the save button
|
|
110
|
+
* @default "Save Preferences"
|
|
111
|
+
*/
|
|
112
|
+
saveButtonText?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Position of the banner.
|
|
115
|
+
* 'top', 'bottom', and 'center' render via a portal to document.body
|
|
116
|
+
* with fixed positioning so the banner overlays the page.
|
|
117
|
+
* 'inline' renders in the normal DOM tree without a portal.
|
|
118
|
+
* @default "bottom"
|
|
119
|
+
*/
|
|
120
|
+
position?: 'top' | 'bottom' | 'center' | 'inline';
|
|
121
|
+
/**
|
|
122
|
+
* Visual treatment.
|
|
123
|
+
* - 'bar' (default): full-width strip pinned to the edge.
|
|
124
|
+
* - 'card' : bounded floating card with rounded corners and a margin
|
|
125
|
+
* from the screen edges. Pairs well with `position="bottom"`.
|
|
126
|
+
* - 'modal' : centered card with a backdrop overlay. Forces center
|
|
127
|
+
* placement regardless of `position`.
|
|
128
|
+
* @default "bar"
|
|
129
|
+
*/
|
|
130
|
+
variant?: 'bar' | 'card' | 'modal';
|
|
131
|
+
/**
|
|
132
|
+
* z-index applied to the fixed-position banner.
|
|
133
|
+
* Ignored when position is 'inline'.
|
|
134
|
+
* @default 9999
|
|
135
|
+
*/
|
|
136
|
+
zIndex?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Version of the consent form
|
|
139
|
+
* @default "1.0"
|
|
140
|
+
*/
|
|
141
|
+
version?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Whether to show the banner
|
|
144
|
+
* If not provided, the banner will be shown if no consent has been saved
|
|
145
|
+
*/
|
|
146
|
+
show?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Storage key for consent settings
|
|
149
|
+
* @default "ndpr_consent"
|
|
150
|
+
*/
|
|
151
|
+
storageKey?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the banner manages its own localStorage persistence.
|
|
154
|
+
* Set to false when an external storage mechanism (e.g., ConsentStorage)
|
|
155
|
+
* is responsible for persisting consent settings under the same key.
|
|
156
|
+
* This avoids race conditions where two writers target the same storage key.
|
|
157
|
+
* @default true
|
|
158
|
+
*/
|
|
159
|
+
manageStorage?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Custom CSS class for the banner
|
|
162
|
+
*/
|
|
163
|
+
className?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Custom CSS class for the buttons
|
|
166
|
+
*/
|
|
167
|
+
buttonClassName?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Custom CSS class for the primary button
|
|
170
|
+
*/
|
|
171
|
+
primaryButtonClassName?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Custom CSS class for the secondary button
|
|
174
|
+
*/
|
|
175
|
+
secondaryButtonClassName?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
178
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
179
|
+
*/
|
|
180
|
+
classNames?: ConsentBannerClassNames;
|
|
181
|
+
/**
|
|
182
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
183
|
+
* can style from scratch using classNames.
|
|
184
|
+
*/
|
|
185
|
+
unstyled?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Optional analytics callback fired on each user interaction.
|
|
188
|
+
* Called when the banner is shown, accepted, rejected, customized, or dismissed.
|
|
189
|
+
*/
|
|
190
|
+
onAnalytics?: (event: ConsentAnalyticsEvent) => void;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare const ConsentManager: React__default.FC<ConsentManagerProps>;
|
|
194
|
+
|
|
195
|
+
export declare interface ConsentManagerClassNames {
|
|
196
|
+
root?: string;
|
|
197
|
+
header?: string;
|
|
198
|
+
title?: string;
|
|
199
|
+
description?: string;
|
|
200
|
+
optionsList?: string;
|
|
201
|
+
optionItem?: string;
|
|
202
|
+
toggle?: string;
|
|
203
|
+
saveButton?: string;
|
|
204
|
+
resetButton?: string;
|
|
205
|
+
/** Alias for saveButton */
|
|
206
|
+
primaryButton?: string;
|
|
207
|
+
/** Alias for resetButton */
|
|
208
|
+
secondaryButton?: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare interface ConsentManagerProps {
|
|
212
|
+
/**
|
|
213
|
+
* Array of consent options to display
|
|
214
|
+
*/
|
|
215
|
+
options: ConsentOption[];
|
|
216
|
+
/**
|
|
217
|
+
* Current consent settings
|
|
218
|
+
*/
|
|
219
|
+
settings?: ConsentSettings;
|
|
220
|
+
/**
|
|
221
|
+
* Callback function called when user saves their consent choices
|
|
222
|
+
*/
|
|
223
|
+
onSave: (settings: ConsentSettings) => void;
|
|
224
|
+
/**
|
|
225
|
+
* Title displayed in the manager
|
|
226
|
+
* @default "Manage Your Privacy Settings"
|
|
227
|
+
*/
|
|
228
|
+
title?: string;
|
|
229
|
+
/**
|
|
230
|
+
* Description text displayed in the manager
|
|
231
|
+
* @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."
|
|
232
|
+
*/
|
|
233
|
+
description?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Text for the save button
|
|
236
|
+
* @default "Save Preferences"
|
|
237
|
+
*/
|
|
238
|
+
saveButtonText?: string;
|
|
239
|
+
/**
|
|
240
|
+
* Text for the reset button
|
|
241
|
+
* @default "Reset to Defaults"
|
|
242
|
+
*/
|
|
243
|
+
resetButtonText?: string;
|
|
244
|
+
/**
|
|
245
|
+
* Version of the consent form
|
|
246
|
+
* @default "1.0"
|
|
247
|
+
*/
|
|
248
|
+
version?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Custom CSS class for the manager
|
|
251
|
+
*/
|
|
252
|
+
className?: string;
|
|
253
|
+
/**
|
|
254
|
+
* Custom CSS class for the buttons
|
|
255
|
+
*/
|
|
256
|
+
buttonClassName?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Custom CSS class for the primary button
|
|
259
|
+
*/
|
|
260
|
+
primaryButtonClassName?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Custom CSS class for the secondary button
|
|
263
|
+
*/
|
|
264
|
+
secondaryButtonClassName?: string;
|
|
265
|
+
/**
|
|
266
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
267
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
268
|
+
*/
|
|
269
|
+
classNames?: ConsentManagerClassNames;
|
|
270
|
+
/**
|
|
271
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
272
|
+
* can style from scratch using classNames.
|
|
273
|
+
*/
|
|
274
|
+
unstyled?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Whether to show a success message after saving
|
|
277
|
+
* @default true
|
|
278
|
+
*/
|
|
279
|
+
showSuccessMessage?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Success message to display after saving
|
|
282
|
+
* @default "Your preferences have been saved."
|
|
283
|
+
*/
|
|
284
|
+
successMessage?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Duration to show the success message (in milliseconds)
|
|
287
|
+
* @default 3000
|
|
288
|
+
*/
|
|
289
|
+
successMessageDuration?: number;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Consent types aligned with NDPA 2023 Section 25-26
|
|
294
|
+
* Consent must be freely given, specific, informed, and unambiguous
|
|
295
|
+
*/
|
|
296
|
+
/**
|
|
297
|
+
* Represents a consent option that can be presented to users
|
|
298
|
+
*/
|
|
299
|
+
declare interface ConsentOption {
|
|
300
|
+
/** Unique identifier for the consent option */
|
|
301
|
+
id: string;
|
|
302
|
+
/** Display label for the consent option */
|
|
303
|
+
label: string;
|
|
304
|
+
/** Detailed description of what this consent option covers */
|
|
305
|
+
description: string;
|
|
306
|
+
/** Whether this consent option is required (cannot be declined) */
|
|
307
|
+
required: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* The specific purpose for which data will be processed
|
|
310
|
+
* NDPA Section 25(2) requires consent to be specific to each purpose
|
|
311
|
+
*/
|
|
312
|
+
purpose: string;
|
|
313
|
+
/**
|
|
314
|
+
* Default state of the consent option
|
|
315
|
+
* @default false
|
|
316
|
+
*/
|
|
317
|
+
defaultValue?: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* Categories of personal data covered by this consent option
|
|
320
|
+
*/
|
|
321
|
+
dataCategories?: string[];
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Represents the user's consent settings
|
|
326
|
+
*/
|
|
327
|
+
declare interface ConsentSettings {
|
|
328
|
+
/** Map of consent option IDs to boolean values indicating consent status */
|
|
329
|
+
consents: Record<string, boolean>;
|
|
330
|
+
/** Timestamp when consent was last updated */
|
|
331
|
+
timestamp: number;
|
|
332
|
+
/** Version of the consent form that was accepted */
|
|
333
|
+
version: string;
|
|
334
|
+
/** Method used to collect consent (e.g., "banner", "settings", "api") */
|
|
335
|
+
method: string;
|
|
336
|
+
/** Whether the user has actively made a choice (as opposed to default settings) */
|
|
337
|
+
hasInteracted: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* The lawful basis under which processing is conducted
|
|
340
|
+
* Required by NDPA Section 25(1)
|
|
341
|
+
*/
|
|
342
|
+
lawfulBasis?: LawfulBasisType;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Represents the data submitted by the DSR request form.
|
|
347
|
+
*/
|
|
348
|
+
declare interface DSRFormSubmission {
|
|
349
|
+
/** The selected request type identifier */
|
|
350
|
+
requestType: string;
|
|
351
|
+
/** Data subject personal information */
|
|
352
|
+
dataSubject: {
|
|
353
|
+
fullName: string;
|
|
354
|
+
email: string;
|
|
355
|
+
phone?: string;
|
|
356
|
+
identifierType: string;
|
|
357
|
+
identifierValue: string;
|
|
358
|
+
};
|
|
359
|
+
/** Additional information provided for the selected request type */
|
|
360
|
+
additionalInfo?: Record<string, string | number | boolean | null>;
|
|
361
|
+
/** Timestamp (ms) when the form was submitted */
|
|
362
|
+
submittedAt: number;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export declare const DSRRequestForm: React__default.FC<DSRRequestFormProps>;
|
|
366
|
+
|
|
367
|
+
export declare interface DSRRequestFormClassNames {
|
|
368
|
+
root?: string;
|
|
369
|
+
title?: string;
|
|
370
|
+
description?: string;
|
|
371
|
+
form?: string;
|
|
372
|
+
fieldGroup?: string;
|
|
373
|
+
label?: string;
|
|
374
|
+
input?: string;
|
|
375
|
+
select?: string;
|
|
376
|
+
textarea?: string;
|
|
377
|
+
submitButton?: string;
|
|
378
|
+
/** Alias for submitButton */
|
|
379
|
+
primaryButton?: string;
|
|
380
|
+
successMessage?: string;
|
|
381
|
+
/** Custom class applied when isSubmitting is true (e.g. a loading overlay) */
|
|
382
|
+
loadingOverlay?: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export declare interface DSRRequestFormProps {
|
|
386
|
+
/**
|
|
387
|
+
* Array of request types that can be submitted
|
|
388
|
+
*/
|
|
389
|
+
requestTypes: RequestType[];
|
|
390
|
+
/**
|
|
391
|
+
* Callback function called when form is submitted
|
|
392
|
+
*/
|
|
393
|
+
onSubmit: (data: DSRFormSubmission) => void;
|
|
394
|
+
/**
|
|
395
|
+
* Callback function called when form validation fails
|
|
396
|
+
*/
|
|
397
|
+
onValidationError?: (errors: Record<string, string>) => void;
|
|
398
|
+
/**
|
|
399
|
+
* Title displayed on the form
|
|
400
|
+
* @default "Submit a Data Subject Request"
|
|
401
|
+
*/
|
|
402
|
+
title?: string;
|
|
403
|
+
/**
|
|
404
|
+
* Description text displayed on the form
|
|
405
|
+
* @default "Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36."
|
|
406
|
+
*/
|
|
407
|
+
description?: string;
|
|
408
|
+
/**
|
|
409
|
+
* Text for the submit button
|
|
410
|
+
* @default "Submit Request"
|
|
411
|
+
*/
|
|
412
|
+
submitButtonText?: string;
|
|
413
|
+
/**
|
|
414
|
+
* Custom CSS class for the form
|
|
415
|
+
*/
|
|
416
|
+
className?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Custom CSS class for the submit button
|
|
419
|
+
*/
|
|
420
|
+
buttonClassName?: string;
|
|
421
|
+
/**
|
|
422
|
+
* Whether to show a confirmation message after submission
|
|
423
|
+
* @default true
|
|
424
|
+
*/
|
|
425
|
+
showConfirmation?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* Confirmation message to display after submission
|
|
428
|
+
* @default "Your request has been submitted successfully. You will receive a confirmation email shortly."
|
|
429
|
+
*/
|
|
430
|
+
confirmationMessage?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Whether to require identity verification
|
|
433
|
+
* @default true
|
|
434
|
+
*/
|
|
435
|
+
requireIdentityVerification?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* Types of identifiers accepted for verification
|
|
438
|
+
* @default ["email", "account", "customer_id"]
|
|
439
|
+
*/
|
|
440
|
+
identifierTypes?: Array<{
|
|
441
|
+
id: string;
|
|
442
|
+
label: string;
|
|
443
|
+
}>;
|
|
444
|
+
/**
|
|
445
|
+
* Whether to collect additional contact information
|
|
446
|
+
* @default true
|
|
447
|
+
*/
|
|
448
|
+
collectAdditionalContact?: boolean;
|
|
449
|
+
/**
|
|
450
|
+
* Custom labels for form fields
|
|
451
|
+
*/
|
|
452
|
+
labels?: {
|
|
453
|
+
name?: string;
|
|
454
|
+
email?: string;
|
|
455
|
+
requestType?: string;
|
|
456
|
+
description?: string;
|
|
457
|
+
submit?: string;
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
461
|
+
*/
|
|
462
|
+
classNames?: DSRRequestFormClassNames;
|
|
463
|
+
/**
|
|
464
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
465
|
+
* can style from scratch using classNames.
|
|
466
|
+
*/
|
|
467
|
+
unstyled?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* Whether the form is currently submitting.
|
|
470
|
+
* When true, the submit button is disabled and shows "Submitting..." text.
|
|
471
|
+
*/
|
|
472
|
+
isSubmitting?: boolean;
|
|
473
|
+
/**
|
|
474
|
+
* Default values to pre-fill form fields.
|
|
475
|
+
* Useful for editing existing requests or pre-populating known data.
|
|
476
|
+
*/
|
|
477
|
+
defaultValues?: Partial<DSRFormSubmission>;
|
|
478
|
+
/**
|
|
479
|
+
* Callback fired when the form is reset via the Reset button.
|
|
480
|
+
* To fully remount the component (clearing all internal state),
|
|
481
|
+
* change the `key` prop from the parent.
|
|
482
|
+
*/
|
|
483
|
+
onReset?: () => void;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Lawful basis for processing personal data per NDPA Section 25(1)
|
|
488
|
+
*/
|
|
489
|
+
declare type LawfulBasisType = 'consent' | 'contract' | 'legal_obligation' | 'vital_interests' | 'public_interest' | 'legitimate_interests';
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Represents a type of data subject request (detailed configuration)
|
|
493
|
+
*/
|
|
494
|
+
declare interface RequestType {
|
|
495
|
+
/** Unique identifier for the request type */
|
|
496
|
+
id: string;
|
|
497
|
+
/** Display name for the request type */
|
|
498
|
+
name: string;
|
|
499
|
+
/** Description of what this request type entails */
|
|
500
|
+
description: string;
|
|
501
|
+
/**
|
|
502
|
+
* NDPA section reference (e.g., "Section 30" for access requests)
|
|
503
|
+
*/
|
|
504
|
+
ndpaSection?: string;
|
|
505
|
+
/**
|
|
506
|
+
* Estimated time to fulfill this type of request (in days)
|
|
507
|
+
* NDPA requires response within 30 days
|
|
508
|
+
*/
|
|
509
|
+
estimatedCompletionTime: number;
|
|
510
|
+
/** Whether additional information is required for this request type */
|
|
511
|
+
requiresAdditionalInfo: boolean;
|
|
512
|
+
/** Custom fields required for this request type */
|
|
513
|
+
additionalFields?: Array<{
|
|
514
|
+
id: string;
|
|
515
|
+
label: string;
|
|
516
|
+
type: 'text' | 'textarea' | 'select' | 'checkbox' | 'file';
|
|
517
|
+
options?: string[];
|
|
518
|
+
required: boolean;
|
|
519
|
+
placeholder?: string;
|
|
520
|
+
}>;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export { }
|
package/dist/unstyled.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkRLYTX3MM_js=require('./chunk-RLYTX3MM.js'),
|
|
2
|
+
'use strict';var chunkRLYTX3MM_js=require('./chunk-RLYTX3MM.js'),chunkXIM7KMD6_js=require('./chunk-XIM7KMD6.js'),chunkZPKVLTSX_js=require('./chunk-ZPKVLTSX.js');require('./chunk-I54CDQGN.js'),require('./chunk-E64TU6IU.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),P=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var P__default=/*#__PURE__*/_interopDefault(P);function e(C,R){let n=d=>{var s=d,{unstyled:l=true}=s,c=chunkMQFZHA2D_js.c(s,["unstyled"]);return P__default.default.createElement(C,chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},c),{unstyled:l}))};return n.displayName=R,n}var u=e(chunkXIM7KMD6_js.a,"UnstyledConsentBanner"),y=e(chunkRLYTX3MM_js.a,"UnstyledConsentManager"),S=e(chunkZPKVLTSX_js.a,"UnstyledDSRRequestForm");exports.ConsentBanner=u;exports.ConsentManager=y;exports.DSRRequestForm=S;//# sourceMappingURL=unstyled.js.map
|
|
3
3
|
//# sourceMappingURL=unstyled.js.map
|
package/dist/unstyled.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {a as a$2}from'./chunk-EPT2K355.mjs';import {a as a$1}from'./chunk-
|
|
2
|
+
import {a as a$2}from'./chunk-EPT2K355.mjs';import {a as a$1}from'./chunk-GN5C32JB.mjs';import {a as a$3}from'./chunk-6HZL2WDU.mjs';import'./chunk-GKKAK6ES.mjs';import'./chunk-AYKLAEOU.mjs';import {c,b,a}from'./chunk-WWT2ZSNU.mjs';import P from'react';function e(C,R){let n=d=>{var s=d,{unstyled:l=true}=s,c$1=c(s,["unstyled"]);return P.createElement(C,b(a({},c$1),{unstyled:l}))};return n.displayName=R,n}var u=e(a$1,"UnstyledConsentBanner"),y=e(a$2,"UnstyledConsentManager"),S=e(a$3,"UnstyledDSRRequestForm");export{u as ConsentBanner,y as ConsentManager,S as DSRRequestForm};//# sourceMappingURL=unstyled.mjs.map
|
|
3
3
|
//# sourceMappingURL=unstyled.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tantainnovative/ndpr-toolkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Nigeria Data Protection Toolkit — enterprise-grade compliance components for the Nigeria Data Protection Act (NDPA) 2023",
|
|
6
6
|
"keywords": [
|
|
@@ -231,6 +231,7 @@
|
|
|
231
231
|
"devDependencies": {
|
|
232
232
|
"@mdx-js/loader": "^3.1.1",
|
|
233
233
|
"@mdx-js/react": "^3.1.1",
|
|
234
|
+
"@microsoft/api-extractor": "^7.58.7",
|
|
234
235
|
"@next/mdx": "^16.2.2",
|
|
235
236
|
"@radix-ui/react-label": "^2.1.8",
|
|
236
237
|
"@radix-ui/react-slot": "^1.2.4",
|
|
@@ -275,11 +276,10 @@
|
|
|
275
276
|
"tw-animate-css": "^1.4.0",
|
|
276
277
|
"typescript": "^5.0.0"
|
|
277
278
|
},
|
|
278
|
-
"dependencies": {},
|
|
279
279
|
"scripts": {
|
|
280
280
|
"dev": "next dev --turbopack",
|
|
281
281
|
"build": "next build && node scripts/post-build.js",
|
|
282
|
-
"build:lib": "tsup && cp packages/ndpr-toolkit/src/styles.d.ts dist/styles.d.ts",
|
|
282
|
+
"build:lib": "tsup && cp packages/ndpr-toolkit/src/styles.d.ts dist/styles.d.ts && node scripts/rollup-dts.mjs",
|
|
283
283
|
"start": "next start",
|
|
284
284
|
"lint": "next lint .",
|
|
285
285
|
"test": "jest --passWithNoTests",
|