@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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [3.5.0](https://github.com/mr-tanta/ndpr-toolkit/compare/v3.4.1...v3.5.0) (2026-05-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **ndpr-toolkit:** persist alias, validateDsrSubmission, hooks plugin v7, dts rollup ([f1fd29d](https://github.com/mr-tanta/ndpr-toolkit/commit/f1fd29d7ccd3fc6002ddd762d9dbc4c483e1952c))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
* **site:** fix homepage + docs code snippets to match published API ([0ed4b13](https://github.com/mr-tanta/ndpr-toolkit/commit/0ed4b1305e57603a20bb08004479e1862740d14d))
|
|
16
|
+
|
|
17
|
+
## [3.4.1](https://github.com/mr-tanta/ndpr-toolkit/compare/v3.4.0...v3.4.1) (2026-05-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **ndpr-toolkit:** {{var}} substitution + dark-mode opt-in + use-client + effectiveDate ([d8deab0](https://github.com/mr-tanta/ndpr-toolkit/commit/d8deab0876e308dd0a8fc9aef3b5dcc757c32884))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Documentation
|
|
26
|
+
|
|
27
|
+
* **phase1:** annotate triage doc with v3.4.0 ship status ([9fb1744](https://github.com/mr-tanta/ndpr-toolkit/commit/9fb17449413ff418f263c9ac3bfbf153db438fb4))
|
|
28
|
+
* **readme:** sync to v3.4.0 — styled defaults, /server entry, real logo ([bf7f632](https://github.com/mr-tanta/ndpr-toolkit/commit/bf7f63239ebac623868f20d69c7d2229303d5869))
|
|
29
|
+
|
|
5
30
|
## [3.4.0](https://github.com/mr-tanta/ndpr-toolkit/compare/v3.3.1...v3.4.0) (2026-05-03)
|
|
6
31
|
|
|
7
32
|
|
package/README.md
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
|
|
6
6
|
[](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](#)
|
|
10
10
|
[](https://bundlephobia.com/package/@tantainnovative/ndpr-toolkit)
|
|
11
11
|
|
|
12
12
|
v3 ships **zero-config presets**, **pluggable storage adapters**, **compound components**, and a **compliance score engine** — eight production-ready modules covering consent, data subject rights, DPIA, breach notification, privacy policies, lawful basis, cross-border transfers, and ROPA.
|
|
13
13
|
|
|
14
|
-
**[Documentation](https://ndprtoolkit.com.ng)** | **[Live Demos](https://ndprtoolkit.com.ng/ndpr-demos)** | **[npm](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)** | **[Blog](https://ndprtoolkit.com.ng/blog)**
|
|
14
|
+
**[Documentation](https://ndprtoolkit.com.ng)** | **[Live Demos](https://ndprtoolkit.com.ng/ndpr-demos)** | **[npm](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)** | **[Blog](https://ndprtoolkit.com.ng/blog)** | **[v3.4.0 Release](https://github.com/mr-tanta/ndpr-toolkit/releases/tag/v3.4.0)**
|
|
15
|
+
|
|
16
|
+
> **What's new in 3.4.0:** components now ship styled defaults via a real stylesheet — Tailwind is no longer required. Add `import "@tantainnovative/ndpr-toolkit/styles";` once in your app entry. Plus a new `/server` subpath for RSC-safe pure-logic imports (validators, generators, scoring) with zero React in the import graph. Backward-compatible at the component API level. Full notes on the [release page](https://github.com/mr-tanta/ndpr-toolkit/releases/tag/v3.4.0).
|
|
15
17
|
|
|
16
18
|
<p align="center">
|
|
17
19
|
<img src="public/screenshots/hero.png" alt="NDPA Toolkit — NDPA Compliance Made Beautiful" width="800" />
|
|
@@ -76,7 +78,16 @@ That's it. NDPA-compliant consent with server-side persistence in under 20 lines
|
|
|
76
78
|
pnpm add @tantainnovative/ndpr-toolkit
|
|
77
79
|
```
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
Add the stylesheet import once in your app entry so components render with default styles:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// app/layout.tsx (Next.js App Router) or src/main.tsx (Vite/CRA)
|
|
85
|
+
import "@tantainnovative/ndpr-toolkit/styles";
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The stylesheet is opinionated but token-driven — override any `--ndpr-*` CSS custom property to theme. Skip this import only if you're using `/unstyled` to bring your own design system.
|
|
89
|
+
|
|
90
|
+
Install UI peer dependencies (only needed if you use the higher-level Radix-based components from `/presets`):
|
|
80
91
|
|
|
81
92
|
```bash
|
|
82
93
|
pnpm add @radix-ui/react-switch @radix-ui/react-tabs @radix-ui/react-label @radix-ui/react-slot lucide-react tailwind-merge clsx class-variance-authority
|
|
@@ -137,12 +148,27 @@ import { useConsent } from '@tantainnovative/ndpr-toolkit/hooks';
|
|
|
137
148
|
const { hasConsent, acceptAll, rejectAll, shouldShowBanner } = useConsent({ options });
|
|
138
149
|
```
|
|
139
150
|
|
|
140
|
-
###
|
|
151
|
+
### Server — strictly RSC-safe, zero React
|
|
152
|
+
|
|
153
|
+
The recommended entry for backend and serverless contexts. Pure validators, generators, scoring, locales, and adapters — no React in the import graph. Safe to call from a Next.js Server Component, Edge Function, NestJS controller, or Cloudflare Worker.
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
import {
|
|
157
|
+
validateConsent,
|
|
158
|
+
generatePolicyText,
|
|
159
|
+
exportHTML,
|
|
160
|
+
getComplianceScore,
|
|
161
|
+
} from '@tantainnovative/ndpr-toolkit/server';
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Build-output guard tests assert this entry never carries a `"use client"` directive and never imports `react` — the RSC-safety contract is structurally enforced.
|
|
165
|
+
|
|
166
|
+
### Core — types + utilities + Provider
|
|
141
167
|
|
|
142
|
-
|
|
168
|
+
Adds the `NDPRProvider` React Context on top of `/server`'s pure surface. Use when you want types and validators alongside the provider in the same import.
|
|
143
169
|
|
|
144
170
|
```ts
|
|
145
|
-
import { validateConsent, getComplianceScore } from '@tantainnovative/ndpr-toolkit/core';
|
|
171
|
+
import { NDPRProvider, validateConsent, getComplianceScore } from '@tantainnovative/ndpr-toolkit/core';
|
|
146
172
|
```
|
|
147
173
|
|
|
148
174
|
### Adapters — pluggable storage
|
|
@@ -312,60 +338,76 @@ Every module has an interactive demo. No signup, no setup — try them instantly
|
|
|
312
338
|
|
|
313
339
|
## Styling & Customization
|
|
314
340
|
|
|
315
|
-
|
|
341
|
+
As of 3.4.0, components ship semantic BEM-style class names (`.ndpr-consent-banner`, `.ndpr-form-field__input`, etc.) backed by a real stylesheet. **Tailwind is no longer required** — the package works in any host so long as you import the stylesheet once.
|
|
316
342
|
|
|
317
|
-
**Default
|
|
343
|
+
**Default — works in any host:**
|
|
344
|
+
```ts
|
|
345
|
+
// Once in your app entry
|
|
346
|
+
import "@tantainnovative/ndpr-toolkit/styles";
|
|
347
|
+
```
|
|
318
348
|
```tsx
|
|
319
|
-
<ConsentBanner options={options} onSave={handleSave} />
|
|
349
|
+
<ConsentBanner options={options} onSave={handleSave} variant="card" position="bottom" />
|
|
320
350
|
```
|
|
321
351
|
|
|
322
|
-
**
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}}
|
|
331
|
-
/>
|
|
352
|
+
**Theme via CSS custom properties:**
|
|
353
|
+
```css
|
|
354
|
+
/* Override any --ndpr-* token at :root, [data-theme="dark"], or scoped to a parent. */
|
|
355
|
+
:root {
|
|
356
|
+
--ndpr-primary: 22 163 74; /* RGB triplet — green-600 */
|
|
357
|
+
--ndpr-radius: 1rem;
|
|
358
|
+
--ndpr-font-sans: "Inter", system-ui, sans-serif;
|
|
359
|
+
}
|
|
332
360
|
```
|
|
333
361
|
|
|
334
|
-
|
|
362
|
+
Light + dark mode auto-switch via `prefers-color-scheme`, plus an explicit opt-in via `data-theme="dark"` or `.dark` on any ancestor.
|
|
363
|
+
|
|
364
|
+
**Per-instance override via slot map:**
|
|
335
365
|
```tsx
|
|
336
366
|
<ConsentBanner
|
|
337
367
|
options={options}
|
|
338
368
|
onSave={handleSave}
|
|
339
|
-
unstyled
|
|
340
369
|
classNames={{
|
|
341
370
|
root: "my-consent-banner",
|
|
342
371
|
acceptButton: "btn btn-primary",
|
|
372
|
+
rejectButton: "btn btn-secondary",
|
|
343
373
|
}}
|
|
344
374
|
/>
|
|
345
375
|
```
|
|
346
376
|
|
|
377
|
+
**Bring your own design system entirely:**
|
|
378
|
+
```tsx
|
|
379
|
+
import { ConsentBanner } from '@tantainnovative/ndpr-toolkit/unstyled';
|
|
380
|
+
|
|
381
|
+
<ConsentBanner options={options} onSave={handleSave} classNames={{ /* yours */ }} />
|
|
382
|
+
```
|
|
383
|
+
The `/unstyled` entry defaults `unstyled` to `true`, stripping every `.ndpr-*` class so your CSS applies unfiltered. ARIA, focus management, and `data-ndpr-component` attributes are preserved (those are part of the contract, not styling).
|
|
384
|
+
|
|
347
385
|
Each component exports its `ClassNames` TypeScript interface for autocomplete. Full reference in the [docs](https://ndprtoolkit.com.ng/docs/guides/styling-customization).
|
|
348
386
|
|
|
349
387
|
---
|
|
350
388
|
|
|
351
389
|
## Available Import Paths
|
|
352
390
|
|
|
353
|
-
| Path | What you get | Dependencies |
|
|
354
|
-
|
|
355
|
-
| `.` (default) | Everything |
|
|
356
|
-
| `/
|
|
357
|
-
| `/
|
|
358
|
-
| `/
|
|
359
|
-
| `/
|
|
360
|
-
| `/
|
|
361
|
-
| `/
|
|
362
|
-
| `/
|
|
363
|
-
| `/
|
|
364
|
-
| `/
|
|
365
|
-
| `/
|
|
366
|
-
| `/
|
|
367
|
-
| `/
|
|
368
|
-
| `/
|
|
391
|
+
| Path | What you get | Dependencies | RSC-safe |
|
|
392
|
+
|------|-------------|--------------|:--------:|
|
|
393
|
+
| `.` (default) | Everything | `react`, optional Radix peers for `/presets` | No |
|
|
394
|
+
| `/server` | **Pure validators, generators, scoring, locales, adapters, types — zero React** | `tslib` | **Yes** |
|
|
395
|
+
| `/core` | Types, utility functions, NDPRProvider | `react`[^core] | Partial |
|
|
396
|
+
| `/hooks` | React hooks for all 8 modules | `react` | No |
|
|
397
|
+
| `/presets` | Zero-config preset components | `react`, Radix peers | No |
|
|
398
|
+
| `/adapters` | Storage adapters (localStorage, sessionStorage, cookie, api, memory, composeAdapters) | none | Yes |
|
|
399
|
+
| `/consent` | ConsentBanner, ConsentManager, `Consent.*` compound API, useConsent | `react` | No |
|
|
400
|
+
| `/dsr` | DSR components + hook | `react` | No |
|
|
401
|
+
| `/dpia` | DPIA components + hook | `react` | No |
|
|
402
|
+
| `/breach` | Breach components + hook | `react` | No |
|
|
403
|
+
| `/policy` | Policy components + hook | `react`, `jspdf`, `docx` (optional) | No |
|
|
404
|
+
| `/lawful-basis` | Lawful basis component + hook | `react` | No |
|
|
405
|
+
| `/cross-border` | Cross-border component + hook | `react` | No |
|
|
406
|
+
| `/ropa` | ROPA component + hook | `react` | No |
|
|
407
|
+
| `/unstyled` | All published components with `unstyled` defaulted to `true` | `react` | No |
|
|
408
|
+
| `/styles` | Default CSS stylesheet — `import "@tantainnovative/ndpr-toolkit/styles"` once in your app entry | none | N/A |
|
|
409
|
+
|
|
410
|
+
[^core]: `/core` re-exports the React `NDPRProvider` for backward compatibility. For strictly server-side imports use `/server` — it carries the same pure validators with no React surface.
|
|
369
411
|
|
|
370
412
|
---
|
|
371
413
|
|
package/dist/adapters.d.mts
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare function
|
|
20
|
-
|
|
21
|
-
declare function memoryAdapter<T = unknown>(initialData?: T): StorageAdapter<T>;
|
|
22
|
-
|
|
23
|
-
declare function
|
|
24
|
-
|
|
25
|
-
export
|
|
1
|
+
export declare function apiAdapter<T = unknown>(endpoint: string, options?: ApiAdapterOptions): StorageAdapter<T>;
|
|
2
|
+
|
|
3
|
+
export declare interface ApiAdapterOptions {
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare function composeAdapters<T = unknown>(primary: StorageAdapter<T>, ...secondaries: StorageAdapter<T>[]): StorageAdapter<T>;
|
|
8
|
+
|
|
9
|
+
export declare function cookieAdapter<T = unknown>(key: string, options?: CookieAdapterOptions): StorageAdapter<T>;
|
|
10
|
+
|
|
11
|
+
export declare interface CookieAdapterOptions {
|
|
12
|
+
domain?: string;
|
|
13
|
+
path?: string;
|
|
14
|
+
expires?: number;
|
|
15
|
+
secure?: boolean;
|
|
16
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function localStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
|
|
20
|
+
|
|
21
|
+
export declare function memoryAdapter<T = unknown>(initialData?: T): StorageAdapter<T>;
|
|
22
|
+
|
|
23
|
+
export declare function sessionStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
|
|
24
|
+
|
|
25
|
+
export declare interface StorageAdapter<T = unknown> {
|
|
26
|
+
/** Load persisted data. Called once on hook mount. */
|
|
27
|
+
load(): T | null | Promise<T | null>;
|
|
28
|
+
/** Persist data. Called on every state change. */
|
|
29
|
+
save(data: T): void | Promise<void>;
|
|
30
|
+
/** Clear persisted data. Called on reset. */
|
|
31
|
+
remove(): void | Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { }
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare function
|
|
20
|
-
|
|
21
|
-
declare function memoryAdapter<T = unknown>(initialData?: T): StorageAdapter<T>;
|
|
22
|
-
|
|
23
|
-
declare function
|
|
24
|
-
|
|
25
|
-
export
|
|
1
|
+
export declare function apiAdapter<T = unknown>(endpoint: string, options?: ApiAdapterOptions): StorageAdapter<T>;
|
|
2
|
+
|
|
3
|
+
export declare interface ApiAdapterOptions {
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare function composeAdapters<T = unknown>(primary: StorageAdapter<T>, ...secondaries: StorageAdapter<T>[]): StorageAdapter<T>;
|
|
8
|
+
|
|
9
|
+
export declare function cookieAdapter<T = unknown>(key: string, options?: CookieAdapterOptions): StorageAdapter<T>;
|
|
10
|
+
|
|
11
|
+
export declare interface CookieAdapterOptions {
|
|
12
|
+
domain?: string;
|
|
13
|
+
path?: string;
|
|
14
|
+
expires?: number;
|
|
15
|
+
secure?: boolean;
|
|
16
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function localStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
|
|
20
|
+
|
|
21
|
+
export declare function memoryAdapter<T = unknown>(initialData?: T): StorageAdapter<T>;
|
|
22
|
+
|
|
23
|
+
export declare function sessionStorageAdapter<T = unknown>(key: string): StorageAdapter<T>;
|
|
24
|
+
|
|
25
|
+
export declare interface StorageAdapter<T = unknown> {
|
|
26
|
+
/** Load persisted data. Called once on hook mount. */
|
|
27
|
+
load(): T | null | Promise<T | null>;
|
|
28
|
+
/** Persist data. Called on every state change. */
|
|
29
|
+
save(data: T): void | Promise<void>;
|
|
30
|
+
/** Clear persisted data. Called on reset. */
|
|
31
|
+
remove(): void | Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { }
|