@tantainnovative/ndpr-toolkit 3.3.1 → 3.4.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 +542 -0
- package/README.md +80 -38
- package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
- package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
- package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
- package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
- package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
- package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/breach.js +2 -1
- package/dist/breach.mjs +2 -1
- package/dist/chunk-2L7BSG7G.mjs +2 -0
- package/dist/chunk-3NQQSU4P.js +2 -0
- package/dist/chunk-3VQAYQR7.js +7 -0
- package/dist/chunk-4BOEFDDE.js +4 -0
- package/dist/chunk-5HL4UBFV.js +2 -0
- package/dist/chunk-6HZL2WDU.mjs +2 -0
- package/dist/chunk-6QPRDQZF.js +2 -0
- package/dist/chunk-74Z23WUA.mjs +2 -0
- package/dist/chunk-AHSMDPG5.js +132 -0
- package/dist/chunk-ASLMPY54.js +3 -0
- package/dist/chunk-BN77GP4W.mjs +2 -0
- package/dist/chunk-C5QO3SX4.js +2 -0
- package/dist/chunk-CISJAQ6W.mjs +2 -0
- package/dist/chunk-DUY6F3GT.mjs +94 -0
- package/dist/chunk-EHAZIKDX.js +81 -0
- package/dist/chunk-EPT2K355.mjs +2 -0
- package/dist/chunk-HGGLW5TE.js +2 -0
- package/dist/chunk-HQSU7LGM.js +94 -0
- package/dist/chunk-I557S566.mjs +15 -0
- package/dist/chunk-IZCWCE7W.mjs +2 -0
- package/dist/chunk-JBSCER34.js +2 -0
- package/dist/chunk-JFFOPHU3.mjs +318 -0
- package/dist/chunk-KF3EFJEF.mjs +3 -0
- package/dist/chunk-LJNNPAFU.mjs +2 -0
- package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
- package/dist/chunk-LSNL4XR5.js +2 -0
- package/dist/chunk-MLOWRZXO.mjs +4 -0
- package/dist/chunk-NFJ4CB63.mjs +3 -0
- package/dist/chunk-NQNFS3QI.js +7 -0
- package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
- package/dist/chunk-P6QAFBCV.js +2 -0
- package/dist/chunk-R5FW5XUQ.mjs +2 -0
- package/dist/chunk-RLYTX3MM.js +2 -0
- package/dist/chunk-RRVKUCFR.mjs +2 -0
- package/dist/chunk-RXL6CZAI.js +2 -0
- package/dist/chunk-RY3PGVLZ.mjs +2 -0
- package/dist/chunk-SUEGUY35.js +2 -0
- package/dist/chunk-SYMQJO2W.mjs +7 -0
- package/dist/chunk-TCN22KYP.mjs +7 -0
- package/dist/chunk-UHTJ6UFW.js +2 -0
- package/dist/chunk-VTITKWGX.mjs +2 -0
- package/dist/chunk-WH6ZMUOS.mjs +81 -0
- package/dist/chunk-WTJGLNTB.js +3 -0
- package/dist/chunk-XHROISIF.mjs +2 -0
- package/dist/chunk-YPKUHSK4.js +15 -0
- package/dist/chunk-Z73T6MWY.js +318 -0
- package/dist/chunk-ZLSWOFAY.mjs +132 -0
- package/dist/chunk-ZPKVLTSX.js +2 -0
- package/dist/consent.d.mts +6 -4
- package/dist/consent.d.ts +6 -4
- package/dist/consent.js +2 -1
- package/dist/consent.mjs +2 -1
- package/dist/core.d.mts +6 -29
- package/dist/core.d.ts +6 -29
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.js +2 -1
- package/dist/cross-border.mjs +2 -1
- package/dist/docx-4n8g4zul.d.mts +64 -0
- package/dist/docx-VvcTLYZM.d.ts +64 -0
- package/dist/dpia.js +2 -1
- package/dist/dpia.mjs +2 -1
- package/dist/dsr.js +2 -1
- package/dist/dsr.mjs +2 -1
- package/dist/hooks.d.mts +3 -3
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +2 -1
- package/dist/hooks.mjs +2 -1
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/lawful-basis.js +2 -1
- package/dist/lawful-basis.mjs +2 -1
- package/dist/locale-CxJx2tzn.d.mts +25 -0
- package/dist/locale-DSkrtf-c.d.ts +25 -0
- package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-5qTfp2z4.d.mts} +21 -1
- package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-DzPxskOK.d.ts} +21 -1
- package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-9tCb7VU7.d.ts} +4 -2
- package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-CBWcJv-R.d.mts} +4 -2
- package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
- package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
- package/dist/policy.d.mts +36 -71
- package/dist/policy.d.ts +36 -71
- package/dist/policy.js +2 -1
- package/dist/policy.mjs +2 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +2 -1
- package/dist/presets.mjs +2 -1
- package/dist/ropa.js +2 -1
- package/dist/ropa.mjs +2 -1
- package/dist/sanitize-CxxwKxAx.d.mts +94 -0
- package/dist/sanitize-CxxwKxAx.d.ts +94 -0
- package/dist/server.d.mts +24 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.js +2 -0
- package/dist/server.mjs +2 -0
- package/dist/styles.css +1423 -31
- package/dist/styling-BMDGQDgS.d.mts +64 -0
- package/dist/styling-BaoQtV06.d.ts +64 -0
- package/dist/unstyled.d.mts +52 -19
- package/dist/unstyled.d.ts +52 -19
- package/dist/unstyled.js +2 -1
- package/dist/unstyled.mjs +2 -1
- package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BSLyltzZ.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-CL7C7MTZ.d.ts} +1 -1
- package/dist/{useDefaultPrivacyPolicy-ySWU7nc-.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +30 -9
- package/dist/{useDefaultPrivacyPolicy-DvCbeEl1.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +30 -9
- package/package.json +14 -2
- package/dist/chunk-25OOUES4.js +0 -2
- package/dist/chunk-4JKTIR33.mjs +0 -2
- package/dist/chunk-5BUS6AI7.js +0 -2
- package/dist/chunk-5ECDPRSZ.js +0 -7
- package/dist/chunk-6YN73KR7.mjs +0 -2
- package/dist/chunk-CDZDT2OS.mjs +0 -320
- package/dist/chunk-CWUPGY3M.mjs +0 -3
- package/dist/chunk-CYU6YUJQ.mjs +0 -81
- package/dist/chunk-EKHBORAH.js +0 -81
- package/dist/chunk-ENIMJ6SQ.js +0 -2
- package/dist/chunk-FLKJSGR7.mjs +0 -94
- package/dist/chunk-FWLPJ5YI.js +0 -94
- package/dist/chunk-GCQRHMTQ.mjs +0 -144
- package/dist/chunk-GMLCWGNJ.js +0 -7
- package/dist/chunk-GXLSOZCH.mjs +0 -2
- package/dist/chunk-LETEUS5X.mjs +0 -2
- package/dist/chunk-LU4PFST7.js +0 -144
- package/dist/chunk-NBSVFQ5G.js +0 -2
- package/dist/chunk-OYR3L4XS.mjs +0 -7
- package/dist/chunk-QF6XNKU6.mjs +0 -2
- package/dist/chunk-QJ3JNHO7.js +0 -2
- package/dist/chunk-QNCGRCAX.mjs +0 -2
- package/dist/chunk-SAA7UVI2.js +0 -3
- package/dist/chunk-TI2M7H6R.mjs +0 -7
- package/dist/chunk-TXXWCB5O.js +0 -320
- package/dist/chunk-UGY5ZYUG.js +0 -2
- package/dist/chunk-UO6QPJLH.js +0 -2
- package/dist/chunk-UX6ZZNEM.mjs +0 -3
- package/dist/chunk-XFUEZ3MP.mjs +0 -2
- package/dist/chunk-XHSHPB74.js +0 -2
- package/dist/chunk-YCX6BFOQ.js +0 -2
- package/dist/chunk-YURSF2YO.mjs +0 -2
- package/dist/chunk-YZXUAIYN.js +0 -3
- package/dist/chunk-ZT7KNFAU.mjs +0 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { a as ConsentSettings, b as ConsentStorageOptions } from './consent-CmVzqZUk.mjs';
|
|
3
|
+
|
|
4
|
+
interface ConsentStorageClassNames {
|
|
5
|
+
root?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ConsentStorageProps {
|
|
8
|
+
/**
|
|
9
|
+
* Current consent settings
|
|
10
|
+
*/
|
|
11
|
+
settings: ConsentSettings;
|
|
12
|
+
/**
|
|
13
|
+
* Storage options for consent settings
|
|
14
|
+
*/
|
|
15
|
+
storageOptions?: ConsentStorageOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called when settings are loaded from storage
|
|
18
|
+
*/
|
|
19
|
+
onLoad?: (settings: ConsentSettings | null) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function called when settings are saved to storage
|
|
22
|
+
*/
|
|
23
|
+
onSave?: (settings: ConsentSettings) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to automatically save settings to storage
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
autoSave?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to automatically load settings from storage on mount
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
autoLoad?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
36
|
+
*/
|
|
37
|
+
classNames?: ConsentStorageClassNames;
|
|
38
|
+
/**
|
|
39
|
+
* When true, all default classes are removed so consumers
|
|
40
|
+
* can style from scratch using classNames.
|
|
41
|
+
*/
|
|
42
|
+
unstyled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Children to render
|
|
45
|
+
* Can be either React nodes or a render prop function that receives storage methods
|
|
46
|
+
*/
|
|
47
|
+
children?: React__default.ReactNode | ((props: {
|
|
48
|
+
loadSettings: () => ConsentSettings | null;
|
|
49
|
+
saveSettings: (settings: ConsentSettings) => void;
|
|
50
|
+
clearSettings: () => void;
|
|
51
|
+
loaded: boolean;
|
|
52
|
+
}) => React__default.ReactNode);
|
|
53
|
+
}
|
|
54
|
+
declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React__default.ReactElement | null;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Resolves class names for a component section.
|
|
58
|
+
* If unstyled is true, only the override class is used (or empty string).
|
|
59
|
+
* If an override is provided, it fully REPLACES the default — no appending.
|
|
60
|
+
* Otherwise the default class string is returned as-is.
|
|
61
|
+
*/
|
|
62
|
+
declare function resolveClass(defaultClass: string, override?: string, unstyled?: boolean): string;
|
|
63
|
+
|
|
64
|
+
export { ConsentStorage as C, type ConsentStorageClassNames as a, type ConsentStorageProps as b, resolveClass as r };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { a as ConsentSettings, b as ConsentStorageOptions } from './consent-CmVzqZUk.js';
|
|
3
|
+
|
|
4
|
+
interface ConsentStorageClassNames {
|
|
5
|
+
root?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ConsentStorageProps {
|
|
8
|
+
/**
|
|
9
|
+
* Current consent settings
|
|
10
|
+
*/
|
|
11
|
+
settings: ConsentSettings;
|
|
12
|
+
/**
|
|
13
|
+
* Storage options for consent settings
|
|
14
|
+
*/
|
|
15
|
+
storageOptions?: ConsentStorageOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called when settings are loaded from storage
|
|
18
|
+
*/
|
|
19
|
+
onLoad?: (settings: ConsentSettings | null) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function called when settings are saved to storage
|
|
22
|
+
*/
|
|
23
|
+
onSave?: (settings: ConsentSettings) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to automatically save settings to storage
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
autoSave?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to automatically load settings from storage on mount
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
autoLoad?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
36
|
+
*/
|
|
37
|
+
classNames?: ConsentStorageClassNames;
|
|
38
|
+
/**
|
|
39
|
+
* When true, all default classes are removed so consumers
|
|
40
|
+
* can style from scratch using classNames.
|
|
41
|
+
*/
|
|
42
|
+
unstyled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Children to render
|
|
45
|
+
* Can be either React nodes or a render prop function that receives storage methods
|
|
46
|
+
*/
|
|
47
|
+
children?: React__default.ReactNode | ((props: {
|
|
48
|
+
loadSettings: () => ConsentSettings | null;
|
|
49
|
+
saveSettings: (settings: ConsentSettings) => void;
|
|
50
|
+
clearSettings: () => void;
|
|
51
|
+
loaded: boolean;
|
|
52
|
+
}) => React__default.ReactNode);
|
|
53
|
+
}
|
|
54
|
+
declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React__default.ReactElement | null;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Resolves class names for a component section.
|
|
58
|
+
* If unstyled is true, only the override class is used (or empty string).
|
|
59
|
+
* If an override is provided, it fully REPLACES the default — no appending.
|
|
60
|
+
* Otherwise the default class string is returned as-is.
|
|
61
|
+
*/
|
|
62
|
+
declare function resolveClass(defaultClass: string, override?: string, unstyled?: boolean): string;
|
|
63
|
+
|
|
64
|
+
export { ConsentStorage as C, type ConsentStorageClassNames as a, type ConsentStorageProps as b, resolveClass as r };
|
package/dist/unstyled.d.mts
CHANGED
|
@@ -1,22 +1,55 @@
|
|
|
1
|
-
import React__default
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { c as ConsentBannerProps } from './ConsentBanner-F5ayys5K.mjs';
|
|
3
|
+
export { C as ConsentAnalyticsEvent, b as ConsentBannerClassNames } from './ConsentBanner-F5ayys5K.mjs';
|
|
4
|
+
import { b as ConsentManagerProps } from './ConsentManager-C7I3PDe8.mjs';
|
|
5
|
+
export { a as ConsentManagerClassNames } from './ConsentManager-C7I3PDe8.mjs';
|
|
6
|
+
import { c as DSRRequestFormProps } from './DSRRequestForm-DRouEr9j.mjs';
|
|
7
|
+
export { b as DSRRequestFormClassNames } from './DSRRequestForm-DRouEr9j.mjs';
|
|
8
|
+
import './consent-CmVzqZUk.mjs';
|
|
9
|
+
import './dsr-yKbqX531.mjs';
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Unstyled entry — design-system-friendly component variants.
|
|
13
|
+
*
|
|
14
|
+
* Components imported from this subpath default `unstyled` to `true`,
|
|
15
|
+
* which strips every default class name from the rendered markup.
|
|
16
|
+
* Consumers using their own design system (Tailwind, Mantine, Chakra,
|
|
17
|
+
* shadcn, raw CSS) get logic + accessibility + semantic structure
|
|
18
|
+
* without any pre-applied visual styling.
|
|
19
|
+
*
|
|
20
|
+
* Markup, ARIA attributes, focus management, keyboard handling, and the
|
|
21
|
+
* `data-ndpr-component` data attributes are all preserved — those are
|
|
22
|
+
* part of the contract, not styling.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // app/cookie-banner.tsx
|
|
27
|
+
* import { ConsentBanner } from '@tantainnovative/ndpr-toolkit/unstyled';
|
|
28
|
+
*
|
|
29
|
+
* export function CookieBanner() {
|
|
30
|
+
* return (
|
|
31
|
+
* <ConsentBanner
|
|
32
|
+
* options={[]}
|
|
33
|
+
* onSave={() => {}}
|
|
34
|
+
* classNames={{
|
|
35
|
+
* root: 'fixed bottom-0 inset-x-0 bg-white p-6 shadow-2xl',
|
|
36
|
+
* title: 'text-xl font-bold mb-2',
|
|
37
|
+
* buttonGroup: 'flex gap-2 mt-4',
|
|
38
|
+
* acceptButton: 'btn-primary',
|
|
39
|
+
* rejectButton: 'btn-secondary',
|
|
40
|
+
* }}
|
|
41
|
+
* />
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* For components not yet migrated to the BEM stylesheet (DPIA, Breach,
|
|
47
|
+
* ROPA, etc.), import them from their normal subpath and pass
|
|
48
|
+
* `unstyled` manually if available — the migration completes in 3.5.x.
|
|
49
|
+
*/
|
|
8
50
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
declare const UnstyledConsentSettings: React__default.FC<UnstyledConsentSettingsProps>;
|
|
51
|
+
declare const ConsentBanner: React__default.FC<ConsentBannerProps>;
|
|
52
|
+
declare const ConsentManager: React__default.FC<ConsentManagerProps>;
|
|
53
|
+
declare const DSRRequestForm: React__default.FC<DSRRequestFormProps>;
|
|
14
54
|
|
|
15
|
-
|
|
16
|
-
category: 'analytics' | 'marketing' | 'functional';
|
|
17
|
-
className?: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
}
|
|
20
|
-
declare const UnstyledConsentToggle: React__default.FC<UnstyledConsentToggleProps>;
|
|
21
|
-
|
|
22
|
-
export { UnstyledConsentBanner as ConsentBanner, UnstyledConsentSettings as ConsentSettings, UnstyledConsentToggle as ConsentToggle };
|
|
55
|
+
export { ConsentBanner, ConsentBannerProps, ConsentManager, ConsentManagerProps, DSRRequestForm, DSRRequestFormProps };
|
package/dist/unstyled.d.ts
CHANGED
|
@@ -1,22 +1,55 @@
|
|
|
1
|
-
import React__default
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { c as ConsentBannerProps } from './ConsentBanner-VqIPophc.js';
|
|
3
|
+
export { C as ConsentAnalyticsEvent, b as ConsentBannerClassNames } from './ConsentBanner-VqIPophc.js';
|
|
4
|
+
import { b as ConsentManagerProps } from './ConsentManager-CQ2IZtUU.js';
|
|
5
|
+
export { a as ConsentManagerClassNames } from './ConsentManager-CQ2IZtUU.js';
|
|
6
|
+
import { c as DSRRequestFormProps } from './DSRRequestForm-D8rPTNmU.js';
|
|
7
|
+
export { b as DSRRequestFormClassNames } from './DSRRequestForm-D8rPTNmU.js';
|
|
8
|
+
import './consent-CmVzqZUk.js';
|
|
9
|
+
import './dsr-yKbqX531.js';
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Unstyled entry — design-system-friendly component variants.
|
|
13
|
+
*
|
|
14
|
+
* Components imported from this subpath default `unstyled` to `true`,
|
|
15
|
+
* which strips every default class name from the rendered markup.
|
|
16
|
+
* Consumers using their own design system (Tailwind, Mantine, Chakra,
|
|
17
|
+
* shadcn, raw CSS) get logic + accessibility + semantic structure
|
|
18
|
+
* without any pre-applied visual styling.
|
|
19
|
+
*
|
|
20
|
+
* Markup, ARIA attributes, focus management, keyboard handling, and the
|
|
21
|
+
* `data-ndpr-component` data attributes are all preserved — those are
|
|
22
|
+
* part of the contract, not styling.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // app/cookie-banner.tsx
|
|
27
|
+
* import { ConsentBanner } from '@tantainnovative/ndpr-toolkit/unstyled';
|
|
28
|
+
*
|
|
29
|
+
* export function CookieBanner() {
|
|
30
|
+
* return (
|
|
31
|
+
* <ConsentBanner
|
|
32
|
+
* options={[]}
|
|
33
|
+
* onSave={() => {}}
|
|
34
|
+
* classNames={{
|
|
35
|
+
* root: 'fixed bottom-0 inset-x-0 bg-white p-6 shadow-2xl',
|
|
36
|
+
* title: 'text-xl font-bold mb-2',
|
|
37
|
+
* buttonGroup: 'flex gap-2 mt-4',
|
|
38
|
+
* acceptButton: 'btn-primary',
|
|
39
|
+
* rejectButton: 'btn-secondary',
|
|
40
|
+
* }}
|
|
41
|
+
* />
|
|
42
|
+
* );
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* For components not yet migrated to the BEM stylesheet (DPIA, Breach,
|
|
47
|
+
* ROPA, etc.), import them from their normal subpath and pass
|
|
48
|
+
* `unstyled` manually if available — the migration completes in 3.5.x.
|
|
49
|
+
*/
|
|
8
50
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
declare const UnstyledConsentSettings: React__default.FC<UnstyledConsentSettingsProps>;
|
|
51
|
+
declare const ConsentBanner: React__default.FC<ConsentBannerProps>;
|
|
52
|
+
declare const ConsentManager: React__default.FC<ConsentManagerProps>;
|
|
53
|
+
declare const DSRRequestForm: React__default.FC<DSRRequestFormProps>;
|
|
14
54
|
|
|
15
|
-
|
|
16
|
-
category: 'analytics' | 'marketing' | 'functional';
|
|
17
|
-
className?: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
}
|
|
20
|
-
declare const UnstyledConsentToggle: React__default.FC<UnstyledConsentToggleProps>;
|
|
21
|
-
|
|
22
|
-
export { UnstyledConsentBanner as ConsentBanner, UnstyledConsentSettings as ConsentSettings, UnstyledConsentToggle as ConsentToggle };
|
|
55
|
+
export { ConsentBanner, ConsentBannerProps, ConsentManager, ConsentManagerProps, DSRRequestForm, DSRRequestFormProps };
|
package/dist/unstyled.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunkRLYTX3MM_js=require('./chunk-RLYTX3MM.js'),chunkSUEGUY35_js=require('./chunk-SUEGUY35.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(chunkSUEGUY35_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
|
|
2
3
|
//# sourceMappingURL=unstyled.js.map
|
package/dist/unstyled.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import {a as a$2}from'./chunk-EPT2K355.mjs';import {a as a$1}from'./chunk-BN77GP4W.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
|
|
2
3
|
//# sourceMappingURL=unstyled.mjs.map
|
package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BSLyltzZ.d.mts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as PrivacyPolicy, P as PolicySection } from './privacy-Ca6te9Ir.mjs';
|
|
2
|
-
import { P as PolicyDraft, C as ComplianceGap, T as TemplateContext,
|
|
2
|
+
import { P as PolicyDraft, C as ComplianceGap, T as TemplateContext, b as CustomSection, a as ComplianceResult, g as PDFExportOptions, f as DOCXExportOptions, H as HTMLExportOptions } from './policy-engine-5qTfp2z4.mjs';
|
|
3
3
|
import { S as StorageAdapter } from './types-DK2CoKOC.mjs';
|
|
4
4
|
|
|
5
5
|
interface UseAdaptivePolicyWizardOptions {
|
package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-CL7C7MTZ.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as PrivacyPolicy, P as PolicySection } from './privacy-Ca6te9Ir.js';
|
|
2
|
-
import { P as PolicyDraft, C as ComplianceGap, T as TemplateContext,
|
|
2
|
+
import { P as PolicyDraft, C as ComplianceGap, T as TemplateContext, b as CustomSection, a as ComplianceResult, g as PDFExportOptions, f as DOCXExportOptions, H as HTMLExportOptions } from './policy-engine-DzPxskOK.js';
|
|
3
3
|
import { S as StorageAdapter } from './types-DK2CoKOC.js';
|
|
4
4
|
|
|
5
5
|
interface UseAdaptivePolicyWizardOptions {
|
package/dist/{useDefaultPrivacyPolicy-ySWU7nc-.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts}
RENAMED
|
@@ -99,16 +99,34 @@ declare function usePrivacyPolicy({ templates, initialPolicy, adapter, storageKe
|
|
|
99
99
|
|
|
100
100
|
interface UseDefaultPrivacyPolicyOptions {
|
|
101
101
|
/**
|
|
102
|
-
* Organisation information to pre-fill into the policy
|
|
102
|
+
* Organisation information to pre-fill into the policy. When provided and
|
|
103
|
+
* `autoGenerate` is true (the default), the hook will auto-select the
|
|
104
|
+
* default template and generate a renderable policy on first commit, so
|
|
105
|
+
* `policy` is non-null on the first useful render.
|
|
103
106
|
*/
|
|
104
107
|
orgInfo?: {
|
|
105
|
-
/** Organisation name */
|
|
108
|
+
/** Organisation name (maps to `organizationInfo.name` and `orgName` variable) */
|
|
106
109
|
name?: string;
|
|
107
|
-
/** Privacy contact email */
|
|
110
|
+
/** Privacy contact email (maps to `privacyEmail`) */
|
|
108
111
|
email?: string;
|
|
112
|
+
/** Organisation website URL */
|
|
113
|
+
website?: string;
|
|
114
|
+
/** Physical address */
|
|
115
|
+
address?: string;
|
|
116
|
+
/** Industry / sector descriptor */
|
|
117
|
+
industry?: string;
|
|
109
118
|
/** Data Protection Officer name */
|
|
110
119
|
dpoName?: string;
|
|
120
|
+
/** DPO email address */
|
|
121
|
+
dpoEmail?: string;
|
|
111
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* Whether the hook should auto-select the default template and generate
|
|
125
|
+
* the policy as soon as it's mounted with `orgInfo`. Set to false to
|
|
126
|
+
* retain manual control via `selectTemplate` / `generatePolicy`.
|
|
127
|
+
* @default true
|
|
128
|
+
*/
|
|
129
|
+
autoGenerate?: boolean;
|
|
112
130
|
/**
|
|
113
131
|
* Storage key for policy data.
|
|
114
132
|
* @default "ndpr_privacy_policy"
|
|
@@ -120,20 +138,23 @@ interface UseDefaultPrivacyPolicyOptions {
|
|
|
120
138
|
*/
|
|
121
139
|
useLocalStorage?: boolean;
|
|
122
140
|
/**
|
|
123
|
-
* Pluggable storage adapter. When provided, takes precedence over
|
|
141
|
+
* Pluggable storage adapter. When provided, takes precedence over
|
|
142
|
+
* storageKey/useLocalStorage.
|
|
124
143
|
*/
|
|
125
144
|
adapter?: StorageAdapter<PrivacyPolicy>;
|
|
126
145
|
}
|
|
127
146
|
/**
|
|
128
|
-
* Convenience wrapper around `usePrivacyPolicy`
|
|
129
|
-
*
|
|
130
|
-
*
|
|
147
|
+
* Convenience wrapper around `usePrivacyPolicy`. With `orgInfo` provided
|
|
148
|
+
* and `autoGenerate` enabled (default), `policy` is non-null on the first
|
|
149
|
+
* post-load render — no manual `selectTemplate` / `generatePolicy` chaining
|
|
150
|
+
* required.
|
|
131
151
|
*
|
|
132
152
|
* @example
|
|
133
153
|
* ```tsx
|
|
134
|
-
* const policy = useDefaultPrivacyPolicy({
|
|
135
|
-
* orgInfo: { name: 'Acme Ltd', email: 'privacy@acme.ng'
|
|
154
|
+
* const { policy } = useDefaultPrivacyPolicy({
|
|
155
|
+
* orgInfo: { name: 'Acme Ltd', email: 'privacy@acme.ng' }
|
|
136
156
|
* });
|
|
157
|
+
* return policy ? <PolicyPage policy={policy} /> : <Spinner />;
|
|
137
158
|
* ```
|
|
138
159
|
*/
|
|
139
160
|
declare function useDefaultPrivacyPolicy(options?: UseDefaultPrivacyPolicyOptions): UsePrivacyPolicyReturn;
|
package/dist/{useDefaultPrivacyPolicy-DvCbeEl1.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts}
RENAMED
|
@@ -99,16 +99,34 @@ declare function usePrivacyPolicy({ templates, initialPolicy, adapter, storageKe
|
|
|
99
99
|
|
|
100
100
|
interface UseDefaultPrivacyPolicyOptions {
|
|
101
101
|
/**
|
|
102
|
-
* Organisation information to pre-fill into the policy
|
|
102
|
+
* Organisation information to pre-fill into the policy. When provided and
|
|
103
|
+
* `autoGenerate` is true (the default), the hook will auto-select the
|
|
104
|
+
* default template and generate a renderable policy on first commit, so
|
|
105
|
+
* `policy` is non-null on the first useful render.
|
|
103
106
|
*/
|
|
104
107
|
orgInfo?: {
|
|
105
|
-
/** Organisation name */
|
|
108
|
+
/** Organisation name (maps to `organizationInfo.name` and `orgName` variable) */
|
|
106
109
|
name?: string;
|
|
107
|
-
/** Privacy contact email */
|
|
110
|
+
/** Privacy contact email (maps to `privacyEmail`) */
|
|
108
111
|
email?: string;
|
|
112
|
+
/** Organisation website URL */
|
|
113
|
+
website?: string;
|
|
114
|
+
/** Physical address */
|
|
115
|
+
address?: string;
|
|
116
|
+
/** Industry / sector descriptor */
|
|
117
|
+
industry?: string;
|
|
109
118
|
/** Data Protection Officer name */
|
|
110
119
|
dpoName?: string;
|
|
120
|
+
/** DPO email address */
|
|
121
|
+
dpoEmail?: string;
|
|
111
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* Whether the hook should auto-select the default template and generate
|
|
125
|
+
* the policy as soon as it's mounted with `orgInfo`. Set to false to
|
|
126
|
+
* retain manual control via `selectTemplate` / `generatePolicy`.
|
|
127
|
+
* @default true
|
|
128
|
+
*/
|
|
129
|
+
autoGenerate?: boolean;
|
|
112
130
|
/**
|
|
113
131
|
* Storage key for policy data.
|
|
114
132
|
* @default "ndpr_privacy_policy"
|
|
@@ -120,20 +138,23 @@ interface UseDefaultPrivacyPolicyOptions {
|
|
|
120
138
|
*/
|
|
121
139
|
useLocalStorage?: boolean;
|
|
122
140
|
/**
|
|
123
|
-
* Pluggable storage adapter. When provided, takes precedence over
|
|
141
|
+
* Pluggable storage adapter. When provided, takes precedence over
|
|
142
|
+
* storageKey/useLocalStorage.
|
|
124
143
|
*/
|
|
125
144
|
adapter?: StorageAdapter<PrivacyPolicy>;
|
|
126
145
|
}
|
|
127
146
|
/**
|
|
128
|
-
* Convenience wrapper around `usePrivacyPolicy`
|
|
129
|
-
*
|
|
130
|
-
*
|
|
147
|
+
* Convenience wrapper around `usePrivacyPolicy`. With `orgInfo` provided
|
|
148
|
+
* and `autoGenerate` enabled (default), `policy` is non-null on the first
|
|
149
|
+
* post-load render — no manual `selectTemplate` / `generatePolicy` chaining
|
|
150
|
+
* required.
|
|
131
151
|
*
|
|
132
152
|
* @example
|
|
133
153
|
* ```tsx
|
|
134
|
-
* const policy = useDefaultPrivacyPolicy({
|
|
135
|
-
* orgInfo: { name: 'Acme Ltd', email: 'privacy@acme.ng'
|
|
154
|
+
* const { policy } = useDefaultPrivacyPolicy({
|
|
155
|
+
* orgInfo: { name: 'Acme Ltd', email: 'privacy@acme.ng' }
|
|
136
156
|
* });
|
|
157
|
+
* return policy ? <PolicyPage policy={policy} /> : <Spinner />;
|
|
137
158
|
* ```
|
|
138
159
|
*/
|
|
139
160
|
declare function useDefaultPrivacyPolicy(options?: UseDefaultPrivacyPolicyOptions): UsePrivacyPolicyReturn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tantainnovative/ndpr-toolkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.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": [
|
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
"import": "./dist/core.mjs",
|
|
47
47
|
"require": "./dist/core.js"
|
|
48
48
|
},
|
|
49
|
+
"./server": {
|
|
50
|
+
"types": "./dist/server.d.ts",
|
|
51
|
+
"import": "./dist/server.mjs",
|
|
52
|
+
"require": "./dist/server.js"
|
|
53
|
+
},
|
|
49
54
|
"./hooks": {
|
|
50
55
|
"types": "./dist/hooks.d.ts",
|
|
51
56
|
"import": "./dist/hooks.mjs",
|
|
@@ -108,8 +113,11 @@
|
|
|
108
113
|
},
|
|
109
114
|
"./styles": {
|
|
110
115
|
"types": "./dist/styles.d.ts",
|
|
116
|
+
"style": "./dist/styles.css",
|
|
117
|
+
"sass": "./dist/styles.css",
|
|
111
118
|
"import": "./dist/styles.css",
|
|
112
|
-
"require": "./dist/styles.css"
|
|
119
|
+
"require": "./dist/styles.css",
|
|
120
|
+
"default": "./dist/styles.css"
|
|
113
121
|
}
|
|
114
122
|
},
|
|
115
123
|
"typesVersions": {
|
|
@@ -117,6 +125,9 @@
|
|
|
117
125
|
"core": [
|
|
118
126
|
"./dist/core.d.ts"
|
|
119
127
|
],
|
|
128
|
+
"server": [
|
|
129
|
+
"./dist/server.d.ts"
|
|
130
|
+
],
|
|
120
131
|
"hooks": [
|
|
121
132
|
"./dist/hooks.d.ts"
|
|
122
133
|
],
|
|
@@ -162,6 +173,7 @@
|
|
|
162
173
|
"dist/**/*.d.mts",
|
|
163
174
|
"dist/**/*.css",
|
|
164
175
|
"README.md",
|
|
176
|
+
"CHANGELOG.md",
|
|
165
177
|
"LICENSE"
|
|
166
178
|
],
|
|
167
179
|
"publishConfig": {
|
package/dist/chunk-25OOUES4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime');var x={consent:"Consent",dsr:"Data Subject Rights",dpia:"DPIA",breach:"Breach Notification",policy:"Privacy Policy",lawfulBasis:"Lawful Basis",crossBorder:"Cross-Border",ropa:"ROPA"},p={critical:"rgb(var(--ndpr-destructive))","needs-work":"rgb(var(--ndpr-warning))",good:"rgb(var(--ndpr-primary))",excellent:"rgb(var(--ndpr-success))"},m={critical:"Critical","needs-work":"Needs Work",good:"Good",excellent:"Excellent"},f={critical:"Critical",high:"High",medium:"Medium",low:"Low"},C=({score:t,rating:o,classNames:e,unstyled:a})=>{let r=p[o],i=2*Math.PI*40,c=i*(1-t/100);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("relative inline-flex items-center justify-center",e==null?void 0:e.scoreCircle,a),role:"img","aria-label":`Compliance score: ${t} out of 100, rated ${m[o]}`,children:[jsxRuntime.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 100 100","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"rgba(0,0,0,0.08)",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:c,transform:"rotate(-90 50 50)",style:{transition:"stroke-dashoffset 0.4s ease"}})]}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("absolute text-2xl font-bold tabular-nums",e==null?void 0:e.scoreValue,a),style:{color:r},children:t})]})},y=({rating:t,className:o,unstyled:e})=>{let a=p[t];return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("inline-block px-3 py-1 rounded-full text-sm font-semibold",o,e),style:{backgroundColor:`${a.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:a,border:`1px solid ${a.replace("rgb(","rgba(").replace(")",", 0.3)")}`},role:"status","aria-live":"polite",children:m[t]})},h=({moduleKey:t,module:o,classNames:e,unstyled:a})=>{var b;let r=o.score>=90?"excellent":o.score>=70?"good":o.score>=40?"needs-work":"critical",i=p[r];Math.round(o.score/100*(o.gaps.length+Math.round(o.score/100*5)));let u=o.gaps.length,g=(b=x[t])!=null?b:t;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("rounded-lg border p-4 flex flex-col gap-2",e==null?void 0:e.moduleCard,a),style:{borderColor:`${i.replace("rgb(","rgba(").replace(")",", 0.25)")}`,backgroundColor:`${i.replace("rgb(","rgba(").replace(")",", 0.04)")}`},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-sm font-semibold truncate",e==null?void 0:e.moduleTitle,a),children:g}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-lg font-bold tabular-nums",e==null?void 0:e.moduleScore,a),style:{color:i},role:"status","aria-label":`${g} score: ${o.score}`,children:o.score})]}),jsxRuntime.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{backgroundColor:"rgba(0,0,0,0.08)"},role:"progressbar","aria-valuenow":o.score,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${g} compliance score: ${o.score}%`,children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${o.score}%`,backgroundColor:i}})}),u>0&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",e==null?void 0:e.moduleGaps,a),children:[u," gap",u!==1?"s":""," to address"]})]})},R=({rec:t,classNames:o,unstyled:e})=>{var i,c;let r=(i={critical:p.critical,high:p["needs-work"],medium:p.good,low:p.excellent}[t.priority])!=null?i:p.good;return jsxRuntime.jsxs("div",{"data-testid":"recommendation-item",className:chunkE64TU6IU_js.a("flex gap-3 p-3 rounded-lg border border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-800",o==null?void 0:o.recommendationItem,e),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("mt-0.5 shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide",o==null?void 0:o.recommendationPriority,e),style:{backgroundColor:`${r.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:r},children:(c=f[t.priority])!=null?c:t.priority}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",o==null?void 0:o.recommendationTitle,e),children:t.label}),jsxRuntime.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 leading-relaxed",children:t.recommendation}),jsxRuntime.jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t.ndpaSection," \u2022 Effort: ",t.effort]})]})]})},k=({report:t,title:o="NDPA Compliance Dashboard",showRecommendations:e=true,maxRecommendations:a=5,classNames:r,unstyled:i=false})=>{let c=t.recommendations.slice(0,a),u=Object.entries(t.modules);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-dashboard",className:chunkE64TU6IU_js.a("w-full rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm p-6 flex flex-col gap-8",r==null?void 0:r.root,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row items-start sm:items-center gap-6",r==null?void 0:r.header,i),children:[jsxRuntime.jsx(C,{score:t.score,rating:t.rating,classNames:{scoreCircle:r==null?void 0:r.scoreCircle,scoreValue:r==null?void 0:r.scoreValue},unstyled:i}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 leading-tight",children:o}),jsxRuntime.jsx(y,{rating:t.rating,className:r==null?void 0:r.ratingBadge,unstyled:i}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Generated on"," ",new Date(t.generatedAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-3",r==null?void 0:r.modulesGrid,i),children:u.map(([g,b])=>jsxRuntime.jsx(h,{moduleKey:g,module:b,classNames:{moduleCard:r==null?void 0:r.moduleCard,moduleTitle:r==null?void 0:r.moduleTitle,moduleScore:r==null?void 0:r.moduleScore,moduleGaps:r==null?void 0:r.moduleGaps},unstyled:i},g))}),e&&c.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col gap-3",r==null?void 0:r.recommendationsSection,i),children:[jsxRuntime.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Recommendations"}),c.map(g=>jsxRuntime.jsx(R,{rec:g,classNames:{recommendationItem:r==null?void 0:r.recommendationItem,recommendationPriority:r==null?void 0:r.recommendationPriority,recommendationTitle:r==null?void 0:r.recommendationTitle},unstyled:i},`${g.module}-${g.key}`))]})]})};exports.a=k;//# sourceMappingURL=chunk-25OOUES4.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-25OOUES4.js.map
|
package/dist/chunk-4JKTIR33.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var yt=({options:d,onSave:U,title:Q="We Value Your Privacy",description:X="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.",acceptAllButtonText:Z="Accept All",rejectAllButtonText:s="Reject All",customizeButtonText:N="Customize",saveButtonText:tt="Save Preferences",position:L="bottom",zIndex:q=9999,version:a$2="1.0",show:x,manageStorage:z=true,storageKey:D="ndpr_consent",className:et="",buttonClassName:B="",primaryButtonClassName:H="",secondaryButtonClassName:nt="",classNames:t,unstyled:o,onAnalytics:k})=>{let[u,c]=useState(false),[g,m]=useState(false),[w,E]=useState({}),[F,rt]=useState(false),f=useRef(null),T=useRef(null),$=useRef(false);useEffect(()=>{rt(true);},[]);let b$1=useCallback((e,n)=>{k==null||k(a({action:e,timestamp:Date.now(),version:a$2},n!==void 0?{categories:n}:{}));},[k,a$2]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),E(e),x===void 0)if(!z)c(true);else {let n=localStorage.getItem(D);if(n)try{JSON.parse(n).version!==a$2?c(!0):c(!1);}catch(C){c(true);}else c(true);}else c(x);},[d,D,a$2,z]),useEffect(()=>{x!==void 0&&c(x);},[x]);let ot=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b$1("accepted_all",e),j(e);},M=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b$1("rejected_all",e),j(e);},it=(e,n)=>{E(C=>b(a({},C),{[e]:n}));},dt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),E(e);},ut=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),E(e);},_=d.length>0&&d.every(e=>w[e.id]),ct=()=>{b$1("customized",w),j(w);},j=e=>{let n={consents:e,timestamp:Date.now(),version:a$2,method:g?"customize":"banner",hasInteracted:true};z&&localStorage.setItem(D,JSON.stringify(n)),U(n),c(false),m(false);};if(useEffect(()=>{if(!u)return;let e=n=>{n.key==="Escape"&&(b$1("dismissed"),M());};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,b$1,d,g]),useEffect(()=>{u&&!$.current&&($.current=true,b$1("shown")),u||($.current=false);},[u,b$1]),useEffect(()=>{if(!u||!f.current)return;let e='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',C=setTimeout(()=>{if(!f.current)return;let p=f.current.querySelectorAll(e);p.length>0?p[0].focus():f.current.focus();},0),G=p=>{if(p.key!=="Tab"||!f.current)return;let A=f.current.querySelectorAll(e);if(A.length===0)return;let V=A[0],J=A[A.length-1];p.shiftKey?document.activeElement===V&&(p.preventDefault(),J.focus()):document.activeElement===J&&(p.preventDefault(),V.focus());};return document.addEventListener("keydown",G),()=>{clearTimeout(C),document.removeEventListener("keydown",G);}},[u,g]),useEffect(()=>{if(g&&T.current){let e=T.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[g]),!u)return null;let lt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B} ${H}`,K=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${B} ${nt}`,gt=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${B}`,ft=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B} ${H}`,S=L==="inline",y=L==="center",h;S||y?h="":L==="top"?h="fixed inset-x-0 top-0":h="fixed inset-x-0 bottom-0";let P=jsx("div",{ref:f,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${S?"":h} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${y?"max-w-lg w-full":""} ${et}`,t==null?void 0:t.root,o),style:!S&&!y?{zIndex:q}:void 0,role:"dialog","aria-modal":y||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$1("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Q}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:X}),g&&jsxs("div",{ref:T,className:a$1("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsx("div",{className:"mb-3 flex items-center justify-end",children:jsx("button",{type:"button",onClick:_?ut:dt,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxs("div",{className:a$1("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:w[e.id]||false,onChange:n=>it(e.id,n.target.checked),disabled:e.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${e.id}`,className:a$1("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:ct,className:a$1(ft,t==null?void 0:t.saveButton,o),children:tt}),jsx("button",{onClick:()=>m(false),className:a$1(K,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!g&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:ot,className:a$1(lt,t==null?void 0:t.acceptButton,o),children:Z}),jsx("button",{onClick:M,className:a$1(K,t==null?void 0:t.rejectButton,o),children:s}),jsx("button",{onClick:()=>m(true),className:a$1(gt,t==null?void 0:t.customizeButton,o),children:N})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(S)return P;if(y){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:q},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:P})]});return F?createPortal(e,document.body):null}return F?createPortal(P,document.body):null};export{yt as a};//# sourceMappingURL=chunk-4JKTIR33.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-4JKTIR33.mjs.map
|