@tantainnovative/ndpr-toolkit 2.1.2 → 2.4.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/README.md +73 -2
- package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
- package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
- package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
- package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
- package/dist/breach-ouXoVTWs.d.ts +438 -0
- package/dist/breach-yRiyyc4n.d.mts +438 -0
- package/dist/breach.d.mts +5 -275
- package/dist/breach.d.ts +5 -275
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-2XFAV267.mjs +2 -0
- package/dist/chunk-32UIWTGD.js +72 -0
- package/dist/chunk-4JUDKBA2.mjs +7 -0
- package/dist/chunk-4VVARDN2.mjs +2 -0
- package/dist/chunk-5RSOLEEP.js +63 -0
- package/dist/chunk-AYKLAEOU.mjs +2 -0
- package/dist/chunk-BGHQTZAC.js +94 -0
- package/dist/chunk-BZTTQS4A.mjs +7 -0
- package/dist/chunk-CAB7O3GR.mjs +63 -0
- package/dist/chunk-CL53OI3I.js +7 -0
- package/dist/chunk-E64TU6IU.js +2 -0
- package/dist/chunk-EKVTLHBQ.js +2 -0
- package/dist/chunk-ELKEZEV5.mjs +2 -0
- package/dist/chunk-EPF7J2FK.js +3 -0
- package/dist/chunk-ER7X6E36.js +2 -0
- package/dist/chunk-FXTZDKDC.mjs +3 -0
- package/dist/chunk-IBEKLDBY.mjs +2 -0
- package/dist/chunk-ILCNDOBU.js +2 -0
- package/dist/chunk-K3GMTMQ6.js +2 -0
- package/dist/chunk-MJGOLP5M.js +2 -0
- package/dist/chunk-NW4A3JW6.mjs +2 -0
- package/dist/chunk-P3PULLYP.mjs +2 -0
- package/dist/chunk-SKJCQKFL.mjs +94 -0
- package/dist/chunk-TCJCE6WN.js +2 -0
- package/dist/chunk-UZ5EZOA7.js +2 -0
- package/dist/chunk-WSHSHIIM.mjs +2 -0
- package/dist/chunk-XMYUYQH7.mjs +72 -0
- package/dist/chunk-ZNTMZ6NM.js +7 -0
- package/dist/consent-audit-BdByjYlM.d.mts +65 -0
- package/dist/consent-audit-DhbfMR0n.d.ts +65 -0
- package/dist/consent.d.mts +120 -7
- package/dist/consent.d.ts +120 -7
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +62 -12
- package/dist/core.d.ts +62 -12
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
- package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
- package/dist/cross-border-entry-BrWVPly6.d.ts +91 -0
- package/dist/cross-border-entry-cCTvpwnT.d.mts +91 -0
- package/dist/cross-border.d.mts +4 -58
- package/dist/cross-border.d.ts +4 -58
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
- package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
- package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
- package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
- package/dist/dpia.d.mts +119 -5
- package/dist/dpia.d.ts +119 -5
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr-190YpijW.d.ts +307 -0
- package/dist/dsr-BTT-Xd7H.d.mts +307 -0
- package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
- package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
- package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
- package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
- package/dist/dsr.d.mts +5 -192
- package/dist/dsr.d.ts +5 -192
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +14 -14
- package/dist/hooks.d.ts +14 -14
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +28 -27
- package/dist/index.d.ts +28 -27
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
- package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
- package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
- package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
- package/dist/lawful-basis-entry-15qjKcNO.d.ts +87 -0
- package/dist/lawful-basis-entry-CxZrofwG.d.mts +87 -0
- package/dist/lawful-basis.d.mts +5 -55
- package/dist/lawful-basis.d.ts +5 -55
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-D2_jh5-T.d.ts +293 -0
- package/dist/policy-E0fXZkda.d.mts +293 -0
- package/dist/policy-templates-CIKcV0i1.d.ts +36 -0
- package/dist/policy-templates-DMsPwOSZ.d.mts +36 -0
- package/dist/policy.d.mts +5 -195
- package/dist/policy.d.ts +5 -195
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
- package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
- package/dist/ropa-entry-B0D7X1GV.d.ts +80 -0
- package/dist/ropa-entry-DiOThOc2.d.mts +80 -0
- package/dist/ropa.d.mts +5 -45
- package/dist/ropa.d.ts +5 -45
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/styles.css +40 -28
- package/dist/styles.d.ts +1 -0
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
- package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
- package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
- package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
- package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
- package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
- package/dist/{usePrivacyPolicy-CfySfBLS.d.ts → useDefaultPrivacyPolicy-B7kTHbZh.d.ts} +39 -2
- package/dist/{usePrivacyPolicy-Dit2sFuV.d.mts → useDefaultPrivacyPolicy-CUluF_ic.d.mts} +39 -2
- package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
- package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
- package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
- package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
- package/package.json +30 -21
- package/dist/chunk-2XHD22J7.mjs +0 -7
- package/dist/chunk-4DKT6IB6.js +0 -94
- package/dist/chunk-6JFTAYXV.mjs +0 -2
- package/dist/chunk-6JVYYLS7.js +0 -2
- package/dist/chunk-6SGG6WPA.mjs +0 -2
- package/dist/chunk-AQEGDEQM.js +0 -7
- package/dist/chunk-C2IJWCZQ.mjs +0 -2
- package/dist/chunk-DB3JH4DS.mjs +0 -2
- package/dist/chunk-FFW7RUAG.mjs +0 -94
- package/dist/chunk-FK3CSFLJ.js +0 -2
- package/dist/chunk-IWUUVRLJ.js +0 -2
- package/dist/chunk-JUN6YPLL.mjs +0 -72
- package/dist/chunk-L3FKTBGV.js +0 -72
- package/dist/chunk-PM7CMTMB.js +0 -4
- package/dist/chunk-RB26MIRI.js +0 -2
- package/dist/chunk-RHWW5FDP.js +0 -16
- package/dist/chunk-SLNMKGQ2.mjs +0 -2
- package/dist/chunk-UUWVBENC.js +0 -2
- package/dist/chunk-UYP64PV7.mjs +0 -4
- package/dist/chunk-XMKA6GVK.mjs +0 -16
- package/dist/consent-DCc5zjXI.d.mts +0 -24
- package/dist/consent-DLWb5ota.d.ts +0 -24
- package/dist/privacy-9FcJceMr.d.mts +0 -15
- package/dist/privacy-BXz7O2ej.d.ts +0 -15
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime'),F=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var F__default=/*#__PURE__*/_interopDefault(F);var E=({sections:d,answers:k,onAnswerChange:y,currentSectionIndex:b,onNextSection:C,onPrevSection:P,validationErrors:$={},readOnly:x=false,className:A="",buttonClassName:D="",nextButtonText:o="Next",prevButtonText:N="Previous",submitButtonText:h="Submit",showProgress:c=true,progress:v,classNames:w={},unstyled:S=false})=>{let u=d[b],i=b===d.length-1,a=(e,m)=>{let n=m?w[m]:void 0;return !n&&m==="nextButton"&&(n=w.primaryButton),!n&&m==="prevButton"&&(n=w.secondaryButton),chunkE64TU6IU_js.a(e,n,S)},g=e=>e.showWhen?e.showWhen.every(m=>{let n=k[m.questionId];switch(m.operator){case "equals":return n===m.value;case "contains":return Array.isArray(n)?n.includes(m.value):false;case "greaterThan":return typeof n=="number"?n>m.value:false;case "lessThan":return typeof n=="number"?n<m.value:false;default:return true}}):true,R=e=>a(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),B=e=>{if(!g(e))return null;let m=$[e.id],n=k[e.id];return jsxRuntime.jsxs("div",{className:a("mb-6","question"),children:[jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:a("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsxRuntime.jsx("p",{className:a("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,className:R(m)}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,rows:4,className:R(m)}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,className:R(m),children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(s=>jsxRuntime.jsx("option",{value:s.value,children:s.label},s.value))]}),e.type==="radio"&&e.options&&jsxRuntime.jsx("div",{className:a("space-y-2","radioGroup"),children:e.options.map(s=>jsxRuntime.jsxs("div",{className:a("flex items-center","radioOption"),children:[jsxRuntime.jsx("input",{type:"radio",id:`${e.id}_${s.value}`,name:e.id,value:s.value,checked:n===s.value,onChange:()=>y(e.id,s.value),disabled:x,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsxs("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[s.label,s.riskLevel&&jsxRuntime.jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${s.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":s.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[s.riskLevel.charAt(0).toUpperCase()+s.riskLevel.slice(1)," Risk"]})]})]},s.value))}),e.type==="checkbox"&&e.options&&jsxRuntime.jsx("div",{className:"space-y-2",children:e.options.map(s=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`${e.id}_${s.value}`,value:s.value,checked:Array.isArray(n)?n.includes(s.value):false,onChange:L=>{let Q=Array.isArray(n)?[...n]:[];L.target.checked?y(e.id,[...Q,s.value]):y(e.id,Q.filter(j=>j!==s.value));},disabled:x,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:s.label})]},s.value))}),e.type==="scale"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([s,L])=>jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:L},s))}),jsxRuntime.jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:n||e.minValue||1,onChange:s=>y(e.id,parseInt(s.target.value,10)),disabled:x,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),jsxRuntime.jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",n||e.minValue||1]})]}),m&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:m})]},e.id)};return u?jsxRuntime.jsxs("div",{className:`${a("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${A}`,children:[c&&jsxRuntime.jsxs("div",{className:a("mb-6","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxRuntime.jsxs("span",{children:["Section ",b+1," of ",d.length]}),jsxRuntime.jsx("span",{children:v!==void 0?`${v}% Complete`:""})]}),jsxRuntime.jsx("div",{className:a("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${v!==void 0?v:(b+1)/d.length*100}%`}})})]}),jsxRuntime.jsx("h2",{className:a("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:u.title}),u.description&&jsxRuntime.jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:u.description}),jsxRuntime.jsx("div",{className:a("space-y-6","section"),children:u.questions.map(e=>B(e))}),jsxRuntime.jsxs("div",{className:a("mt-8 flex justify-between","navigation"),children:[jsxRuntime.jsx("button",{type:"button",onClick:P,disabled:b===0||x,className:`${a("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 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${D}`,children:N}),jsxRuntime.jsx("button",{type:"button",onClick:C,disabled:x,className:`${a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${D}`,children:i?h:o})]})]}):jsxRuntime.jsx("div",{children:"No section found."})};var U=({result:d,sections:k,showFullReport:y=true,allowPrint:b=true,allowExport:C=true,onExport:P,className:$="",buttonClassName:x="",classNames:A={},unstyled:D=false})=>{let o=(i,a)=>{let g=a?A[a]:void 0;return !g&&a==="printButton"&&(g=A.primaryButton),chunkE64TU6IU_js.a(i,g,D)},N=i=>new Date(i).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),v=i=>{let a=d.answers[i];return a==null?"Not answered":typeof a=="boolean"?a?"Yes":"No":Array.isArray(a)?a.join(", "):String(a)},w=()=>{window.print();},S=i=>{P&&P(i);},u=i=>jsxRuntime.jsx("span",{className:o(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[i]}`,"riskBadge"),children:i.charAt(0).toUpperCase()+i.slice(1)});return jsxRuntime.jsxs("div",{className:`${o("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${$}`,children:[jsxRuntime.jsxs("div",{className:o("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:o("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsxRuntime.jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:d.title})]}),(b||C)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[b&&jsxRuntime.jsx("button",{onClick:w,className:`${o("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${x}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),C&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.jsx("button",{onClick:()=>S("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",d.assessor.name,", ",d.assessor.role]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",d.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",N(d.startedAt)]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",d.completedAt?N(d.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",d.reviewDate?N(d.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:o("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),u(d.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:o("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",d.conclusion]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",d.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:d.processingDescription}),d.recommendations&&d.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:d.recommendations.map((i,a)=>jsxRuntime.jsx("li",{className:o("","recommendation"),children:i},a))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),d.risks.length===0?jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:o("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:d.risks.map(i=>jsxRuntime.jsxs("tr",{className:o("","riskRow"),children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:i.description}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[i.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[i.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:u(i.level)}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:i.mitigated?jsxRuntime.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},i.id))})]})})]}),y&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),k.map(i=>{let a=i.questions.filter(g=>d.answers[g.id]!==void 0);return a.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:i.title}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:a.map(g=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:g.text}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:v(g.id)})]},g.id))})]})})]},i.id)})]}),jsxRuntime.jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",d.version]}),jsxRuntime.jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var K=({steps:d,onStepClick:k,clickable:y=true,orientation:b="horizontal",className:C="",activeStepClassName:P="",completedStepClassName:$="",incompleteStepClassName:x="",classNames:A={},unstyled:D=false})=>{let o=(c,v)=>chunkE64TU6IU_js.a(c,v?A[v]:void 0,D),N=c=>{y&&k&&k(c);},h=b==="vertical";return jsxRuntime.jsx("div",{className:`${o(h?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${C}`,children:d.map((c,v)=>{let w=v===d.length-1,S=c.active?o(`font-medium ${P||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):c.completed?o($||"text-green-600 dark:text-green-400","label"):o(x||"text-gray-600 dark:text-gray-400","label"),u=c.active?o("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):c.completed?o("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):o("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxRuntime.jsxs(F__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:o(`${h?"flex items-start":"flex flex-col items-center"} ${y?"cursor-pointer":""}`,"step"),onClick:()=>N(c.id),children:[jsxRuntime.jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${h?"mr-4":""}
|
|
4
|
+
`,children:jsxRuntime.jsx("div",{className:u,children:c.icon?c.icon:c.completed?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsxRuntime.jsx("span",{children:v+1})})}),jsxRuntime.jsxs("div",{className:`
|
|
5
|
+
${h?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsxRuntime.jsx("div",{className:`text-sm font-medium ${S}`,children:c.label}),c.description&&jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:c.description})]})]}),!w&&jsxRuntime.jsx("div",{className:o(h?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},c.id)})})};exports.a=E;exports.b=U;exports.c=K;//# sourceMappingURL=chunk-ZNTMZ6NM.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-ZNTMZ6NM.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { a as ConsentSettings, C as ConsentOption } from './consent-CmVzqZUk.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Validates consent settings to ensure they meet NDPA requirements
|
|
5
|
+
* @param settings The consent settings to validate
|
|
6
|
+
* @returns An object containing validation result and any error messages
|
|
7
|
+
*/
|
|
8
|
+
declare function validateConsent(settings: ConsentSettings): {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
errors: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Validates that consent options meet NDPA Section 26 requirements.
|
|
14
|
+
* Each consent option must specify a purpose for which data will be processed,
|
|
15
|
+
* as consent must be specific and informed per the Nigeria Data Protection Act.
|
|
16
|
+
* @param options The consent options to validate
|
|
17
|
+
* @returns An object containing validation result and any error messages
|
|
18
|
+
*/
|
|
19
|
+
declare function validateConsentOptions(options: ConsentOption[]): {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
errors: string[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents a single entry in the consent audit trail.
|
|
26
|
+
* Each entry captures what happened, when, and the full consent state
|
|
27
|
+
* at that point in time, satisfying NDPA recordkeeping requirements.
|
|
28
|
+
*/
|
|
29
|
+
interface ConsentAuditEntry {
|
|
30
|
+
/** The type of consent action that occurred */
|
|
31
|
+
action: 'consent_given' | 'consent_withdrawn' | 'consent_updated' | 'consent_expired';
|
|
32
|
+
/** Unix timestamp (ms) when the action occurred */
|
|
33
|
+
timestamp: number;
|
|
34
|
+
/** Version of the consent form at the time of the action */
|
|
35
|
+
version: string;
|
|
36
|
+
/** Full snapshot of consent category states */
|
|
37
|
+
categories: Record<string, boolean>;
|
|
38
|
+
/** How consent was collected (e.g. "banner", "customize", "api") */
|
|
39
|
+
method: string;
|
|
40
|
+
/** Browser user-agent string for forensic traceability */
|
|
41
|
+
userAgent?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new audit entry from consent settings. If `previousSettings` is
|
|
45
|
+
* provided, the action is automatically determined by comparing old and new
|
|
46
|
+
* states. Otherwise `action` defaults to `'consent_given'`.
|
|
47
|
+
*/
|
|
48
|
+
declare function createAuditEntry(settings: ConsentSettings, previousSettings?: ConsentSettings | null, actionOverride?: ConsentAuditEntry['action']): ConsentAuditEntry;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the full consent audit log from localStorage.
|
|
51
|
+
* Returns an empty array if no log exists or parsing fails.
|
|
52
|
+
*
|
|
53
|
+
* @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
|
|
54
|
+
*/
|
|
55
|
+
declare function getAuditLog(storageKey?: string): ConsentAuditEntry[];
|
|
56
|
+
/**
|
|
57
|
+
* Appends a single audit entry to the consent audit log in localStorage.
|
|
58
|
+
* The log is append-only; existing entries are never modified.
|
|
59
|
+
*
|
|
60
|
+
* @param entry - The audit entry to append
|
|
61
|
+
* @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
|
|
62
|
+
*/
|
|
63
|
+
declare function appendAuditEntry(entry: ConsentAuditEntry, storageKey?: string): void;
|
|
64
|
+
|
|
65
|
+
export { type ConsentAuditEntry as C, appendAuditEntry as a, validateConsentOptions as b, createAuditEntry as c, getAuditLog as g, validateConsent as v };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { a as ConsentSettings, C as ConsentOption } from './consent-CmVzqZUk.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Validates consent settings to ensure they meet NDPA requirements
|
|
5
|
+
* @param settings The consent settings to validate
|
|
6
|
+
* @returns An object containing validation result and any error messages
|
|
7
|
+
*/
|
|
8
|
+
declare function validateConsent(settings: ConsentSettings): {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
errors: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Validates that consent options meet NDPA Section 26 requirements.
|
|
14
|
+
* Each consent option must specify a purpose for which data will be processed,
|
|
15
|
+
* as consent must be specific and informed per the Nigeria Data Protection Act.
|
|
16
|
+
* @param options The consent options to validate
|
|
17
|
+
* @returns An object containing validation result and any error messages
|
|
18
|
+
*/
|
|
19
|
+
declare function validateConsentOptions(options: ConsentOption[]): {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
errors: string[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents a single entry in the consent audit trail.
|
|
26
|
+
* Each entry captures what happened, when, and the full consent state
|
|
27
|
+
* at that point in time, satisfying NDPA recordkeeping requirements.
|
|
28
|
+
*/
|
|
29
|
+
interface ConsentAuditEntry {
|
|
30
|
+
/** The type of consent action that occurred */
|
|
31
|
+
action: 'consent_given' | 'consent_withdrawn' | 'consent_updated' | 'consent_expired';
|
|
32
|
+
/** Unix timestamp (ms) when the action occurred */
|
|
33
|
+
timestamp: number;
|
|
34
|
+
/** Version of the consent form at the time of the action */
|
|
35
|
+
version: string;
|
|
36
|
+
/** Full snapshot of consent category states */
|
|
37
|
+
categories: Record<string, boolean>;
|
|
38
|
+
/** How consent was collected (e.g. "banner", "customize", "api") */
|
|
39
|
+
method: string;
|
|
40
|
+
/** Browser user-agent string for forensic traceability */
|
|
41
|
+
userAgent?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new audit entry from consent settings. If `previousSettings` is
|
|
45
|
+
* provided, the action is automatically determined by comparing old and new
|
|
46
|
+
* states. Otherwise `action` defaults to `'consent_given'`.
|
|
47
|
+
*/
|
|
48
|
+
declare function createAuditEntry(settings: ConsentSettings, previousSettings?: ConsentSettings | null, actionOverride?: ConsentAuditEntry['action']): ConsentAuditEntry;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the full consent audit log from localStorage.
|
|
51
|
+
* Returns an empty array if no log exists or parsing fails.
|
|
52
|
+
*
|
|
53
|
+
* @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
|
|
54
|
+
*/
|
|
55
|
+
declare function getAuditLog(storageKey?: string): ConsentAuditEntry[];
|
|
56
|
+
/**
|
|
57
|
+
* Appends a single audit entry to the consent audit log in localStorage.
|
|
58
|
+
* The log is append-only; existing entries are never modified.
|
|
59
|
+
*
|
|
60
|
+
* @param entry - The audit entry to append
|
|
61
|
+
* @param storageKey - Base storage key (the audit key is derived as `${storageKey}_audit`)
|
|
62
|
+
*/
|
|
63
|
+
declare function appendAuditEntry(entry: ConsentAuditEntry, storageKey?: string): void;
|
|
64
|
+
|
|
65
|
+
export { type ConsentAuditEntry as C, appendAuditEntry as a, validateConsentOptions as b, createAuditEntry as c, getAuditLog as g, validateConsent as v };
|
package/dist/consent.d.mts
CHANGED
|
@@ -2,8 +2,36 @@ import React from 'react';
|
|
|
2
2
|
import { C as ConsentOption, a as ConsentSettings, b as ConsentStorageOptions } from './consent-CmVzqZUk.mjs';
|
|
3
3
|
export { L as LawfulBasisType } from './consent-CmVzqZUk.mjs';
|
|
4
4
|
export { u as useConsent } from './useConsent-DOt2Njst.mjs';
|
|
5
|
-
export { v as validateConsent,
|
|
5
|
+
export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-BdByjYlM.mjs';
|
|
6
6
|
|
|
7
|
+
interface ConsentAnalyticsEvent {
|
|
8
|
+
action: 'shown' | 'accepted_all' | 'rejected_all' | 'customized' | 'dismissed';
|
|
9
|
+
timestamp: number;
|
|
10
|
+
version: string;
|
|
11
|
+
categories?: Record<string, boolean>;
|
|
12
|
+
}
|
|
13
|
+
interface ConsentBannerClassNames {
|
|
14
|
+
root?: string;
|
|
15
|
+
container?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
optionsList?: string;
|
|
19
|
+
optionItem?: string;
|
|
20
|
+
optionCheckbox?: string;
|
|
21
|
+
optionLabel?: string;
|
|
22
|
+
optionDescription?: string;
|
|
23
|
+
buttonGroup?: string;
|
|
24
|
+
acceptButton?: string;
|
|
25
|
+
rejectButton?: string;
|
|
26
|
+
customizeButton?: string;
|
|
27
|
+
saveButton?: string;
|
|
28
|
+
customizePanel?: string;
|
|
29
|
+
selectAllButton?: string;
|
|
30
|
+
/** Alias for acceptButton */
|
|
31
|
+
primaryButton?: string;
|
|
32
|
+
/** Alias for rejectButton */
|
|
33
|
+
secondaryButton?: string;
|
|
34
|
+
}
|
|
7
35
|
interface ConsentBannerProps {
|
|
8
36
|
/**
|
|
9
37
|
* Array of consent options to display
|
|
@@ -20,7 +48,7 @@ interface ConsentBannerProps {
|
|
|
20
48
|
title?: string;
|
|
21
49
|
/**
|
|
22
50
|
* Description text displayed on the banner
|
|
23
|
-
* @default "We use cookies and similar technologies to provide our services and enhance your experience."
|
|
51
|
+
* @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."
|
|
24
52
|
*/
|
|
25
53
|
description?: string;
|
|
26
54
|
/**
|
|
@@ -44,10 +72,19 @@ interface ConsentBannerProps {
|
|
|
44
72
|
*/
|
|
45
73
|
saveButtonText?: string;
|
|
46
74
|
/**
|
|
47
|
-
* Position of the banner
|
|
75
|
+
* Position of the banner.
|
|
76
|
+
* 'top', 'bottom', and 'center' render via a portal to document.body
|
|
77
|
+
* with fixed positioning so the banner overlays the page.
|
|
78
|
+
* 'inline' renders in the normal DOM tree without a portal.
|
|
48
79
|
* @default "bottom"
|
|
49
80
|
*/
|
|
50
|
-
position?: 'top' | 'bottom' | 'center';
|
|
81
|
+
position?: 'top' | 'bottom' | 'center' | 'inline';
|
|
82
|
+
/**
|
|
83
|
+
* z-index applied to the fixed-position banner.
|
|
84
|
+
* Ignored when position is 'inline'.
|
|
85
|
+
* @default 9999
|
|
86
|
+
*/
|
|
87
|
+
zIndex?: number;
|
|
51
88
|
/**
|
|
52
89
|
* Version of the consent form
|
|
53
90
|
* @default "1.0"
|
|
@@ -63,6 +100,14 @@ interface ConsentBannerProps {
|
|
|
63
100
|
* @default "ndpr_consent"
|
|
64
101
|
*/
|
|
65
102
|
storageKey?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the banner manages its own localStorage persistence.
|
|
105
|
+
* Set to false when an external storage mechanism (e.g., ConsentStorage)
|
|
106
|
+
* is responsible for persisting consent settings under the same key.
|
|
107
|
+
* This avoids race conditions where two writers target the same storage key.
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
manageStorage?: boolean;
|
|
66
111
|
/**
|
|
67
112
|
* Custom CSS class for the banner
|
|
68
113
|
*/
|
|
@@ -79,9 +124,43 @@ interface ConsentBannerProps {
|
|
|
79
124
|
* Custom CSS class for the secondary button
|
|
80
125
|
*/
|
|
81
126
|
secondaryButtonClassName?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
129
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
130
|
+
*/
|
|
131
|
+
classNames?: ConsentBannerClassNames;
|
|
132
|
+
/**
|
|
133
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
134
|
+
* can style from scratch using classNames.
|
|
135
|
+
*/
|
|
136
|
+
unstyled?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Optional analytics callback fired on each user interaction.
|
|
139
|
+
* Called when the banner is shown, accepted, rejected, customized, or dismissed.
|
|
140
|
+
*/
|
|
141
|
+
onAnalytics?: (event: ConsentAnalyticsEvent) => void;
|
|
82
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Consent banner component. Implements NDPA Sections 25-26 consent requirements
|
|
145
|
+
* for obtaining and managing data subject consent.
|
|
146
|
+
*/
|
|
83
147
|
declare const ConsentBanner: React.FC<ConsentBannerProps>;
|
|
84
148
|
|
|
149
|
+
interface ConsentManagerClassNames {
|
|
150
|
+
root?: string;
|
|
151
|
+
header?: string;
|
|
152
|
+
title?: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
optionsList?: string;
|
|
155
|
+
optionItem?: string;
|
|
156
|
+
toggle?: string;
|
|
157
|
+
saveButton?: string;
|
|
158
|
+
resetButton?: string;
|
|
159
|
+
/** Alias for saveButton */
|
|
160
|
+
primaryButton?: string;
|
|
161
|
+
/** Alias for resetButton */
|
|
162
|
+
secondaryButton?: string;
|
|
163
|
+
}
|
|
85
164
|
interface ConsentManagerProps {
|
|
86
165
|
/**
|
|
87
166
|
* Array of consent options to display
|
|
@@ -102,7 +181,7 @@ interface ConsentManagerProps {
|
|
|
102
181
|
title?: string;
|
|
103
182
|
/**
|
|
104
183
|
* Description text displayed in the manager
|
|
105
|
-
* @default "Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function."
|
|
184
|
+
* @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."
|
|
106
185
|
*/
|
|
107
186
|
description?: string;
|
|
108
187
|
/**
|
|
@@ -136,6 +215,16 @@ interface ConsentManagerProps {
|
|
|
136
215
|
* Custom CSS class for the secondary button
|
|
137
216
|
*/
|
|
138
217
|
secondaryButtonClassName?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
220
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
221
|
+
*/
|
|
222
|
+
classNames?: ConsentManagerClassNames;
|
|
223
|
+
/**
|
|
224
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
225
|
+
* can style from scratch using classNames.
|
|
226
|
+
*/
|
|
227
|
+
unstyled?: boolean;
|
|
139
228
|
/**
|
|
140
229
|
* Whether to show a success message after saving
|
|
141
230
|
* @default true
|
|
@@ -152,8 +241,15 @@ interface ConsentManagerProps {
|
|
|
152
241
|
*/
|
|
153
242
|
successMessageDuration?: number;
|
|
154
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Consent management component. Implements NDPA Sections 25-26 consent requirements,
|
|
246
|
+
* allowing data subjects to review and update their consent preferences.
|
|
247
|
+
*/
|
|
155
248
|
declare const ConsentManager: React.FC<ConsentManagerProps>;
|
|
156
249
|
|
|
250
|
+
interface ConsentStorageClassNames {
|
|
251
|
+
root?: string;
|
|
252
|
+
}
|
|
157
253
|
interface ConsentStorageProps {
|
|
158
254
|
/**
|
|
159
255
|
* Current consent settings
|
|
@@ -181,6 +277,15 @@ interface ConsentStorageProps {
|
|
|
181
277
|
* @default true
|
|
182
278
|
*/
|
|
183
279
|
autoLoad?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
282
|
+
*/
|
|
283
|
+
classNames?: ConsentStorageClassNames;
|
|
284
|
+
/**
|
|
285
|
+
* When true, all default classes are removed so consumers
|
|
286
|
+
* can style from scratch using classNames.
|
|
287
|
+
*/
|
|
288
|
+
unstyled?: boolean;
|
|
184
289
|
/**
|
|
185
290
|
* Children to render
|
|
186
291
|
* Can be either React nodes or a render prop function that receives storage methods
|
|
@@ -192,6 +297,14 @@ interface ConsentStorageProps {
|
|
|
192
297
|
loaded: boolean;
|
|
193
298
|
}) => React.ReactNode);
|
|
194
299
|
}
|
|
195
|
-
declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, children }: ConsentStorageProps) => React.ReactElement | null;
|
|
300
|
+
declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React.ReactElement | null;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Resolves class names for a component section.
|
|
304
|
+
* If unstyled is true, only the override class is used (or empty string).
|
|
305
|
+
* If an override is provided, it fully REPLACES the default — no appending.
|
|
306
|
+
* Otherwise the default class string is returned as-is.
|
|
307
|
+
*/
|
|
308
|
+
declare function resolveClass(defaultClass: string, override?: string, unstyled?: boolean): string;
|
|
196
309
|
|
|
197
|
-
export { ConsentBanner, ConsentManager, ConsentOption, ConsentSettings, ConsentStorage, ConsentStorageOptions };
|
|
310
|
+
export { type ConsentAnalyticsEvent, ConsentBanner, type ConsentBannerClassNames, ConsentManager, type ConsentManagerClassNames, ConsentOption, ConsentSettings, ConsentStorage, type ConsentStorageClassNames, ConsentStorageOptions, resolveClass };
|
package/dist/consent.d.ts
CHANGED
|
@@ -2,8 +2,36 @@ import React from 'react';
|
|
|
2
2
|
import { C as ConsentOption, a as ConsentSettings, b as ConsentStorageOptions } from './consent-CmVzqZUk.js';
|
|
3
3
|
export { L as LawfulBasisType } from './consent-CmVzqZUk.js';
|
|
4
4
|
export { u as useConsent } from './useConsent-D0pAfTlb.js';
|
|
5
|
-
export { v as validateConsent,
|
|
5
|
+
export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-DhbfMR0n.js';
|
|
6
6
|
|
|
7
|
+
interface ConsentAnalyticsEvent {
|
|
8
|
+
action: 'shown' | 'accepted_all' | 'rejected_all' | 'customized' | 'dismissed';
|
|
9
|
+
timestamp: number;
|
|
10
|
+
version: string;
|
|
11
|
+
categories?: Record<string, boolean>;
|
|
12
|
+
}
|
|
13
|
+
interface ConsentBannerClassNames {
|
|
14
|
+
root?: string;
|
|
15
|
+
container?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
optionsList?: string;
|
|
19
|
+
optionItem?: string;
|
|
20
|
+
optionCheckbox?: string;
|
|
21
|
+
optionLabel?: string;
|
|
22
|
+
optionDescription?: string;
|
|
23
|
+
buttonGroup?: string;
|
|
24
|
+
acceptButton?: string;
|
|
25
|
+
rejectButton?: string;
|
|
26
|
+
customizeButton?: string;
|
|
27
|
+
saveButton?: string;
|
|
28
|
+
customizePanel?: string;
|
|
29
|
+
selectAllButton?: string;
|
|
30
|
+
/** Alias for acceptButton */
|
|
31
|
+
primaryButton?: string;
|
|
32
|
+
/** Alias for rejectButton */
|
|
33
|
+
secondaryButton?: string;
|
|
34
|
+
}
|
|
7
35
|
interface ConsentBannerProps {
|
|
8
36
|
/**
|
|
9
37
|
* Array of consent options to display
|
|
@@ -20,7 +48,7 @@ interface ConsentBannerProps {
|
|
|
20
48
|
title?: string;
|
|
21
49
|
/**
|
|
22
50
|
* Description text displayed on the banner
|
|
23
|
-
* @default "We use cookies and similar technologies to provide our services and enhance your experience."
|
|
51
|
+
* @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."
|
|
24
52
|
*/
|
|
25
53
|
description?: string;
|
|
26
54
|
/**
|
|
@@ -44,10 +72,19 @@ interface ConsentBannerProps {
|
|
|
44
72
|
*/
|
|
45
73
|
saveButtonText?: string;
|
|
46
74
|
/**
|
|
47
|
-
* Position of the banner
|
|
75
|
+
* Position of the banner.
|
|
76
|
+
* 'top', 'bottom', and 'center' render via a portal to document.body
|
|
77
|
+
* with fixed positioning so the banner overlays the page.
|
|
78
|
+
* 'inline' renders in the normal DOM tree without a portal.
|
|
48
79
|
* @default "bottom"
|
|
49
80
|
*/
|
|
50
|
-
position?: 'top' | 'bottom' | 'center';
|
|
81
|
+
position?: 'top' | 'bottom' | 'center' | 'inline';
|
|
82
|
+
/**
|
|
83
|
+
* z-index applied to the fixed-position banner.
|
|
84
|
+
* Ignored when position is 'inline'.
|
|
85
|
+
* @default 9999
|
|
86
|
+
*/
|
|
87
|
+
zIndex?: number;
|
|
51
88
|
/**
|
|
52
89
|
* Version of the consent form
|
|
53
90
|
* @default "1.0"
|
|
@@ -63,6 +100,14 @@ interface ConsentBannerProps {
|
|
|
63
100
|
* @default "ndpr_consent"
|
|
64
101
|
*/
|
|
65
102
|
storageKey?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the banner manages its own localStorage persistence.
|
|
105
|
+
* Set to false when an external storage mechanism (e.g., ConsentStorage)
|
|
106
|
+
* is responsible for persisting consent settings under the same key.
|
|
107
|
+
* This avoids race conditions where two writers target the same storage key.
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
manageStorage?: boolean;
|
|
66
111
|
/**
|
|
67
112
|
* Custom CSS class for the banner
|
|
68
113
|
*/
|
|
@@ -79,9 +124,43 @@ interface ConsentBannerProps {
|
|
|
79
124
|
* Custom CSS class for the secondary button
|
|
80
125
|
*/
|
|
81
126
|
secondaryButtonClassName?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
129
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
130
|
+
*/
|
|
131
|
+
classNames?: ConsentBannerClassNames;
|
|
132
|
+
/**
|
|
133
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
134
|
+
* can style from scratch using classNames.
|
|
135
|
+
*/
|
|
136
|
+
unstyled?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Optional analytics callback fired on each user interaction.
|
|
139
|
+
* Called when the banner is shown, accepted, rejected, customized, or dismissed.
|
|
140
|
+
*/
|
|
141
|
+
onAnalytics?: (event: ConsentAnalyticsEvent) => void;
|
|
82
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Consent banner component. Implements NDPA Sections 25-26 consent requirements
|
|
145
|
+
* for obtaining and managing data subject consent.
|
|
146
|
+
*/
|
|
83
147
|
declare const ConsentBanner: React.FC<ConsentBannerProps>;
|
|
84
148
|
|
|
149
|
+
interface ConsentManagerClassNames {
|
|
150
|
+
root?: string;
|
|
151
|
+
header?: string;
|
|
152
|
+
title?: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
optionsList?: string;
|
|
155
|
+
optionItem?: string;
|
|
156
|
+
toggle?: string;
|
|
157
|
+
saveButton?: string;
|
|
158
|
+
resetButton?: string;
|
|
159
|
+
/** Alias for saveButton */
|
|
160
|
+
primaryButton?: string;
|
|
161
|
+
/** Alias for resetButton */
|
|
162
|
+
secondaryButton?: string;
|
|
163
|
+
}
|
|
85
164
|
interface ConsentManagerProps {
|
|
86
165
|
/**
|
|
87
166
|
* Array of consent options to display
|
|
@@ -102,7 +181,7 @@ interface ConsentManagerProps {
|
|
|
102
181
|
title?: string;
|
|
103
182
|
/**
|
|
104
183
|
* Description text displayed in the manager
|
|
105
|
-
* @default "Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function."
|
|
184
|
+
* @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."
|
|
106
185
|
*/
|
|
107
186
|
description?: string;
|
|
108
187
|
/**
|
|
@@ -136,6 +215,16 @@ interface ConsentManagerProps {
|
|
|
136
215
|
* Custom CSS class for the secondary button
|
|
137
216
|
*/
|
|
138
217
|
secondaryButtonClassName?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
220
|
+
* Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
|
|
221
|
+
*/
|
|
222
|
+
classNames?: ConsentManagerClassNames;
|
|
223
|
+
/**
|
|
224
|
+
* When true, all default Tailwind classes are removed so consumers
|
|
225
|
+
* can style from scratch using classNames.
|
|
226
|
+
*/
|
|
227
|
+
unstyled?: boolean;
|
|
139
228
|
/**
|
|
140
229
|
* Whether to show a success message after saving
|
|
141
230
|
* @default true
|
|
@@ -152,8 +241,15 @@ interface ConsentManagerProps {
|
|
|
152
241
|
*/
|
|
153
242
|
successMessageDuration?: number;
|
|
154
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Consent management component. Implements NDPA Sections 25-26 consent requirements,
|
|
246
|
+
* allowing data subjects to review and update their consent preferences.
|
|
247
|
+
*/
|
|
155
248
|
declare const ConsentManager: React.FC<ConsentManagerProps>;
|
|
156
249
|
|
|
250
|
+
interface ConsentStorageClassNames {
|
|
251
|
+
root?: string;
|
|
252
|
+
}
|
|
157
253
|
interface ConsentStorageProps {
|
|
158
254
|
/**
|
|
159
255
|
* Current consent settings
|
|
@@ -181,6 +277,15 @@ interface ConsentStorageProps {
|
|
|
181
277
|
* @default true
|
|
182
278
|
*/
|
|
183
279
|
autoLoad?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Object of CSS class overrides keyed by semantic section name.
|
|
282
|
+
*/
|
|
283
|
+
classNames?: ConsentStorageClassNames;
|
|
284
|
+
/**
|
|
285
|
+
* When true, all default classes are removed so consumers
|
|
286
|
+
* can style from scratch using classNames.
|
|
287
|
+
*/
|
|
288
|
+
unstyled?: boolean;
|
|
184
289
|
/**
|
|
185
290
|
* Children to render
|
|
186
291
|
* Can be either React nodes or a render prop function that receives storage methods
|
|
@@ -192,6 +297,14 @@ interface ConsentStorageProps {
|
|
|
192
297
|
loaded: boolean;
|
|
193
298
|
}) => React.ReactNode);
|
|
194
299
|
}
|
|
195
|
-
declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, children }: ConsentStorageProps) => React.ReactElement | null;
|
|
300
|
+
declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React.ReactElement | null;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Resolves class names for a component section.
|
|
304
|
+
* If unstyled is true, only the override class is used (or empty string).
|
|
305
|
+
* If an override is provided, it fully REPLACES the default — no appending.
|
|
306
|
+
* Otherwise the default class string is returned as-is.
|
|
307
|
+
*/
|
|
308
|
+
declare function resolveClass(defaultClass: string, override?: string, unstyled?: boolean): string;
|
|
196
309
|
|
|
197
|
-
export { ConsentBanner, ConsentManager, ConsentOption, ConsentSettings, ConsentStorage, ConsentStorageOptions };
|
|
310
|
+
export { type ConsentAnalyticsEvent, ConsentBanner, type ConsentBannerClassNames, ConsentManager, type ConsentManagerClassNames, ConsentOption, ConsentSettings, ConsentStorage, type ConsentStorageClassNames, ConsentStorageOptions, resolveClass };
|
package/dist/consent.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkK3GMTMQ6_js=require('./chunk-K3GMTMQ6.js'),chunkMJGOLP5M_js=require('./chunk-MJGOLP5M.js'),chunkZU73VG3X_js=require('./chunk-ZU73VG3X.js'),chunkY34DQYS7_js=require('./chunk-Y34DQYS7.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js');require('./chunk-MQFZHA2D.js');Object.defineProperty(exports,"ConsentBanner",{enumerable:true,get:function(){return chunkK3GMTMQ6_js.a}});Object.defineProperty(exports,"ConsentManager",{enumerable:true,get:function(){return chunkK3GMTMQ6_js.b}});Object.defineProperty(exports,"ConsentStorage",{enumerable:true,get:function(){return chunkK3GMTMQ6_js.c}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunkMJGOLP5M_js.b}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunkZU73VG3X_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkY34DQYS7_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkY34DQYS7_js.b}});Object.defineProperty(exports,"resolveClass",{enumerable:true,get:function(){return chunkE64TU6IU_js.a}});//# sourceMappingURL=consent.js.map
|
|
2
2
|
//# sourceMappingURL=consent.js.map
|
package/dist/consent.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as ConsentBanner,b as ConsentManager,c as ConsentStorage}from'./chunk-
|
|
1
|
+
export{a as ConsentBanner,b as ConsentManager,c as ConsentStorage}from'./chunk-NW4A3JW6.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-P3PULLYP.mjs';export{a as useConsent}from'./chunk-PDJGTQMY.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-GIV2OHE6.mjs';export{a as resolveClass}from'./chunk-AYKLAEOU.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=consent.mjs.map
|
|
2
2
|
//# sourceMappingURL=consent.mjs.map
|